file_path
stringlengths 32
153
| content
stringlengths 0
3.14M
|
---|---|
omniverse-code/kit/exts/omni.kit.tool.collect/config/extension.toml | [package]
title = "Project Collector"
description = "It's a tool that could be used to collect and gather all dependencies an USD depends on."
version = "2.1.20"
# Lists people or organizations that are considered the "authors" of the package.
authors = ["NVIDIA"]
# URL of the extension source repository.
repository = ""
changelog = "docs/CHANGELOG.md"
readme = "docs/README.md"
category = "Utility"
# Preview image and icon. Folder named "data" automatically goes in git lfs (see .gitattributes file).
# Preview image is shown in "Overview" of Extensions window. Screenshot of an extension might be a good preview image.
preview_image = "data/preview.png"
# Icon is shown in Extensions window, it is recommended to be square, of size 256x256.
icon = "data/icon.png"
[dependencies]
"omni.usd" = {}
"omni.client" = {}
"omni.ui" = {}
"omni.kit.window.filepicker" = {}
"omni.kit.window.content_browser" = { optional=true }
"omni.kit.widget.prompt" = {}
"omni.kit.menu.utils" = {}
[[python.module]]
name = "omni.kit.tool.collect"
[[test]]
timeout=300
args = [
"--/app/file/ignoreUnsavedOnExit=true",
"--/app/asyncRendering=false",
"--/app/window/dpiScaleOverride=1.0",
"--/app/window/scaleToMonitor=false",
"--no-window"
]
dependencies = [
"omni.hydra.pxr",
"omni.kit.commands",
"omni.kit.renderer.capture",
"omni.kit.mainwindow",
"omni.kit.ui_test"
]
stdoutFailPatterns.exclude = ["*Cannot copy from*"]
|
omniverse-code/kit/exts/omni.kit.tool.collect/omni/kit/tool/collect/async_utils.py | import os
import platform
import sys
import re
import asyncio
import traceback
from functools import partial, wraps
from pxr import Sdf, Usd
# This piece of wrapper is borrowed from aiofiles, see following for details
# https://github.com/Tinche/aiofiles/blob/master/aiofiles/os.py
def wrap(func):
@asyncio.coroutine
@wraps(func)
def run(*args, loop=None, executor=None, **kwargs):
if loop is None:
loop = asyncio.get_event_loop()
pfunc = partial(func, *args, **kwargs)
return loop.run_in_executor(executor, pfunc)
return run
def _read_file(path):
with open(path, "rb") as f:
return f.read()
def _encode_content(content):
if type(content) == str:
payload = bytes(content.encode("utf-8"))
elif type(content) != type(None):
payload = bytes(content)
else:
payload = bytes()
return payload
def _write_file(file, content):
with open(file, "wb") as f:
payload = _encode_content(content)
f.write(payload)
def _open_layer(path):
return Sdf.Layer.FindOrOpen(path)
def _open_stage(stage_path):
return Usd.Stage.Open(stage_path)
def _transfer_layer_content(layer, target_layer):
return target_layer.TransferContent(layer)
def _layer_save(layer):
return layer.Save()
def _export_layer_to_string(layer):
return layer.ExportToString()
def _re_find_all(regex, content):
return re.findall(regex, content)
def _replace_all(s, old_text, new_text):
if type(s) == bytes:
s = s.decode()
return s.replace(old_text, new_text)
aio_write_file = wrap(_write_file)
aio_read_file = wrap(_read_file)
aio_open_layer = wrap(_open_layer)
aio_export_layer_to_string = wrap(_export_layer_to_string)
aio_re_find_all = wrap(_re_find_all)
aio_replace_all = wrap(_replace_all)
aio_transfer_layer = wrap(_transfer_layer_content)
aio_open_stage = wrap(_open_stage)
aio_save_layer = wrap(_layer_save)
|
omniverse-code/kit/exts/omni.kit.tool.collect/omni/kit/tool/collect/mdl_parser.py | import os
from .async_utils import aio_replace_all, aio_re_find_all
from .utils import Utils
class MDLImportItem:
def __init__(self):
self.import_clause = "" # The import clause like `import xx`
self.import_package = "" # The package name without import directive
self.package_path = "" # The package path converted from import package
self.module_preset = False # If it's preset.
def __repr__(self):
s = f"<'import_clause': {self.import_clause},"
s += f"'import_package': {self.import_package},"
s += f"'packag_path': {self.package_path}>"
return s
class MDLParser:
"""A parser of mdl file, for get the relative texture files.
Args:
mdl_file_path (str): Human readable string describing the exception.
mdl_content(bytes): MDL content in bytes array.
"""
def __init__(self, mdl_file_path, mdl_content):
self._parsed = False
self._mdl_file_path = mdl_file_path
self._mdl_content = mdl_content
if type(self._mdl_content) == bytes:
self._mdl_content = self._mdl_content.decode()
self._raw_to_absolute_texture_paths = {}
self._mdl_imports = {}
@property
def content(self):
return self._mdl_content
async def parse(self):
if not self._parsed:
self._parsed = True
texture_paths, self._mdl_imports = await self._parse_internal()
absolute_mdl_basepath = os.path.dirname(self._mdl_file_path)
if absolute_mdl_basepath != "/":
absolute_mdl_basepath += "/"
for raw_texture_path in texture_paths:
if not raw_texture_path.strip():
continue
if raw_texture_path[0] == '/':
texture_path = "." + raw_texture_path
else:
texture_path = raw_texture_path
absolute_texture_path = Utils.compute_absolute_path(absolute_mdl_basepath, texture_path)
self._raw_to_absolute_texture_paths[raw_texture_path] = absolute_texture_path
for mdl_import in self._mdl_imports:
mdl_import.package_path = Utils.compute_absolute_path(
absolute_mdl_basepath, mdl_import.package_path
)
return self._raw_to_absolute_texture_paths, self._mdl_imports
async def _parse_internal(self):
if not self._mdl_content:
return [], []
texture_paths = await aio_re_find_all(
'texture_2d[ \t]*\([ \t]*"(.*?)"', self._mdl_content
)
texture_paths.extend(
await aio_re_find_all(
'texture_3d[ \t]*\([ \t]*"(.*?)"', self._mdl_content
)
)
texture_paths.extend(
await aio_re_find_all(
'texture_cube[ \t]*\([ \t]*"(.*?)"', self._mdl_content
)
)
texture_paths.extend(
await aio_re_find_all(
'texture_ptex[ \t]*\([ \t]*"(.*?)"', self._mdl_content
)
)
mdl_packages = await aio_re_find_all("import[ \t]+(.*)::.*;", self._mdl_content)
mdl_imports = await aio_re_find_all("(import[ \t]+.*::.*);", self._mdl_content)
mdl_packages += await aio_re_find_all("using[ \t]+(.*)[ \t]+import.*;", self._mdl_content)
mdl_imports += await aio_re_find_all("(using[ \t]+.*import.*);", self._mdl_content)
mdl_packages += await aio_re_find_all("=[ \t]+(.*)::.*", self._mdl_content)
mdl_imports += await aio_re_find_all("(=[ \t]+.*::.*)", self._mdl_content)
mdl_paths = await self._convert_packages(mdl_packages)
import_items = []
for clause, package, path in zip(mdl_imports, mdl_packages, mdl_paths):
item = MDLImportItem()
item.import_clause = clause
item.import_package = package
item.package_path = path
if clause.startswith("="):
item.module_preset = True
import_items.append(item)
return texture_paths, import_items
async def _convert_packages(self, packages):
paths = []
for mdl_package in packages:
path = await aio_replace_all(mdl_package, "::", "/")
if path:
paths.append(path + ".mdl")
return paths
|
omniverse-code/kit/exts/omni.kit.tool.collect/omni/kit/tool/collect/main_window.py | import os
from omni import ui
from .icons import Icons
from .filebrowser import FileBrowserSelectionType, FileBrowserMode
from .file_picker import FilePicker
class CollectMainWindow:
def __init__(self, collect_button_fn=None, cancel_button_fn=None):
self._collect_button_fn = collect_button_fn
self._cancel_button_fn = cancel_button_fn
self._file_picker = None
self._collection_path_field = None
self._build_content_ui()
def destroy(self):
self._collect_button_fn = None
self._cancel_button_fn = None
self._collection_path_field = None
if self._file_picker:
self._file_picker.destroy()
self._file_picker = None
if self._cancel_button:
self._cancel_button.set_clicked_fn(None)
self._cancel_button = None
if self._collect_button:
self._collect_button.set_clicked_fn(None)
self._collect_button = None
if self._folder_button:
self._folder_button.set_clicked_fn(None)
self._folder_button = None
self._window = None
def set_collect_fn(self, collect_fn):
self._collect_button_fn = collect_fn
def set_cancel_fn(self, cancel_fn):
self._cancel_button_fn = cancel_fn
def _build_content_ui(self):
self._window = ui.Window(
"Collection Options", visible=False, height=0, dockPreference=ui.DockPreference.DISABLED
)
self._window.flags = (
ui.WINDOW_FLAGS_NO_COLLAPSE
| ui.WINDOW_FLAGS_NO_RESIZE
| ui.WINDOW_FLAGS_NO_SCROLLBAR
| ui.WINDOW_FLAGS_NO_RESIZE
| ui.WINDOW_FLAGS_NO_MOVE
)
self._window.flags = self._window.flags | ui.WINDOW_FLAGS_MODAL
def _build_option_checkbox(text, default_value, identifier, tooltip=None):
stack = ui.HStack(height=0, width=0)
with stack:
checkbox = ui.CheckBox(width=20, identifier=identifier, style={"font_size": 16})
checkbox.model.set_value(default_value)
ui.Label(text, alignment=ui.Alignment.LEFT)
if tooltip:
stack.set_tooltip(tooltip)
return checkbox
style = {
"Rectangle::hovering": {"background_color": 0x0, "border_radius": 2, "margin": 0, "padding": 0},
"Rectangle::hovering:hovered": {"background_color": 0xFF9E9E9E},
"Button.Image::folder": {"image_url": Icons().get("folder")},
"Button.Image::folder:checked": {"image_url": Icons().get("folder")},
"Button::folder": {"background_color": 0x0, "margin": 0},
"Button::folder:checked": {"background_color": 0x0, "margin": 0},
"Button::folder:pressed": {"background_color": 0x0, "margin": 0},
"Button::folder:hovered": {"background_color": 0x0, "margin": 0},
}
self._window.width = 600
with self._window.frame:
with ui.HStack(height=0, style=style):
ui.Spacer(width=40)
with ui.VStack(spacing=10):
ui.Spacer(height=10)
# build collection path widgets
with ui.HStack(height=0):
ui.Label("Collection Path: ", width=0)
with ui.VStack(height=0):
ui.Spacer(height=4)
self._collection_path_field = ui.StringField(
height=20, identifier="collect_path", width=ui.Fraction(1)
)
ui.Spacer(height=4)
ui.Spacer(width=5)
with ui.VStack(width=0):
ui.Spacer()
with ui.ZStack(width=20, height=20):
ui.Rectangle(name="hovering")
self._folder_button = ui.Button(
name="folder", identifier="folder_button", width=24, height=24
)
self._folder_button.set_tooltip("Choose folder")
ui.Spacer()
ui.Spacer(width=2)
self._folder_button.set_clicked_fn(lambda: self._show_file_picker())
# build collection options
with ui.HStack(height=0, spacing=10):
self._usd_only_checkbox = _build_option_checkbox(
"USD Only",
False,
"usd_only_checkbox",
"Only USD files will be collected. Any materials bindings will be removed.",
)
self._material_only_checkbox = _build_option_checkbox(
"Material Only",
False,
"material_only_checkbox",
"Only MDL files and their depdendent textures will be collected.",
)
self._flat_collection_checkbox = _build_option_checkbox(
"Flat Collection",
False,
"flat_collection_checkbox",
"By default, it will keep the folder structure after collection. "
"After this option is enabled, assets will be collected into specified folders.",
)
# add value changed callback to enable flat collection settings combo
self._flat_collection_checkbox.model.add_value_changed_fn(self._on_flat_collection_toggled)
# build flat collection texture options (visibility toggled by flat collection checkbox)
with ui.HStack(spacing=10):
tooltip = "Options for grouping for textures.\nTextures can be grouped under parent folders by MDL or USD, or flat in the same hierarchy."
self._flat_options_widgets = [
ui.Label("Flat Collection Texture Option: ", name="label", width=0, tooltip=tooltip),
ui.ComboBox(
0,
"Group By MDL",
"Group By USD",
"Flat",
height=10,
name="choices",
identifier="texture_option_combo",
),
]
for widget in self._flat_options_widgets:
widget.visible = False
ui.Spacer(height=0)
# build action buttons
with ui.HStack(height=0):
ui.Spacer()
self._collect_button = ui.Button("Start", width=120, height=0)
self._collect_button.set_clicked_fn(self._on_collect_button_clicked)
self._cancel_button = ui.Button("Cancel", width=120, height=0)
self._cancel_button.set_clicked_fn(self._on_cancel_button_clicked)
ui.Spacer()
ui.Spacer(height=20)
ui.Spacer(width=40)
def _on_collect_button_clicked(self):
if self._collect_button_fn:
collect_dir = self._collection_path_field.model.get_value_as_string()
usd_only = self._usd_only_checkbox.model.get_value_as_bool()
material_only = self._material_only_checkbox.model.get_value_as_bool()
flat_collection = self._flat_collection_checkbox.model.get_value_as_bool()
texture_option = self._flat_options_widgets[1].model.get_item_value_model().as_int
self._collect_button_fn(collect_dir, usd_only, flat_collection, material_only, texture_option)
self._window.visible = False
def _on_cancel_button_clicked(self):
if self._cancel_button_fn:
self._cancel_button_fn()
self._window.visible = False
def _select_picked_folder_callback(self, path):
self._collection_path_field.model.set_value(path)
self._window.visible = True
def _cancel_picked_folder_callback(self):
self._window.visible = True
def _show_file_picker(self):
self._window.visible = False
if not self._file_picker:
mode = FileBrowserMode.SAVE
file_type = FileBrowserSelectionType.DIRECTORY_ONLY
filters = [(".*", "All Files (*.*)")]
self._file_picker = FilePicker(
"Select Collect Destination", mode=mode, file_type=file_type, filter_options=filters
)
self._file_picker.set_filebar_label_name("Folder name")
self._file_picker.set_file_selected_fn(self._select_picked_folder_callback)
self._file_picker.set_cancel_fn(self._cancel_picked_folder_callback)
path = self._collection_path_field.model.get_value_as_string().rstrip("/")
dir_name = os.path.dirname(path)
folder_name = os.path.basename(path)
self._file_picker.show(dir_name, folder_name)
def _on_flat_collection_toggled(self, model):
for widget in self._flat_options_widgets:
widget.visible = model.as_bool
def show(self, export_folder=None):
if export_folder:
self._collection_path_field.model.set_value(export_folder)
self._window.visible = True
def hide(self):
self._window.visible = False
|
omniverse-code/kit/exts/omni.kit.tool.collect/omni/kit/tool/collect/extension.py | import os
import asyncio
import weakref
import omni
import omni.usd
import carb
from typing import Callable
from omni.kit.widget.prompt import PromptButtonInfo, PromptManager
from .omni_client_wrapper import OmniClientWrapper
from .main_window import CollectMainWindow
from .collector import Collector, CollectorException, CollectorFailureOptions, FlatCollectionTextureOptions
from .progress_popup import ProgressPopup
from .utils import Utils
from omni.kit.menu.utils import MenuItemDescription
g_singleton = None
def get_instance():
global g_singleton
return g_singleton
class PublicExtension(omni.ext.IExt):
def on_startup(self):
self._main_window = None
self._context_menu_name = None
self._register_menus()
global g_singleton
g_singleton = self
def on_shutdown(self):
global g_singleton
g_singleton = None
content_window = self.get_content_window()
if content_window and self._context_menu_name:
content_window.delete_context_menu(self._context_menu_name)
self._context_menu_name = None
if self._main_window:
self._main_window.destroy()
self._main_window = None
def collect(self, filepath: str, finish_callback: Callable[[], None] = None) -> None:
"""
Collect a usd file.
Args:
filepath: Path to usd file to be collected.
"""
if not omni.usd.is_usd_writable_filetype(filepath):
self._show_file_not_supported_popup()
else:
self._show_main_window(filepath, finish_callback)
def _register_menus(self):
content_window = self.get_content_window()
if content_window:
self._context_menu_name = content_window.add_context_menu(
"Collect Asset", "upload.svg",
lambda b, c: self._on_menu_click(b, c),
omni.usd.is_usd_writable_filetype
)
def _collect():
stage = omni.usd.get_context().get_stage()
self.collect(stage.GetRootLayer().identifier)
def _enable_collect_menu():
stage = omni.usd.get_context().get_stage()
return stage is not None and not stage.GetRootLayer().anonymous
self._file_menu_list = [
MenuItemDescription(
name="Collect As...",
glyph="none.svg",
appear_after="Save Flattened As...",
enable_fn=_enable_collect_menu,
onclick_fn=_collect,
)
]
omni.kit.menu.utils.add_menu_items(self._file_menu_list, "File")
def _get_collection_dir(self, folder, usd_file_name):
stage_name = os.path.splitext(usd_file_name)[0]
if not folder.endswith("/"):
folder += "/"
folder = Utils.normalize_path(folder)
return f"{folder}Collected_{stage_name}"
def _show_folder_exist_popup(
self,
usd_path,
collect_dir,
usd_only,
flat_collection,
material_only,
texture_option,
finish_callback: Callable[[], None] = None,
):
def on_confirm():
self._start_collecting(
usd_path, collect_dir, usd_only, flat_collection, material_only, texture_option, finish_callback
)
def on_cancel():
self._show_main_window(usd_path)
PromptManager.post_simple_prompt(
"Overwrite",
"The target directory already exists, do you want to overwrite it?",
PromptButtonInfo("Confirm", on_confirm),
PromptButtonInfo("Cancel", on_cancel),
modal=False,
)
def _start_collecting(
self,
usd_path,
collect_folder,
usd_only,
flat_collection,
material_only,
texture_option,
finish_callback: Callable[[], None] = None,
):
progress_popup = self._show_progress_popup()
progress_popup.status_text = "Collecting dependencies..."
collector = Collector(
usd_path,
collect_folder,
usd_only,
flat_collection,
material_only,
texture_option=FlatCollectionTextureOptions(texture_option),
)
collector_weakref = weakref.ref(collector)
def on_cancel():
carb.log_info("Cancelling collector...")
if not collector_weakref():
return
collector_weakref().cancel()
progress_popup.set_cancel_fn(on_cancel)
def on_progress(step, total):
progress_popup.status_text = f"Collecting USD {os.path.basename(usd_path)}..."
if total != 0:
progress_popup.progress = float(step) / total
else:
progress_popup.progress = 0.0
def on_finish():
if finish_callback:
finish_callback()
progress_popup.hide()
self._refresh_current_directory()
if self._main_window:
self._main_window.set_collect_fn(None)
if not collector_weakref():
return
collector_weakref().destroy()
asyncio.ensure_future(collector.collect(on_progress, on_finish))
def _show_main_window(self, usd_path, finish_callback: Callable[[], None] = None):
if not self._main_window:
self._main_window = CollectMainWindow(None, None)
def on_collect(collect_folder, usd_only, flat_collection, material_only, texture_option):
existed = OmniClientWrapper.exists_sync(collect_folder)
if existed:
self._show_folder_exist_popup(
usd_path, collect_folder, usd_only, flat_collection, material_only, texture_option, finish_callback
)
else:
self._start_collecting(
usd_path, collect_folder, usd_only, flat_collection, material_only, texture_option, finish_callback
)
self._main_window.set_collect_fn(on_collect)
default_folder = self._get_collection_dir(os.path.dirname(usd_path), os.path.basename(usd_path))
self._main_window.show(default_folder)
def _on_menu_click(self, menu, value):
self.collect(value)
def _refresh_current_directory(self):
content_window = self.get_content_window()
if content_window:
content_window.refresh_current_directory()
def _show_progress_popup(self):
progress_popup = ProgressPopup("Collecting")
progress_popup.progress = 0
progress_popup.show()
return progress_popup
def _show_file_not_supported_popup(self):
PromptManager.post_simple_prompt("Warning", "Only USD file can be collected")
def get_content_window(self):
try:
import omni.kit.window.content_browser as content
return content.get_content_window()
except Exception as e:
pass
return None
|
omniverse-code/kit/exts/omni.kit.tool.collect/omni/kit/tool/collect/__init__.py | from .extension import PublicExtension, get_instance, CollectorFailureOptions, Collector, CollectorException
|
omniverse-code/kit/exts/omni.kit.tool.collect/omni/kit/tool/collect/file_picker.py | import omni
import os
from omni.kit.widget.prompt import PromptManager, PromptButtonInfo
from .omni_client_wrapper import OmniClientWrapper
from .filebrowser import FileBrowserMode
from .filebrowser.app_filebrowser import FileBrowserUI
class FilePicker:
def __init__(self, title, mode, file_type, filter_options, ok_button_title="Open"):
self._mode = mode
self._app = omni.kit.app.get_app()
self._open_handler = None
self._cancel_handler = None
self._ui_handler = FileBrowserUI(title, mode, file_type, filter_options, ok_button_title)
def _show_prompt(self, file_path, file_save_handler):
def on_confirm():
if file_save_handler:
file_save_handler(file_path)
PromptManager.post_simple_prompt(
f'{omni.kit.ui.get_custom_glyph_code("${glyphs}/exclamation.svg")} Overwrite',
f"File {os.path.basename(file_path)} already exists, do you want to overwrite it?",
PromptButtonInfo("Confirm", on_confirm),
PromptButtonInfo("Cancel")
)
def _save_and_prompt_if_exists(self, file_path, file_save_handler=None):
existed = OmniClientWrapper.exists_sync(file_path)
if existed:
self._show_prompt(file_path, file_save_handler)
elif file_save_handler:
file_save_handler(file_path)
def _on_file_open(self, path):
if self._mode == FileBrowserMode.SAVE:
self._save_and_prompt_if_exists(path, self._open_handler)
elif self._open_handler:
self._open_handler(path)
def _on_cancel_open(self):
if self._cancel_handler:
self._cancel_handler()
def set_file_selected_fn(self, file_open_handler):
self._open_handler = file_open_handler
def set_cancel_fn(self, cancel_handler):
self._cancel_handler = cancel_handler
def show(self, dir=None, filename=None):
if self._ui_handler:
if dir and OmniClientWrapper.exists_sync(dir):
self._ui_handler.set_current_directory(dir)
if filename:
self._ui_handler.set_current_filename(filename)
self._ui_handler.open(self._on_file_open, self._on_cancel_open)
def set_current_directory(self, dir):
if self._ui_handler:
if dir and OmniClientWrapper.exists_sync(dir):
self._ui_handler.set_current_directory(dir)
def set_current_filename(self, filename):
if self._ui_handler:
self._ui_handler.set_current_filename(filename)
def set_filebar_label_name(self, name):
if self._ui_handler:
self._ui_handler.set_filebar_label_name(name)
def destroy(self):
self._open_handler = None
self._cancel_handler = None
if self._ui_handler:
self._ui_handler.destroy()
self._ui_handler = None
|
omniverse-code/kit/exts/omni.kit.tool.collect/omni/kit/tool/collect/progress_popup.py | from omni import ui
class CustomProgressModel(ui.AbstractValueModel):
def __init__(self):
super().__init__()
self._value = 0.0
def set_value(self, value):
"""Reimplemented set"""
try:
value = float(value)
except ValueError:
value = None
if value != self._value:
# Tell the widget that the model is changed
self._value = value
self._value_changed()
def get_value_as_float(self):
return self._value
def get_value_as_string(self):
return str(int(self._value * 100)) + "%"
class ProgressPopup:
"""Creates a modal window with a status label and a progress bar inside.
Args:
title (str): Title of this window.
cancel_button_text (str): It will have a cancel button by default. This is the title of it.
cancel_button_fn (function): The callback after cancel button is clicked.
status_text (str): The status text.
min_value: The min value of the progress bar. It's 0 by default.
max_value: The max value of the progress bar. It's 100 by default.
dark_style: If it's to use dark style or light style. It's dark stye by default.
"""
def __init__(self, title, cancel_button_text="Cancel", cancel_button_fn=None, status_text="", modal=False):
self._status_text = status_text
self._title = title
self._cancel_button_text = cancel_button_text
self._cancel_button_fn = cancel_button_fn
self._progress_bar_model = None
self._modal = modal
self._popup = None
self._buttons = []
self._build_ui()
def destroy(self):
self._cancel_button_fn = None
self._progress_bar_model = None
for button in self._buttons:
button.set_clicked_fn(None)
self._popup = None
def __enter__(self):
self._popup.visible = True
return self
def __exit__(self, type, value, trace):
self._popup.visible = False
def set_cancel_fn(self, on_cancel_button_clicked):
self._cancel_button_fn = on_cancel_button_clicked
def set_progress(self, progress):
self._progress_bar.model.set_value(progress)
def get_progress(self):
return self._progress_bar.model.get_value_as_float()
progress = property(get_progress, set_progress)
def set_status_text(self, status_text):
self._status_label.text = status_text
def get_status_text(self):
return self._status_label.text
status_text = property(get_status_text, set_status_text)
def show(self):
self._popup.visible = True
def hide(self):
self._popup.visible = False
def is_visible(self):
return self._popup.visible
def _on_cancel_button_fn(self):
self.hide()
if self._cancel_button_fn:
self._cancel_button_fn()
def _build_ui(self):
self._popup = ui.Window(
self._title, visible=False,
auto_resize=True, height=0,
dockPreference=ui.DockPreference.DISABLED
)
self._popup.flags = (
ui.WINDOW_FLAGS_NO_COLLAPSE
| ui.WINDOW_FLAGS_NO_SCROLLBAR
| ui.WINDOW_FLAGS_NO_RESIZE
)
if self._modal:
self._popup.flags = self._popup.flags | ui.WINDOW_FLAGS_MODAL
with self._popup.frame:
with ui.VStack(height=0, width=400):
ui.Spacer(height=10)
with ui.HStack(height=0):
ui.Spacer()
self._status_label = ui.Label(self._status_text, width=0, height=0)
ui.Spacer()
ui.Spacer(height=10)
with ui.HStack(height=0):
ui.Spacer(width=40)
self._progress_bar_model = CustomProgressModel()
self._progress_bar = ui.ProgressBar(
self._progress_bar_model, width=320, style={"color": 0xFFFF9E3D}
)
ui.Spacer(width=40)
ui.Spacer(height=10)
with ui.HStack(height=0):
ui.Spacer(height=0)
cancel_button = ui.Button(self._cancel_button_text, width=120, height=0)
cancel_button.set_clicked_fn(self._on_cancel_button_fn)
self._buttons.append(cancel_button)
ui.Spacer(height=0)
ui.Spacer(width=0, height=10)
|
omniverse-code/kit/exts/omni.kit.tool.collect/omni/kit/tool/collect/utils.py | import re
import omni
from urllib.parse import unquote
class Utils:
MDL_RE = re.compile("^.*\\.mdl?$", re.IGNORECASE)
# References https://gitlab-master.nvidia.com/omniverse/rtxdev/kit/blob/d37f0906c58cb1a5d8591f9e47125b4154b19b88/rendering/source/plugins/common/UDIM.h#L22
# for regex details to detect udim textures.
UDIM_MARKER_RE = re.compile("^.*(<UDIM>|<UVTILE0>|<UVTILE1>).*")
UDIM_GROUP_RE = re.compile("^(.*)(<UDIM>|<UVTILE0>|<UVTILE1>)(.*)")
@staticmethod
def normalize_path(path):
path = omni.client.normalize_url(path)
# Hard-decoding url currently since combine_urls will encode url
path = unquote(path)
return path.replace("\\", "/")
@staticmethod
def compute_absolute_path(base_path, path):
# Handles old omni path
if path.startswith("omni:"):
path = path[5:]
absolute_path = omni.client.combine_urls(base_path, path)
return Utils.normalize_path(absolute_path)
@staticmethod
def is_material(path):
if not path:
return False
path = Utils.remove_query_from_url(path)
if Utils.MDL_RE.match(path):
return True
return False
@staticmethod
def is_local_path(path):
if not path:
return False
client_url = omni.client.break_url(path)
return client_url and client_url.is_raw
@staticmethod
def is_omniverse_path(path):
return path and path.startswith("omniverse://")
@staticmethod
def remove_query_from_url(url):
if not url:
return url
client_url = omni.client.break_url(url)
url_without_query = omni.client.make_url(
scheme=client_url.scheme,
user=client_url.user,
host=client_url.host,
port=client_url.port,
path=client_url.path,
query=None,
fragment=client_url.fragment,
)
url_without_query = url_without_query.replace("\\", "/")
return url_without_query
@staticmethod
def is_udim_texture(path):
if not path:
return False
path = Utils.remove_query_from_url(path)
url = omni.client.break_url(path)
if url and Utils.UDIM_MARKER_RE.match(url.path):
return True
return False
@staticmethod
def is_udim_wildcard_texture(path, udim_texture_path):
if not path or not udim_texture_path:
return False
udim_path = Utils.remove_query_from_url(udim_texture_path)
url = omni.client.break_url(udim_path)
groups = Utils.UDIM_GROUP_RE.match(url.path)
if not groups:
return False
base_path = groups[1]
suffix_path = groups[3]
wildcard_re = re.compile(re.escape(base_path) + "((\\d\\d\\d\\d)|(_u\\d*_v\\d*))" + suffix_path)
path = Utils.remove_query_from_url(path)
url = omni.client.break_url(path)
if wildcard_re.match(url.path):
return True
return False
@staticmethod
def make_relative_path(relative_to, path):
relative_path = omni.client.make_relative_url(relative_to, path)
return Utils.normalize_path(relative_path)
|
omniverse-code/kit/exts/omni.kit.tool.collect/omni/kit/tool/collect/icons.py | # Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
from pathlib import Path
from .singleton import Singleton
@Singleton
class Icons:
"""A singleton that scans the icon folder and returns the icon depending on the type"""
def __init__(self):
self._current_path = Path(__file__).parent
self._icon_path = self._current_path.parent.parent.parent.parent.joinpath("icons")
self._icons = {icon.stem: icon for icon in self._icon_path.glob("*.png")}
def get(self, name, default=None):
"""Checks the icon cache and returns the icon if exists"""
found = self._icons.get(name)
if not found and default:
found = self._icons.get(default)
if found:
return str(found)
|
omniverse-code/kit/exts/omni.kit.tool.collect/omni/kit/tool/collect/collector.py | import os
import asyncio
import omni
import omni.usd
import carb
import traceback
from enum import IntFlag, Enum
from pxr import Sdf, Usd, UsdUtils, UsdShade, UsdLux, Tf
from .omni_client_wrapper import OmniClientWrapper
from .utils import Utils
from .async_utils import aio_open_layer, aio_replace_all, aio_save_layer
from .mdl_parser import MDLParser
from .async_utils import wrap
class CollectorFailureOptions(IntFlag):
"""Options to customize failure options"""
SILENT = 0 # Silent for all failures except root USD.
EXTERNAL_USD_REFERENCES = 1 # Throws exception if any external USD file is not found.
OTHER_EXTERNAL_REFERENCES = 4 # Throws exception if external references other than all above are missing.
class CollectorException(Exception):
def __init__(self, error: str):
self._error = error
def __str__(self):
return self._error
class CollectorTaskType:
"""Task type"""
READ_TASK = 0
WRITE_TASK = 1
COPY_TASK = 2
RESOLVE_TASK = 3
class FlatCollectionTextureOptions(Enum):
"""Collection options for textures under 'Flat Collection' mode"""
BY_MDL = 0 # group textures by MDL
BY_USD = 1 # group textures by USD
FLAT = 2 # all textures will be under the same hierarchy, flat
class Collector:
"""Collect stage related asset to {target_folder}/collected_stagename/}.
Args:
usd_path (str): The usd stage to be collected.
collect_dir (str): The target dir to collect the usd stage to.
usd_only (bool): Collects usd files only or not. It will ignore all asset types.
flat_collection (bool): Collects stage without keeping the original dir structure.
material_only (bool): Collects material and textures only or not. It will ignore all other asset types.
skip_existing (bool): If files already exist in the target location, don't copy again. Be careful of corrupt files
texture_option (FlatCollectionTextureOptions): Specifies how textures are grouped in flat collection mode.
This is to avoid name collision which results in textures overwriting each other in the cases where textures
for different assets are not uniquely named.
If both `usd_only` and `material_only` are true, it will collect all.
"""
def __init__(
self,
usd_path: str,
collect_dir: str,
usd_only: bool,
flat_collection: bool,
material_only: bool = False,
failure_options=CollectorFailureOptions.SILENT,
skip_existing: bool = False,
max_concurrent_tasks=64,
texture_option=FlatCollectionTextureOptions.BY_MDL,
):
self._usd_path = Utils.normalize_path(usd_path)
self._collect_dir = Utils.normalize_path(collect_dir)
if not self._collect_dir.endswith("/"):
self._collect_dir += "/"
self._usd_only = usd_only and not material_only
self._material_only = material_only and not usd_only
self._flat_collection = flat_collection
self._texture_option = texture_option
self._finished = False
self._cancelled = False
self.MAX_CONCURRENT_TASKS = max_concurrent_tasks
self._current_tasks = set([])
self._finished_callback = None
self._progress_callback = None
self._unique_path_name = {} # Records the count key that appears in the collected paths to generate unique name
self._source_target_path_mapping = {} # It records source to target
self._failure_options = failure_options
self._skip_existing = skip_existing
self._layer_store = {}
self._mdl_parsers = {}
self._sublayer_offsets = {}
self._other_asset_paths = set({})
self._current_progress = 0
self._total_steps = 0
self._all_read_paths = set({})
def destroy(self):
self._finished_callback = None
self._progress_callback = None
def _caculate_flat_target_path(self, path, parent_asset=None):
target_dir = self._collect_dir
master_usd = Utils.normalize_path(path) == self._usd_path
material_only = self._material_only
file_url = omni.client.break_url(path)
target_url = omni.client.break_url(target_dir)
file_path = file_url.path
file_name = os.path.basename(file_path)
if omni.usd.is_usd_writable_filetype(path) and master_usd:
int_dir = ""
else:
if not material_only:
int_dir = "SubUSDs/"
else:
int_dir = ""
if Utils.is_material(file_name):
int_dir = f"{int_dir}materials/"
elif not omni.usd.is_usd_writable_filetype(file_name):
int_dir = f"{int_dir}textures/"
# OM-52799 add options to group textures by MDL / USD assets to avoid name collision causing overwrites
if parent_asset:
parent_name, _ = os.path.splitext(os.path.basename(parent_asset))
# currently not including the file extension in parent folder names, but could add it in if it is
# more clear to show the ext as a suffix to the folder name
int_dir += f"{parent_name}/"
target_path = target_url.path + int_dir + file_name
if file_url.query:
branch_checkpoint = omni.client.get_branch_and_checkpoint_from_query(file_url.query)
if branch_checkpoint:
branch, checkpoint = branch_checkpoint
file_path, ext = os.path.splitext(target_path)
if not branch:
branch = "default"
target_path = f"{file_path}__{branch}__v{checkpoint}{ext}"
target_path = omni.client.make_url(
scheme=target_url.scheme,
user=target_url.user,
host=target_url.host,
port=target_url.port,
path=target_path,
query=None,
fragment=None,
)
return Utils.normalize_path(target_path)
# All paths must be absolute path
def _calculate_target_path(self, file_path, parent_asset=None):
file_path = Utils.normalize_path(file_path)
if self._flat_collection:
return self._caculate_flat_target_path(file_path, parent_asset=parent_asset)
target_dir = self._collect_dir
if not target_dir.endswith("/"):
target_dir += "/"
stage_path = self._usd_path
stage_url = omni.client.break_url(stage_path)
if not stage_url.scheme:
stage_path_with_scheme = "file://" + stage_path
else:
stage_path_with_scheme = stage_path
file_url = omni.client.break_url(file_path)
if not file_url.scheme:
file_path_with_shceme = "file://" + file_path
else:
file_path_with_shceme = file_path
stage_url = omni.client.break_url(stage_path_with_scheme)
file_url = omni.client.break_url(file_path_with_shceme)
target_url = omni.client.break_url(target_dir)
if stage_url.scheme != file_url.scheme or stage_url.host != file_url.host:
file_path = file_url.path.lstrip("/")
if file_url.host:
target_path = target_url.path + file_url.host + "/" + file_path
else:
target_path = target_url.path + file_path
else:
stage_url_path = stage_url.path.replace("//", "/")
file_url_path = file_url.path.replace("//", "/")
common_path = os.path.commonpath([os.path.dirname(stage_url_path), os.path.dirname(file_url_path)])
common_path = common_path.replace("\\", "/")
file_path = file_url_path[len(common_path) :].lstrip("/")
target_path = target_url.path + file_path
if file_url.query:
branch_checkpoint = omni.client.get_branch_and_checkpoint_from_query(file_url.query)
if branch_checkpoint:
branch, checkpoint = branch_checkpoint
file_name, ext = os.path.splitext(target_path)
if not branch:
branch = "default"
target_path = f"{file_name}__{branch}__v{checkpoint}{ext}"
target_path = omni.client.make_url(
scheme=target_url.scheme,
user=target_url.user,
host=target_url.host,
port=target_url.port,
path=target_path,
query=None,
fragment=None,
)
return Utils.normalize_path(target_path)
async def _get_total_steps(self):
stage_path = self._usd_path
collect_usd_only = self._usd_only
carb.log_info(f"Downloading and collecting dependencies: {stage_path}...")
# Pre-warming to download all USDs and MDLs in parallel.
target_path = self._calculate_target_path(stage_path)
self._source_target_path_mapping[stage_path] = target_path
if target_path and target_path == stage_path:
self._raise_or_log(
stage_path, f"Failed to collect layer {stage_path} as it tries to overwrite itself.", True
)
await self.__add_read_task(stage_path)
# Cancelled
if not await self.wait_all_unfinished_tasks(True):
return None
if collect_usd_only:
total = len(self._layer_store)
else:
total_textures = 0
for parser in self._mdl_parsers.values():
raw_to_absolute_texture_paths, _ = await parser.parse()
total_textures += len(raw_to_absolute_texture_paths)
total_material_assets = len(self._mdl_parsers) + total_textures
if self._material_only:
total = len(self._other_asset_paths) + total_material_assets
else:
total = len(self._layer_store) + len(self._other_asset_paths) + total_material_assets
return total
def _remove_prim_spec(self, layer: Sdf.Layer, prim_spec_path: str):
prim_spec = layer.GetPrimAtPath(prim_spec_path)
if not prim_spec:
return False
if prim_spec.nameParent:
name_parent = prim_spec.nameParent
else:
name_parent = layer.pseudoRoot
if not name_parent:
return False
name = prim_spec.name
if name in name_parent.nameChildren:
del name_parent.nameChildren[name]
def _remove_all_materials_and_bindings(self, stage_path):
stage = Usd.Stage.Open(stage_path)
if not stage:
return
to_be_removed = []
for prim in stage.Traverse():
if prim.IsA(UsdShade.Material):
to_be_removed.append(prim)
binding_api = UsdShade.MaterialBindingAPI(prim)
if binding_api:
binding_api.UnbindAllBindings()
if prim.IsA(UsdLux.DomeLight):
dome_light = UsdLux.DomeLight(prim)
dome_light.GetTextureFileAttr().Set("")
for prim in to_be_removed:
to_remove_paths = []
if prim:
for prim_spec in prim.GetPrimStack():
layer = prim_spec.layer
to_remove_paths.append((layer, prim_spec.path))
for item in to_remove_paths:
self._remove_prim_spec(item[0], item[1])
stage.Save()
def __modify_external_references(self, original_layer_identifier, target_layer):
def modifiy_paths_cb(path):
absolute_path = Utils.compute_absolute_path(original_layer_identifier, path)
target_path = self._source_target_path_mapping.get(absolute_path, None)
if not target_path:
return path
return Utils.make_relative_path(target_layer.identifier, target_path)
try:
UsdUtils.ModifyAssetPaths(target_layer, modifiy_paths_cb)
except Exception as e:
carb.log_error(f"Failed to modify asset paths {target_layer.identifier}:" + str(e))
LAYER_OMNI_CUSTOM_KEY = "omni_layer"
LAYER_MUTENESS_CUSTOM_KEY = "muteness"
custom_data = target_layer.customLayerData
if LAYER_OMNI_CUSTOM_KEY in custom_data:
omni_data = custom_data[LAYER_OMNI_CUSTOM_KEY]
if LAYER_MUTENESS_CUSTOM_KEY in omni_data:
new_muteness_data = {}
for path, muted in omni_data[LAYER_MUTENESS_CUSTOM_KEY].items():
absolute_path = Utils.compute_absolute_path(original_layer_identifier, path)
target_path = self._source_target_path_mapping.get(absolute_path, None)
if target_path:
target_path = Utils.make_relative_path(target_layer.identifier, target_path)
new_muteness_data[target_path] = muted
if new_muteness_data:
omni_data[LAYER_MUTENESS_CUSTOM_KEY] = new_muteness_data
custom_data[LAYER_OMNI_CUSTOM_KEY] = omni_data
target_layer.customLayerData = custom_data
def __mapping_source_path(self, source_path, parent_asset=None):
if source_path in self._source_target_path_mapping:
return False
# OM-52799 add options to group textures by MDL / USD assets to avoid name collision causing overwrites
target_path = self._calculate_target_path(source_path, parent_asset=parent_asset)
target_path = self._make_sure_unique_path(target_path)
self._source_target_path_mapping[source_path] = target_path
return True
# Gets external references.
async def __get_external_references(self, original_layer_identifier, target_layer):
stage_path = self._usd_path
try:
sublayer_paths, reference_paths, payload_paths = UsdUtils.ExtractExternalReferences(target_layer.identifier)
except Exception as e:
carb.log_error(f"Failed to collect {target_layer.identifier}: " + str(e))
sublayer_paths = []
reference_paths = []
payload_paths = []
all_usd_paths = set()
all_mdl_paths = set()
other_asset_paths = set()
async def track_path(path):
absolute_path = Utils.compute_absolute_path(original_layer_identifier, path)
if absolute_path in self._source_target_path_mapping:
return
if Utils.is_material(path):
existed = await OmniClientWrapper.exists(absolute_path)
# OM-44975: If it's not existed locally and it cannot be resolved with search paths,
# just leave the path as it is.
if not existed:
absolute_path = Utils.compute_absolute_path(stage_path, path)
# OM-43965: resolve agaist stage path.
existed = await OmniClientWrapper.exists(absolute_path)
if not existed:
return
mapping_kwargs = {}
if Utils.is_udim_texture(absolute_path):
all_asset_paths = await self.__populate_udim_textures(absolute_path)
for path in all_asset_paths:
self.__mapping_source_path(path, **mapping_kwargs)
else:
all_asset_paths = [absolute_path]
if omni.usd.is_usd_writable_filetype(absolute_path):
all_usd_paths.add(absolute_path)
elif Utils.is_material(absolute_path):
all_mdl_paths.add(absolute_path)
else:
# should only add parent asset option in mapping if the current path is not USD or MDL
if self._flat_collection and self._texture_option is FlatCollectionTextureOptions.BY_USD:
# do not add the root stage itself as a parent
if original_layer_identifier != self._usd_path:
mapping_kwargs["parent_asset"] = original_layer_identifier
# Adds udim mapping but not into copy list.
if Utils.is_udim_texture(absolute_path):
all_asset_paths = await self.__populate_udim_textures(absolute_path)
for path in all_asset_paths:
self.__mapping_source_path(path, **mapping_kwargs)
else:
all_asset_paths = [absolute_path]
other_asset_paths.update(all_asset_paths)
self.__mapping_source_path(absolute_path, **mapping_kwargs)
async def check_paths(paths):
tasks = []
for path in paths:
future = asyncio.ensure_future(track_path(path))
tasks.append(future)
if tasks:
await asyncio.wait(tasks, return_when=asyncio.ALL_COMPLETED)
await check_paths(sublayer_paths)
await check_paths(reference_paths)
await check_paths(payload_paths)
return all_usd_paths, all_mdl_paths, other_asset_paths
async def open_or_create_layer(self, layer_path, clear=True):
# WA to fix OM-33212
await omni.client.create_folder_async(os.path.dirname(layer_path))
layer = await aio_open_layer(layer_path)
if not layer:
layer = Sdf.Layer.CreateNew(layer_path)
elif clear:
layer.Clear()
return layer
async def add_copy_task(self, source, target, skip_if_existed=False):
if self._skip_existing and await OmniClientWrapper.exists(target):
carb.log_info(f"Asset file {target} already exists, skipping copy")
else:
carb.log_info(f"Adding copy task from {source} to {target}")
task = asyncio.ensure_future(OmniClientWrapper.copy(source, target, True))
task.source = source
task.target = target
task.task_type = CollectorTaskType.COPY_TASK
self._current_tasks.add(task)
if len(self._current_tasks) >= self.MAX_CONCURRENT_TASKS:
await self.wait_all_unfinished_tasks()
async def add_write_task(self, target, content):
carb.log_info(f"Adding write task to {target}")
task = asyncio.ensure_future(OmniClientWrapper.write(target, content))
task.task_type = CollectorTaskType.WRITE_TASK
task.source = None
task.target = target
self._current_tasks.add(task)
if len(self._current_tasks) >= self.MAX_CONCURRENT_TASKS:
await self.wait_all_unfinished_tasks()
async def __add_layer_resolve_task(self, source_layer_path, target_layer):
carb.log_info(f"Adding layer resolve task for {target_layer.identifier}")
task = asyncio.ensure_future(self.__resolve_layer(source_layer_path, target_layer))
task.task_type = CollectorTaskType.RESOLVE_TASK
task.source = target_layer.identifier
task.target = None
self._current_tasks.add(task)
if len(self._current_tasks) >= self.MAX_CONCURRENT_TASKS:
await self.wait_all_unfinished_tasks()
async def __resolve_layer(self, source_layer_path, target_layer):
# Resolve all external assets
__aio_modify_external_references = wrap(self.__modify_external_references)
await __aio_modify_external_references(source_layer_path, target_layer)
# OM-40291: Copy sublayer offsets.
sublayer_offsets = self._sublayer_offsets.get(source_layer_path, None)
if sublayer_offsets:
for i in range(len(sublayer_offsets)):
target_layer.subLayerOffsets[i] = sublayer_offsets[i]
return await aio_save_layer(target_layer)
async def __open_and_analyze_layer(self, source_path, target_path):
if self._material_only:
target_layer = await aio_open_layer(source_path)
else:
# OM-52207: copy it firstly to keep tags for omniverse path.
success = await OmniClientWrapper.copy(source_path, target_path, True)
if not success:
return False
try:
target_layer = await self.open_or_create_layer(target_path, False)
except Tf.ErrorException:
# WA for OM-52094: usda in server may be saved as usdc format,
# which cannot be opened with USD library locally.
# The solution here is to rename it as .usd.
target_layer = None
root, _ = os.path.splitext(target_path)
renamed_usd = root + ".usd"
success = await OmniClientWrapper.copy(target_path, renamed_usd)
if success:
await OmniClientWrapper.delete(target_path)
target_layer = await self.open_or_create_layer(renamed_usd, False)
self._source_target_path_mapping[source_path] = renamed_usd
if not target_layer:
return False
self._layer_store[source_path] = target_layer
if target_layer.subLayerOffsets:
self._sublayer_offsets[source_path] = target_layer.subLayerOffsets.copy()
carb.log_info(f"Collecting dependencies for usd {source_path}...")
all_usd_paths, all_mdl_paths, all_other_paths = await self.__get_external_references(source_path, target_layer)
for path in all_usd_paths:
if self._cancelled:
break
await self.__add_read_task(path)
if self._usd_only:
self._remove_all_materials_and_bindings(target_layer.identifier)
else:
for path in all_mdl_paths:
if self._cancelled:
break
await self.__add_read_task(path)
self._other_asset_paths.update(all_other_paths)
return True
async def __populate_udim_textures(self, udim_texture_path):
src_dir = os.path.dirname(udim_texture_path)
if not src_dir.endswith("/"):
src_dir = src_dir + "/"
result, entries = await omni.client.list_async(src_dir)
if result != omni.client.Result.OK:
self._raise_or_log(
udim_texture_path, f"Failed to list UDIM textures {udim_texture_path}, error code: {result}"
)
texture_paths = []
for entry in entries:
texture_path = Utils.compute_absolute_path(src_dir, entry.relative_path)
if Utils.is_udim_wildcard_texture(texture_path, udim_texture_path):
texture_paths.append(texture_path)
return texture_paths
async def __open_and_analyze_mdl(self, path, target_path):
# OM-52207: copy it firstly to keep tags for omniverse path.
if Utils.is_omniverse_path(path):
success = await OmniClientWrapper.copy(path, target_path, True)
if not success:
return False
content = await OmniClientWrapper.read(path)
if not content:
return False
mdl_parser = MDLParser(path, content)
self._mdl_parsers[path] = mdl_parser
carb.log_info(f"Collecting dependencies for mdl {path}...")
raw_to_absolute_texture_paths, imports = await mdl_parser.parse()
mapping_kwargs = {}
if self._flat_collection and self._texture_option is FlatCollectionTextureOptions.BY_MDL:
mapping_kwargs["parent_asset"] = path
for absolute_texture_path in raw_to_absolute_texture_paths.values():
if not self.__mapping_source_path(absolute_texture_path, **mapping_kwargs):
continue
if Utils.is_udim_texture(absolute_texture_path):
all_asset_paths = await self.__populate_udim_textures(absolute_texture_path)
for path in all_asset_paths:
self.__mapping_source_path(path, **mapping_kwargs)
for mdl_import in imports:
if self._cancelled:
break
absolute_import_path = mdl_import.package_path
if not await OmniClientWrapper.exists(absolute_import_path):
continue
self.__mapping_source_path(absolute_import_path)
await self.__add_read_task(absolute_import_path)
return True
async def __add_read_task(self, path):
if path in self._all_read_paths:
return
self._all_read_paths.add(path)
if path in self._layer_store or path in self._mdl_parsers:
return
carb.log_info(f"Adding read task to {path}")
is_usd_type = omni.usd.is_usd_writable_filetype(path)
is_mdl_path = Utils.is_material(path)
target_path = self._source_target_path_mapping.get(path)
if is_usd_type:
task = asyncio.ensure_future(self.__open_and_analyze_layer(path, target_path))
elif is_mdl_path and not self._usd_only:
task = asyncio.ensure_future(self.__open_and_analyze_mdl(path, target_path))
else:
return
task.task_type = CollectorTaskType.READ_TASK
task.source = path
task.target = None
self._current_tasks.add(task)
if len(self._current_tasks) >= self.MAX_CONCURRENT_TASKS:
await self.wait_all_unfinished_tasks()
def __cancel_all_tasks(self):
try:
self._progress_callback = None
for task in self._current_tasks:
task.cancel()
except Exception:
pass
finally:
self._current_tasks.clear()
async def wait_all_unfinished_tasks(self, all_completed=False):
if len(self._current_tasks) == 0:
return True
carb.log_info(f"Waiting for {len(self._current_tasks)} tasks...")
while len(self._current_tasks) > 0:
if self._cancelled:
self.__cancel_all_tasks()
return False
try:
done, _ = await asyncio.wait(self._current_tasks, return_when=asyncio.FIRST_COMPLETED)
failed_tasks = set()
for task in done:
if task not in self._current_tasks:
continue
if task.task_type != CollectorTaskType.READ_TASK:
self.__report_one_progress()
result = task.result()
if not result:
failed_tasks.add(task)
if task.task_type == CollectorTaskType.COPY_TASK:
self._raise_or_log(task.source, f"Failed to move from {task.source} to {task.target}.")
elif task.task_type == CollectorTaskType.WRITE_TASK:
self._raise_or_log(task.target, f"Failed to write {task.target}.")
elif task.task_type == CollectorTaskType.READ_TASK:
self._raise_or_log(task.source, f"Failed to read {task.source} as it's not existed.")
elif task.task_type == CollectorTaskType.RESOLVE_TASK:
self._raise_or_log(task.source, f"Failed to resolve layer {task.source}.")
self._current_tasks.discard(task)
except CollectorException as e:
raise e
except Exception:
traceback.print_exc()
if not all_completed:
break
await asyncio.sleep(0.1)
carb.log_info(f"Waiting for unfinished done, left {len(self._current_tasks)} tasks...")
return True
def is_finished(self):
return self._finished
def cancel(self):
self._cancelled = True
self.__cancel_all_tasks()
if self._finished_callback:
self._finished_callback()
def _make_sure_unique_path(self, path):
# Generates unique path name
if Utils.is_udim_texture(path):
return path
path = Utils.normalize_path(path)
while True:
index = self._unique_path_name.get(path, -1)
if index == -1:
self._unique_path_name[path] = 0
break
else:
index += 1
self._unique_path_name[path] = index
file_path, ext = os.path.splitext(path)
path = file_path + "_" + str(index) + ext
self._unique_path_name[path] = 0
return path
def _raise_or_log(self, path, error, force_raise=False):
is_usd_type = omni.usd.is_usd_writable_filetype(path)
has_usd_failure_option = self._failure_options & CollectorFailureOptions.EXTERNAL_USD_REFERENCES
has_other_failure_option = self._failure_options & CollectorFailureOptions.OTHER_EXTERNAL_REFERENCES
if force_raise or (is_usd_type and has_usd_failure_option) or (not is_usd_type and has_other_failure_option):
raise CollectorException(error)
else:
carb.log_warn(error)
async def collect(self, progress_callback, finish_callback):
def __reset():
self._layer_store = {}
self._mdl_parsers = {}
self._sublayer_offsets = {}
self._other_asset_paths = set()
self._unique_path_name.clear()
self._source_target_path_mapping = {}
self._current_progress = 0
self._total_steps = 0
self._progress_callback = None
self._finished_callback = None
self._all_read_paths.clear()
try:
__reset()
self._finished = False
self._finished_callback = finish_callback
self._progress_callback = progress_callback
await self._collect_internal()
finally:
self._finished = True
if finish_callback:
finish_callback()
__reset()
def __report_one_progress(self):
self._current_progress += 1
if self._current_progress >= self._total_steps:
self._current_progress = self._total_steps
if self._progress_callback:
self._progress_callback(self._current_progress, self._total_steps)
async def _collect_internal(self):
carb.log_info(f"Collecting stage {self._usd_path} to {self._collect_dir}...")
total = await self._get_total_steps()
if total == 0:
raise CollectorException(f"Failed to collect {self._usd_path} as it cannot be opened.")
elif total is None:
carb.log_info(f"Collecting stage {self._usd_path} to {self._collect_dir} is cancelled.")
return
# Add one more step to wait for tasks to be done.
self._total_steps = total + 1
carb.log_info(f"Starting to collect: total steps {self._total_steps} found...")
if not self._material_only:
for source_layer_path, target_layer in self._layer_store.items():
carb.log_info(f"Modifying external references for {target_layer.identifier}...")
if self._cancelled:
break
await self.__add_layer_resolve_task(source_layer_path, target_layer)
if not self._usd_only:
for mdl_absolute_path, mdl_parser in self._mdl_parsers.items():
if self._cancelled:
break
carb.log_info(f"Collecting mdl {mdl_absolute_path}...")
# Per MDL.
processed_texture_path = set([])
mdl_target_path = self._source_target_path_mapping.get(mdl_absolute_path)
mdl_content = mdl_parser.content
raw_to_absolute_texture_paths, mdl_imports = await mdl_parser.parse()
for raw_texture_path, absolute_texture_path in raw_to_absolute_texture_paths.items():
if self._cancelled:
break
if absolute_texture_path in processed_texture_path:
continue
processed_texture_path.add(absolute_texture_path)
texture_target_path = self._source_target_path_mapping.get(absolute_texture_path)
relative_path = Utils.make_relative_path(mdl_target_path, texture_target_path)
mdl_content = await aio_replace_all(
mdl_content, f'texture_2d("{raw_texture_path}', f'texture_2d("{relative_path}'
)
mdl_content = await aio_replace_all(
mdl_content, f'texture_3d("{raw_texture_path}', f'texture_3d("{relative_path}'
)
mdl_content = await aio_replace_all(
mdl_content, f'texture_cube("{raw_texture_path}', f'texture_cube("{relative_path}'
)
mdl_content = await aio_replace_all(
mdl_content, f'texture_ptex("{raw_texture_path}', f'texture_ptex("{relative_path}'
)
carb.log_info(f"Moving texture file {absolute_texture_path} to {texture_target_path}")
await self.add_copy_task(absolute_texture_path, texture_target_path, self._skip_existing)
# handl mdls that's imported
for mdl_import in mdl_imports:
if self._cancelled:
break
import_target_path = self._source_target_path_mapping.get(mdl_import.package_path)
# It's not mapped so it's not existed.
if not import_target_path:
continue
relative_path = Utils.make_relative_path(mdl_target_path, import_target_path)
import_clause = mdl_import.import_clause
if relative_path.endswith(".mdl"):
relative_path = relative_path[:-4]
while relative_path.startswith("./"):
relative_path = relative_path[2:]
relative_path = relative_path.replace("/", "::")
if mdl_import.module_preset:
# OM-7604
has_prefix = False
while relative_path.startswith("..::"):
has_prefix = True
relative_path = relative_path[4:]
if has_prefix and relative_path:
relative_path = f"::{relative_path}"
import_clause = import_clause.replace(mdl_import.import_package, relative_path)
mdl_content = await aio_replace_all(mdl_content, mdl_import.import_clause, import_clause)
if self._flat_collection:
import_package = mdl_import.import_package
while import_package.startswith(".::") or import_package.startswith("..::"):
if import_package.startswith(".::"):
import_package = import_package[3:]
else:
import_package = import_package[4:]
# OM-37410: It's possible that function is referenced with full module path.
if import_package:
if not import_package.startswith("::"):
import_package = "::" + import_package
if not relative_path.startswith("::"):
relative_path = f"::{relative_path}"
mdl_content = await aio_replace_all(mdl_content, import_package, relative_path)
await self.add_write_task(mdl_target_path, mdl_content)
# Copy all external assets except USD and MDLs to target path
for absolute_asset_path in self._other_asset_paths:
if self._cancelled:
break
asset_target_path = self._source_target_path_mapping.get(absolute_asset_path)
carb.log_info(f"Moving asset file from {absolute_asset_path} to {asset_target_path}")
await self.add_copy_task(absolute_asset_path, asset_target_path, self._skip_existing)
if not await self.wait_all_unfinished_tasks(True):
carb.log_info("Collecting is cancelled.")
else:
carb.log_info("Collecting is finished.")
|
omniverse-code/kit/exts/omni.kit.tool.collect/omni/kit/tool/collect/omni_client_wrapper.py | import os
import traceback
import asyncio
import carb
import omni.client
import stat
def _encode_content(content):
if type(content) == str:
payload = bytes(content.encode("utf-8"))
elif type(content) != type(None):
payload = bytes(content)
else:
payload = bytes()
return payload
class OmniClientWrapper:
@staticmethod
async def exists(path):
try:
result, entry = await omni.client.stat_async(path)
return result == omni.client.Result.OK
except Exception:
return False
@staticmethod
def exists_sync(path):
try:
result, entry = omni.client.stat(path)
return result == omni.client.Result.OK
except Exception:
return False
@staticmethod
async def write(path: str, content):
carb.log_info(f"Writing {path}...")
try:
result = await omni.client.write_file_async(path, _encode_content(content))
if result != omni.client.Result.OK:
carb.log_warn(f"Cannot write {path}, error code: {result}.")
return False
except Exception as e:
carb.log_warn(f"Cannot write {path}: {str(e)}.")
return False
finally:
carb.log_info(f"Writing {path} done...")
return True
@staticmethod
async def delete(path: str):
carb.log_info(f"Removing {path}...")
try:
result = await omni.client.delete_async(path)
if result != omni.client.Result.OK:
carb.log_warn(f"Cannot remove {path}, error code: {result}.")
return False
except Exception:
carb.log_warn(f"Cannot delete {path}: {str(e)}.")
return False
return True
@staticmethod
async def set_write_permission(src_path: str):
# It can change ACIs for o
url = omni.client.break_url(src_path)
# Local path
try:
if url.is_raw:
st = os.stat(src_path)
os.chmod(src_path, st.st_mode | stat.S_IWRITE)
elif src_path.startswith("omniverse://"):
result, server_info = await omni.client.get_server_info_async(src_path)
if result != omni.client.Result.OK:
return False
user_acl = omni.client.AclEntry(
server_info.username,
omni.client.AccessFlags.READ | omni.client.AccessFlags.WRITE | omni.client.AccessFlags.ADMIN
)
result = await omni.client.set_acls_async(src_path, [user_acl])
return result == omni.client.Result.OK
except Exception as e:
carb.log_warn(f"Failed to set write permission for url {src_path}: {str(e)}.")
return False
@staticmethod
async def copy(src_path: str, dest_path: str, set_target_writable_if_read_only=False):
carb.log_info(f"Copying from {src_path} to {dest_path}...")
try:
result = await omni.client.copy_async(src_path, dest_path, omni.client.CopyBehavior.OVERWRITE)
if result != omni.client.Result.OK:
carb.log_warn(f"Cannot copy from {src_path} to {dest_path}, error code: {result}.")
return False
else:
if set_target_writable_if_read_only:
await OmniClientWrapper.set_write_permission(dest_path)
return True
except Exception as e:
carb.log_warn(f"Cannot copy {src_path} to {dest_path}: {str(e)}.")
return False
@staticmethod
async def read(src_path: str):
carb.log_info(f"Reading {src_path}...")
try:
result, version, content = await omni.client.read_file_async(src_path)
if result == omni.client.Result.OK:
return memoryview(content).tobytes()
else:
carb.log_warn(f"Cannot read {src_path}, error code: {result}.")
except Exception as e:
carb.log_warn(f"Cannot read {src_path}: {str(e)}.")
finally:
carb.log_info(f"Reading {src_path} done.")
return None
@staticmethod
async def create_folder(path):
carb.log_info(f"Creating dir {path}...")
result = await omni.client.create_folder_async(path)
return result == omni.client.Result.OK
|
omniverse-code/kit/exts/omni.kit.tool.collect/omni/kit/tool/collect/singleton.py | # Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
def Singleton(class_):
"""A singleton decorator"""
instances = {}
def getinstance(*args, **kwargs):
if class_ not in instances:
instances[class_] = class_(*args, **kwargs)
return instances[class_]
return getinstance
|
omniverse-code/kit/exts/omni.kit.tool.collect/omni/kit/tool/collect/filebrowser/__init__.py | class FileBrowserSelectionType:
FILE_ONLY = 0
DIRECTORY_ONLY = 1
ALL = 2
class FileBrowserMode:
OPEN = 0
SAVE = 1
|
omniverse-code/kit/exts/omni.kit.tool.collect/omni/kit/tool/collect/filebrowser/app_filebrowser.py | import asyncio
import re
import omni.ui
import omni.client
from omni.kit.window.filepicker import FilePickerDialog
from omni.kit.widget.filebrowser import FileBrowserItem
from . import FileBrowserSelectionType, FileBrowserMode
class FileBrowserUI:
def __init__(
self, title: str, mode: FileBrowserMode,
selection_type: FileBrowserSelectionType,
filter_options, ok_button_title="Open"
):
self._file_picker = FilePickerApp(title, ok_button_title, selection_type, filter_options, mode)
def set_current_directory(self, dir):
self._file_picker.set_current_directory(dir)
def set_current_filename(self, filename):
self._file_picker.set_current_filename(filename)
def set_filebar_label_name(self, name):
self._file_picker.set_filebar_label_name(name)
def open(self, select_fn, cancel_fn):
self._file_picker.set_custom_fn(select_fn, cancel_fn)
self._file_picker.show_dialog()
def destroy(self):
if self._file_picker:
self._file_picker.destroy()
self._file_picker = None
class FilePickerApp:
"""
Standalone app to demonstrate the use of the FilePicker dialog.
Args:
title (str): Title of the window.
apply_button_name (str): Name of the confirm button.
selection_type (FileBrowserSelectionType): The file type that confirm event will respond to.
item_filter_options (list): Array of filter options. Element of array
is a tuple that first element of this tuple is the regex string for filtering,
and second element of this tuple is the descriptions, like ("*.*", "All Files").
By default, it will list all files.
"""
APP_SETTINGS_PREFIX = "/persistent/app/omniverse/savedServers"
def __init__(
self,
title: str,
apply_button_name: str,
selection_type: FileBrowserSelectionType = FileBrowserSelectionType.ALL,
item_filter_options: list = [("*.*", "All Files (*.*)")],
mode: FileBrowserMode = FileBrowserMode.OPEN
):
self._title = title
self._filepicker = None
self._mode = mode
self._selection_type = selection_type
self._custom_select_fn = None
self._custom_cancel_fn = None
self._apply_button_name = apply_button_name
self._filter_regexes = []
self._filter_descriptions = []
self._current_directory = None
for item in item_filter_options:
self._filter_regexes.append(re.compile(item[0], re.IGNORECASE))
self._filter_descriptions.append(item[1])
self._build_ui()
def destroy(self):
self._custom_cancel_fn = None
self._custom_select_fn = None
if self._filepicker:
self._filepicker.destroy()
def set_custom_fn(self, select_fn, cancel_fn):
self._custom_select_fn = select_fn
self._custom_cancel_fn = cancel_fn
def show_dialog(self):
self._filepicker.show(self._current_directory)
self._current_directory = None
def hide_dialog(self):
self._filepicker.hide()
def set_current_directory(self, dir: str):
self._current_directory = dir
if not self._current_directory.endswith("/"):
self._current_directory += "/"
def set_current_filename(self, filename: str):
self._filepicker.set_filename(filename)
def set_filebar_label_name(self, name):
self._filepicker.set_filebar_label_name(name)
def _build_ui(self):
on_click_open = lambda f, d: asyncio.ensure_future(self._on_click_open(f, d))
on_click_cancel = lambda f, d: asyncio.ensure_future(self._on_click_cancel(f, d))
# Create the dialog
self._filepicker = FilePickerDialog(
self._title,
allow_multi_selection=False,
apply_button_label=self._apply_button_name,
click_apply_handler=on_click_open,
click_cancel_handler=on_click_cancel,
item_filter_options=self._filter_descriptions,
item_filter_fn=lambda item: self._on_filter_item(item),
error_handler=lambda m: self._on_error(m),
)
# Start off hidden
self.hide_dialog()
def _on_filter_item(self, item: FileBrowserItem) -> bool:
if not item or item.is_folder:
return True
if self._selection_type == FileBrowserSelectionType.DIRECTORY_ONLY:
return False
if self._filepicker.current_filter_option >= len(self._filter_regexes):
return False
regex = self._filter_regexes[self._filepicker.current_filter_option]
if regex.match(item.path):
return True
else:
return False
def _on_error(self, msg: str):
"""
Demonstrates error handling. Instead of just printing to the shell, the App can
display the error message to a console window.
"""
print(msg)
async def _on_click_open(self, filename: str, dirname: str):
"""
The meat of the App is done in this callback when the user clicks 'Accept'. This is
a potentially costly operation so we implement it as an async operation. The inputs
are the filename and directory name. Together they form the fullpath to the selected
file.
"""
dirname = dirname.strip()
if dirname and not dirname.endswith("/"):
dirname += "/"
fullpath = f"{dirname}{filename}"
result, entry = omni.client.stat(fullpath)
existed = True
if result == omni.client.Result.OK and entry.flags & omni.client.ItemFlags.CAN_HAVE_CHILDREN:
is_folder = True
else:
existed = False
is_folder = False
# If it's open, it cannot open non-existed file.
if not existed and self._mode == FileBrowserMode.OPEN:
return
if existed or self._mode == FileBrowserMode.OPEN:
if (is_folder and self._selection_type == FileBrowserSelectionType.FILE_ONLY) or (
not is_folder and self._selection_type == FileBrowserSelectionType.DIRECTORY_ONLY
):
return
self.hide_dialog()
await omni.kit.app.get_app().next_update_async()
if self._custom_select_fn:
self._custom_select_fn(fullpath)
async def _on_click_cancel(self, filename: str, dirname: str):
"""
This function is called when the user clicks 'Cancel'.
"""
self.hide_dialog()
await omni.kit.app.get_app().next_update_async()
if self._custom_cancel_fn:
self._custom_cancel_fn()
|
omniverse-code/kit/exts/omni.kit.tool.collect/omni/kit/tool/collect/tests/test_collect.py | import os
import asyncio
import carb
import omni.kit.test
import omni.usd
import omni.client
import omni.kit.commands
from pathlib import Path
from omni.kit.tool.collect import get_instance
from omni.kit.tool.collect.collector import (
Collector,
CollectorException,
CollectorFailureOptions,
FlatCollectionTextureOptions,
)
from omni.kit.tool.collect.utils import Utils
from pxr import Usd
# NOTE: those tests belong to omni.kit.tool.collect extension.
class TestCollect(omni.kit.test.AsyncTestCase):
def list_folder(self, folder_path):
all_file_names = []
result, entry = omni.client.stat(folder_path)
if result == omni.client.Result.OK and entry.flags & omni.client.ItemFlags.CAN_HAVE_CHILDREN:
is_folder = True
else:
is_folder = False
if not is_folder:
all_file_names = [os.path.basename(folder_path)]
else:
folder_queue = [folder_path]
while len(folder_queue) > 0:
folder = folder_queue.pop(0)
(result, entries) = omni.client.list(folder)
if result != omni.client.Result.OK:
break
folders = set((e.relative_path for e in entries if e.flags & omni.client.ItemFlags.CAN_HAVE_CHILDREN))
for f in folders:
folder_queue.append(f"{folder}/{f}")
files = set((e.relative_path for e in entries if not e.flags & omni.client.ItemFlags.CAN_HAVE_CHILDREN))
for file in files:
all_file_names.append(os.path.basename(file))
return all_file_names
def get_test_dir(self):
token = carb.tokens.get_tokens_interface()
data_dir = token.resolve("${data}")
if not data_dir.endswith("/"):
data_dir += "/"
data_dir = Utils.normalize_path(data_dir)
return f"{data_dir}collect_tool_tests"
async def setUp(self):
pass
async def tearDown(self):
await omni.client.delete_async(self.get_test_dir())
async def __test_internal(
self,
stage_name,
root_usd,
usd_only,
material_only,
flat_collection,
texture_option=FlatCollectionTextureOptions.FLAT,
):
extension_path = omni.kit.app.get_app().get_extension_manager().get_extension_path_by_module(__name__)
extension_path = Path(extension_path)
test_data_path = extension_path.joinpath("data")
test_stage_dir = str(test_data_path.joinpath("test_stages").joinpath(stage_name))
test_root_usd = test_stage_dir + "/" + root_usd
collected_stage_dir = self.get_test_dir() + f"/collected_{stage_name}"
collector = Collector(
test_root_usd, collected_stage_dir, usd_only, flat_collection, material_only, texture_option=texture_option
)
await collector.collect(None, None)
before = self.list_folder(test_stage_dir)
after = self.list_folder(collected_stage_dir)
self.assertTrue(len(after) > 0)
if usd_only:
before_filtered = []
for f in before:
if omni.usd.is_usd_writable_filetype(f):
before_filtered.append(f)
before = before_filtered
if material_only:
before_filtered = []
for f in before:
if not omni.usd.is_usd_writable_filetype(f):
before_filtered.append(f)
before = before_filtered
self.assertEqual(set(before), set(after))
async def test_collect_with_usd_and_material(self):
await self.__test_internal("normal", "FullScene.usd", False, False, False)
async def test_collect_with_udim_textures(self):
await self.__test_internal("udim", "SM_Hood_A1_1.usd", False, False, False)
async def test_collect_without_material(self):
await self.__test_internal("normal", "FullScene.usd", False, True, False)
async def test_collect_without_usd(self):
await self.__test_internal("normal", "FullScene.usd", True, False, False)
async def test_flatten_collection(self):
await self.__test_internal("normal", "FullScene.usd", False, False, True)
await self.__test_internal("layer_offsets", "root.usd", False, False, True)
async def test_flatten_collection_texture_options(self):
stage_name = "texture_options"
texture_dir = self.get_test_dir() + f"/collected_{stage_name}/SubUSDs/textures/"
mdl_name = "Contour1_Surface_0"
mdl_texture_name = "Contour1_Surface_1.bmp"
usd_preview_texture_name = "another_texture.bmp"
# test group textures by MDL
await self.__test_internal(
stage_name, "test_scene.usd", False, False, True, texture_option=FlatCollectionTextureOptions.BY_MDL
)
# mdl texture should be under the mdl named folder, while the usd preview texture should be directly under
# textures dir
self.assertTrue(os.path.exists(os.path.join(texture_dir, mdl_name, mdl_texture_name)))
self.assertTrue(os.path.exists(os.path.join(texture_dir, usd_preview_texture_name)))
await omni.client.delete_async(self.get_test_dir())
# test group textures by USD
await self.__test_internal(
stage_name, "test_scene.usd", False, False, True, texture_option=FlatCollectionTextureOptions.BY_USD
)
# usd preview texture should be under the usd asset named folder, while the mdl texture should be directly under
# textures dir
self.assertTrue(os.path.exists(os.path.join(texture_dir, "assetB", usd_preview_texture_name)))
self.assertTrue(os.path.exists(os.path.join(texture_dir, mdl_texture_name)))
await omni.client.delete_async(self.get_test_dir())
# test flat
await self.__test_internal(
stage_name, "test_scene.usd", False, False, True, texture_option=FlatCollectionTextureOptions.FLAT
)
# all textures should be directly under textures dir
self.assertEqual(set([mdl_texture_name, usd_preview_texture_name]), set(os.listdir(texture_dir)))
async def test_layer_offsets_collect(self):
current_path = Path(__file__).parent
test_data_path = current_path.parent.parent.parent.parent.parent.joinpath("data")
test_stage_dir = str(test_data_path.joinpath("test_stages").joinpath("layer_offsets"))
test_root_usd = test_stage_dir + "/root.usd"
collected_stage_dir = self.get_test_dir() + f"/collected_layer_offfsets"
collector = Collector(test_root_usd, collected_stage_dir, False, False, False)
await collector.collect(None, None)
before = self.list_folder(test_stage_dir)
after = self.list_folder(collected_stage_dir)
self.assertEqual(set(before), set(after))
after_stage_usd = collected_stage_dir + "/root.usd"
before_stage = Usd.Stage.Open(test_root_usd)
after_stage = Usd.Stage.Open(after_stage_usd)
before_root = before_stage.GetRootLayer()
after_root = after_stage.GetRootLayer()
before_sublayers = before_root.subLayerPaths
after_sublayers = after_root.subLayerPaths
self.assertTrue(len(before_sublayers) > 0)
self.assertEqual(len(before_sublayers), len(after_sublayers))
self.assertEqual(len(before_sublayers), len(after_sublayers))
for i in range(len(before_sublayers)):
before_sublayer = before_root.ComputeAbsolutePath(before_sublayers[i])
after_sublayer = after_root.ComputeAbsolutePath(after_sublayers[i])
self.assertNotEqual(before_sublayer, after_sublayer)
self.assertEqual(before_root.subLayerOffsets, after_root.subLayerOffsets)
async def test_collect_failure_with_exception(self):
with self.assertRaises(CollectorException):
collector = Collector("invalid_source.usd", self.get_test_dir(), False, False, False)
await collector.collect(None, None)
with self.assertRaises(CollectorException):
current_path = Path(__file__).parent
test_data_path = current_path.parent.parent.parent.parent.parent.joinpath("data")
test_stage_path = str(test_data_path.joinpath("test_stages").joinpath("normal/FullScene.usd"))
collector = Collector(test_stage_path, "omniverse://invalid_path", False, False, False)
await collector.collect(None, None)
usd_error_option = CollectorFailureOptions.EXTERNAL_USD_REFERENCES
other_error_option = CollectorFailureOptions.OTHER_EXTERNAL_REFERENCES
all_option = CollectorFailureOptions.EXTERNAL_USD_REFERENCES | CollectorFailureOptions.OTHER_EXTERNAL_REFERENCES
for option in [usd_error_option, other_error_option, all_option]:
with self.assertRaises(CollectorException):
current_path = Path(__file__).parent
test_data_path = current_path.parent.parent.parent.parent.parent.joinpath("data")
test_stage_path = str(test_data_path.joinpath("test_stages/normal").joinpath("FullScene.usd"))
collected_stage_dir = self.get_test_dir() + "/collected_normal"
collector = Collector(test_stage_path, collected_stage_dir, False, False, False, failure_options=option)
await collector.collect(None, None)
async def test_utils(self):
self.assertTrue(Utils.is_udim_texture("test.<UDIM>.png"))
self.assertTrue(Utils.is_udim_texture("test_<UDIM>_suffix.png"))
self.assertTrue(Utils.is_udim_texture("test.%3cUDIM%3e.png"))
self.assertFalse(Utils.is_udim_texture(""))
self.assertFalse(Utils.is_udim_texture("random"))
self.assertTrue(Utils.is_udim_wildcard_texture("test_0001_suffix.png", "test_<UDIM>_suffix.png"))
self.assertFalse(Utils.is_udim_wildcard_texture("test_0001_another_suffix.png", "test_<UDIM>_suffix.png"))
self.assertTrue(
Utils.is_udim_wildcard_texture(
"omniverse://fake-server/base_path/test_0001_suffix.png",
"omniverse://fake-server/base_path/test_<UDIM>_suffix.png",
)
)
self.assertFalse(
Utils.is_udim_wildcard_texture(
"omniverse://fake-server/base_path/test_0001_another_suffix.png",
"omniverse://fake-server/base_path/test_<UDIM>_suffix.png",
)
)
async def test_path_calculation(self):
# Tests for https://nvidia-omniverse.atlassian.net/browse/OM-34746
current_path = Path(__file__).parent
test_data_path = current_path.parent.parent.parent.parent.parent.joinpath("data")
test_stage_path = str(test_data_path.joinpath("test_stages").joinpath("normal/FullScene.usd"))
collector = Collector(test_stage_path, self.get_test_dir(), False, False, False)
path = collector._calculate_target_path("http://test_server/testfile.png")
self.assertEqual(path, self.get_test_dir() + "/test_server/testfile.png")
path = collector._calculate_target_path(str(test_data_path) + "/deep_folder/testfile.png")
self.assertEqual(path, self.get_test_dir() + "/deep_folder/testfile.png")
path = collector._calculate_target_path("omniverse://test_server/testfile.png")
self.assertEqual(path, self.get_test_dir() + "/test_server/testfile.png")
# Flat collect
collector._flat_collection = True
collector._material_only = False
path = collector._calculate_target_path("omniverse://test_server/testfile.png")
self.assertEqual(path, self.get_test_dir() + "/SubUSDs/textures/testfile.png")
path = collector._calculate_target_path("http://test_server/testfile.png")
self.assertEqual(path, self.get_test_dir() + "/SubUSDs/textures/testfile.png")
path = collector._calculate_target_path("http://test_server/testfile.usd")
self.assertEqual(path, self.get_test_dir() + "/SubUSDs/testfile.usd")
# Materials only with flat collect
collector._flat_collection = True
collector._material_only = True
path = collector._calculate_target_path("omniverse://test_server/testfile.png")
self.assertEqual(path, self.get_test_dir() + "/textures/testfile.png")
path = collector._calculate_target_path("http://test_server/testfile.png")
self.assertEqual(path, self.get_test_dir() + "/textures/testfile.png")
# Master USD with flat collect
collector._flat_collection = True
collector._material_only = False
path = collector._calculate_target_path(test_stage_path)
self.assertEqual(path, self.get_test_dir() + "/FullScene.usd")
async def __wait(self, frames=2):
for _ in range(frames):
await omni.kit.app.get_app().next_update_async()
async def __test_ui_internal(self, stage_name, root_usd, usd_only, material_only, flat_collection):
extension_path = omni.kit.app.get_app().get_extension_manager().get_extension_path_by_module(__name__)
extension_path = Path(extension_path)
test_data_path = extension_path.joinpath("data")
test_stage_dir = str(test_data_path.joinpath("test_stages").joinpath(stage_name))
test_root_usd = test_stage_dir + "/" + root_usd
collected_stage_dir = self.get_test_dir() + f"/collected_{stage_name}"
done = False
def on_finish():
nonlocal done
done = True
collect_extension = get_instance()
collect_extension.collect(test_root_usd, on_finish)
await self.__wait()
from omni.kit import ui_test
collect_window = ui_test.find("Collection Options")
await collect_window.focus()
usd_only_checkbox = collect_window.find("**/CheckBox[*].identifier=='usd_only_checkbox'")
material_only_checkbox = collect_window.find("**/CheckBox[*].identifier=='material_only_checkbox'")
flat_collection_checkbox = collect_window.find("**/CheckBox[*].identifier=='flat_collection_checkbox'")
folder_button = collect_window.find("**/Button[*].identifier=='folder_button'")
path_field = collect_window.find("**/StringField[*].identifier=='collect_path'")
start_button = collect_window.find("**/Button[*].text=='Start'")
cancel_button = collect_window.find("**/Button[*].text=='Cancel'")
option_combo = collect_window.find("**/ComboBox[*].identifier=='texture_option_combo'")
self.assertTrue(usd_only_checkbox)
self.assertTrue(material_only_checkbox)
self.assertTrue(flat_collection_checkbox)
self.assertTrue(folder_button)
self.assertTrue(path_field)
self.assertTrue(start_button)
self.assertTrue(cancel_button)
self.assertTrue(option_combo)
usd_only_checkbox.model.set_value(False)
material_only_checkbox.model.set_value(False)
flat_collection_checkbox.model.set_value(False)
if usd_only:
await usd_only_checkbox.click()
if material_only:
await material_only_checkbox.click()
if flat_collection:
self.assertFalse(option_combo.widget.visible)
await flat_collection_checkbox.click()
# should show texture options combo here
self.assertTrue(option_combo.widget.visible)
await folder_button.click()
file_picker = ui_test.find("Select Collect Destination")
self.assertTrue(file_picker)
await file_picker.focus()
open_button = file_picker.find("**/Button[*].text=='Open'")
cancel_button = file_picker.find("**/Button[*].text=='Cancel'")
self.assertTrue(open_button)
self.assertTrue(cancel_button)
await cancel_button.click()
path_field.model.set_value(collected_stage_dir)
await start_button.click()
await self.__wait()
progress_window = ui_test.find("Collecting")
self.assertTrue(progress_window)
while not done:
await self.__wait()
self.assertFalse(progress_window.window.visible)
before = self.list_folder(test_stage_dir)
after = self.list_folder(collected_stage_dir)
self.assertTrue(len(after) > 0)
if usd_only:
before_filtered = []
for f in before:
if omni.usd.is_usd_writable_filetype(f):
before_filtered.append(f)
before = before_filtered
if material_only:
before_filtered = []
for f in before:
if not omni.usd.is_usd_writable_filetype(f):
before_filtered.append(f)
before = before_filtered
self.assertEqual(set(before), set(after))
self.assertTrue(done)
async def test_ui_collect_with_usd_and_material(self):
await self.__test_ui_internal("normal", "FullScene.usd", False, False, False)
async def test_ui_collect_without_material(self):
await self.__test_ui_internal("normal", "FullScene.usd", False, True, False)
async def test_ui_collect_without_usd(self):
await self.__test_ui_internal("normal", "FullScene.usd", True, False, False)
async def test_om_55150(self):
await self.__test_ui_internal("OM_55150", "collect_donut.usd", False, False, False)
async def test_ui_flatten_collection(self):
await self.__test_ui_internal("normal", "FullScene.usd", False, False, True)
async def test_file_menu(self):
await omni.usd.get_context().new_stage_async()
from omni.kit import ui_test
await ui_test.menu_click("File/Collect As...")
# It cannot collect anonymous stage
collect_window = ui_test.find("Collection Options")
self.assertFalse(collect_window)
extension_path = omni.kit.app.get_app().get_extension_manager().get_extension_path_by_module(__name__)
extension_path = Path(extension_path)
test_data_path = extension_path.joinpath("data")
test_stage_dir = str(test_data_path.joinpath("test_stages").joinpath("udim"))
test_root_usd = test_stage_dir + "/SM_Hood_A1_1.usd"
await omni.usd.get_context().open_stage_async(test_root_usd)
await ui_test.menu_click("File/Collect As...")
# It cannot collect anonymous stage
collect_window = ui_test.find("Collection Options")
self.assertFalse(collect_window)
|
omniverse-code/kit/exts/omni.kit.tool.collect/omni/kit/tool/collect/tests/__init__.py | from .test_collect import *
|
omniverse-code/kit/exts/omni.kit.tool.collect/docs/CHANGELOG.md | # Changelog
## [2.1.20] - 2022-11-10
### Added
- Add texture grouping options for flat collection mode, textures can be grouped by MDL, USD or flat.
## [2.1.19] - 2022-11-07
### Changed
- Reduce size of test data.
- Improve UI.
- Make omni.kit.window.content_browser as optional.
- Fix MDL parser that cannot handle spaces in texture define.
## [2.1.18] - 2022-09-05
### Changed
- Fix issue that won't hide progress bar.
## [2.1.17] - 2022-08-27
### Changed
- Move collect tool into Kit core.
- More improvement to perf.
- Hook collect tool to file menu.
## [2.1.16] - 2022-08-26
### Changed
- Fix file naming conflicts for flat collection.
- More improvement about logging and perf.
## [2.1.15] - 2022-08-23
### Changed
- More test coverage.
## [2.1.14] - 2022-08-18
### Changed
- Fix refactoring issues.
## [2.1.13] - 2022-08-12
### Changed
- Refactoring collect tool to improve perf.
- Fix tags collecting.
## [2.1.12] - 2022-07-28
### Changed
- Fix issues to collect read-only USD files.
## [2.1.11] - 2022-05-26
### Changed
- Workaround to solve usda collect issue by renaming extension to match its content format.
## [2.1.10] - 2022-05-20
### Added
- Fix collect issue that will miss tags for USD files.
## [2.1.9] - 2022-05-12
### Added
- add flag to elide copy if files that already in destination location.
## [2.1.8] - 2022-04-28
### Changed
- Revert maximum tasks to 8 to avoid influence interaction of UI.
## [2.1.7] - 2022-04-28
### Changed
- Add error options to customize error reporting.
## [2.1.6] - 2022-04-06
### Changed
- Match MDL resolve rule as new-MDL-Schema in USD.
## [2.1.5] - 2022-03-07
### Changed
- Fix missing changes from Kit release/103.1.
## [2.1.4] - 2022-03-07
### Changed
- Catch possible exceptions threw by UsdUtils.ExtractExternalReferences and UsdUtils.ModifyAssetPaths.
## [2.1.3] - 2022-02-21
### Changed
- Move collect tool to kit-tools repo.
## [2.1.2] - 2022-02-09
### Changed
- Fix an issue that UDIM textures are missing to be collected.
## [2.1.1] - 2022-01-12
### Changed
- Fix path decode issue for collecting projects from ov to ov.
## [2.1.0] - 2021-12-16
### Changed
- Fix path resolve that's with/without relative path prefix, like './' or '../'
## [2.0.8] - 2021-09-27
### Changed
- Fix texture collecting for cube/ptex textures
- Fix mdl module replace.
## [2.0.7] - 2021-09-16
### Changed
- Improve UX of file picker to show folder name for folder picker.
## [2.0.6] - 2021-09-10
### Fixes
- Improve flat collect to resolve material dependencies.
## [2.0.5] - 2021-09-09
### Added
- Add API to collect.
## [2.0.4] - 2021-08-25
### Fixes
- Fix UDIM textures collect.
## [2.0.3] - 2021-07-28
### Changed
- More tests.
## [2.0.2] - 2021-07-21
### Fixed
- Fix collection to assets from http source.
## [2.0.1] - 2021-02-06
### Changed
- Initialize change log.
- Remove old editor and content window dependencies.
|
omniverse-code/kit/exts/omni.kit.tool.collect/docs/README.md | # Project Collector [omni.kit.tool.collect]
This extension provides UI interfaces to collect USD project by resolving, re-pathing and gathering all dependencies, so project can be movable and sharable conveniently.
## UI Options Explained
`USD Only`: If this option is enabled, it will only collect USD files and other other dependencies are ignored (like material files and textures.)
`Material Only`: If this options is enabled, it will only collect all material related dependencies including textures, and USD files will be ignored.
`Flat Collection`: By default, it will collect USD project by keeping the directory structure. If this option is enabled, the directory structure will not be kept and all dependencies will be put into specified folders.
`Flat Collection Texture Options`: When collecting in Flat mode, users can specify the grouping for texture files via this option; Currently there are 3 available options:
| Options | Description |
| ------- | ----------- |
| Group by MDL | Textures will be grouped by their parent MDL file name. |
| Group by USD | Textures will be grouped by their parent USD file name. |
| Flat | All textures will be collected under the same hierarchy under "textures" folder. Note that there might be potential danger of textures overwriting each other, if they have the same names but belong to different assets/mdls. |
## Limitations
There is no USDZ support currently until Kit resolves MDL loading issue inside USDZ file. |
omniverse-code/kit/exts/omni.kit.tool.collect/docs/index.rst | omni.kit.tool.collector
#######################
Python extension to collect all dependencies of an USD.
|
omniverse-code/kit/exts/omni.kit.tool.collect/data/test_stages/normal/ov-sandbox/Users/kvankooten/paraview/Session_74/materials/OmniPBR_Opacity.mdl |
/*****************************************************************************
* Copyright 1986-2017 NVIDIA Corporation. All rights reserved.
******************************************************************************
MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
THE MDL MATERIALS.
*/
/*
//fixes: customIOR, AO mapping JIC, added bsdf dropdown
//fixes 10/12/2018 - converted metallic Bool into float for map.
//jjordan 10/18: disabled bsdf_type. imho makes material complicated without real benefit, but final call is for Daniela since she knows feedback
//jjordan 10/18: removed all ternaries on material structs and substituted with ternaries on bsdf. this works around https://moskito.nvidia-arc.com/show_bug.cgi?id=18719 but at the same time is shorter then original code
//danielaf 10/24/18: replacing ifm annotation with updated 1.4 anno for parameter ui grouping
//danielaf 10/24/18: removing all Booleans and using floats instead for dynamic material in RTX_OV
//ddanielaf 10/24/18: adding explicit texture input parameter and texture enable parameters for RTX_OV OMN-812 - unless tex::texture_isvalid implemented in RTX_OV
//danielaf 10/24/18: removed anisotropy,backscatter, thinfilms, custom_bsdf, abbe_number(things that don't seem to have any effect in RTX_OV ATM)
//danielaf 11/2/2018: omni flex trimmed way down
//danielaf 11/06/2018: switch enables to bool! :D
//switched back to 1.3, getting "mdl 1.4 not supported" from my iviewer version 2017 1.4 296300.6298
//switched to 1.2 - getting normalmap_texture parameter type error when switching to 1.4 - still troubleshooting
//azoellner 1/18/19 - promoting staging to the real material, removed "Staging" from all names
//azoellner 2/11/19 modified display name sand group names to match up with known Sol master
//rraab 28/2/19 Changed surface reflectance behavior to match the UE4 model
//rraab 11/4/19 Changed material name from SolPBR_Master to Advanced PBR,
// Adding keywords and removing
//tmosier 12/4/19 Cleaned up display names
azoellner on behave of Ignacio - 8-9-2019 - added advancedPBR_Cutouts.mdl to improve class comiplation on Kit.
azoellner 10/30/19 changing to omniPBR. adding use base texture bool, base color, and so its not required to use emmissive mask.
*/
mdl 1.4;
import ::df::*;
import ::state::*;
import ::math::*;
import ::base::*;
import ::tex::*;
import ::anno::*;
import ::nvidia::core_definitions::file_texture;
import ::nvidia::core_definitions::normalmap_texture;
uniform float4x4 rotation_translation_scale(
uniform float3 rotation = float3(0.)
[[ anno::description("Rotation applied to every UVW coordinate") ]],
uniform float3 translation = float3(0.)
[[ anno::description("Offset applied to every UVW coordinate") ]],
uniform float3 scaling = float3(1.)
[[ anno::description("Scale applied to every UVW coordinate") ]]
)
[[
anno::description("Construct transformation matrix from Euler rotation, translation and scale"),
anno::hidden()
]]
{
float4x4 scale =
float4x4(scaling.x , 0. , 0. , 0.,
0. , scaling.y , 0. , 0.,
0. , 0. , scaling.z , 0.,
translation.x, translation.y, translation.z, 1.);
float3 s = math::sin(rotation);
float3 c = math::cos(rotation);
float4x4 rotate =
float4x4( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , 0.0,
c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , 0.0,
-s.y , s.x*c.y , c.x*c.y , 0.0,
0. , 0 , 0 , 1.);
return scale*rotate;
}
// Returns the normal n in tangent space, given n is in internal space.
float3 transform_internal_to_tangent(float3 n)
{
return
n.x* float3(state::texture_tangent_u(0).x,state::texture_tangent_v(0).x,state::normal().x)+
n.y* float3(state::texture_tangent_u(0).y,state::texture_tangent_v(0).y,state::normal().y)+
n.z* float3(state::texture_tangent_u(0).z,state::texture_tangent_v(0).z,state::normal().z);
}
// Returns the normal n in internal space, given n is in tangent space.
float3 transform_tangent_to_internal(float3 n)
{
return state::texture_tangent_u(0) * n.x +
state::texture_tangent_v(0) * n.y +
state::normal() * n.z ;
}
// Returns a normal by adding a detail normal to a global normal.
export float3 add_detail_normal(float3 nd = state::normal(), float3 n = state::normal())
{
// http://blog.selfshadow.com/publications/blending-in-detail/
float3 n_t = transform_internal_to_tangent(n);
float3 nd_t = transform_internal_to_tangent(nd);
n_t=n_t + float3(0.,0.,1.);
nd_t = nd_t * float3(-1.,-1.,1.);
n = n_t*math::dot(n_t, nd_t)/n_t.z - nd_t;
return math::normalize(transform_tangent_to_internal(n));
}
base::texture_return multiply_colors(
color color_1 = color(1.0, 1.0, 1.0),
color color_2 = color(.5, .5, .5),
float weight = 1.0
) [[
anno::hidden()
]]
{
return base::blend_color_layers(
layers: base::color_layer[](
base::color_layer(
layer_color: color_2,
weight: weight,
mode: base::color_layer_multiply
)),
base: color_1
);
}
base::texture_return add_colors(
color color_1 = color(.5, .5, .5),
color color_2 = color(.5, .5, .5),
float weight = 1.0
) [[
anno::hidden(),
anno::unused()
]]
{
return base::blend_color_layers(
layers: base::color_layer[](
base::color_layer(
layer_color: color_2,
weight: weight,
mode: base::color_layer_add
)),
base: color_1
);
}
base::texture_return blend_colors(
color color_1 = color(1.0, 1.0, 1.0),
color color_2 = color(.5, .5, .5),
float weight = 1.0
) [[
anno::hidden(),
anno::unused()
]]
{
return base::blend_color_layers(
layers: base::color_layer[](
base::color_layer(
layer_color: color_2,
weight: weight,
mode: base::color_layer_blend
)),
base: color_1
);
}
export material OmniPBR_Opacity(
color diffuse_color_constant = color(0.2f)
[[
anno::display_name("Base Color"),
anno::description("This is the base color"),
anno::in_group("Albedo")
]],
uniform texture_2d diffuse_texture = texture_2d()
[[
anno::display_name("Albedo Map"),
anno::in_group("Albedo")
]],
float albedo_desaturation = float(0.0)
[[
anno::display_name("Albedo Desaturation"),
anno::soft_range(float(0.0f), float(1.0f)),
anno::description("Desaturates the diffuse color"),
anno::in_group("Albedo")
]],
float albedo_add = float(0.0)
[[
anno::display_name("Albedo Add"),
anno::soft_range(float(-1.0f), float(1.0f)),
anno::description("Adds a constant value to the diffuse color "),
anno::in_group("Albedo")
]],
float albedo_brightness = float(1.0)
[[
anno::display_name("Albedo Brightness"),
anno::soft_range(float(0.0f), float(1.0f)),
anno::description("Multiplier for the diffuse color "),
anno::in_group("Albedo")
]],
color diffuse_tint = color(1.0f)
[[
anno::display_name("Color Tint"),
anno::description("When enabled, this color value is multiplied over the final albedo color"),
anno::in_group("Albedo")
]],
// -------------------- REFLECTIVITY ----------------------
float reflection_roughness_constant = 0.5f
[[
anno::display_name("Roughness Amount"),
anno::hard_range(0.0,1.),
anno::description("Higher roughness values lead to more blurry reflections"),
anno::in_group("Reflectivity")
]],
float reflection_roughness_texture_influence = 0.0f
[[
anno::display_name("Roughness Map Influence"),
anno::hard_range(0.0, 1.),
anno::description("Blends between the constant value and the lookup of the roughness texture"),
anno::in_group("Reflectivity")
]],
uniform texture_2d reflectionroughness_texture = texture_2d()
[[
anno::display_name("Roughness Map"),
anno::in_group("Reflectivity")
]],
float metallic_constant = 0.f
[[
anno::display_name("Metallic Amount"),
anno::hard_range(0.0,1.),
anno::description("Metallic Material"),
anno::in_group("Reflectivity")
]],
float metallic_texture_influence = 0.0f
[[
anno::display_name("Metallic Map Influence"),
anno::hard_range(0.0, 1.),
anno::description("Blends between the constant value and the lookup of the metallic texture"),
anno::in_group("Reflectivity")
]],
uniform texture_2d metallic_texture = texture_2d()
[[
anno::display_name("Metallic Map"),
anno::in_group("Reflectivity")
]],
float specular_level = float(0.5)
[[
anno::display_name("Specular"),
anno::soft_range(float(0.0f), float(1.0f)),
anno::description("The specular level (intensity) of the material"),
anno::in_group("Reflectivity")
]],
// -------------------- ORM ----------------------
uniform bool enable_ORM_texture = false
[[
anno::display_name("Enable ORM Texture"),
anno::description("When True the ORM texture will be used to extract the Occlusion, Roughness and Metallic Map"),
anno::in_group("Reflectivity")
]],
uniform texture_2d ORM_texture = texture_2d()
[[
anno::display_name("ORM Map"),
anno::description("Texture that hae Occlusion, Roughness and Metallic map stored in the respective r, g and b channels"),
anno::in_group("Reflectivity")
]],
// -------------------- AO Group ----------------------
float ao_to_diffuse = 0.0
[[
anno::display_name("AO to Diffuse"),
anno::description("Controls the amount of ambient occlusion multiplied into the diffuse color channel"),
anno::in_group("AO")
]],
uniform texture_2d ao_texture = texture_2d()
[[
anno::display_name("Ambient Occlusion Map"),
anno::description("The Ambient Occlusion texture for the material"),
anno::in_group("AO")
]],
// -------------------- EMISSIVE ----------------------
uniform bool enable_emission = false
[[
anno::display_name("Enable Emission"),
anno::description("Enables the emission of light from the material"),
anno::in_group("Emissive")
]],
color emissive_color = color(1.0, 0.1, 0.1)
[[
anno::enable_if("enable_emission == true"),
anno::display_name("Emissive Color"),
anno::description("The emission color"),
anno::in_group("Emissive")
]],
uniform texture_2d emissive_mask_texture = texture_2d()
[[
anno::enable_if("enable_emission == true"),
anno::display_name("Emissive Mask map"),
anno::description("The texture masking the emissive color"),
anno::in_group("Emissive")
]],
uniform float emissive_intensity = 40.f
[[
anno::enable_if("enable_emission == true"),
anno::display_name("Emissive Intensity"),
anno::description("Intensity of the emission"),
anno::in_group("Emissive")
]],
// Opacity Map
uniform bool enable_opacity_texture = false
[[
anno::display_name("Enable Opacity"),
anno::description("Enables or disbales the usage of the opacity texture map"),
anno::in_group("Opacity")
]],
uniform float opacity_constant = 1.f
[[
anno::enable_if("enable_opacity_texture == true"),
anno::hard_range(0.0, 1.0),
anno::display_name("Opacity Amount"),
anno::description("Amount of Opacity"),
anno::in_group("Opacity")
]],
uniform texture_2d opacity_texture = texture_2d()
[[
anno::enable_if("enable_opacity_texture==true"),
anno::display_name("Opacity Map"),
anno::in_group("Opacity")
]],
// -------------------- Normal ----------------------
uniform float bump_factor = 1.f
[[
anno::display_name("Normal Map Strength"),
anno::description("Strength of normal map."),
anno::in_group("Normal")
]],
uniform texture_2d normalmap_texture = texture_2d()
[[
anno::display_name("Normal Map"),
anno::description("Enables the usage of the normalmap texture"),
anno::in_group("Normal")
]],
uniform float detail_bump_factor = .3f
[[
anno::display_name("Detail Normal Strength"),
anno::in_group("Normal"),
anno::description("Strength of the detail normal")
]],
uniform texture_2d detail_normalmap_texture = texture_2d()
[[
anno::display_name("Detail Normal Map"),
anno::in_group("Normal")
]],
// UV Projection Group
uniform bool project_uvw = false
[[
anno::display_name("Enable Project UVW Coordinates"),
anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
anno::in_group("UV")
]],
uniform bool world_or_object = false
[[
anno::enable_if("project_uvw == true"),
anno::display_name("Enable World Space"),
anno::description("When set to 'true' uses world space for projection, when 'false' object space is used"),
anno::in_group("UV")
]],
uniform int uv_space_index = 0
[[
anno::enable_if("project_uvw == true"),
anno::display_name("UV Space Index"),
anno::description("UV Space Index."),
anno::in_group("UV"),
anno::hard_range(0, 3)
]],
// Adjustments Group
uniform float2 texture_translate = float2(0.0f)
[[
anno::enable_if("project_uvw == true"),
anno::display_name("Texture Translate"),
anno::description("Controls position of texture."),
anno::in_group("UV")
]],
uniform float texture_rotate = 0.f
[[
anno::enable_if("project_uvw == true"),
anno::display_name("Texture Rotate"),
anno::description("Rotates angle of texture in degrees."),
anno::in_group("UV")
]],
uniform float2 texture_scale = float2(1.0f)
[[
anno::enable_if("project_uvw == true"),
anno::display_name("Texture Scale"),
anno::description("Larger number increases size of texture."),
anno::in_group("UV")
]],
uniform float2 detail_texture_translate = float2(0.0f)
[[
anno::enable_if("project_uvw == true"),
anno::display_name("Detail Texture Translate"),
anno::description("Controls the position of the detail texture."),
anno::in_group("UV")
]],
uniform float detail_texture_rotate = 0.f
[[
anno::enable_if("project_uvw == true"),
anno::display_name("Detail Texture Rotate"),
anno::description("Rotates angle of the detail texture in degrees."),
anno::in_group("UV")
]],
uniform float2 detail_texture_scale = float2(1.0f)
[[
anno::enable_if("project_uvw == true"),
anno::display_name("Detail Texture Scale"),
anno::description("Larger numbers increase the size of the detail texture"),
anno::in_group("UV")
]]
)
[[
anno::display_name("Omni PBR Opacity"),
anno::description("Omni PBR,supports opacity and ORM textures"),
anno::version( 1, 0, 0),
anno::author("NVIDIA CORPORATION"),
anno::key_words(string[]("omni", "PBR", "omniverse", "generic"))
]]
= let{
base::texture_coordinate_system the_system = world_or_object ? base::texture_coordinate_world : base::texture_coordinate_object;
base::texture_coordinate_info uvw = project_uvw ?
base::coordinate_projection(
coordinate_system: the_system,
texture_space: uv_space_index,
projection_type: base::projection_cubic ) :
base::coordinate_source(
coordinate_system: base::texture_coordinate_uvw,
texture_space: uv_space_index
);
base::texture_coordinate_info transformed_uvw = base::transform_coordinate(
transform: rotation_translation_scale(
scaling: float3(texture_scale.x, texture_scale.y, 1.0),
rotation: float3(0.0, 0.0, texture_rotate/180.*math::PI ),
translation: float3(texture_translate.x, texture_translate.y, 0.0)
),
coordinate: uvw
);
base::texture_coordinate_info detail_transformed_uvw = base::transform_coordinate(
transform: rotation_translation_scale(
scaling: float3(detail_texture_scale.x, detail_texture_scale.y, 1.0),
rotation: float3(0.0, 0.0, detail_texture_rotate/180.*math::PI ),
translation: float3(detail_texture_translate.x, detail_texture_translate.y, 0.0)
),
coordinate: uvw
);
// -------------------- ORM Handling --------------------
float3 ORM_lookup = tex::lookup_float3(
tex: ORM_texture,
coord: float2(transformed_uvw.position.x, transformed_uvw.position.y)
);
base::texture_return roughness_lookup = base::file_texture(
texture: reflectionroughness_texture,
mono_source: base::mono_average,
uvw: transformed_uvw,
clip: false
);
float roughness_selection = enable_ORM_texture ? ORM_lookup.y : roughness_lookup.mono;
float reflection_roughness_1 = math::lerp(reflection_roughness_constant, roughness_selection, reflection_roughness_texture_influence);
// Diffuse Color Lookup and AO
base::texture_return base_lookup = base::file_texture(
texture: diffuse_texture,
color_offset: color(albedo_add),
color_scale: color(albedo_brightness),
mono_source: base::mono_luminance,
uvw: transformed_uvw,
clip: false
);
float alpha = tex::texture_isvalid(diffuse_texture) ? base::file_texture(
texture: diffuse_texture,
mono_source: base::mono_alpha,
uvw: transformed_uvw,
clip: false
).mono : 1.0;
base::texture_return ao_lookup = base::file_texture(
texture: ao_texture,
color_offset: color(0.0, 0.0, 0.0),
color_scale: color(1.0, 1.0, 1.0),
mono_source: base::mono_average,
uvw: transformed_uvw,
clip: false
);
// checking whether the ORM texture or the AO texture is supposed to be used
color ao_color = enable_ORM_texture ? color(ORM_lookup.x) : ao_lookup.tint;
color desaturated_base = math::lerp(base_lookup.tint, color(base_lookup.mono), albedo_desaturation);
color diffuse_color = tex::texture_isvalid(diffuse_texture)? desaturated_base : diffuse_color_constant;
//color diffuse_color = desaturated_base ;
color tinted_diffuse_color = multiply_colors(diffuse_color, diffuse_tint, 1.0).tint ;
color base_color = multiply_colors(
color_1: tinted_diffuse_color,
color_2: ao_color,
weight: ao_to_diffuse
).tint;
base::texture_return metallic_lookup = base::file_texture(
texture: metallic_texture,
color_offset: color(0.0, 0.0, 0.0),
color_scale: color(1.0, 1.0, 1.0),
mono_source: base::mono_average,
uvw: transformed_uvw,
clip: false
);
// Choose between ORM or metallic map
float metallic_selection = enable_ORM_texture ? ORM_lookup.z : metallic_lookup.mono;
// blend between the constant metallic value and the map lookup
float metallic = math::lerp(metallic_constant, metallic_selection, metallic_texture_influence);
bsdf diffuse_bsdf = df::diffuse_reflection_bsdf(
tint: base_color,
roughness: 0.f
);
bsdf ggx_smith_bsdf = df::microfacet_ggx_smith_bsdf(
roughness_u:reflection_roughness_1 * reflection_roughness_1,
roughness_v:reflection_roughness_1 * reflection_roughness_1,
tint: color(1.0, 1.0, 1.0),
mode: df::scatter_reflect
);
bsdf custom_curve_layer_bsdf = df::custom_curve_layer(
normal_reflectivity: 0.08,
grazing_reflectivity: 1.0,
exponent: 5.0,
weight: specular_level,
layer: ggx_smith_bsdf,
base: diffuse_bsdf
);
// Replaced by tinting as this reproduces the UE4 behavior more faithfully
bsdf directional_factor_bsdf = df::directional_factor(
normal_tint: base_color,
grazing_tint: base_color, //color(1.0, 1.0, 1.0),
exponent: 3.0f,
base: ggx_smith_bsdf
);
//bsdf directional_factor_bsdf = df::tint(base_color, ggx_smith_bsdf);
bsdf final_bsdf = df::weighted_layer(
weight: metallic,
layer: directional_factor_bsdf,
base: custom_curve_layer_bsdf
);
color emissive_mask = tex::texture_isvalid(emissive_mask_texture) ?
base::file_texture(
texture: emissive_mask_texture,
color_offset: color(0.0, 0.0, 0.0),
color_scale: color(1.0, 1.0, 1.0),
mono_source: base::mono_average,
uvw: transformed_uvw,
clip: false
).tint : color(1.0);
// Normal calculations
float3 the_normal = tex::texture_isvalid(normalmap_texture) ?
base::tangent_space_normal_texture(
texture: normalmap_texture,
factor: bump_factor,
uvw: transformed_uvw
//flip_tangent_u: false,
//flip_tangent_v: true
): state::normal() ;
float3 detail_normal = tex::texture_isvalid(detail_normalmap_texture) ?
base::tangent_space_normal_texture(
texture: detail_normalmap_texture,
factor: detail_bump_factor,
uvw: detail_transformed_uvw
): state::normal() ;
float3 final_normal = tex::texture_isvalid(detail_normalmap_texture) ? add_detail_normal(detail_normal, the_normal) : the_normal;
// Opacity Map
float opacity_value = enable_opacity_texture ? base::file_texture(
texture: opacity_texture,
mono_source: base::mono_average,
uvw: transformed_uvw
).mono : (opacity_constant > 0? opacity_constant*alpha : alpha);
} in material(
surface: material_surface(
scattering: final_bsdf,
emission: material_emission (
df::diffuse_edf(),
intensity: enable_emission? emissive_color * emissive_mask * color(emissive_intensity) : color(0)
)
),
geometry: material_geometry(
normal: final_normal,
cutout_opacity: opacity_value
)
);
|
omniverse-code/kit/exts/omni.kit.tool.collect/data/test_stages/normal/ov-sandbox/Users/kvankooten/paraview/Session_74/materials/Contour1_Surface_0.mdl |
mdl 1.4;
import ::df::*;
import ::base::*;
import ::math::*;
import ::state::*;
import ::anno::*;
import ::tex::*;
import OmniPBR_Opacity::OmniPBR_Opacity;
export material Contour1_Surface_0(*) = OmniPBR_Opacity::OmniPBR_Opacity(
diffuse_color_constant: color( 1.0000000f, 1.0000000f, 1.0000000f),
diffuse_texture: texture_2d("../textures/Contour1_Surface_1.bmp", ::tex::gamma_default),
emissive_color: color( 1.0000000f, 1.0000000f, 1.0000000f),
emissive_intensity: 0,
enable_emission: false,
opacity_constant: 1,
opacity_texture: texture_2d(),
enable_opacity_texture: false,
reflection_roughness_constant : 0.3,
reflectionroughness_texture : texture_2d(),
reflection_roughness_texture_influence : 0.f,
metallic_constant : 0,
metallic_texture : texture_2d(),
metallic_texture_influence : 0.f,
albedo_add: 0.f,
albedo_brightness: 1.f,
ao_texture : texture_2d(),
ao_to_diffuse : 0.f,
specular_level : 0.5f,
normalmap_texture : texture_2d(),
bump_factor : 1.f,
project_uvw : false,
world_or_object : false,
uv_space_index : 0,
texture_translate : float2(0.f),
texture_rotate : 0.f,
texture_scale : float2(1.f)
);
|
omniverse-code/kit/exts/omni.kit.tool.collect/data/test_stages/texture_options/materials/Contour1_Surface_0.mdl |
mdl 1.4;
import ::df::*;
import ::base::*;
import ::math::*;
import ::state::*;
import ::anno::*;
import ::tex::*;
import OmniPBR_Opacity::OmniPBR_Opacity;
export material Contour1_Surface_0(*) = OmniPBR_Opacity::OmniPBR_Opacity(
diffuse_color_constant: color( 1.0000000f, 1.0000000f, 1.0000000f),
diffuse_texture: texture_2d("../textures/Contour1_Surface_1.bmp", ::tex::gamma_default),
emissive_color: color( 1.0000000f, 1.0000000f, 1.0000000f),
emissive_intensity: 0,
enable_emission: false,
opacity_constant: 1,
opacity_texture: texture_2d(),
enable_opacity_texture: false,
reflection_roughness_constant : 0.3,
reflectionroughness_texture : texture_2d(),
reflection_roughness_texture_influence : 0.f,
metallic_constant : 0,
metallic_texture : texture_2d(),
metallic_texture_influence : 0.f,
albedo_add: 0.f,
albedo_brightness: 1.f,
ao_texture : texture_2d(),
ao_to_diffuse : 0.f,
specular_level : 0.5f,
normalmap_texture : texture_2d(),
bump_factor : 1.f,
project_uvw : false,
world_or_object : false,
uv_space_index : 0,
texture_translate : float2(0.f),
texture_rotate : 0.f,
texture_scale : float2(1.f)
);
|
omniverse-code/kit/exts/omni.kit.tool.collect/data/test_stages/OM_55150/1/Materials/vMaterials_2/Concrete/Concrete_Precast.mdl | /*****************************************************************************
* Copyright 2022 NVIDIA Corporation. All rights reserved.
******************************************************************************
MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
THE MDL MATERIALS.
*/
mdl 1.4;
import ::state::*;
import ::base::*;
import ::tex::*;
import ::anno::*;
import ::nvidia::core_definitions::*;
const string COPYRIGHT =
" Copyright 2022 NVIDIA Corporation. All rights reserved.\n"
" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
export material Concrete_Precast(
color concrete_color = color ( 0.57f, 0.57f, 0.57f )
[[
::anno::display_name("Concrete Color"),
::anno::description ( "Choose the color of the Concrete."),
::anno::in_group("Appearance")
]],
float grunge_amount = 0.20f
[[
::anno::display_name("Grunge Amount"),
::anno::description("higher values results in more noise difference in the color of the concrete."),
::anno::hard_range(0.0,1.0),
::anno::in_group("Appearance")
]],
float reflection_roughness = 0.5f
[[
::anno::display_name("Reflection Roughness"),
::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
::anno::hard_range(0.0,1.0),
::anno::in_group("Appearance")
]],
uniform float bump_strength = .5f
[[
::anno::display_name("Bump Strength"),
::anno::description("Specifies the strength of the bump."),
::anno::in_group("Appearance")
]],
uniform float2 texture_translate = float2 ( 0.f)
[[
::anno::display_name("Translate"),
::anno::description("Controls the position of the texture."),
::anno::in_group("Transform")
]],
uniform float texture_rotate = 0.f
[[
::anno::display_name("Rotate"),
::anno::description("Rotate angle of the texture in degrees."),
::anno::in_group("Transform")
]],
uniform float2 texture_scale = float2 ( 1.f , 1.f)
[[
::anno::display_name("Scale"),
::anno::description("Larger numbers increase the texture size."),
::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)),
::anno::in_group("Transform")
]],
uniform float ior = 1.5f
[[
::anno::display_name("IOR"),
::anno::description("Index of refraction."),
::anno::soft_range(1.0,4.0),
::anno::in_group("Advanced")
]],
uniform int uv_space_index = 0
[[
::anno::display_name("UV Space Index"),
::anno::description("UV space index."),
::anno::hard_range(0,3),
::anno::in_group("Advanced")
]])
[[
::anno::display_name("Concrete Precast - White"),
::anno::description("A material for (pre)cast concrete formwork panels that have holes as part of the manufacturing process"),
::anno::author("NVIDIA vMaterials"),
::anno::copyright_notice(COPYRIGHT),
::anno::thumbnail("./.thumbs/Concrete_Precast.concrete_precast_gray.png"),
::anno::key_words(string[]("floor", "cast", "concrete", "precast", "construction", "cement", "white", "unfinished", "rough"))
]]=
::nvidia::core_definitions::flex_material_v2(
base_color: ::nvidia::core_definitions::blend_colors(
color_1: ::nvidia::core_definitions::blend_colors(
color_1: concrete_color,
color_2: ::nvidia::core_definitions::file_texture(
texture: texture_2d ( "./textures/precastconcrete_diff.png" , ::tex::gamma_srgb) ,
mono_source: ::base::mono_average,
brightness: 1.f,
contrast: 1.f,
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
texture_space: uv_space_index,
invert: false).tint,
mode: ::base::color_layer_overlay,
weight: 1.0f ).tint,
color_2: ::nvidia::core_definitions::file_texture(
texture: texture_2d ( "./textures/precastconcrete_grunge_mask.png" , ::tex::gamma_srgb) ,
mono_source: ::base::mono_average,
brightness: 1.f,
contrast: 1.f,
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
texture_space: uv_space_index,
invert: false).tint,
mode: ::base::color_layer_multiply,
weight: grunge_amount ).tint,
diffuse_roughness: 0.f,
is_metal: false,
reflectivity: 1.0f,
reflection_roughness: ::nvidia::core_definitions::blend_colors(
color_1: ::nvidia::core_definitions::file_texture(
texture: texture_2d ( "./textures/precastconcrete_rough.png" , ::tex::gamma_srgb) ,
mono_source: ::base::mono_average,
brightness: 1.f,
contrast: 1.f,
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
texture_space: uv_space_index,
invert: false).tint,
color_2: color ( reflection_roughness ),
mode: ::base::color_layer_overlay,
weight: 1.0f ).mono,
anisotropy: 0.f,
anisotropy_rotation: 0.f,
transparency: 0.f,
transmission_color: color ( 1.f , 1.f , 1.f),
volume_color: color ( 1.f , 1.f , 1.f),
transmission_roughness: 0.f,
base_thickness: 0.1f,
ior: ior,
thin_walled: false,
normal: ::nvidia::core_definitions::normalmap_texture(
texture: texture_2d ( "./textures/precastconcrete_norm.jpg" , ::tex::gamma_linear),
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
factor: bump_strength * 0.20f,
texture_space: uv_space_index));
export material concrete_precast_light_gray(
color concrete_color = color ( 0.68f , 0.68f , 0.68f )
[[
::anno::display_name("Concrete Color"),
::anno::description ( "Choose the color of the Concrete."),
::anno::in_group("Appearance")
]],
float grunge_amount = 0.40f
[[
::anno::display_name("Grunge Amount"),
::anno::description("higher values results in more noise difference in the color of the concrete."),
::anno::hard_range(0.0,1.0),
::anno::in_group("Appearance")
]],
float reflection_roughness = 0.15f
[[
::anno::display_name("Reflection Roughness"),
::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
::anno::hard_range(0.0,1.0),
::anno::in_group("Appearance")
]],
uniform float bump_strength = 1.f
[[
::anno::display_name("Bump Strength"),
::anno::description("Specifies the strength of the bump."),
::anno::in_group("Appearance")
]],
uniform float2 texture_translate = float2 ( 0.f)
[[
::anno::display_name("Translate"),
::anno::description("Controls the position of the texture."),
::anno::in_group("Transform")
]],
uniform float texture_rotate = 0.f
[[
::anno::display_name("Rotate"),
::anno::description("Rotate angle of the texture in degrees."),
::anno::in_group("Transform")
]],
uniform float2 texture_scale = float2 ( 1.f , 1.f)
[[
::anno::display_name("Scale"),
::anno::description("Larger numbers increase the texture size."),
::anno::in_group("Transform")
]],
uniform float ior = 1.5f
[[
::anno::display_name("IOR"),
::anno::description("Index of refraction."),
::anno::soft_range(1.0,4.0),
::anno::in_group("Advanced")
]],
uniform int uv_space_index = 0
[[
::anno::display_name("UV Space Index"),
::anno::description("UV space index."),
::anno::hard_range(0,3),
::anno::in_group("Advanced")
]])
[[
::anno::display_name("Concrete Precast - Light Gray"),
::anno::description("A material for (pre)cast concrete formwork panels that have holes as part of the manufacturing process"),
::anno::author("NVIDIA vMaterials"),
::anno::copyright_notice(COPYRIGHT),
::anno::thumbnail("./.thumbs/Concrete_Precast.concrete_precast_light_gray.png"),
::anno::key_words(string[]("floor", "cast", "concrete", "precast", "construction", "cement", "gray", "light gray", "light", "unfinished", "rough"))
]]=
::nvidia::core_definitions::flex_material_v2(
base_color: ::nvidia::core_definitions::blend_colors(
color_1: ::nvidia::core_definitions::blend_colors(
color_1: concrete_color,
color_2: ::nvidia::core_definitions::file_texture(
texture: texture_2d ( "./textures/precastconcrete_diff.png" , ::tex::gamma_srgb) ,
mono_source: ::base::mono_average,
brightness: 1.f,
contrast: 1.f,
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
texture_space: uv_space_index,
invert: false).tint,
mode: ::base::color_layer_overlay,
weight: 1.0f ).tint,
color_2: ::nvidia::core_definitions::file_texture(
texture: texture_2d ( "./textures/precastconcrete_grunge_mask.png" , ::tex::gamma_srgb) ,
mono_source: ::base::mono_average,
brightness: 1.f,
contrast: 1.f,
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
texture_space: uv_space_index,
invert: false).tint,
mode: ::base::color_layer_multiply,
weight: grunge_amount ).tint,
diffuse_roughness: 0.f,
is_metal: false,
reflectivity: 1.0f,
reflection_roughness: ::nvidia::core_definitions::blend_colors(
color_1: ::nvidia::core_definitions::file_texture(
texture: texture_2d ( "./textures/precastconcrete_rough.png" , ::tex::gamma_srgb) ,
mono_source: ::base::mono_average,
brightness: 1.f,
contrast: 1.f,
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
texture_space: uv_space_index,
invert: false).tint,
color_2: color (reflection_roughness),
mode: ::base::color_layer_overlay,
weight: 1.0f ).mono,
anisotropy: 0.f,
anisotropy_rotation: 0.f,
transparency: 0.f,
transmission_color: color ( 1.f , 1.f , 1.f),
volume_color: color ( 1.f , 1.f , 1.f),
transmission_roughness: 0.f,
base_thickness: 0.1f,
ior: ior,
thin_walled: false,
normal: ::nvidia::core_definitions::normalmap_texture(
texture: texture_2d ( "./textures/precastconcrete_norm.jpg" , ::tex::gamma_linear),
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
factor: bump_strength * 0.20f,
texture_space: uv_space_index));
export material concrete_precast_ivory(
color concrete_color = color ( 0.883f , 0.851f , 0.797f )
[[
::anno::display_name("Concrete Color"),
::anno::description ( "Choose the color of the Concrete."),
::anno::in_group("Appearance")
]],
float grunge_amount = 0.30f
[[
::anno::display_name("Grunge Amount"),
::anno::description("higher values results in more noise difference in the color of the concrete."),
::anno::hard_range(0.0,1.0),
::anno::in_group("Appearance")
]],
float reflection_roughness = 0.15f
[[
::anno::display_name("Reflection Roughness"),
::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
::anno::hard_range(0.0,1.0),
::anno::in_group("Appearance")
]],
uniform float bump_strength = 1.f
[[
::anno::display_name("Bump Strength"),
::anno::description("Specifies the strength of the bump."),
::anno::in_group("Appearance")
]],
uniform float2 texture_translate = float2 ( 0.f)
[[
::anno::display_name("Translate"),
::anno::description("Controls the position of the texture."),
::anno::in_group("Transform")
]],
uniform float texture_rotate = 0.f
[[
::anno::display_name("Rotate"),
::anno::description("Rotate angle of the texture in degrees."),
::anno::in_group("Transform")
]],
uniform float2 texture_scale = float2 ( 1.f , 1.f)
[[
::anno::display_name("Scale"),
::anno::description("Larger numbers increase the texture size."),
::anno::in_group("Transform")
]],
uniform float ior = 1.5f
[[
::anno::display_name("IOR"),
::anno::description("Index of refraction."),
::anno::soft_range(1.0,4.0),
::anno::in_group("Advanced")
]],
uniform int uv_space_index = 0
[[
::anno::display_name("UV Space Index"),
::anno::description("UV space index."),
::anno::hard_range(0,3),
::anno::in_group("Advanced")
]])
[[
::anno::display_name("Concrete Precast - Ivory"),
::anno::description("A material for (pre)cast concrete formwork panels that have holes as part of the manufacturing process"),
::anno::author("NVIDIA vMaterials"),
::anno::copyright_notice(COPYRIGHT),
::anno::thumbnail("./.thumbs/Concrete_Precast.concrete_precast_ivory.png"),
::anno::key_words(string[]("floor", "cast", "concrete", "precast", "construction", "cement", "white", "ivory", "unfinished", "rough"))
]]=
::nvidia::core_definitions::flex_material_v2(
base_color: ::nvidia::core_definitions::blend_colors(
color_1: ::nvidia::core_definitions::blend_colors(
color_1: concrete_color,
color_2: ::nvidia::core_definitions::file_texture(
texture: texture_2d ( "./textures/precastconcrete_diff.png" , ::tex::gamma_srgb) ,
mono_source: ::base::mono_average,
brightness: 1.f,
contrast: 1.f,
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
texture_space: uv_space_index,
invert: false).tint,
mode: ::base::color_layer_overlay,
weight: 1.0f ).tint,
color_2: ::nvidia::core_definitions::file_texture(
texture: texture_2d ( "./textures/precastconcrete_grunge_mask.png" , ::tex::gamma_srgb) ,
mono_source: ::base::mono_average,
brightness: 1.f,
contrast: 1.f,
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
texture_space: uv_space_index,
invert: false).tint,
mode: ::base::color_layer_multiply,
weight: grunge_amount ).tint,
diffuse_roughness: 0.f,
is_metal: false,
reflectivity: 1.0f,
reflection_roughness: ::nvidia::core_definitions::blend_colors(
color_1: ::nvidia::core_definitions::file_texture(
texture: texture_2d ( "./textures/precastconcrete_rough.png" , ::tex::gamma_srgb) ,
mono_source: ::base::mono_average,
brightness: 1.f,
contrast: 1.f,
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
texture_space: uv_space_index,
invert: false).tint,
color_2: color (reflection_roughness),
mode: ::base::color_layer_overlay,
weight: 1.0f ).mono,
anisotropy: 0.f,
anisotropy_rotation: 0.f,
transparency: 0.f,
transmission_color: color ( 1.f , 1.f , 1.f),
volume_color: color ( 1.f , 1.f , 1.f),
transmission_roughness: 0.f,
base_thickness: 0.1f,
ior: ior,
thin_walled: false,
normal: ::nvidia::core_definitions::normalmap_texture(
texture: texture_2d ( "./textures/precastconcrete_norm.jpg" , ::tex::gamma_linear),
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
factor: bump_strength * 0.20f,
texture_space: uv_space_index));
export material concrete_precast_light_warm_gray(
color concrete_color = color (0.932f , 0.859f , 0.797f )
[[
::anno::display_name("Concrete Color"),
::anno::description ( "Choose the color of the Concrete."),
::anno::in_group("Appearance")
]],
float grunge_amount = 0.55f
[[
::anno::display_name("Grunge Amount"),
::anno::description("higher values results in more noise difference in the color of the concrete."),
::anno::hard_range(0.0,1.0),
::anno::in_group("Appearance")
]],
float reflection_roughness = 0.15f
[[
::anno::display_name("Reflection Roughness"),
::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
::anno::hard_range(0.0,1.0),
::anno::in_group("Appearance")
]],
uniform float bump_strength = 1.f
[[
::anno::display_name("Bump Strength"),
::anno::description("Specifies the strength of the bump."),
::anno::in_group("Appearance")
]],
uniform float2 texture_translate = float2 ( 0.f)
[[
::anno::display_name("Translate"),
::anno::description("Controls the position of the texture."),
::anno::in_group("Transform")
]],
uniform float texture_rotate = 0.f
[[
::anno::display_name("Rotate"),
::anno::description("Rotate angle of the texture in degrees."),
::anno::in_group("Transform")
]],
uniform float2 texture_scale = float2 ( 1.f , 1.f)
[[
::anno::display_name("Scale"),
::anno::description("Larger numbers increase the texture size."),
::anno::in_group("Transform")
]],
uniform float ior = 1.5f
[[
::anno::display_name("IOR"),
::anno::description("Index of refraction."),
::anno::soft_range(1.0,4.0),
::anno::in_group("Advanced")
]],
uniform int uv_space_index = 0
[[
::anno::display_name("UV Space Index"),
::anno::description("UV space index."),
::anno::hard_range(0,3),
::anno::in_group("Advanced")
]])
[[
::anno::display_name("Concrete Precast - Light Warm Gray"),
::anno::description("A material for (pre)cast concrete formwork panels that have holes as part of the manufacturing process"),
::anno::author("NVIDIA vMaterials"),
::anno::copyright_notice(COPYRIGHT),
::anno::thumbnail("./.thumbs/Concrete_Precast.concrete_precast_light_warm_gray.png"),
::anno::key_words(string[]("floor", "cast", "concrete", "precast", "construction", "cement", "warm", "gray", "light gray", "unfinished", "rough"))
]]=
::nvidia::core_definitions::flex_material_v2(
base_color: ::nvidia::core_definitions::blend_colors(
color_1: ::nvidia::core_definitions::blend_colors(
color_1: concrete_color,
color_2: ::nvidia::core_definitions::file_texture(
texture: texture_2d ( "./textures/precastconcrete_diff.png" , ::tex::gamma_srgb) ,
mono_source: ::base::mono_average,
brightness: 1.f,
contrast: 1.f,
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
texture_space: uv_space_index,
invert: false).tint,
mode: ::base::color_layer_overlay,
weight: 1.0f ).tint,
color_2: ::nvidia::core_definitions::file_texture(
texture: texture_2d ( "./textures/precastconcrete_grunge_mask.png" , ::tex::gamma_srgb) ,
mono_source: ::base::mono_average,
brightness: 1.f,
contrast: 1.f,
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
texture_space: uv_space_index,
invert: false).tint,
mode: ::base::color_layer_multiply,
weight: grunge_amount ).tint,
diffuse_roughness: 0.f,
is_metal: false,
reflectivity: 1.0f,
reflection_roughness: ::nvidia::core_definitions::blend_colors(
color_1: ::nvidia::core_definitions::file_texture(
texture: texture_2d ( "./textures/precastconcrete_rough.png" , ::tex::gamma_srgb) ,
mono_source: ::base::mono_average,
brightness: 1.f,
contrast: 1.f,
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
texture_space: uv_space_index,
invert: false).tint,
color_2: color (reflection_roughness),
mode: ::base::color_layer_overlay,
weight: 1.0f ).mono,
anisotropy: 0.f,
anisotropy_rotation: 0.f,
transparency: 0.f,
transmission_color: color ( 1.f , 1.f , 1.f),
volume_color: color ( 1.f , 1.f , 1.f),
transmission_roughness: 0.f,
base_thickness: 0.1f,
ior: ior,
thin_walled: false,
normal: ::nvidia::core_definitions::normalmap_texture(
texture: texture_2d ( "./textures/precastconcrete_norm.jpg" , ::tex::gamma_linear),
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
factor: bump_strength * 0.20f,
texture_space: uv_space_index));
export material concrete_precast_warm_gray(
color concrete_color = color (0.932f , 0.859f , 0.797f )
[[
::anno::display_name("Concrete Color"),
::anno::description ( "Choose the color of the Concrete."),
::anno::in_group("Appearance")
]],
float grunge_amount = 0.55f
[[
::anno::display_name("Grunge Amount"),
::anno::description("higher values results in more noise difference in the color of the concrete."),
::anno::hard_range(0.0,1.0),
::anno::in_group("Appearance")
]],
float reflection_roughness = 0.15f
[[
::anno::display_name("Reflection Roughness"),
::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
::anno::hard_range(0.0,1.0),
::anno::in_group("Appearance")
]],
uniform float bump_strength = 1.f
[[
::anno::display_name("Bump Strength"),
::anno::description("Specifies the strength of the bump."),
::anno::in_group("Appearance")
]],
uniform float2 texture_translate = float2 ( 0.f)
[[
::anno::display_name("Translate"),
::anno::description("Controls the position of the texture."),
::anno::in_group("Transform")
]],
uniform float texture_rotate = 0.f
[[
::anno::display_name("Rotate"),
::anno::description("Rotate angle of the texture in degrees."),
::anno::in_group("Transform")
]],
uniform float2 texture_scale = float2 ( 1.f , 1.f)
[[
::anno::display_name("Scale"),
::anno::description("Larger numbers increase the texture size."),
::anno::in_group("Transform")
]],
uniform float ior = 1.5f
[[
::anno::display_name("IOR"),
::anno::description("Index of refraction."),
::anno::soft_range(1.0,4.0),
::anno::in_group("Advanced")
]],
uniform int uv_space_index = 0
[[
::anno::display_name("UV Space Index"),
::anno::description("UV space index."),
::anno::hard_range(0,3),
::anno::in_group("Advanced")
]])
[[
::anno::display_name("Concrete Precast - Warm Gray"),
::anno::description("A material for (pre)cast concrete formwork panels that have holes as part of the manufacturing process"),
::anno::author("NVIDIA vMaterials"),
::anno::copyright_notice(COPYRIGHT),
::anno::thumbnail("./.thumbs/Concrete_Precast.concrete_precast_warm_gray.png"),
::anno::key_words(string[]("floor", "cast", "concrete", "precast", "construction", "cement", "warm", "gray", "unfinished", "rough"))
]]=
::nvidia::core_definitions::flex_material_v2(
base_color: ::nvidia::core_definitions::blend_colors(
color_1: ::nvidia::core_definitions::blend_colors(
color_1: concrete_color,
color_2: ::nvidia::core_definitions::file_texture(
texture: texture_2d ( "./textures/precastconcrete_diff.png" , ::tex::gamma_srgb) ,
mono_source: ::base::mono_average,
brightness: 1.f,
contrast: 1.f,
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
texture_space: uv_space_index,
invert: false).tint,
mode: ::base::color_layer_overlay,
weight: 1.0f ).tint,
color_2: ::nvidia::core_definitions::file_texture(
texture: texture_2d ( "./textures/precastconcrete_grunge_mask.png" , ::tex::gamma_srgb) ,
mono_source: ::base::mono_average,
brightness: 1.f,
contrast: 1.f,
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
texture_space: uv_space_index,
invert: false).tint,
mode: ::base::color_layer_multiply,
weight: grunge_amount ).tint,
diffuse_roughness: 0.f,
is_metal: false,
reflectivity: 1.0f,
reflection_roughness: ::nvidia::core_definitions::blend_colors(
color_1: ::nvidia::core_definitions::file_texture(
texture: texture_2d ( "./textures/precastconcrete_rough.png" , ::tex::gamma_srgb) ,
mono_source: ::base::mono_average,
brightness: 1.f,
contrast: 1.f,
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
texture_space: uv_space_index,
invert: false).tint,
color_2: color (reflection_roughness),
mode: ::base::color_layer_overlay,
weight: 1.0f ).mono,
anisotropy: 0.f,
anisotropy_rotation: 0.f,
transparency: 0.f,
transmission_color: color ( 1.f , 1.f , 1.f),
volume_color: color ( 1.f , 1.f , 1.f),
transmission_roughness: 0.f,
base_thickness: 0.1f,
ior: ior,
thin_walled: false,
normal: ::nvidia::core_definitions::normalmap_texture(
texture: texture_2d ( "./textures/precastconcrete_norm.jpg" , ::tex::gamma_linear),
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
factor: bump_strength * 0.20f,
texture_space: uv_space_index));
export material concrete_precast_dark_gray(
color concrete_color = color ( 0.53f , 0.505f , 0.494f )
[[
::anno::display_name("Concrete Color"),
::anno::description ( "Choose the color of the Concrete."),
::anno::in_group("Appearance")
]],
float grunge_amount = 0.5f
[[
::anno::display_name("Grunge Amount"),
::anno::description("higher values results in more noise difference in the color of the concrete."),
::anno::hard_range(0.0,1.0),
::anno::in_group("Appearance")
]],
float reflection_roughness = 0.15f
[[
::anno::display_name("Reflection Roughness"),
::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
::anno::hard_range(0.0,1.0),
::anno::in_group("Appearance")
]],
uniform float bump_strength = 1.f
[[
::anno::display_name("Bump Strength"),
::anno::description("Specifies the strength of the bump."),
::anno::in_group("Appearance")
]],
uniform float2 texture_translate = float2 ( 0.f)
[[
::anno::display_name("Translate"),
::anno::description("Controls the position of the texture."),
::anno::in_group("Transform")
]],
uniform float texture_rotate = 0.f
[[
::anno::display_name("Rotate"),
::anno::description("Rotate angle of the texture in degrees."),
::anno::in_group("Transform")
]],
uniform float2 texture_scale = float2 ( 1.f , 1.f)
[[
::anno::display_name("Scale"),
::anno::description("Larger numbers increase the texture size."),
::anno::in_group("Transform")
]],
uniform float ior = 1.5f
[[
::anno::display_name("IOR"),
::anno::description("Index of refraction."),
::anno::soft_range(1.0,4.0),
::anno::in_group("Advanced")
]],
uniform int uv_space_index = 0
[[
::anno::display_name("UV Space Index"),
::anno::description("UV space index."),
::anno::hard_range(0,3),
::anno::in_group("Advanced")
]])
[[
::anno::display_name("Concrete Precast - Dark Gray"),
::anno::description("A material for (pre)cast concrete formwork panels that have holes as part of the manufacturing process"),
::anno::author("NVIDIA vMaterials"),
::anno::copyright_notice(COPYRIGHT),
::anno::thumbnail("./.thumbs/Concrete_Precast.concrete_precast_dark_gray.png"),
::anno::key_words(string[]("floor", "cast", "concrete", "precast", "construction", "cement", "dark", "gray", "dark gray", "unfinished", "rough"))
]]=
::nvidia::core_definitions::flex_material_v2(
base_color: ::nvidia::core_definitions::blend_colors(
color_1: ::nvidia::core_definitions::blend_colors(
color_1: concrete_color,
color_2: ::nvidia::core_definitions::file_texture(
texture: texture_2d ( "./textures/precastconcrete_diff.png" , ::tex::gamma_srgb) ,
mono_source: ::base::mono_average,
brightness: 1.f,
contrast: 1.f,
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
texture_space: uv_space_index,
invert: false).tint,
mode: ::base::color_layer_overlay,
weight: 1.0f ).tint,
color_2: ::nvidia::core_definitions::file_texture(
texture: texture_2d ( "./textures/precastconcrete_grunge_mask.png" , ::tex::gamma_srgb) ,
mono_source: ::base::mono_average,
brightness: 1.f,
contrast: 1.f,
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
texture_space: uv_space_index,
invert: false).tint,
mode: ::base::color_layer_multiply,
weight: grunge_amount ).tint,
diffuse_roughness: 0.f,
is_metal: false,
reflectivity: 1.0f,
reflection_roughness: ::nvidia::core_definitions::blend_colors(
color_1: ::nvidia::core_definitions::file_texture(
texture: texture_2d ( "./textures/precastconcrete_rough.png" , ::tex::gamma_srgb) ,
mono_source: ::base::mono_average,
brightness: 1.f,
contrast: 1.f,
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
texture_space: uv_space_index,
invert: false).tint,
color_2: color (reflection_roughness),
mode: ::base::color_layer_overlay,
weight: 1.0f ).mono,
anisotropy: 0.f,
anisotropy_rotation: 0.f,
transparency: 0.f,
transmission_color: color ( 1.f , 1.f , 1.f),
volume_color: color ( 1.f , 1.f , 1.f),
transmission_roughness: 0.f,
base_thickness: 0.1f,
ior: ior,
thin_walled: false,
normal: ::nvidia::core_definitions::normalmap_texture(
texture: texture_2d ( "./textures/precastconcrete_norm.jpg" , ::tex::gamma_linear),
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
factor: bump_strength * 0.20f,
texture_space: uv_space_index));
export material concrete_precast_dark_charcoal(
color concrete_color = color ( 0.28f , 0.259f , 0.239f )
[[
::anno::display_name("Concrete Color"),
::anno::description ( "Choose the color of the Concrete."),
::anno::in_group("Appearance")
]],
float grunge_amount = 0.5f
[[
::anno::display_name("Grunge Amount"),
::anno::description("higher values results in more noise difference in the color of the concrete."),
::anno::hard_range(0.0,1.0),
::anno::in_group("Appearance")
]],
float reflection_roughness = 0.15f
[[
::anno::display_name("Reflection Roughness"),
::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
::anno::hard_range(0.0,1.0),
::anno::in_group("Appearance")
]],
uniform float bump_strength = 1.f
[[
::anno::display_name("Bump Strength"),
::anno::description("Specifies the strength of the bump."),
::anno::in_group("Appearance")
]],
uniform float2 texture_translate = float2 ( 0.f)
[[
::anno::display_name("Translate"),
::anno::description("Controls the position of the texture."),
::anno::in_group("Transform")
]],
uniform float texture_rotate = 0.f
[[
::anno::display_name("Rotate"),
::anno::description("Rotate angle of the texture in degrees."),
::anno::in_group("Transform")
]],
uniform float2 texture_scale = float2 ( 1.f , 1.f)
[[
::anno::display_name("Scale"),
::anno::description("Larger numbers increase the texture size."),
::anno::in_group("Transform")
]],
uniform float ior = 1.5f
[[
::anno::display_name("IOR"),
::anno::description("Index of refraction."),
::anno::soft_range(1.0,4.0),
::anno::in_group("Advanced")
]],
uniform int uv_space_index = 0
[[
::anno::display_name("UV Space Index"),
::anno::description("UV space index."),
::anno::hard_range(0,3),
::anno::in_group("Advanced")
]])
[[
::anno::display_name("Concrete Precast - Charcoal"),
::anno::description("A material for (pre)cast concrete formwork panels that have holes as part of the manufacturing process"),
::anno::author("NVIDIA vMaterials"),
::anno::copyright_notice(COPYRIGHT),
::anno::thumbnail("./.thumbs/Concrete_Precast.concrete_precast_dark_charcoal.png"),
::anno::key_words(string[]("floor", "cast", "concrete", "precast", "construction", "cement", "dark", "charcoal", "gray", "unfinished", "rough"))
]]=
::nvidia::core_definitions::flex_material_v2(
base_color: ::nvidia::core_definitions::blend_colors(
color_1: ::nvidia::core_definitions::blend_colors(
color_1: concrete_color,
color_2: ::nvidia::core_definitions::file_texture(
texture: texture_2d ( "./textures/precastconcrete_diff.png" , ::tex::gamma_srgb) ,
mono_source: ::base::mono_average,
brightness: 1.f,
contrast: 1.f,
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
texture_space: uv_space_index,
invert: false).tint,
mode: ::base::color_layer_overlay,
weight: 1.0f ).tint,
color_2: ::nvidia::core_definitions::file_texture(
texture: texture_2d ( "./textures/precastconcrete_grunge_mask.png" , ::tex::gamma_srgb) ,
mono_source: ::base::mono_average,
brightness: 1.f,
contrast: 1.f,
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
texture_space: uv_space_index,
invert: false).tint,
mode: ::base::color_layer_multiply,
weight: grunge_amount ).tint,
diffuse_roughness: 0.f,
is_metal: false,
reflectivity: 1.0f,
reflection_roughness: ::nvidia::core_definitions::blend_colors(
color_1: ::nvidia::core_definitions::file_texture(
texture: texture_2d ( "./textures/precastconcrete_rough.png" , ::tex::gamma_srgb) ,
mono_source: ::base::mono_average,
brightness: 1.f,
contrast: 1.f,
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
texture_space: uv_space_index,
invert: false).tint,
color_2: color (reflection_roughness),
mode: ::base::color_layer_overlay,
weight: 1.0f ).mono,
anisotropy: 0.f,
anisotropy_rotation: 0.f,
transparency: 0.f,
transmission_color: color ( 1.f , 1.f , 1.f),
volume_color: color ( 1.f , 1.f , 1.f),
transmission_roughness: 0.f,
base_thickness: 0.1f,
ior: ior,
thin_walled: false,
normal: ::nvidia::core_definitions::normalmap_texture(
texture: texture_2d ( "./textures/precastconcrete_norm.jpg" , ::tex::gamma_linear),
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
factor: bump_strength * 0.20f,
texture_space: uv_space_index));
export material concrete_precast_walnut(
color concrete_color = color ( 0.47f , 0.307f , 0.239f )
[[
::anno::display_name("Concrete Color"),
::anno::description ( "Choose the color of the Concrete."),
::anno::in_group("Appearance")
]],
float grunge_amount = 0.5f
[[
::anno::display_name("Grunge Amount"),
::anno::description("higher values results in more noise difference in the color of the concrete."),
::anno::hard_range(0.0,1.0),
::anno::in_group("Appearance")
]],
float reflection_roughness = 0.15f
[[
::anno::display_name("Reflection Roughness"),
::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
::anno::hard_range(0.0,1.0),
::anno::in_group("Appearance")
]],
uniform float bump_strength = 1.f
[[
::anno::display_name("Bump Strength"),
::anno::description("Specifies the strength of the bump."),
::anno::in_group("Appearance")
]],
uniform float2 texture_translate = float2 ( 0.f)
[[
::anno::display_name("Translate"),
::anno::description("Controls the position of the texture."),
::anno::in_group("Transform")
]],
uniform float texture_rotate = 0.f
[[
::anno::display_name("Rotate"),
::anno::description("Rotate angle of the texture in degrees."),
::anno::in_group("Transform")
]],
uniform float2 texture_scale = float2 ( 1.f , 1.f)
[[
::anno::display_name("Scale"),
::anno::description("Larger numbers increase the texture size."),
::anno::in_group("Transform")
]],
uniform float ior = 1.5f
[[
::anno::display_name("IOR"),
::anno::description("Index of refraction."),
::anno::soft_range(1.0,4.0),
::anno::in_group("Advanced")
]],
uniform int uv_space_index = 0
[[
::anno::display_name("UV Space Index"),
::anno::description("UV space index."),
::anno::hard_range(0,3),
::anno::in_group("Advanced")
]])
[[
::anno::display_name("Concrete Precast - Walnut"),
::anno::description("A material for (pre)cast concrete formwork panels that have holes as part of the manufacturing process"),
::anno::author("NVIDIA vMaterials"),
::anno::copyright_notice(COPYRIGHT),
::anno::thumbnail("./.thumbs/Concrete_Precast.concrete_precast_walnut.png"),
::anno::key_words(string[]("floor", "cast", "concrete", "precast", "construction", "cement", "warm", "walnut", "unfinished", "rough"))
]]=
::nvidia::core_definitions::flex_material_v2(
base_color: ::nvidia::core_definitions::blend_colors(
color_1: ::nvidia::core_definitions::blend_colors(
color_1: concrete_color,
color_2: ::nvidia::core_definitions::file_texture(
texture: texture_2d ( "./textures/precastconcrete_diff.png" , ::tex::gamma_srgb) ,
mono_source: ::base::mono_average,
brightness: 1.f,
contrast: 1.f,
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
texture_space: uv_space_index,
invert: false).tint,
mode: ::base::color_layer_overlay,
weight: 1.0f ).tint,
color_2: ::nvidia::core_definitions::file_texture(
texture: texture_2d ( "./textures/precastconcrete_grunge_mask.png" , ::tex::gamma_srgb) ,
mono_source: ::base::mono_average,
brightness: 1.f,
contrast: 1.f,
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
texture_space: uv_space_index,
invert: false).tint,
mode: ::base::color_layer_multiply,
weight: grunge_amount ).tint,
diffuse_roughness: 0.f,
is_metal: false,
reflectivity: 1.0f,
reflection_roughness: ::nvidia::core_definitions::blend_colors(
color_1: ::nvidia::core_definitions::file_texture(
texture: texture_2d ( "./textures/precastconcrete_rough.png" , ::tex::gamma_srgb) ,
mono_source: ::base::mono_average,
brightness: 1.f,
contrast: 1.f,
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
texture_space: uv_space_index,
invert: false).tint,
color_2: color (reflection_roughness),
mode: ::base::color_layer_overlay,
weight: 1.0f ).mono,
anisotropy: 0.f,
anisotropy_rotation: 0.f,
transparency: 0.f,
transmission_color: color ( 1.f , 1.f , 1.f),
volume_color: color ( 1.f , 1.f , 1.f),
transmission_roughness: 0.f,
base_thickness: 0.1f,
ior: ior,
thin_walled: false,
normal: ::nvidia::core_definitions::normalmap_texture(
texture: texture_2d ( "./textures/precastconcrete_norm.jpg" , ::tex::gamma_linear),
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
factor: bump_strength * 0.20f,
texture_space: uv_space_index));
export material concrete_precast_sienna(
color concrete_color = color ( 0.517f , 0.453f , 0.344f )
[[
::anno::display_name("Concrete Color"),
::anno::description ( "Choose the color of the Concrete."),
::anno::in_group("Appearance")
]],
float grunge_amount = 0.5f
[[
::anno::display_name("Grunge Amount"),
::anno::description("higher values results in more noise difference in the color of the concrete."),
::anno::hard_range(0.0,1.0),
::anno::in_group("Appearance")
]],
float reflection_roughness = 0.15f
[[
::anno::display_name("Reflection Roughness"),
::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."),
::anno::hard_range(0.0,1.0),
::anno::in_group("Appearance")
]],
uniform float bump_strength = 1.f
[[
::anno::display_name("Bump Strength"),
::anno::description("Specifies the strength of the bump."),
::anno::in_group("Appearance")
]],
uniform float2 texture_translate = float2 ( 0.f)
[[
::anno::display_name("Translate"),
::anno::description("Controls the position of the texture."),
::anno::in_group("Transform")
]],
uniform float texture_rotate = 0.f
[[
::anno::display_name("Rotate"),
::anno::description("Rotate angle of the texture in degrees."),
::anno::in_group("Transform")
]],
uniform float2 texture_scale = float2 ( 1.f , 1.f)
[[
::anno::display_name("Scale"),
::anno::description("Larger numbers increase the texture size."),
::anno::in_group("Transform")
]],
uniform float ior = 1.5f
[[
::anno::display_name("IOR"),
::anno::description("Index of refraction."),
::anno::soft_range(1.0,4.0),
::anno::in_group("Advanced")
]],
uniform int uv_space_index = 0
[[
::anno::display_name("UV Space Index"),
::anno::description("UV space index."),
::anno::hard_range(0,3),
::anno::in_group("Advanced")
]])
[[
::anno::display_name("Concrete Precast - Sienna"),
::anno::description("A material for (pre)cast concrete formwork panels that have holes as part of the manufacturing process"),
::anno::author("NVIDIA vMaterials"),
::anno::copyright_notice(COPYRIGHT),
::anno::thumbnail("./.thumbs/Concrete_Precast.concrete_precast_sienna.png"),
::anno::key_words(string[]("floor", "cast", "concrete", "precast", "construction", "cement", "sienna", "gray", "unfinished", "rough"))
]]=
::nvidia::core_definitions::flex_material_v2(
base_color: ::nvidia::core_definitions::blend_colors(
color_1: ::nvidia::core_definitions::blend_colors(
color_1: concrete_color,
color_2: ::nvidia::core_definitions::file_texture(
texture: texture_2d ( "./textures/precastconcrete_diff.png" , ::tex::gamma_srgb) ,
mono_source: ::base::mono_average,
brightness: 1.f,
contrast: 1.f,
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
texture_space: uv_space_index,
invert: false).tint,
mode: ::base::color_layer_overlay,
weight: 1.0f ).tint,
color_2: ::nvidia::core_definitions::file_texture(
texture: texture_2d ( "./textures/precastconcrete_grunge_mask.png" , ::tex::gamma_srgb) ,
mono_source: ::base::mono_average,
brightness: 1.f,
contrast: 1.f,
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
texture_space: uv_space_index,
invert: false).tint,
mode: ::base::color_layer_multiply,
weight: grunge_amount ).tint,
diffuse_roughness: 0.f,
is_metal: false,
reflectivity: 1.0f,
reflection_roughness: ::nvidia::core_definitions::blend_colors(
color_1: ::nvidia::core_definitions::file_texture(
texture: texture_2d ( "./textures/precastconcrete_rough.png" , ::tex::gamma_srgb) ,
mono_source: ::base::mono_average,
brightness: 1.f,
contrast: 1.f,
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
texture_space: uv_space_index,
invert: false).tint,
color_2: color (reflection_roughness),
mode: ::base::color_layer_overlay,
weight: 1.0f ).mono,
anisotropy: 0.f,
anisotropy_rotation: 0.f,
transparency: 0.f,
transmission_color: color ( 1.f , 1.f , 1.f),
volume_color: color ( 1.f , 1.f , 1.f),
transmission_roughness: 0.f,
base_thickness: 0.1f,
ior: ior,
thin_walled: false,
normal: ::nvidia::core_definitions::normalmap_texture(
texture: texture_2d ( "./textures/precastconcrete_norm.jpg" , ::tex::gamma_linear),
scaling: 0.5f/ texture_scale,
translation: texture_translate,
rotation: texture_rotate,
clip: false,
factor: bump_strength * 0.20f,
texture_space: uv_space_index)); |
omniverse-code/kit/exts/omni.kit.tool.collect/data/test_stages/OM_55150/1/Materials/Base/Metals/Aluminum_Anodized_Red.mdl | mdl 1.4;
using ::OmniPBR import OmniPBR;
import ::tex::gamma_mode;
import ::state::normal;
export material Aluminum_Anodized_Red(*)
= OmniPBR(
diffuse_color_constant: color(0.500000, 0.500000, 0.500000),
diffuse_texture: texture_2d("./Aluminum_Anodized/Aluminum_Anodized_BaseColor.png", ::tex::gamma_srgb),
albedo_desaturation: 0.f,
albedo_add: 0.f,
albedo_brightness: 1.f,
diffuse_tint: color(0.5f, 0.025f, 0.025f),
reflection_roughness_constant: 0.000000,
reflection_roughness_texture_influence: 1.f,
reflectionroughness_texture: texture_2d(),
metallic_constant: 0.000000,
metallic_texture_influence: 1.f,
metallic_texture: texture_2d(),
specular_level: 0.5f,
enable_ORM_texture: true,
ORM_texture: texture_2d("./Aluminum_Anodized/Aluminum_Anodized_ORM.png", ::tex::gamma_linear),
ao_to_diffuse: 0.f,
ao_texture: texture_2d(),
enable_emission: false,
emissive_color: color(1.000000, 1.000000, 1.000000),
emissive_mask_texture: texture_2d(),
emissive_intensity: 0.000000,
bump_factor: 1.f,
normalmap_texture: texture_2d("./Aluminum_Anodized/Aluminum_Anodized_Normal.png", ::tex::gamma_linear),
detail_bump_factor: 0.300000012f,
detail_normalmap_texture: texture_2d(),
project_uvw: false,
world_or_object: false,
uv_space_index: 0,
texture_translate: float2(0.f),
texture_rotate: 0.f,
texture_scale: float2(1.f),
detail_texture_translate: float2(0.f),
detail_texture_rotate: 0.f,
detail_texture_scale: float2(1.f));
|
omniverse-code/kit/exts/omni.graph.instancing/PACKAGE-LICENSES/omni.graph.instancing-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. |
omniverse-code/kit/exts/omni.graph.instancing/config/extension.toml | [package]
version = "1.3.0"
title = "OmniGraph Instancing"
authors = ["NVIDIA"]
repository = ""
readme = "docs/README.md"
changelog = "docs/CHANGELOG.md"
description = "OmniGraph instance graph processing per USD Prim"
category = "Graph"
preview_image = "data/preview.png"
icon = "data/icon.svg"
[dependencies]
"omni.graph.core" = {}
[[python.module]]
name = "omni.graph.instancing"
[[test]]
waiver = "Tests are in omni.graph.test"
# RTX regression OM-51983
timeout = 600
unreliable = true # OM-51982
args = [
"--/app/extensions/registryEnabled=1" # needs to be fixed and removed: OM-49579
]
|
omniverse-code/kit/exts/omni.graph.instancing/omni/graph/instancing/__init__.py | import carb
carb.log_warn("omni.graph.instancing has been deprecated. All functionality has been moved to omni.graph.core and omni.graph.ui.")
|
omniverse-code/kit/exts/omni.graph.instancing/docs/CHANGELOG.md | # Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [1.3.0] - 2022-08-04
### Changed
- Marked extension for deprecated
## [1.2.4] - 2022-06-17
### Removed
- Moved ApplyOmniGraph and RemoveOmniGraph api commands to omni.graph.core
- Moved ui elements to omni.graph.ui
## [1.2.3] - 2022-05-24
### Fixed
- Graph instances in references no longer require a stage reload to evaluate
## [1.2.2] - 2022-05-23
### Removed
- Explicit dependency on omni.kit.window.viewport
## [1.2.1] - 2022-04-27
### Fixed
- Fixed error thrown when extension is loaded.
### Changed
- Removed dependency on tools, nodes and ui OmniGraph extensions
## [1.2.0] - 2022-04-19
### Removed
- ReadGraphVariable, WriteGraphVariable, GraphTarget nodes.
- Instances are no longer run in this extension
- OmniGraph no longer modifies compute graph pipeline automatically
## [1.1.2] - 2022-04-13
### Changed
- Warning will appear when a graph with incompatible nodes is set as an instance
## [1.1.1] - 2022-04-12
### Fixed
- Fixed errors thrown when variables nodes are multi-selected
## [1.1.0] - 2022-03-30
### Changed
- WriteGraphVariable value output port
## [1.0.3] - 2022-03-23
### Fixed
- Variable types are now synchronized between graph and instance
- ReadGraphVariable and WriteGraphVariable listen for create and remove variable events
## [1.0.2] - 2022-02-14
### Fixed
- fixed unregistered notice handler causing crash
## [1.0.1] - 2022-02-14
### Fixed
- add additional extension enabled check for omni.graph.ui not enabled error
## [1.0.0] - 2022-01-17
### Modified
- Initial release.
|
omniverse-code/kit/exts/omni.graph.instancing/docs/README.md | # OmniGraph Instancing [omni.graph.instancing]
This extension is no longer required. Variable and Instancing OmniGraph functionality previously provided by this extension is available through the omni.graph.core and omni.graph.ui extensions.
|
omniverse-code/kit/exts/omni.graph.instancing/docs/index.rst | .. _ogn_omni_graph_instancing:
OmniGraph Instancing
####################
.. tabularcolumns:: |L|R|
.. csv-table::
:width: 100%
**Extension**: omni.graph.instancing,**Documentation Generated**: |today|
.. toctree::
:maxdepth: 1
CHANGELOG
What Is It?
===========
Instancing provides a mechanism to apply a single graph to multiple `UsdPrim` objects. Applying the
`OmniGraph` component onto a `UsdPrim` will cause the graph to execute with the variable values stored on the
`OmniGraph` component. Multiple Prims referencing the same graph will cause the graph to execute once for each Prim.
The `GraphTarget` node exposes the path of the `UsdPrim` instance to the graph, allowing each execution to uniquely
read or modify the primitive that initiated the execution.
For more comprehensive documentation explaining the use of OmniGraph features in detail see
:ref:`ogn_user_guide`
Limitations
===========
At present, each execution of the graph occurs sequentially and nodes in the graph share state across all instances.
Nodes that use event callbacks, or use internal state may not behave as anticipated when multiple instances exists.
For example, using the `OnKeyboardInput` action graph node will only trigger the event on the first instance executed.
Instead, it is recommended to use the ReadKeyboardInput node instead. Another example is the `Counter` node - it will
increment for each instance executed.
The following is a noncomprehensive list of nodes that may not be suitable for instanced graphs
* omni.graph.action.OgnCounter
* omni.graph.action.OgnDelay
* omni.graph.action.OgnForEach
* omni.graph.action.OgnFlipFlop
* omni.graph.action.OgnForEach
* omni.graph.action.OgnGate
* omni.graph.action.OgnMultiGate
* omni.graph.action.OgnOnCustomEvent
* omni.graph.action.OgnOnGamepadInput
* omni.graph.action.OgnOnImpulseEvent
* omni.graph.action.OgnOnKeyboardInput
* omni.graph.action.OgnOnMouseInput
* omni.graph.action.OgnOnObjectChange
* omni.graph.action.OgnOnStageEvent
* omni.graph.action.OgnSendCustomEvent
* omni.graph.action.OgnSequence
* omni.graph.action.OgnSyncGate
|
omniverse-code/kit/exts/omni.rtx.ovtextureconverter/PACKAGE-LICENSES/omni.rtx.ovtextureconverter-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. |
omniverse-code/kit/exts/omni.rtx.ovtextureconverter/config/extension.toml | [core]
[package]
title = "OV Texture converter"
category = "Internal"
version = "1.0.0"
[dependencies]
"carb.windowing.plugins" = {}
"omni.assets.plugins" = {}
"omni.client" = {} # needed for carb.datasource-omniclient.plugin
"omni.gpu_foundation" = {}
[[python.module]]
name = "omni.rtx.ovtextureconverter"
[[native.plugin]]
path = "bin/*.plugin"
[settings]
[[test]]
args = [
] |
omniverse-code/kit/exts/omni.rtx.ovtextureconverter/omni/rtx/ovtextureconverter/__init__.py | from ._ovtextureconverter import *
from .scripts import *
|
omniverse-code/kit/exts/omni.rtx.ovtextureconverter/omni/rtx/ovtextureconverter/_ovtextureconverter.pyi | from __future__ import annotations
import omni.rtx.ovtextureconverter._ovtextureconverter
import typing
__all__ = [
"IOVTextureConverter",
"ResultList",
"acquire_ovtextureconverter_interface"
]
class IOVTextureConverter():
def compressFile(self, arg0: str, arg1: str, arg2: str) -> list: ...
def compressFileOnly(self, arg0: str) -> bool: ...
def compressJob(self, arg0: str) -> list: ...
pass
class ResultList():
pass
def acquire_ovtextureconverter_interface(*args, **kwargs) -> typing.Any:
pass
|
omniverse-code/kit/exts/omni.rtx.ovtextureconverter/omni/rtx/ovtextureconverter/scripts/commands.py | ## Copyright (c) 2023, 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 carb
import omni.kit.commands
import omni.rtx.ovtextureconverter
class IssueTextureCompressionRequest(omni.kit.commands.Command):
def __init__(
self,
**kwargs,
):
# pull out the stage name to process from the entry
# check for a couple different forms
self._path = None
for key in ["path", "texture_path"]:
if key in kwargs:
self._path = kwargs[key]
break
# standardize the path separator character
self._path = self._path.replace("\\", "/") if self._path else None
self._convert_iface = omni.rtx.ovtextureconverter.acquire_ovtextureconverter_interface()
def do(self):
if not self._path:
carb.log_warn("'path' not valid")
return False
carb.log_info("Processing Texture: " + self._path)
# This inserts an async request, but we can't yet "await" it.
# TODO: May need to sleep after this?
return self._convert_iface.compressFileOnly(str(self._path))
omni.kit.commands.register_all_commands_in_module(__name__)
|
omniverse-code/kit/exts/omni.rtx.ovtextureconverter/omni/rtx/ovtextureconverter/scripts/__init__.py | from .commands import * |
omniverse-code/kit/exts/omni.rtx.ovtextureconverter/omni/rtx/ovtextureconverter/tests/test_ovtextureconverter.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.app
from omni.kit.test import AsyncTestCase
import omni.rtx.ovtextureconverter
class TestConverter(AsyncTestCase):
async def setUp(self):
self._convert_iface = omni.rtx.ovtextureconverter.acquire_ovtextureconverter_interface()
async def tearDown(self):
pass
async def test_001_compress(self):
print("Disabled because somehow on linux the gpufoundation shaders cannot be found 1/2.")
#results = self._convert_iface.compressFile("./resources/test/dot.png", "./resources/test", "BlaBlaBla")
#for x in results:
# print(x)
|
omniverse-code/kit/exts/omni.rtx.ovtextureconverter/omni/rtx/ovtextureconverter/tests/__init__.py | from .test_commands import *
|
omniverse-code/kit/exts/omni.rtx.ovtextureconverter/omni/rtx/ovtextureconverter/tests/test_commands.py | ## Copyright (c) 2023, 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 carb.settings
import omni.kit.app
from omni.kit.test import AsyncTestCase
import omni.rtx.ovtextureconverter.scripts.commands as commands
import asyncio
import os
import os.path
import pathlib
import shutil
TEST_DATA_DIR = str(pathlib.Path(__file__).parent.joinpath("data"))
TEST_OUTPUT_DIR = omni.kit.test.get_test_output_path()
class TestCommands(AsyncTestCase):
async def setUp(self):
pass
async def tearDown(self):
pass
async def test_IssueTextureCompressionRequest(self):
"""
Test Command to create texture caches with new UJITSO build system
"""
source_texture = pathlib.Path(TEST_DATA_DIR, "dot.png")
tex_cache_dir = pathlib.Path(TEST_OUTPUT_DIR, "ujitso_texcache")
settings = carb.settings.get_settings()
self.assertTrue(settings.get_as_bool("/rtx-transient/resourcemanager/UJITSO/enabled"))
# Set the destination for texture caching
settings.set_string("/rtx-transient/resourcemanager/remoteTextureCachePath", str(tex_cache_dir))
# Clear the local texture cache path to allow repeated tests, otherwise only works first time.
settings.set_string("/rtx-transient/resourcemanager/localTextureCachePath", "")
# Disable omnihub
settings.set_bool("/rtx-transient/resourcemanager/useOmniHubCache", False)
settings.set_bool("/rtx-transient/resourcemanager/useMDBCache", False)
# Remove results from any previous run
if os.path.exists(tex_cache_dir):
shutil.rmtree(tex_cache_dir)
cmd = commands.IssueTextureCompressionRequest(path=str(source_texture))
self.assertTrue(cmd.do())
# NOTE: the datastore that handles the upload currently has no way to wait for all uploads to complete.
print("Waiting for UJITSO texture uploads...")
await asyncio.sleep(5)
self.assertTrue(os.path.exists(tex_cache_dir))
files = os.listdir(tex_cache_dir)
self.assertTrue(len(files) > 0)
|
omniverse-code/kit/exts/omni.rtx.ovtextureconverter/docs/index.rst | omni.rtx.ovtextureconverter
###########################
.. toctree::
:maxdepth: 1
CHANGELOG
|
omniverse-code/kit/exts/omni.activity.profiler/omni/activity/profiler/__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.
##
# Necessary so we can link to the Python source instead of copying it.
__all__ = ['IActivityProfiler', 'acquire_activity_profiler', 'release_activity_profiler']
from .impl import *
|
omniverse-code/kit/exts/omni.activity.profiler/omni/activity/profiler/tests/test_activity_profiler.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.activity.profiler
import carb.profiler
class TestActivityProfiler(omni.kit.test.AsyncTestCase):
async def setUp(self):
self._activity_profiler = omni.activity.profiler.get_activity_profiler()
self._carb_profiler = carb.profiler.acquire_profiler_interface(plugin_name="omni.activity.profiler.plugin")
async def tearDown(self):
self._carb_profiler = None
self._activity_profiler = None
async def test_activity_profiler_masks(self):
# Verify the initial value of the activity profiler capture mask.
self.assertEqual(self._carb_profiler.get_capture_mask(), 0)
# Set the base activity profiler capture mask directly through the carb profiler API.
self._carb_profiler.set_capture_mask(omni.activity.profiler.CAPTURE_MASK_STARTUP)
self.assertEqual(self._carb_profiler.get_capture_mask(), omni.activity.profiler.CAPTURE_MASK_STARTUP)
# Enable an activity profiler capture mask through the activity profiler API.
uid1 = self._activity_profiler.enable_capture_mask(omni.activity.profiler.CAPTURE_MASK_LATENCY)
self.assertEqual(self._carb_profiler.get_capture_mask(), omni.activity.profiler.CAPTURE_MASK_STARTUP |
omni.activity.profiler.CAPTURE_MASK_LATENCY)
# Enable another activity profiler capture mask through the activity profiler API.
uid2 = self._activity_profiler.enable_capture_mask(omni.activity.profiler.CAPTURE_MASK_SCENE_LOADING)
self.assertEqual(self._carb_profiler.get_capture_mask(), omni.activity.profiler.CAPTURE_MASK_STARTUP |
omni.activity.profiler.CAPTURE_MASK_LATENCY |
omni.activity.profiler.CAPTURE_MASK_SCENE_LOADING)
# Enable an activity profiler capture mask for the second time through the activity profiler API.
uid3 = self._activity_profiler.enable_capture_mask(omni.activity.profiler.CAPTURE_MASK_LATENCY)
self.assertEqual(self._carb_profiler.get_capture_mask(), omni.activity.profiler.CAPTURE_MASK_STARTUP |
omni.activity.profiler.CAPTURE_MASK_LATENCY |
omni.activity.profiler.CAPTURE_MASK_SCENE_LOADING)
# Disable the activity profiler capture mask that was set a second time through the activity profiler API.
self._activity_profiler.disable_capture_mask(uid3)
self.assertEqual(self._carb_profiler.get_capture_mask(), omni.activity.profiler.CAPTURE_MASK_STARTUP |
omni.activity.profiler.CAPTURE_MASK_LATENCY |
omni.activity.profiler.CAPTURE_MASK_SCENE_LOADING)
# Disable the first activity profiler capture mask that was set through the activity profiler API.
self._activity_profiler.disable_capture_mask(uid1)
self.assertEqual(self._carb_profiler.get_capture_mask(), omni.activity.profiler.CAPTURE_MASK_STARTUP |
omni.activity.profiler.CAPTURE_MASK_SCENE_LOADING)
# Enable the same base activity profiler capture mask through the activity profiler API.
uid4 = self._activity_profiler.enable_capture_mask(omni.activity.profiler.CAPTURE_MASK_STARTUP)
self.assertEqual(self._carb_profiler.get_capture_mask(), omni.activity.profiler.CAPTURE_MASK_STARTUP |
omni.activity.profiler.CAPTURE_MASK_SCENE_LOADING)
# Disable the same base activity profiler capture mask that was set through the activity profiler API.
self._activity_profiler.disable_capture_mask(uid4)
self.assertEqual(self._carb_profiler.get_capture_mask(), omni.activity.profiler.CAPTURE_MASK_STARTUP |
omni.activity.profiler.CAPTURE_MASK_SCENE_LOADING)
# Set the base activity profiler capture mask directly through the carb profiler API.
self._carb_profiler.set_capture_mask(0)
self.assertEqual(self._carb_profiler.get_capture_mask(), omni.activity.profiler.CAPTURE_MASK_SCENE_LOADING)
# Disable the second activity profiler capture mask that was set through the activity profiler API.
self._activity_profiler.disable_capture_mask(uid2)
self.assertEqual(self._carb_profiler.get_capture_mask(), 0)
# Set the base activity profiler capture mask to something that is not an activity mask.
self._activity_profiler.disable_capture_mask(1)
self.assertEqual(self._carb_profiler.get_capture_mask(), 0)
# Enable an activity profiler capture mask that is not an activity mask.
uid5 = self._activity_profiler.enable_capture_mask(1)
self.assertEqual(self._carb_profiler.get_capture_mask(), 0)
# Disable the activity profiler capture mask that is not an activity mask.
self._activity_profiler.disable_capture_mask(uid5)
self.assertEqual(self._carb_profiler.get_capture_mask(), 0)
|
omniverse-code/kit/exts/omni.activity.profiler/omni/activity/profiler/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_activity_profiler import *
|
omniverse-code/kit/exts/omni.kit.widget.browser_bar/PACKAGE-LICENSES/omni.kit.widget.browser_bar-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. |
omniverse-code/kit/exts/omni.kit.widget.browser_bar/config/extension.toml | [package]
title = "Kit Browser Bar Widget"
version = "2.0.5"
category = "Internal"
description = "Treeview browser bar as embeddable widget"
authors = ["NVIDIA"]
slackids = ["UQY4RMR3N"]
repository = ""
keywords = ["kit", "ui"]
changelog = "docs/CHANGELOG.md"
preview_image = "data/preview.png"
[dependencies]
"omni.ui" = {}
"omni.kit.widget.path_field" = {}
[[python.module]]
name = "omni.kit.widget.browser_bar"
[[test]]
args = [
"--/app/window/dpiScaleOverride=1.0",
"--/app/window/scaleToMonitor=false",
"--no-window"
]
dependencies = [
"omni.kit.renderer.core"
] |
omniverse-code/kit/exts/omni.kit.widget.browser_bar/omni/kit/widget/browser_bar/style.py | # Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
import omni.ui as ui
from pathlib import Path
CURRENT_PATH = Path(__file__).parent
ICON_PATH = CURRENT_PATH.parent.parent.parent.parent.joinpath("icons")
UI_STYLES = {}
UI_STYLES["NvidiaLight"] = {
"Rectangle": {"background_color": 0xFF535354},
"Button": {"background_color": 0xFFE0E0E0, "margin": 4, "padding": 0, "border_width": 0},
"Button:hovered": {"background_color": 0xFFACACAF},
"Button:selected": {"background_color": 0xFFACACAF},
"Button:disabled": {"background_color": 0xFFE0E0E0},
"Button.Image": {"color": 0xFF6E6E6E},
"Button.Image:disabled": {"color": 0x0},
"ComboBox": {"background_color": 0xFF535354, "selected_color": 0xFFACACAF, "color": 0xFFD6D6D6},
"ComboBox:hovered": {"background_color": 0xFFACACAF},
"ComboBox:selected": {"background_color": 0xFFACACAF},
}
UI_STYLES["NvidiaDark"] = {
"Rectangle": {"background_color": 0xFF23211F},
"Button": {"background_color": 0x0, "margin": 4, "padding": 0},
"Button:disabled": {"background_color": 0x0},
"Button.Image": {"color": 0xFFFFFFFF},
"Button.Image:disabled": {"color": 0xFF888888},
"ComboBox": {
"background_color": 0xFF23211F,
"selected_color": 0x0,
"color": 0xFF4A4A4A,
"border_radius": 0,
"margin": 0,
"padding": 4,
"secondary_color": 0xFF23211F,
},
"ComboBox.Active": {
"background_color": 0xFF23211F,
"selected_color": 0xFF3A3A3A,
"color": 0xFF9E9E9E,
"border_radius": 0,
"margin": 0,
"padding": 4,
"secondary_selected_color": 0xFF9E9E9E,
"secondary_color": 0xFF23211F,
},
"ComboBox.Active:hovered": {"color": 0xFF4A4A4A, "secondary_color": 0x0,},
"ComboBox.Active:pressed": {"color": 0xFF4A4A4A, "secondary_color": 0x0,},
"ComboBox.Bg": {
"background_color": 0x0,
"margin": 0,
"padding": 2,
},
"ComboBox.Bg.Active": {
"background_color": 0x0,
"margin": 0,
"padding": 2,
},
"ComboBox.Bg.Active:hovered": {
"background_color": 0xFF6E6E6E,
},
"ComboBox.Bg.Active:pressed": {
"background_color": 0xFF6E6E6E,
},
}
|
omniverse-code/kit/exts/omni.kit.widget.browser_bar/omni/kit/widget/browser_bar/__init__.py | # Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
"""
The :obj:`PathField` widget supes up tree navigation via keyboard entry. This widget extends that
experience further by queuing up the user's navigation history. As in any modern day browser, the
user can then directly jump to any previously visited path.
Example:
.. code-block:: python
browser_bar = BrowserBar(
visited_history_size=20,
branching_options_provider=branching_options_provider,
apply_path_handler=apply_path_handler,
)
"""
from .widget import BrowserBar
|
omniverse-code/kit/exts/omni.kit.widget.browser_bar/omni/kit/widget/browser_bar/model.py | # Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
import sys, os
import omni.ui as ui
class StringQueueItem(ui.AbstractItem):
def __init__(self, value: str):
super().__init__()
self._model = ui.SimpleStringModel(value)
@property
def model(self):
return self._model
@property
def value(self):
return self._model.get_value_as_string()
class StringQueueModel(ui.AbstractItemModel):
def __init__(self, max_items: int = 4, value_changed_fn=None):
super().__init__()
self._value_changed_fn = value_changed_fn
self._max_items = max_items
self._items = []
self._selected_index = ui.SimpleIntModel(0)
# TODO: There's a bug that if the item selected doesn't have a different
# index, then it doesn't trigger this callback. It's better to trigger on
# mouse pressed but we don't have this option.
self._selected_index.add_value_changed_fn(self._on_selection_changed)
def __getitem__(self, idx: int) -> StringQueueItem:
if idx < len(self._items):
return self._items[idx]
return None
@property
def selected_index(self) -> int:
return self._selected_index.get_value_as_int()
@selected_index.setter
def selected_index(self, index: int):
self._selected_index.set_value(index)
def get_selected_item(self) -> StringQueueItem:
index = self._selected_index.get_value_as_int()
if index >= 0 and index < len(self._items):
return self._items[index]
return None
def get_item_children(self, item) -> [StringQueueItem]:
if item is None:
return self._items
return []
def get_item_value_model(self, item, column_id) -> ui.AbstractValueModel:
if item is None:
return self._selected_index
return item.model
def find_item(self, value: str) -> StringQueueItem:
for item in self._items:
if item.value == value:
return item
return None
def size(self) -> int:
return len(self._items)
def peek(self) -> StringQueueItem:
if self._items:
return self._items[0]
return None
def enqueue(self, value: str):
if not value:
return
found = self.find_item(value)
if not found:
item = StringQueueItem(value)
self._items.insert(0, item)
while len(self._items) > self._max_items:
self.dequeue()
self.selected_index = 0
self._item_changed(None)
def dequeue(self):
if self._items:
self._items.pop(-1)
self.selected_index = min(self.selected_index, self.size()-1)
self._item_changed(None)
def _on_selection_changed(self, model: ui.AbstractValueModel):
if self._value_changed_fn:
self._value_changed_fn(model)
self._item_changed(None)
def destroy(self):
self._items = None
self._selected_index = None
class VisitedHistory():
def __init__(self, max_items: int = 100):
self._max_items = max_items
self._items = []
self._selected_index = 0
# the activation state for the visited history; when we are jumping between history entries, the visited history
# should not change; for example, when we click the prev/next button, the path field would update to that entry
# but those should not be counted in visited history.
self._active = True
def __getitem__(self, idx: int) -> str:
if idx < len(self._items):
return self._items[idx]
return None
def activate(self):
self._active = True
def deactivate(self):
self._active = False
@property
def selected_index(self) -> int:
return self._selected_index
@selected_index.setter
def selected_index(self, index: int):
self._selected_index = index
def get_selected_item(self) -> str:
index = self._selected_index
if index >= 0 and index < len(self._items):
return self._items[index]
return None
def size(self) -> int:
return len(self._items)
def insert(self, value: str):
if self._active is False:
return
if not value:
return
# avoid adding the same entry twice
# this could happen when actions on top sets the browser bar path to the same path twice
if self.size() > 0 and self._items[0] == value:
return
self._items.insert(0, value)
while self.size() > self._max_items:
self.pop()
self.selected_index = 0
def pop(self):
if self._items:
self._items.pop()
self.selected_index = min(self.selected_index, self.size()-1)
def destroy(self):
self._items.clear()
|
omniverse-code/kit/exts/omni.kit.widget.browser_bar/omni/kit/widget/browser_bar/widget.py | # Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
import sys, os
import omni.ui as ui
from omni.kit.widget.path_field import PathField
from .model import StringQueueModel, VisitedHistory
from .style import UI_STYLES, ICON_PATH
class BrowserBar:
"""
The Browser Bar extends the :obj:`PathField` UI widget for navigating tree views via the
keyboard. Namely, it adds navigation history. As in any modern day browser, this allows the
user to diectly jump to any previously visited path.
Args:
None
Keyword Args:
visited_history_size (int): Maximum number of previously visited paths to queue up. Default 10.
apply_path_handler (Callable): This function is called when the user updates the path and is
expected to update the caller app accordingly. The user can update the path in one of 3
ways: 1. by hitting Enter on the input field, 2. selecting a path from the dropdown,
or 3. by clicking on the "prev" or "next" buttons. Function signature:
void apply_path_handler(path: str)
branching_options_handler (Callable): This function is required to provide a list of possible
branches whenever prompted with a path. For example, if path = "C:", then the list of values
produced might be ["Program Files", "temp", ..., "Users"]. Function signature:
list(str) branching_options_handler(path: str, callback: func)
modal (bool): Used for modal window. Default False.
"""
def __init__(self, **kwargs):
self._path_field = None
self._next_button = None
self._prev_button = None
self._visited_menu = None
self._visited_queue = None
self._visited_history = None
self._visited_menu_bg = None
import carb.settings
theme = carb.settings.get_settings().get_as_string("/persistent/app/window/uiStyle") or "NvidiaDark"
self._style = UI_STYLES[theme]
self._icon_path = f"{ICON_PATH}/{theme}"
self._visited_max_size = kwargs.get("visited_history_size", 10)
self._visited_history_max_size = kwargs.get("visited_history_max_size", 100)
self._apply_path_handler = kwargs.get("apply_path_handler", None)
self._branching_options_handler = kwargs.get("branching_options_handler", None)
# OM-49484: Add subscription to begin edit and apply callback, for example we could add callback to cancel
# initial navigation upon user edit
self._begin_edit_handler = kwargs.get("begin_edit_handler", None)
self._branching_options_provider = kwargs.get("branching_options_provider", None) # OBSOLETE
self._prefix_separator = kwargs.get("prefix_separator", None)
self._modal = kwargs.get("modal", False)
self._build_ui()
@property
def path(self) -> str:
"""str: Returns the current path as entered in the field box."""
if self._path_field:
return self._path_field.path
return None
def set_path(self, path: str):
"""
Sets the path and adds it to the history queue.
Args:
path (str): The full path name.
"""
if not path:
return
if self._path_field:
self._path_field.set_path(path)
self._update_visited(path)
def _build_ui(self):
import carb.settings
font_size = carb.settings.get_settings().get("/app/font/size") or 0
with ui.HStack(height=0, style=self._style):
self._prev_button = ui.Button(
image_url=f"{self._icon_path}/angle_left.svg",
image_height=16,
width=24,
clicked_fn=self._on_prev_button_pressed,
enabled=False,
)
self._next_button = ui.Button(
image_url=f"{self._icon_path}/angle_right.svg",
image_height=16,
width=24,
clicked_fn=self._on_next_button_pressed,
enabled=False,
)
with ui.ZStack():
ui.Rectangle()
# OM-66124: Update look for browser bar, use full width combobox and hide beneath Pathfield;
# FIXME: this is because currently we cannot control the menu width for arrow_only combo box;
with ui.ZStack():
# OM-66124: manually add combo box drop down background, since it is hard to control combo box height
# FIXME: Ideally should fix in ui.ComboBox directly
combo_dropdown_size = font_size + 8
with ui.HStack():
ui.Spacer()
with ui.VStack(width=combo_dropdown_size):
ui.Spacer()
self._visited_menu_bg = ui.Rectangle(height=22, style=self._style, style_type_name_override="ComboBox.Bg")
ui.Spacer()
with ui.HStack():
self._path_field = PathField(
apply_path_handler=self._apply_path_handler,
branching_options_handler=self._branching_options_handler,
prefix_separator=self._prefix_separator,
modal=self._modal,
begin_edit_handler=self._begin_edit_handler,
)
ui.Spacer(width=combo_dropdown_size)
self._build_visited_menu()
def _build_visited_menu(self):
self._visited_queue = StringQueueModel(
max_items=self._visited_max_size, value_changed_fn=self._on_menu_item_selected
)
self._visited_history = VisitedHistory(max_items=self._visited_history_max_size)
self._visited_menu = ui.ComboBox(self._visited_queue, arrow_only=False, style=self._style)
# Note: This callback is needed to trigger a refresh
self._visited_menu.model.add_item_changed_fn(lambda model, item: None)
def _update_visited(self, path: str):
if self._visited_queue:
self._visited_queue.enqueue(path)
self._visited_menu.style_type_name_override = "ComboBox.Active"
self._visited_menu_bg.style_type_name_override = "ComboBox.Bg.Active"
# update visited history
self._visited_history.insert(path)
self._update_nav_buttons()
self._visited_history.activate()
def _on_prev_button_pressed(self):
self._visited_history.deactivate()
selected_index = self._visited_history.selected_index
if selected_index >= self._visited_history.size() - 1:
return
else:
self._visited_history.selected_index = selected_index + 1
if self._path_field:
self._path_field.set_path(self._visited_history.get_selected_item())
if self._apply_path_handler:
self._apply_path_handler(self._visited_history.get_selected_item())
self._update_nav_buttons()
def _on_next_button_pressed(self):
self._visited_history.deactivate()
selected_index = self._visited_history.selected_index
if selected_index <= 0:
return
else:
self._visited_history.selected_index = selected_index - 1
if self._path_field:
self._path_field.set_path(self._visited_history.get_selected_item())
if self._apply_path_handler:
self._apply_path_handler(self._visited_history.get_selected_item())
self._update_nav_buttons()
def _update_nav_buttons(self):
if self._visited_history.selected_index > 0:
self._next_button.enabled = True
else:
self._next_button.enabled = False
if self._visited_history.selected_index < self._visited_history.size() - 1:
self._prev_button.enabled = True
else:
self._prev_button.enabled = False
def _on_menu_item_selected(self, model: ui.SimpleIntModel):
if not model:
return
menu_item = self._visited_queue[model.get_value_as_int()]
if menu_item:
if self._path_field:
self._path_field.set_path(menu_item.value)
if self._apply_path_handler:
self._apply_path_handler(menu_item.value)
def destroy(self):
if self._path_field:
self._path_field.destroy()
self._path_field = None
self._next_button = None
self._prev_button = None
self._visited_menu = None
self._visited_queue = None
if self._visited_history:
self._visited_history.destroy()
self._visited_menu_bg = None
self._style = None
self._apply_path_handler = None
self._branching_options_handler = None
self._begin_edit_handler = None
self._branching_options_provider = None
|
omniverse-code/kit/exts/omni.kit.widget.browser_bar/omni/kit/widget/browser_bar/tests/test_widget.py | ## Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved.
##
## NVIDIA CORPORATION and its licensors retain all intellectual property
## and proprietary rights in and to this software, related documentation
## and any modifications thereto. Any use, reproduction, disclosure or
## distribution of this software and related documentation without an express
## license agreement from NVIDIA CORPORATION is strictly prohibited.
##
import omni.kit.test
from omni.ui.tests.test_base import OmniUiTest
from unittest.mock import Mock, call
from ..widget import BrowserBar
class TestBrowserBar(OmniUiTest):
"""Testing PathField.set_path"""
async def setUp(self):
pass
async def tearDown(self):
pass
async def test_nav_buttons(self):
"""Testing navigation buttons"""
window = await self.create_test_window()
mock_path_handler = Mock()
with window.frame:
under_test = BrowserBar(apply_path_handler=mock_path_handler)
for path in ["one", "two", "three", "two", "three"]:
under_test.set_path(path)
self.assertEqual(under_test.path, "three/")
self.assertEqual(under_test._visited_history.size(), 5)
self.assertEqual(under_test._visited_queue.size(), 3)
under_test._prev_button.call_clicked_fn()
self.assertEqual(under_test.path, "two/")
under_test._prev_button.call_clicked_fn()
self.assertEqual(under_test.path, "three/")
under_test._prev_button.call_clicked_fn()
under_test._prev_button.call_clicked_fn()
self.assertEqual(under_test.path, "one/")
self.assertFalse(under_test._prev_button.enabled)
for _ in range(4):
under_test._next_button.call_clicked_fn()
self.assertEqual(under_test.path, "three/")
self.assertFalse(under_test._next_button.enabled)
self.assertEqual(
mock_path_handler.call_args_list,
[call('two'), call('three'), call('two'), call('one'), call('two'), call('three'), call('two'), call('three')]
)
async def test_nav_menu(self):
"""Testing navigation menu"""
window = await self.create_test_window()
mock_path_handler = Mock()
with window.frame:
under_test = BrowserBar(apply_path_handler=mock_path_handler)
for path in ["one", "two", "three"]:
under_test.set_path(path)
self.assertEqual(under_test.path, "three/")
model = under_test._visited_menu.model
self.assertEqual(model, under_test._visited_queue)
model.selected_index = 2
self.assertEqual(under_test.path, "one/")
# selecting one of navigation menu browse to that path, and will appear as the most recent visited history
self.assertFalse(under_test._next_button.enabled)
under_test.set_path("four")
self.assertEqual(model.selected_index, 0)
self.assertEqual(under_test.path, "four/")
|
omniverse-code/kit/exts/omni.kit.widget.browser_bar/omni/kit/widget/browser_bar/tests/__init__.py | ## Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.
##
## NVIDIA CORPORATION and its licensors retain all intellectual property
## and proprietary rights in and to this software, related documentation
## and any modifications thereto. Any use, reproduction, disclosure or
## distribution of this software and related documentation without an express
## license agreement from NVIDIA CORPORATION is strictly prohibited.
##
from .test_widget import * |
omniverse-code/kit/exts/omni.kit.widget.browser_bar/docs/CHANGELOG.md | # Changelog
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [2.0.5] - 2022-12-19
### Changes
- Update browser bar combo box style, add custom rectangle background to match UX.
## [2.0.4] - 2022-11-09
### Changes
- Fix to toml file
## [2.0.3] - 2022-03-09
### Changes
- Fixed navigation bugs. Added unittests.
## [2.0.2] - 2021-06-07
### Changes
- More thorough destruction of class instances upon shutdown.
## [2.0.1] - 2021-02-10
### Changes
- Updated StyleUI handling
## [2.0.0] - 2020-01-03
### Updated
- Refactored for async directory listing to improve overall stability in case of network delays.
### Added
- Keyword Arg: 'branching_options_handler'
### Deleted
- Keyword Arg: 'branching_options_provider'
## [0.1.4] - 2020-09-18
### Added
- Initial commit to master.
|
omniverse-code/kit/exts/omni.kit.widget.browser_bar/docs/index.rst | omni.kit.widget.browser_bar
###########################
A UI widget that adds navigation history to the :obj:`PathField`.
.. toctree::
:maxdepth: 1
CHANGELOG
.. automodule:: omni.kit.widget.browser_bar
:platform: Windows-x86_64, Linux-x86_64
:members:
:show-inheritance:
:undoc-members:
:imported-members:
|
omniverse-code/kit/exts/omni.kit.widget.cache_indicator/omni/kit/widget/cache_indicator/cache_state_menu.py | import asyncio
import aiohttp
import carb
import os
import toml
import time
import omni.client
import webbrowser
from omni.kit.menu.utils import MenuItemDescription, MenuAlignment
from omni import ui
from typing import Union
from .style import Styles
class CacheStateDelegate(ui.MenuDelegate):
def __init__(self, cache_enabled, hub_enabled, **kwargs):
super().__init__(**kwargs)
self._hub_enabled = hub_enabled
self._cache_enabled = cache_enabled
self._cache_widget = None
def destroy(self):
self._cache_widget = None
def build_item(self, item: ui.MenuHelper):
with ui.HStack(width=0, style={"margin" : 0}):
self._cache_widget = ui.HStack(content_clipping=1, width=0, style=Styles.CACHE_STATE_ITEM_STYLE)
ui.Spacer(width=10)
self.update_cache_state(self._cache_enabled, self._hub_enabled)
def get_menu_alignment(self):
return MenuAlignment.RIGHT
def update_menu_item(self, menu_item: Union[ui.Menu, ui.MenuItem], menu_refresh: bool):
if isinstance(menu_item, ui.MenuItem):
menu_item.visible = False
def update_cache_state(self, cache_enabled, hub_enabled):
self._hub_enabled = hub_enabled
self._cache_enabled = cache_enabled
if not self._cache_widget:
return
margin = 2
self._cache_widget.clear()
with self._cache_widget:
ui.Label("CACHE: ")
if hub_enabled:
ui.Label("HUB", style={"color": 0xff00b86b})
elif cache_enabled:
ui.Label("ON", style={"color": 0xff00b86b})
else:
with ui.VStack():
ui.Spacer(height=margin)
with ui.ZStack(width=0):
with ui.HStack(width=20):
ui.Spacer()
ui.Label("OFF", name="offline", width=0)
ui.Spacer(width=margin)
with ui.VStack(width=0):
ui.Spacer()
ui.Image(width=14, height=14, name="doc")
ui.Spacer()
ui.Spacer()
button = ui.InvisibleButton(width=20)
button.set_clicked_fn(lambda: webbrowser.open('https://docs.omniverse.nvidia.com/nucleus/cache_troubleshoot.html', new=2))
ui.Spacer(height=margin)
class CacheStateMenu:
def __init__(self):
self._live_menu_name = "Cache State Widget"
self._menu_list = [MenuItemDescription(name="placeholder", show_fn=lambda: False)]
global_config_path = carb.tokens.get_tokens_interface().resolve("${omni_global_config}")
self._omniverse_config_path = os.path.join(global_config_path, "omniverse.toml").replace("\\", "/")
self._all_cache_apis = []
self._hub_enabled = False
self._cache_enabled = False
self._last_time_check = 0
self._ping_cache_future = None
self._update_subscription = None
def _load_cache_config(self):
if os.path.exists(self._omniverse_config_path):
try:
contents = toml.load(self._omniverse_config_path)
except Exception as e:
carb.log_error(f"Unable to parse {self._omniverse_config_path}. File corrupted?")
contents = None
if contents:
self._all_cache_apis = self._load_all_cache_server_apis(contents)
if self._all_cache_apis:
self._cache_enabled = True
self._update_subscription = omni.kit.app.get_app().get_update_event_stream().create_subscription_to_pop(
self._on_update, name="omni.kit.widget.live update"
)
else:
carb.log_warn("Unable to detect Omniverse Cache Server. Consider installing it for better IO performance.")
self._cache_enabled = False
else:
carb.log_warn(f"Unable to detect Omniverse Cache Server. File {self._omniverse_config_path} is not found."
f" Consider installing it for better IO performance.")
def _get_hub_version_cb(self, result, version):
if result == omni.client.Result.OK:
self._hub_enabled = True
else:
self._hub_enabled = False
self._load_cache_config()
if self._cache_state_delegate:
self._cache_state_delegate.update_cache_state(self._cache_enabled, self._hub_enabled)
def _initialize(self):
self._get_hub_version_request = omni.client.get_hub_version_with_callback(self._get_hub_version_cb)
def register_menu_widgets(self):
self._initialize()
self._cache_state_delegate = CacheStateDelegate(self._cache_enabled, self._hub_enabled)
omni.kit.menu.utils.add_menu_items(self._menu_list, name=self._live_menu_name, delegate=self._cache_state_delegate)
def unregister_menu_widgets(self):
omni.kit.menu.utils.remove_menu_items(self._menu_list, self._live_menu_name)
if self._cache_state_delegate:
self._cache_state_delegate.destroy()
self._cache_state_delegate = None
self._menu_list = None
self._update_subscription = None
self._all_cache_apis = []
try:
if self._ping_cache_future and not self._ping_cache_future.done():
self._ping_cache_future.cancel()
self._ping_cache_future = None
except Exception:
self._ping_cache_future = None
def _on_update(self, dt):
if not self._cache_state_delegate or not self._all_cache_apis:
return
if not self._ping_cache_future or self._ping_cache_future.done():
now = time.time()
duration = now - self._last_time_check
# 30s
if duration < 30:
return
self._last_time_check = now
async def _ping_cache():
async with aiohttp.ClientSession() as session:
cache_enabled = None
for cache_api in self._all_cache_apis:
try:
async with session.head(cache_api):
''' If we're here the service port is alive '''
cache_enabled = True
except Exception as e:
cache_enabled = False
break
if cache_enabled is not None and self._cache_enabled != cache_enabled:
self._cache_enabled = cache_enabled
if self._cache_state_delegate:
self._cache_state_delegate.update_cache_state(self._cache_enabled, self._hub_enabled)
self._ping_cache_future = asyncio.ensure_future(_ping_cache())
def _load_all_cache_server_apis(self, config_contents):
mapping = os.environ.get("OMNI_CONN_CACHE", None)
if mapping:
mapping = f"*#{mapping},f"
else:
mapping = os.environ.get("OMNI_CONN_REDIRECTION_DICT", None)
if not mapping:
mapping = os.environ.get("OM_REDIRECTION_DICT", None)
if not mapping:
connection_library_dict = config_contents.get("connection_library", None)
if connection_library_dict:
mapping = connection_library_dict.get("proxy_dict", None)
all_proxy_apis = set([])
if mapping:
mapping = mapping.lstrip("\"")
mapping = mapping.rstrip("\"")
mapping = mapping.lstrip("'")
mapping = mapping.rstrip("'")
redirections = mapping.split(";")
for redirection in redirections:
parts = redirection.split("#")
if not parts or len(parts) < 2:
continue
source, target = parts[0], parts[1]
targets = target.split(",")
if not targets:
continue
if len(targets) > 1:
proxy_address = targets[0]
else:
proxy_address = target
if not proxy_address.startswith("http://") and not proxy_address.startswith("https://"):
proxy_address_api = f"http://{proxy_address}/ping"
else:
if proxy_address.endswith("/"):
proxy_address_api = f"{proxy_address}ping"
else:
proxy_address_api = f"{proxy_address}/ping"
all_proxy_apis.add(proxy_address_api)
return all_proxy_apis
|
omniverse-code/kit/exts/omni.kit.widget.cache_indicator/omni/kit/widget/cache_indicator/style.py | from .icons import Icons
class Styles:
CACHE_STATE_ITEM_STYLE = None
LIVE_STATE_ITEM_STYLE = None
@staticmethod
def on_startup():
# It needs to delay initialization of style as icons need to be initialized firstly.
Styles.CACHE_STATE_ITEM_STYLE = {
"Image::doc": {"image_url": Icons.get("docs"), "color": 0xB04B4BFF},
"Label::offline": {"color": 0xB04B4BFF},
"Rectangle::offline": {"border_radius": 2.0},
"Rectangle::offline": {"background_color": 0xff808080},
"Rectangle::offline:hovered": {"background_color": 0xFF9E9E9E},
}
|
omniverse-code/kit/exts/omni.kit.widget.cache_indicator/omni/kit/widget/cache_indicator/extension.py | # Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
import omni.ext
import omni.kit.app
from .cache_state_menu import CacheStateMenu
from .icons import Icons
from .style import Styles
class OmniCacheIndicatorWidgetExtension(omni.ext.IExt):
def on_startup(self, ext_id):
extension_path = omni.kit.app.get_app_interface().get_extension_manager().get_extension_path(ext_id)
Icons.on_startup(extension_path)
Styles.on_startup()
self._cache_state_menu = CacheStateMenu()
self._cache_state_menu.register_menu_widgets()
def on_shutdown(self):
self._cache_state_menu.unregister_menu_widgets()
Icons.on_shutdown()
|
omniverse-code/kit/exts/omni.kit.widget.cache_indicator/omni/kit/widget/cache_indicator/__init__.py | from .extension import OmniCacheIndicatorWidgetExtension |
omniverse-code/kit/exts/omni.kit.widget.cache_indicator/omni/kit/widget/cache_indicator/icons.py | # Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
from pathlib import Path
class Icons:
"""A singleton that scans the icon folder and returns the icon depending on the type"""
_icons = {}
@staticmethod
def on_startup(extension_path):
current_path = Path(extension_path)
icon_path = current_path.joinpath("icons")
# Read all the svg files in the directory
Icons._icons = {icon.stem: icon for icon in icon_path.glob("*.svg")}
@staticmethod
def on_shutdown():
Icons._icons = None
@staticmethod
def get(name, default=None):
"""Checks the icon cache and returns the icon if exists"""
found = Icons._icons.get(name)
if not found and default:
found = Icons._icons.get(default)
if found:
return str(found)
return None
|
omniverse-code/kit/exts/omni.kit.widget.cache_indicator/omni/kit/widget/cache_indicator/tests/__init__.py | from .test_cache_indicator_widget import TestCacheIndicatorWidget |
omniverse-code/kit/exts/omni.kit.widget.cache_indicator/omni/kit/widget/cache_indicator/tests/test_cache_indicator_widget.py | import omni.kit.test
import omni.client
import omni.kit.app
class TestCacheIndicatorWidget(omni.kit.test.AsyncTestCase):
async def test_menu_setup(self):
import omni.kit.ui_test as ui_test
menu_widget = ui_test.get_menubar()
menu = menu_widget.find_menu("Cache State Widget")
self.assertTrue(menu)
|
omniverse-code/kit/exts/omni.kit.widget.cache_indicator/docs/index.rst | omni.kit.widget.cache_indicator
##################################
Omniverse Kit Cache Status Indicator
|
omniverse-code/kit/exts/omni.kit.renderer.imgui/omni/kit/imgui.pyi | """pybind11 carb.imgui bindings"""
from __future__ import annotations
import omni.kit.imgui
import typing
import carb._carb
__all__ = [
"Condition",
"Context",
"ImGui",
"MouseCursor",
"Style",
"StyleColor",
"StyleColorsPreset",
"StyleVar",
"WINDOW_FLAG_ALWAYS_AUTO_RESIZE",
"WINDOW_FLAG_ALWAYS_HORIZONTAL_SCROLLBAR",
"WINDOW_FLAG_ALWAYS_USE_WINDOW_PADDING",
"WINDOW_FLAG_ALWAYS_VERTICAL_SCROLLBAR",
"WINDOW_FLAG_HORIZONTAL_SCROLLBAR",
"WINDOW_FLAG_MENU_BAR",
"WINDOW_FLAG_NO_BACKGROUND",
"WINDOW_FLAG_NO_BRING_TO_FRONT_ON_FOCUS",
"WINDOW_FLAG_NO_COLLAPSE",
"WINDOW_FLAG_NO_DOCKING",
"WINDOW_FLAG_NO_FOCUS_ON_APPEARING",
"WINDOW_FLAG_NO_MOUSE_INPUTS",
"WINDOW_FLAG_NO_MOVE",
"WINDOW_FLAG_NO_NAV_FOCUS",
"WINDOW_FLAG_NO_NAV_INPUTS",
"WINDOW_FLAG_NO_RESIZE",
"WINDOW_FLAG_NO_SAVED_SETTINGS",
"WINDOW_FLAG_NO_SCROLLBAR",
"WINDOW_FLAG_NO_SCROLL_WITH_MOUSE",
"WINDOW_FLAG_NO_TITLE_BAR",
"WINDOW_FLAG_UNSAVED_DOCUMENT",
"acquire_imgui"
]
class Condition():
"""
Members:
ALWAYS
APPEARING
FIRST_USE_EVER
ONCE
"""
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
"""
ALWAYS: omni.kit.imgui.Condition # value = <Condition.ALWAYS: 1>
APPEARING: omni.kit.imgui.Condition # value = <Condition.APPEARING: 8>
FIRST_USE_EVER: omni.kit.imgui.Condition # value = <Condition.FIRST_USE_EVER: 4>
ONCE: omni.kit.imgui.Condition # value = <Condition.ONCE: 2>
__members__: dict # value = {'ALWAYS': <Condition.ALWAYS: 1>, 'APPEARING': <Condition.APPEARING: 8>, 'FIRST_USE_EVER': <Condition.FIRST_USE_EVER: 4>, 'ONCE': <Condition.ONCE: 2>}
pass
class Context():
pass
class ImGui():
def begin(self, arg0: str, arg1: bool, arg2: int) -> tuple: ...
def begin_child(self, arg0: str, arg1: carb._carb.Float2, arg2: bool, arg3: int) -> bool: ...
def begin_popup_modal(self, arg0: str, arg1: bool, arg2: int) -> bool: ...
def bullet(self) -> None: ...
def button(self, arg0: str) -> bool: ...
def checkbox(self, arg0: str, arg1: bool) -> tuple: ...
def close_current_popup(self) -> None: ...
def collapsing_header(self, arg0: str, arg1: int) -> bool: ...
def color_edit3(self, arg0: str, arg1: carb._carb.Float3) -> tuple: ...
def color_edit4(self, arg0: str, arg1: carb._carb.Float4) -> tuple: ...
def combo(self, arg0: str, arg1: int, arg2: typing.List[str]) -> tuple: ...
def dock_builder_dock_window(self, arg0: str, arg1: int) -> None: ...
def dummy(self, arg0: carb._carb.Float2) -> None: ...
def end(self) -> None: ...
def end_child(self) -> None: ...
def end_popup(self) -> None: ...
def get_display_size(self) -> carb._carb.Float2: ...
def get_mouse_cursor(self) -> MouseCursor: ...
def get_style(self) -> Style: ...
def indent(self, arg0: float) -> None: ...
def input_float(self, arg0: str, arg1: float, arg2: float) -> tuple: ...
def input_int(self, arg0: str, arg1: int, arg2: int) -> tuple: ...
def input_text(self, arg0: str, arg1: str, arg2: int) -> tuple: ...
def is_valid(self) -> bool: ...
def menu_item_ex(self, arg0: str, arg1: str, arg2: bool, arg3: bool) -> tuple: ...
def open_popup(self, arg0: str) -> None: ...
def plot_lines(self, arg0: str, arg1: typing.List[float], arg2: int, arg3: int, arg4: str, arg5: float, arg6: float, arg7: carb._carb.Float2, arg8: int) -> None: ...
def pop_id(self) -> None: ...
def pop_item_width(self) -> None: ...
def pop_style_color(self) -> None: ...
def pop_style_var(self) -> None: ...
def progress_bar(self, arg0: float, arg1: carb._carb.Float2, arg2: str) -> None: ...
def push_id_int(self, arg0: int) -> None: ...
def push_id_string(self, arg0: str) -> None: ...
def push_item_width(self, arg0: float) -> None: ...
def push_style_color(self, arg0: StyleColor, arg1: carb._carb.Float4) -> None: ...
def push_style_var_float(self, arg0: StyleVar, arg1: float) -> None: ...
def push_style_var_float2(self, arg0: StyleVar, arg1: carb._carb.Float2) -> None: ...
def same_line(self) -> None: ...
def same_line_ex(self, pos_x: float = 0.0, spacing_w: float = -1.0) -> None: ...
def separator(self) -> None: ...
def set_display_size(self, arg0: carb._carb.Float2) -> None: ...
def set_mouse_cursor(self, arg0: MouseCursor) -> None: ...
def set_next_window_pos(self, arg0: carb._carb.Float2, arg1: Condition, arg2: carb._carb.Float2) -> None: ...
def set_next_window_size(self, arg0: carb._carb.Float2, arg1: Condition) -> None: ...
def set_scroll_here_y(self, arg0: float) -> None: ...
def set_style_colors(self, arg0: Style, arg1: StyleColorsPreset) -> None: ...
def show_demo_window(self, arg0: bool) -> None: ...
def show_style_editor(self, arg0: Style) -> None: ...
def slider_float(self, arg0: str, arg1: float, arg2: float, arg3: float) -> tuple: ...
def slider_int(self, arg0: str, arg1: int, arg2: int, arg3: int) -> tuple: ...
def small_button(self, arg0: str) -> bool: ...
def spacing(self) -> None: ...
def text(self, arg0: str) -> None: ...
def text_unformatted(self, arg0: str) -> None: ...
def text_wrapped(self, arg0: str) -> None: ...
def tree_node_ptr(self, arg0: int, arg1: str) -> bool: ...
def tree_pop(self) -> None: ...
def unindent(self, arg0: float) -> None: ...
pass
class MouseCursor():
"""
Members:
NONE
ARROW
TEXT_INPUT
RESIZE_ALL
RESIZE_NS
RESIZE_EW
RESIZE_NESW
RESIZE_NWSE
HAND
NOT_ALLOWED
CROSSHAIR
"""
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
"""
ARROW: omni.kit.imgui.MouseCursor # value = <MouseCursor.ARROW: 0>
CROSSHAIR: omni.kit.imgui.MouseCursor # value = <MouseCursor.CROSSHAIR: 9>
HAND: omni.kit.imgui.MouseCursor # value = <MouseCursor.HAND: 7>
NONE: omni.kit.imgui.MouseCursor # value = <MouseCursor.NONE: -1>
NOT_ALLOWED: omni.kit.imgui.MouseCursor # value = <MouseCursor.NOT_ALLOWED: 8>
RESIZE_ALL: omni.kit.imgui.MouseCursor # value = <MouseCursor.RESIZE_ALL: 2>
RESIZE_EW: omni.kit.imgui.MouseCursor # value = <MouseCursor.RESIZE_EW: 4>
RESIZE_NESW: omni.kit.imgui.MouseCursor # value = <MouseCursor.RESIZE_NESW: 5>
RESIZE_NS: omni.kit.imgui.MouseCursor # value = <MouseCursor.RESIZE_NS: 3>
RESIZE_NWSE: omni.kit.imgui.MouseCursor # value = <MouseCursor.RESIZE_NWSE: 6>
TEXT_INPUT: omni.kit.imgui.MouseCursor # value = <MouseCursor.TEXT_INPUT: 1>
__members__: dict # value = {'NONE': <MouseCursor.NONE: -1>, 'ARROW': <MouseCursor.ARROW: 0>, 'TEXT_INPUT': <MouseCursor.TEXT_INPUT: 1>, 'RESIZE_ALL': <MouseCursor.RESIZE_ALL: 2>, 'RESIZE_NS': <MouseCursor.RESIZE_NS: 3>, 'RESIZE_EW': <MouseCursor.RESIZE_EW: 4>, 'RESIZE_NESW': <MouseCursor.RESIZE_NESW: 5>, 'RESIZE_NWSE': <MouseCursor.RESIZE_NWSE: 6>, 'HAND': <MouseCursor.HAND: 7>, 'NOT_ALLOWED': <MouseCursor.NOT_ALLOWED: 8>, 'CROSSHAIR': <MouseCursor.CROSSHAIR: 9>}
pass
class Style():
pass
class StyleColor():
"""
Members:
Text
TextDisabled
WindowBg
ChildBg
PopupBg
Border
BorderShadow
FrameBg
FrameBgHovered
FrameBgActive
TitleBg
TitleBgActive
TitleBgCollapsed
MenuBarBg
ScrollbarBg
ScrollbarGrab
ScrollbarGrabHovered
ScrollbarGrabActive
CheckMark
SliderGrab
SliderGrabActive
Button
ButtonHovered
ButtonActive
Header
HeaderHovered
HeaderActive
Separator
SeparatorHovered
SeparatorActive
ResizeGrip
ResizeGripHovered
ResizeGripActive
Tab
TabHovered
TabActive
TabUnfocused
TabUnfocusedActive
DockingPreview
DockingEmptyBg
PlotLines
PlotLinesHovered
PlotHistogram
PlotHistogramHovered
TableHeaderBg
TableBorderStrong
TableBorderLight
TableRowBg
TableRowBgAlt
TextSelectedBg
DragDropTarget
NavHighlight
NavWindowingHighlight
NavWindowingDimBg
ModalWindowDimBg
WindowShadow
CustomText
Count
"""
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
"""
Border: omni.kit.imgui.StyleColor # value = <StyleColor.Border: 5>
BorderShadow: omni.kit.imgui.StyleColor # value = <StyleColor.BorderShadow: 6>
Button: omni.kit.imgui.StyleColor # value = <StyleColor.Button: 21>
ButtonActive: omni.kit.imgui.StyleColor # value = <StyleColor.ButtonActive: 23>
ButtonHovered: omni.kit.imgui.StyleColor # value = <StyleColor.ButtonHovered: 22>
CheckMark: omni.kit.imgui.StyleColor # value = <StyleColor.CheckMark: 18>
ChildBg: omni.kit.imgui.StyleColor # value = <StyleColor.ChildBg: 3>
Count: omni.kit.imgui.StyleColor # value = <StyleColor.Count: 57>
CustomText: omni.kit.imgui.StyleColor # value = <StyleColor.CustomText: 56>
DockingEmptyBg: omni.kit.imgui.StyleColor # value = <StyleColor.DockingEmptyBg: 39>
DockingPreview: omni.kit.imgui.StyleColor # value = <StyleColor.DockingPreview: 38>
DragDropTarget: omni.kit.imgui.StyleColor # value = <StyleColor.DragDropTarget: 50>
FrameBg: omni.kit.imgui.StyleColor # value = <StyleColor.FrameBg: 7>
FrameBgActive: omni.kit.imgui.StyleColor # value = <StyleColor.FrameBgActive: 9>
FrameBgHovered: omni.kit.imgui.StyleColor # value = <StyleColor.FrameBgHovered: 8>
Header: omni.kit.imgui.StyleColor # value = <StyleColor.Header: 24>
HeaderActive: omni.kit.imgui.StyleColor # value = <StyleColor.HeaderActive: 26>
HeaderHovered: omni.kit.imgui.StyleColor # value = <StyleColor.HeaderHovered: 25>
MenuBarBg: omni.kit.imgui.StyleColor # value = <StyleColor.MenuBarBg: 13>
ModalWindowDimBg: omni.kit.imgui.StyleColor # value = <StyleColor.ModalWindowDimBg: 54>
NavHighlight: omni.kit.imgui.StyleColor # value = <StyleColor.NavHighlight: 51>
NavWindowingDimBg: omni.kit.imgui.StyleColor # value = <StyleColor.NavWindowingDimBg: 53>
NavWindowingHighlight: omni.kit.imgui.StyleColor # value = <StyleColor.NavWindowingHighlight: 52>
PlotHistogram: omni.kit.imgui.StyleColor # value = <StyleColor.PlotHistogram: 42>
PlotHistogramHovered: omni.kit.imgui.StyleColor # value = <StyleColor.PlotHistogramHovered: 43>
PlotLines: omni.kit.imgui.StyleColor # value = <StyleColor.PlotLines: 40>
PlotLinesHovered: omni.kit.imgui.StyleColor # value = <StyleColor.PlotLinesHovered: 41>
PopupBg: omni.kit.imgui.StyleColor # value = <StyleColor.PopupBg: 4>
ResizeGrip: omni.kit.imgui.StyleColor # value = <StyleColor.ResizeGrip: 30>
ResizeGripActive: omni.kit.imgui.StyleColor # value = <StyleColor.ResizeGripActive: 32>
ResizeGripHovered: omni.kit.imgui.StyleColor # value = <StyleColor.ResizeGripHovered: 31>
ScrollbarBg: omni.kit.imgui.StyleColor # value = <StyleColor.ScrollbarBg: 14>
ScrollbarGrab: omni.kit.imgui.StyleColor # value = <StyleColor.ScrollbarGrab: 15>
ScrollbarGrabActive: omni.kit.imgui.StyleColor # value = <StyleColor.ScrollbarGrabActive: 17>
ScrollbarGrabHovered: omni.kit.imgui.StyleColor # value = <StyleColor.ScrollbarGrabHovered: 16>
Separator: omni.kit.imgui.StyleColor # value = <StyleColor.Separator: 27>
SeparatorActive: omni.kit.imgui.StyleColor # value = <StyleColor.SeparatorActive: 29>
SeparatorHovered: omni.kit.imgui.StyleColor # value = <StyleColor.SeparatorHovered: 28>
SliderGrab: omni.kit.imgui.StyleColor # value = <StyleColor.SliderGrab: 19>
SliderGrabActive: omni.kit.imgui.StyleColor # value = <StyleColor.SliderGrabActive: 20>
Tab: omni.kit.imgui.StyleColor # value = <StyleColor.Tab: 33>
TabActive: omni.kit.imgui.StyleColor # value = <StyleColor.TabActive: 35>
TabHovered: omni.kit.imgui.StyleColor # value = <StyleColor.TabHovered: 34>
TabUnfocused: omni.kit.imgui.StyleColor # value = <StyleColor.TabUnfocused: 36>
TabUnfocusedActive: omni.kit.imgui.StyleColor # value = <StyleColor.TabUnfocusedActive: 37>
TableBorderLight: omni.kit.imgui.StyleColor # value = <StyleColor.TableBorderLight: 46>
TableBorderStrong: omni.kit.imgui.StyleColor # value = <StyleColor.TableBorderStrong: 45>
TableHeaderBg: omni.kit.imgui.StyleColor # value = <StyleColor.TableHeaderBg: 44>
TableRowBg: omni.kit.imgui.StyleColor # value = <StyleColor.TableRowBg: 47>
TableRowBgAlt: omni.kit.imgui.StyleColor # value = <StyleColor.TableRowBgAlt: 48>
Text: omni.kit.imgui.StyleColor # value = <StyleColor.Text: 0>
TextDisabled: omni.kit.imgui.StyleColor # value = <StyleColor.TextDisabled: 1>
TextSelectedBg: omni.kit.imgui.StyleColor # value = <StyleColor.TextSelectedBg: 49>
TitleBg: omni.kit.imgui.StyleColor # value = <StyleColor.TitleBg: 10>
TitleBgActive: omni.kit.imgui.StyleColor # value = <StyleColor.TitleBgActive: 11>
TitleBgCollapsed: omni.kit.imgui.StyleColor # value = <StyleColor.TitleBgCollapsed: 12>
WindowBg: omni.kit.imgui.StyleColor # value = <StyleColor.WindowBg: 2>
WindowShadow: omni.kit.imgui.StyleColor # value = <StyleColor.WindowShadow: 55>
__members__: dict # value = {'Text': <StyleColor.Text: 0>, 'TextDisabled': <StyleColor.TextDisabled: 1>, 'WindowBg': <StyleColor.WindowBg: 2>, 'ChildBg': <StyleColor.ChildBg: 3>, 'PopupBg': <StyleColor.PopupBg: 4>, 'Border': <StyleColor.Border: 5>, 'BorderShadow': <StyleColor.BorderShadow: 6>, 'FrameBg': <StyleColor.FrameBg: 7>, 'FrameBgHovered': <StyleColor.FrameBgHovered: 8>, 'FrameBgActive': <StyleColor.FrameBgActive: 9>, 'TitleBg': <StyleColor.TitleBg: 10>, 'TitleBgActive': <StyleColor.TitleBgActive: 11>, 'TitleBgCollapsed': <StyleColor.TitleBgCollapsed: 12>, 'MenuBarBg': <StyleColor.MenuBarBg: 13>, 'ScrollbarBg': <StyleColor.ScrollbarBg: 14>, 'ScrollbarGrab': <StyleColor.ScrollbarGrab: 15>, 'ScrollbarGrabHovered': <StyleColor.ScrollbarGrabHovered: 16>, 'ScrollbarGrabActive': <StyleColor.ScrollbarGrabActive: 17>, 'CheckMark': <StyleColor.CheckMark: 18>, 'SliderGrab': <StyleColor.SliderGrab: 19>, 'SliderGrabActive': <StyleColor.SliderGrabActive: 20>, 'Button': <StyleColor.Button: 21>, 'ButtonHovered': <StyleColor.ButtonHovered: 22>, 'ButtonActive': <StyleColor.ButtonActive: 23>, 'Header': <StyleColor.Header: 24>, 'HeaderHovered': <StyleColor.HeaderHovered: 25>, 'HeaderActive': <StyleColor.HeaderActive: 26>, 'Separator': <StyleColor.Separator: 27>, 'SeparatorHovered': <StyleColor.SeparatorHovered: 28>, 'SeparatorActive': <StyleColor.SeparatorActive: 29>, 'ResizeGrip': <StyleColor.ResizeGrip: 30>, 'ResizeGripHovered': <StyleColor.ResizeGripHovered: 31>, 'ResizeGripActive': <StyleColor.ResizeGripActive: 32>, 'Tab': <StyleColor.Tab: 33>, 'TabHovered': <StyleColor.TabHovered: 34>, 'TabActive': <StyleColor.TabActive: 35>, 'TabUnfocused': <StyleColor.TabUnfocused: 36>, 'TabUnfocusedActive': <StyleColor.TabUnfocusedActive: 37>, 'DockingPreview': <StyleColor.DockingPreview: 38>, 'DockingEmptyBg': <StyleColor.DockingEmptyBg: 39>, 'PlotLines': <StyleColor.PlotLines: 40>, 'PlotLinesHovered': <StyleColor.PlotLinesHovered: 41>, 'PlotHistogram': <StyleColor.PlotHistogram: 42>, 'PlotHistogramHovered': <StyleColor.PlotHistogramHovered: 43>, 'TableHeaderBg': <StyleColor.TableHeaderBg: 44>, 'TableBorderStrong': <StyleColor.TableBorderStrong: 45>, 'TableBorderLight': <StyleColor.TableBorderLight: 46>, 'TableRowBg': <StyleColor.TableRowBg: 47>, 'TableRowBgAlt': <StyleColor.TableRowBgAlt: 48>, 'TextSelectedBg': <StyleColor.TextSelectedBg: 49>, 'DragDropTarget': <StyleColor.DragDropTarget: 50>, 'NavHighlight': <StyleColor.NavHighlight: 51>, 'NavWindowingHighlight': <StyleColor.NavWindowingHighlight: 52>, 'NavWindowingDimBg': <StyleColor.NavWindowingDimBg: 53>, 'ModalWindowDimBg': <StyleColor.ModalWindowDimBg: 54>, 'WindowShadow': <StyleColor.WindowShadow: 55>, 'CustomText': <StyleColor.CustomText: 56>, 'Count': <StyleColor.Count: 57>}
pass
class StyleColorsPreset():
"""
Members:
NvidiaDark
NvidiaLight
Dark
Light
Classic
Count
"""
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
"""
Classic: omni.kit.imgui.StyleColorsPreset # value = <StyleColorsPreset.Classic: 4>
Count: omni.kit.imgui.StyleColorsPreset # value = <StyleColorsPreset.Count: 5>
Dark: omni.kit.imgui.StyleColorsPreset # value = <StyleColorsPreset.Dark: 2>
Light: omni.kit.imgui.StyleColorsPreset # value = <StyleColorsPreset.Light: 3>
NvidiaDark: omni.kit.imgui.StyleColorsPreset # value = <StyleColorsPreset.NvidiaDark: 0>
NvidiaLight: omni.kit.imgui.StyleColorsPreset # value = <StyleColorsPreset.NvidiaLight: 1>
__members__: dict # value = {'NvidiaDark': <StyleColorsPreset.NvidiaDark: 0>, 'NvidiaLight': <StyleColorsPreset.NvidiaLight: 1>, 'Dark': <StyleColorsPreset.Dark: 2>, 'Light': <StyleColorsPreset.Light: 3>, 'Classic': <StyleColorsPreset.Classic: 4>, 'Count': <StyleColorsPreset.Count: 5>}
pass
class StyleVar():
"""
Members:
Alpha
WindowPadding
WindowRounding
WindowBorderSize
WindowMinSize
WindowTitleAlign
ChildRounding
ChildBorderSize
PopupRounding
PopupBorderSize
FramePadding
FrameRounding
FrameBorderSize
ItemSpacing
ItemInnerSpacing
CellPadding
IndentSpacing
ScrollbarSize
ScrollbarRounding
GrabMinSize
GrabRounding
TabRounding
ButtonTextAlign
SelectableTextAlign
DockSplitterSize
"""
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
"""
Alpha: omni.kit.imgui.StyleVar # value = <StyleVar.Alpha: 0>
ButtonTextAlign: omni.kit.imgui.StyleVar # value = <StyleVar.ButtonTextAlign: 22>
CellPadding: omni.kit.imgui.StyleVar # value = <StyleVar.CellPadding: 15>
ChildBorderSize: omni.kit.imgui.StyleVar # value = <StyleVar.ChildBorderSize: 7>
ChildRounding: omni.kit.imgui.StyleVar # value = <StyleVar.ChildRounding: 6>
DockSplitterSize: omni.kit.imgui.StyleVar # value = <StyleVar.DockSplitterSize: 24>
FrameBorderSize: omni.kit.imgui.StyleVar # value = <StyleVar.FrameBorderSize: 12>
FramePadding: omni.kit.imgui.StyleVar # value = <StyleVar.FramePadding: 10>
FrameRounding: omni.kit.imgui.StyleVar # value = <StyleVar.FrameRounding: 11>
GrabMinSize: omni.kit.imgui.StyleVar # value = <StyleVar.GrabMinSize: 19>
GrabRounding: omni.kit.imgui.StyleVar # value = <StyleVar.GrabRounding: 20>
IndentSpacing: omni.kit.imgui.StyleVar # value = <StyleVar.IndentSpacing: 16>
ItemInnerSpacing: omni.kit.imgui.StyleVar # value = <StyleVar.ItemInnerSpacing: 14>
ItemSpacing: omni.kit.imgui.StyleVar # value = <StyleVar.ItemSpacing: 13>
PopupBorderSize: omni.kit.imgui.StyleVar # value = <StyleVar.PopupBorderSize: 9>
PopupRounding: omni.kit.imgui.StyleVar # value = <StyleVar.PopupRounding: 8>
ScrollbarRounding: omni.kit.imgui.StyleVar # value = <StyleVar.ScrollbarRounding: 18>
ScrollbarSize: omni.kit.imgui.StyleVar # value = <StyleVar.ScrollbarSize: 17>
SelectableTextAlign: omni.kit.imgui.StyleVar # value = <StyleVar.SelectableTextAlign: 23>
TabRounding: omni.kit.imgui.StyleVar # value = <StyleVar.TabRounding: 21>
WindowBorderSize: omni.kit.imgui.StyleVar # value = <StyleVar.WindowBorderSize: 3>
WindowMinSize: omni.kit.imgui.StyleVar # value = <StyleVar.WindowMinSize: 4>
WindowPadding: omni.kit.imgui.StyleVar # value = <StyleVar.WindowPadding: 1>
WindowRounding: omni.kit.imgui.StyleVar # value = <StyleVar.WindowRounding: 2>
WindowTitleAlign: omni.kit.imgui.StyleVar # value = <StyleVar.WindowTitleAlign: 5>
__members__: dict # value = {'Alpha': <StyleVar.Alpha: 0>, 'WindowPadding': <StyleVar.WindowPadding: 1>, 'WindowRounding': <StyleVar.WindowRounding: 2>, 'WindowBorderSize': <StyleVar.WindowBorderSize: 3>, 'WindowMinSize': <StyleVar.WindowMinSize: 4>, 'WindowTitleAlign': <StyleVar.WindowTitleAlign: 5>, 'ChildRounding': <StyleVar.ChildRounding: 6>, 'ChildBorderSize': <StyleVar.ChildBorderSize: 7>, 'PopupRounding': <StyleVar.PopupRounding: 8>, 'PopupBorderSize': <StyleVar.PopupBorderSize: 9>, 'FramePadding': <StyleVar.FramePadding: 10>, 'FrameRounding': <StyleVar.FrameRounding: 11>, 'FrameBorderSize': <StyleVar.FrameBorderSize: 12>, 'ItemSpacing': <StyleVar.ItemSpacing: 13>, 'ItemInnerSpacing': <StyleVar.ItemInnerSpacing: 14>, 'CellPadding': <StyleVar.CellPadding: 15>, 'IndentSpacing': <StyleVar.IndentSpacing: 16>, 'ScrollbarSize': <StyleVar.ScrollbarSize: 17>, 'ScrollbarRounding': <StyleVar.ScrollbarRounding: 18>, 'GrabMinSize': <StyleVar.GrabMinSize: 19>, 'GrabRounding': <StyleVar.GrabRounding: 20>, 'TabRounding': <StyleVar.TabRounding: 21>, 'ButtonTextAlign': <StyleVar.ButtonTextAlign: 22>, 'SelectableTextAlign': <StyleVar.SelectableTextAlign: 23>, 'DockSplitterSize': <StyleVar.DockSplitterSize: 24>}
pass
def acquire_imgui(plugin_name: str = None, library_path: str = None) -> ImGui:
pass
WINDOW_FLAG_ALWAYS_AUTO_RESIZE = 64
WINDOW_FLAG_ALWAYS_HORIZONTAL_SCROLLBAR = 32768
WINDOW_FLAG_ALWAYS_USE_WINDOW_PADDING = 65536
WINDOW_FLAG_ALWAYS_VERTICAL_SCROLLBAR = 16384
WINDOW_FLAG_HORIZONTAL_SCROLLBAR = 2048
WINDOW_FLAG_MENU_BAR = 1024
WINDOW_FLAG_NO_BACKGROUND = 128
WINDOW_FLAG_NO_BRING_TO_FRONT_ON_FOCUS = 8192
WINDOW_FLAG_NO_COLLAPSE = 32
WINDOW_FLAG_NO_DOCKING = 2097152
WINDOW_FLAG_NO_FOCUS_ON_APPEARING = 4096
WINDOW_FLAG_NO_MOUSE_INPUTS = 512
WINDOW_FLAG_NO_MOVE = 4
WINDOW_FLAG_NO_NAV_FOCUS = 262144
WINDOW_FLAG_NO_NAV_INPUTS = 524288
WINDOW_FLAG_NO_RESIZE = 2
WINDOW_FLAG_NO_SAVED_SETTINGS = 256
WINDOW_FLAG_NO_SCROLLBAR = 8
WINDOW_FLAG_NO_SCROLL_WITH_MOUSE = 16
WINDOW_FLAG_NO_TITLE_BAR = 1
WINDOW_FLAG_UNSAVED_DOCUMENT = 1048576
|
omniverse-code/kit/exts/omni.kit.renderer.imgui/omni/kit/imgui_renderer/_imgui_renderer.pyi | from __future__ import annotations
import omni.kit.imgui_renderer._imgui_renderer
import typing
import omni.appwindow._appwindow
__all__ = [
"IImGuiRenderer",
"acquire_imgui_renderer_interface",
"release_imgui_renderer_interface"
]
class IImGuiRenderer():
def attach_app_window(self, arg0: omni.appwindow._appwindow.IAppWindow) -> bool: ...
@staticmethod
def attach_app_window_with_imgui_context(*args, **kwargs) -> typing.Any: ...
def clear_cursor_shape_override(self, arg0: omni.appwindow._appwindow.IAppWindow) -> None: ...
def detach_app_window(self, arg0: omni.appwindow._appwindow.IAppWindow) -> None: ...
def get_all_cursor_shape_names(self) -> typing.List[str]: ...
@staticmethod
def get_cursor_shape_override(*args, **kwargs) -> typing.Any: ...
@staticmethod
def get_cursor_shape_override_extend(*args, **kwargs) -> typing.Any: ...
@staticmethod
def get_window_set(*args, **kwargs) -> typing.Any: ...
def has_cursor_shape_override(self, arg0: omni.appwindow._appwindow.IAppWindow) -> bool: ...
def is_app_window_attached(self, arg0: omni.appwindow._appwindow.IAppWindow) -> bool: ...
def register_cursor_shape_extend(self, arg0: str, arg1: str) -> None: ...
@staticmethod
def set_cursor_shape_override(*args, **kwargs) -> typing.Any: ...
def set_cursor_shape_override_extend(self, arg0: omni.appwindow._appwindow.IAppWindow, arg1: str) -> None: ...
def shutdown(self) -> None: ...
def startup(self) -> None: ...
def unregister_cursor_shape_extend(self, arg0: str) -> None: ...
pass
def acquire_imgui_renderer_interface(plugin_name: str = None, library_path: str = None) -> IImGuiRenderer:
pass
def release_imgui_renderer_interface(arg0: IImGuiRenderer) -> None:
pass
|
omniverse-code/kit/exts/omni.kit.renderer.imgui/omni/kit/imgui_renderer/__init__.py | from ._imgui_renderer import *
# Cached interface instance pointer
def get_imgui_renderer_interface() -> IImGuiRenderer:
"""Returns cached :class:`omni.kit.renderer.IImGuiRenderer` interface"""
if not hasattr(get_imgui_renderer_interface, "imgui_renderer"):
get_imgui_renderer_interface.imgui_renderer = acquire_imgui_renderer_interface()
return get_imgui_renderer_interface.imgui_renderer
|
omniverse-code/kit/exts/omni.kit.renderer.imgui/omni/kit/imgui_renderer/tests/test_imgui_renderer.py | import inspect
import pathlib
import carb
import carb.settings
import carb.tokens
import carb.windowing
import omni.kit.app
import omni.kit.test
import omni.kit.test_helpers_gfx
import omni.kit.renderer.bind
import omni.kit.imgui_renderer
import omni.kit.imgui_renderer_test
# Maximum allowed difference of the same pixel between two images. If the object is moved, the difference will be
# close to 255. 10 is enough to filter out the artifacts of antialiasing on the different systems.
THRESHOLD = 10
OUTPUTS_DIR = omni.kit.test.get_test_output_path()
EXTENSION_FOLDER_PATH = pathlib.Path(omni.kit.app.get_app().get_extension_manager().get_extension_path_by_module(__name__))
GOLDEN_DIR = EXTENSION_FOLDER_PATH.joinpath("data/tests")
RENDERER_CAPTURE_EXT_NAME = "omni.kit.renderer.capture"
class ImGuiRendererTest(omni.kit.test.AsyncTestCase):
async def setUp(self):
self._settings = carb.settings.acquire_settings_interface()
self._app_window_factory = omni.appwindow.acquire_app_window_factory_interface()
self._renderer = omni.kit.renderer.bind.acquire_renderer_interface()
self._imgui_renderer = omni.kit.imgui_renderer.acquire_imgui_renderer_interface()
self._imgui_renderer_test = omni.kit.imgui_renderer_test.acquire_imgui_renderer_test_interface()
self._renderer.startup()
self._imgui_renderer.startup()
self._imgui_renderer_test.startup()
async def tearDown(self):
self._imgui_renderer_test.shutdown()
self._imgui_renderer.shutdown()
self._renderer.shutdown()
self._imgui_renderer_test = None
self._imgui_renderer = None
self._renderer = None
self._app_window_factory = None
self._settings = None
async def __create_app_window(self, title: str, width: int = 300, height: int = 300):
app_window = self._app_window_factory.create_window_from_settings()
app_window.startup_with_desc(
title=f"ImGui renderer test {title}",
width=width,
height=height,
x=omni.appwindow.POSITION_CENTERED,
y=omni.appwindow.POSITION_CENTERED,
decorations=True,
resize=True,
always_on_top=False,
scale_to_monitor=False,
dpi_scale_override=1.0
)
self._app_window_factory.set_default_window(app_window)
self._renderer.attach_app_window(app_window)
self._imgui_renderer.attach_app_window(app_window)
self._imgui_renderer_test.register_empty_window(
app_window,
50,
50,
200,
200,
title
)
# Test the carb.imgui is_valid returns True since it is now properly setup
await self.test_carb_imgui_is_valid(True)
await omni.kit.app.get_app().next_update_async()
return app_window
async def __destroy_app_window(self, app_window):
self._app_window_factory.set_default_window(None)
self._imgui_renderer.detach_app_window(app_window)
self._renderer.detach_app_window(app_window)
app_window.shutdown()
await omni.kit.app.get_app().next_update_async()
return None
@omni.kit.test.omni_test_registry(guid="4ecaf4c3-17bd-40fa-8a76-f0e12291d0ef")
async def test_1000_empty_imgui_window(self):
TESTNAME = "test_1000_empty_imgui_window"
FILENAME = f"{TESTNAME}.png"
app_window = await self.__create_app_window("Test Empty Window")
diff = await omni.kit.test_helpers_gfx.capture_and_compare(FILENAME, THRESHOLD, OUTPUTS_DIR, GOLDEN_DIR, app_window)
if diff != 0:
carb.log_warn(f"[TEST_NAME] the generated image has max difference {diff}")
if diff > THRESHOLD:
carb.log_error(f'The generated image {FILENAME} has a difference of {diff}, but max difference is {THRESHOLD}')
self.assertTrue(False)
app_window = await self.__destroy_app_window(app_window)
@omni.kit.test.omni_test_registry(guid="bf09077f-e44a-11ed-ade6-ac91a108fede")
async def test_null_app_window_0(self):
"""Test crash avoidance on API abuse 0"""
result = self._imgui_renderer_test.attach_null_window(0)
self.assertTrue(result)
@omni.kit.test.omni_test_registry(guid="65059f66-e44d-11ed-9523-ac91a108fede")
async def test_null_app_window_1(self):
"""Test crash avoidance on API abuse 1"""
result = self._imgui_renderer_test.attach_null_window(1)
self.assertTrue(result)
async def test_set_cursor_shape_override(self):
"""Test crash avoidance on set_cursor_shape_override"""
app_window = await self.__create_app_window("Test Empty Window")
self._imgui_renderer.set_cursor_shape_override(app_window, carb.windowing.CursorStandardShape.HAND)
app_window = await self.__destroy_app_window(app_window)
async def test_cursor_shape_override_extend(self):
"""Test crash avoidance on set_cursor_shape_override_extend"""
app_window = await self.__create_app_window("Test Empty Window")
self._imgui_renderer.get_all_cursor_shape_names()
self._imgui_renderer.set_cursor_shape_override_extend(app_window, "Arrow")
self._imgui_renderer.get_cursor_shape_override_extend(app_window)
self._imgui_renderer.register_cursor_shape_extend("test_cursor", r"${exe-path}/resources/icons/Ok_64.png")
self._imgui_renderer.unregister_cursor_shape_extend("test_cursor")
app_window = await self.__destroy_app_window(app_window)
async def test_carb_imgui_is_valid(self, should_be_valid: bool = False):
"""Test low level carb.imgui is_valid API"""
import carb.imgui
imgui = carb.imgui.acquire_imgui()
self.assertIsNotNone(imgui)
self.assertEqual(imgui.is_valid(), should_be_valid)
|
omniverse-code/kit/exts/omni.kit.renderer.imgui/omni/kit/imgui_renderer/tests/__init__.py | from .test_imgui_renderer import *
|
omniverse-code/kit/exts/omni.kit.renderer.imgui/omni/kit/imgui_renderer_test/__init__.py | from ._imgui_renderer_test import *
# Cached interface instance pointer
def get_imgui_renderer_test_interface() -> IImGuiRendererTest:
if not hasattr(get_imgui_renderer_test_interface, "imgui_renderer_test"):
get_imgui_renderer_test_interface.imgui_renderer_test = acquire_imgui_renderer_test_interface()
return get_imgui_renderer_test_interface.imgui_renderer_test
|
omniverse-code/kit/exts/omni.kit.renderer.imgui/omni/kit/ui/editor_menu.py | import carb
from typing import Callable, Union, Tuple
extension_id = "omni.kit.ui.editor_menu_bridge"
class EditorMenu():
active_menus = {}
window_handler = {}
setup_hook = False
omni_kit_menu_utils_loaded = False
def __init__(self):
import omni.kit.app
manager = omni.kit.app.get_app().get_extension_manager()
self._hooks = []
self._hooks.append(
manager.subscribe_to_extension_enable(
on_enable_fn=lambda _: EditorMenu.set_menu_loaded(True),
on_disable_fn=lambda _: EditorMenu.set_menu_loaded(False),
ext_name="omni.kit.menu.utils",
hook_name="editor menu omni.kit.menu.utils listener",
)
)
@staticmethod
def clean_menu_path(path):
import re
return re.sub(r"[^\x00-\x7F]+", "", path).lstrip()
@staticmethod
def set_menu_loaded(state: bool):
EditorMenu.omni_kit_menu_utils_loaded = state
class EditorMenuItem:
def __init__(self, menu_path):
self._menu_path = menu_path
def __del__(self):
carb.log_info(f"{self._menu_path} went out of scope and is being automatically removed from the menu system")
EditorMenu.remove_item(self._menu_path)
@staticmethod
def sort_menu_hook(merged_menu):
from omni.kit.menu.utils import MenuItemDescription
def priority_sort(menu_entry):
if hasattr(menu_entry, "priority"):
return menu_entry.priority
return 0
for name in ["Window", "Help"]:
if name in merged_menu:
merged_menu[name].sort(key=priority_sort)
priority = 0
for index, menu_entry in enumerate(merged_menu[name]):
if hasattr(menu_entry, "priority"):
if index > 0 and abs(menu_entry.priority - priority) > 9:
spacer = MenuItemDescription()
spacer.priority = menu_entry.priority
merged_menu[name].insert(index, spacer)
priority = menu_entry.priority
@staticmethod
def get_action_name(menu_path):
import re
action = re.sub(r'[^\x00-\x7F]','', menu_path).lower().strip().replace('/', '_').replace(' ', '_').replace('__', '_')
return(f"action_editor_menu_bridge_{action}")
@staticmethod
def convert_to_new_menu(menu_path:str, menu_name: Union[str, list], on_click: Callable, toggle: bool, priority: int, value: bool, enabled: bool, original_svg_color: bool):
from omni.kit.menu.utils import MenuItemDescription
action_name = EditorMenu.get_action_name(menu_path)
if on_click:
import omni.kit.actions.core
omni.kit.actions.core.get_action_registry().register_action(
extension_id,
action_name,
lambda: on_click(menu_path, EditorMenu.toggle_value(menu_path)),
display_name=action_name,
description=action_name,
tag=action_name,
)
if isinstance(menu_name, list):
menu_item = menu_name.pop(-1)
sub_menu_item = MenuItemDescription(name=menu_item,
enabled=enabled,
ticked=toggle,
ticked_value=value if toggle else None,
onclick_action=(extension_id, action_name),
original_svg_color=original_svg_color)
sub_menu = [sub_menu_item]
while(len(menu_name) > 0):
menu_item = menu_name.pop(-1)
menu = MenuItemDescription(name=menu_item, sub_menu=sub_menu, original_svg_color=original_svg_color)
menu.priority=priority
sub_menu = [menu]
return menu, sub_menu_item
else:
menu = MenuItemDescription(name=menu_name,
enabled=enabled,
ticked=toggle,
ticked_value=value if toggle else None,
onclick_action=(extension_id, action_name),
original_svg_color=original_svg_color)
menu.priority=priority
return menu, menu
@staticmethod
def split_menu_path(menu_path: str):
menu_name = None
menu_parts = menu_path.replace("\/", "@TEMPSLASH@").split("/")
menu_title = menu_parts.pop(0)
if len(menu_parts) > 1:
menu_name = menu_parts
elif menu_parts:
menu_name = menu_parts[0]
if menu_name:
if isinstance(menu_name, list):
menu_name = [name.replace("@TEMPSLASH@", "\\") for name in menu_name]
else:
menu_name = menu_name.replace("@TEMPSLASH@", "\\")
if menu_title:
menu_title = menu_title.replace("@TEMPSLASH@", "\\")
return menu_title, menu_name
@staticmethod
def add_item(menu_path: str, on_click: Callable=None, toggle: bool=False, priority: int=0, value: bool=False, enabled: bool=True, original_svg_color: bool=False, auto_release=True):
if not EditorMenu.omni_kit_menu_utils_loaded:
carb.log_warn(f"omni.kit.menu.utils not loaded for add_item({EditorMenu.clean_menu_path(menu_path)}) - Extension needs dependency to omni.kit.menu.utils")
return
import omni.kit.menu.utils
if EditorMenu.setup_hook == False:
omni.kit.menu.utils.add_hook(EditorMenu.sort_menu_hook)
EditorMenu.setup_hook = True
menu_title, menu_name = EditorMenu.split_menu_path(menu_path)
menu, menuitem = EditorMenu.convert_to_new_menu(menu_path, menu_name, on_click, toggle, priority, value, enabled, original_svg_color)
EditorMenu.active_menus[menu_path] = (menu, menuitem)
omni.kit.menu.utils.add_menu_items([menu], menu_title)
# disabled for fastShutdown as auto-release causes exceptions on shutdown, so editor_menus may leak as most are not removed
if auto_release:
return EditorMenu.EditorMenuItem(menu_path)
return menu_path
@staticmethod
def set_on_click(menu_path: str, on_click: Callable=None):
if not EditorMenu.omni_kit_menu_utils_loaded:
carb.log_warn(f"omni.kit.menu.utils not loaded for set_on_click({EditorMenu.clean_menu_path(menu_path)}) - Extension needs dependency to omni.kit.menu.utils")
return
import omni.kit.menu.utils
action_name = EditorMenu.get_action_name(menu_path)
if menu_path in EditorMenu.active_menus:
import omni.kit.actions.core
omni.kit.actions.core.get_action_registry().deregister_action(
extension_id,
action_name
)
if on_click:
omni.kit.actions.core.get_action_registry().register_action(
extension_id,
action_name,
lambda: on_click(menu_path, EditorMenu.toggle_value(menu_path)),
display_name=action_name,
description=action_name,
tag=action_name,
)
menu_title, menu_name = EditorMenu.split_menu_path(menu_path)
menu, menuitem = EditorMenu.active_menus[menu_path]
omni.kit.menu.utils.remove_menu_items([menu], menu_title)
menuitem.onclick_action = None
if on_click:
menuitem.onclick_action=(extension_id, action_name)
omni.kit.menu.utils.add_menu_items([menu], menu_title)
return None
carb.log_warn(f"set_on_click menu {EditorMenu.clean_menu_path(menu_path)} not found")
return None
@staticmethod
def remove_item(menu_path: str):
if not EditorMenu.omni_kit_menu_utils_loaded:
carb.log_warn(f"omni.kit.menu.utils not loaded for remove_item({EditorMenu.clean_menu_path(menu_path)}) - Extension needs dependency to omni.kit.menu.utils")
return
import omni.kit.menu.utils
import omni.kit.actions.core
if menu_path in EditorMenu.active_menus:
menu_title, menu_name = EditorMenu.split_menu_path(menu_path)
menu, menuitem = EditorMenu.active_menus[menu_path]
omni.kit.menu.utils.remove_menu_items([menu], menu_title)
del EditorMenu.active_menus[menu_path]
omni.kit.actions.core.get_action_registry().deregister_action(
extension_id,
EditorMenu.get_action_name(menu_path)
)
return None
carb.log_warn(f"remove_item menu {EditorMenu.clean_menu_path(menu_path)} not found")
return None
@staticmethod
def set_priority(menu_path: str, priority: int):
if not EditorMenu.omni_kit_menu_utils_loaded:
carb.log_warn(f"omni.kit.menu.utils not loaded for set_priority({EditorMenu.clean_menu_path(menu_path)}) - Extension needs dependency to omni.kit.menu.utils")
return
import omni.kit.menu.utils
menu_title_id, menu_name = EditorMenu.split_menu_path(menu_path)
if menu_title_id and not menu_name:
for menu_id in EditorMenu.active_menus:
menu_title, menu_name = EditorMenu.split_menu_path(menu_id)
if menu_title == menu_title_id:
menu, menuitem = EditorMenu.active_menus[menu_id]
omni.kit.menu.utils.remove_menu_items([menu], menu_title)
omni.kit.menu.utils.add_menu_items([menu], menu_title, priority)
return
if menu_path in EditorMenu.active_menus:
menu_title, menu_name = EditorMenu.split_menu_path(menu_path)
menu, menuitem = EditorMenu.active_menus[menu_path]
omni.kit.menu.utils.remove_menu_items([menu], menu_title)
menuitem.priority = priority
omni.kit.menu.utils.add_menu_items([menu], menu_title)
return
carb.log_warn(f"set_priority menu {EditorMenu.clean_menu_path(menu_path)} not found")
return
@staticmethod
def set_enabled(menu_path: str, enabled: bool):
if not EditorMenu.omni_kit_menu_utils_loaded:
return None
import omni.kit.menu.utils
if menu_path in EditorMenu.active_menus:
menu_title, menu_name = EditorMenu.split_menu_path(menu_path)
menu, menuitem = EditorMenu.active_menus[menu_path]
menuitem.enabled = enabled
return None
carb.log_warn(f"set_enabled menu {EditorMenu.clean_menu_path(menu_path)} not found")
return None
@staticmethod
def set_hotkey(menu_path: str, modifier: int, key: int):
if not EditorMenu.omni_kit_menu_utils_loaded:
carb.log_warn(f"omni.kit.menu.utils not loaded for set_hotkey({EditorMenu.clean_menu_path(menu_path)}) - Extension needs dependency to omni.kit.menu.utils")
return None
import omni.kit.menu.utils
if menu_path in EditorMenu.active_menus:
menu_title, menu_name = EditorMenu.split_menu_path(menu_path)
menu, menuitem = EditorMenu.active_menus[menu_path]
omni.kit.menu.utils.remove_menu_items([menu], menu_title)
menuitem.set_hotkey((modifier, key))
omni.kit.menu.utils.add_menu_items([menu], menu_title)
return None
carb.log_warn(f"set_hotkey menu {EditorMenu.clean_menu_path(menu_path)} not found")
return None
@staticmethod
def set_value(menu_path: str, value: bool):
if not EditorMenu.omni_kit_menu_utils_loaded:
carb.log_warn(f"omni.kit.menu.utils not loaded for set_value({EditorMenu.clean_menu_path(menu_path)}) - Extension needs dependency to omni.kit.menu.utils")
return None
import omni.kit.menu.utils
if menu_path in EditorMenu.active_menus:
menu_title, menu_name = EditorMenu.split_menu_path(menu_path)
menu, menuitem = EditorMenu.active_menus[menu_path]
if menuitem.ticked_value != value:
menuitem.ticked_value = value
omni.kit.menu.utils.refresh_menu_items(menu_title)
return None
carb.log_warn(f"set_value menu {EditorMenu.clean_menu_path(menu_path)} not found")
return None
@staticmethod
def get_value(menu_path: str):
if not EditorMenu.omni_kit_menu_utils_loaded:
carb.log_warn(f"omni.kit.menu.utils not loaded for get_value({EditorMenu.clean_menu_path(menu_path)}) - Extension needs dependency to omni.kit.menu.utils")
return None
if menu_path in EditorMenu.active_menus:
menu, menuitem = EditorMenu.active_menus[menu_path]
return menuitem.ticked_value
carb.log_warn(f"get_value menu {EditorMenu.clean_menu_path(menu_path)} not found")
return None
@staticmethod
def toggle_value(menu_path: str):
if not EditorMenu.omni_kit_menu_utils_loaded:
carb.log_warn(f"omni.kit.menu.utils not loaded for toggle_value({EditorMenu.clean_menu_path(menu_path)}) - Extension needs dependency to omni.kit.menu.utils")
return None
import omni.kit.menu.utils
if menu_path in EditorMenu.active_menus:
menu_title, menu_name = EditorMenu.split_menu_path(menu_path)
menu, menuitem = EditorMenu.active_menus[menu_path]
menuitem.ticked_value = not menuitem.ticked_value
omni.kit.menu.utils.refresh_menu_items(menu_title)
return menuitem.ticked_value
carb.log_warn(f"toggle_value menu {EditorMenu.clean_menu_path(menu_path)} not found")
return None
@staticmethod
def has_item(menu_path: str):
return (menu_path in EditorMenu.active_menus)
@staticmethod
def set_on_right_click(menu_path: str, on_click: Callable=None):
carb.log_warn(f"EditorMenu.set_on_right_click(menu_path='{EditorMenu.clean_menu_path(menu_path)}', on_click={on_click}) not supported")
return None
@staticmethod
def set_action(menu_path: str, action_mapping_path: str, action_name: str):
carb.log_warn(f"EditorMenu.set_action(menu_path='{EditorMenu.clean_menu_path(menu_path)}', action_mapping_path='{action_mapping_path}', action_name='{action_name}') not supported")
return None
@staticmethod
def add_action_to_menu(
menu_path: str,
on_action: Callable,
action_name: str = None,
default_hotkey: Tuple[int, int] = None,
on_rmb_click: Callable = None,
) -> None:
if not EditorMenu.omni_kit_menu_utils_loaded:
carb.log_warn(f"omni.kit.menu.utils not loaded for add_action_to_menu({EditorMenu.clean_menu_path(menu_path)}) - Extension needs dependency to omni.kit.menu.utils")
return None
import omni.kit.menu.utils
from omni.kit.menu.utils import MenuActionControl
if on_rmb_click:
carb.log_warn(f"add_action_to_menu {EditorMenu.clean_menu_path(menu_path)} on_rmb_click not supported")
if menu_path in EditorMenu.active_menus:
menu_title, menu_name = EditorMenu.split_menu_path(menu_path)
menu, menuitem = EditorMenu.active_menus[menu_path]
omni.kit.menu.utils.remove_menu_items([menu], menu_title)
action_name = EditorMenu.get_action_name(menu_path)
if on_action:
import omni.kit.actions.core
omni.kit.actions.core.get_action_registry().deregister_action(
extension_id,
action_name
)
omni.kit.actions.core.get_action_registry().register_action(
extension_id,
action_name,
on_action,
display_name=action_name,
description=action_name,
tag=action_name,
)
# HACK - async/frame delay breaks fullscreen mode
if action_name in ["action_editor_menu_bridge_window_fullscreen_mode"]:
menuitem.onclick_action=(extension_id, action_name, MenuActionControl.NODELAY)
else:
menuitem.onclick_action=(extension_id, action_name)
menuitem.set_hotkey(default_hotkey)
omni.kit.menu.utils.add_menu_items([menu], menu_title)
return None
carb.log_warn(f"add_action_to_menu menu {EditorMenu.clean_menu_path(menu_path)} not found")
return None
|
omniverse-code/kit/exts/omni.kit.renderer.imgui/omni/kit/ui/_ui.pyi | from __future__ import annotations
import omni.kit.ui._ui
import typing
import carb
import carb._carb
import carb.events._events
import omni.ui._ui
__all__ = [
"BroadcastModel",
"Button",
"CheckBox",
"ClippingType",
"CollapsingFrame",
"ColorRgb",
"ColorRgba",
"ColumnLayout",
"ComboBox",
"ComboBoxInt",
"Container",
"ContainerBase",
"ContentWindow",
"DelegateAction",
"DelegateResult",
"DockPreference",
"DragDouble",
"DragDouble2",
"DragDouble3",
"DragDouble4",
"DragInt",
"DragInt2",
"DragUInt",
"DraggingType",
"FieldDouble",
"FieldInt",
"FileDialogDataSource",
"FileDialogOpenMode",
"FileDialogSelectType",
"FilePicker",
"Image",
"Label",
"Length",
"ListBox",
"MODEL_META_SERIALIZED_CONTENTS",
"MODEL_META_WIDGET_TYPE",
"Mat44",
"Menu",
"MenuEventType",
"Model",
"ModelChangeInfo",
"ModelEventType",
"ModelNodeType",
"ModelWidget",
"Percent",
"Pixel",
"Popup",
"ProgressBar",
"RowColumnLayout",
"RowLayout",
"ScalarXYZ",
"ScalarXYZW",
"ScrollingFrame",
"Separator",
"SimpleTreeView",
"SimpleValueWidgetBool",
"SimpleValueWidgetColorRgb",
"SimpleValueWidgetColorRgba",
"SimpleValueWidgetDouble",
"SimpleValueWidgetDouble2",
"SimpleValueWidgetDouble3",
"SimpleValueWidgetDouble4",
"SimpleValueWidgetInt",
"SimpleValueWidgetInt2",
"SimpleValueWidgetMat44",
"SimpleValueWidgetString",
"SimpleValueWidgetUint",
"SliderDouble",
"SliderDouble2",
"SliderDouble3",
"SliderDouble4",
"SliderInt",
"SliderInt2",
"SliderUInt",
"Spacer",
"TextBox",
"Transform",
"UnitType",
"ValueWidgetBool",
"ValueWidgetColorRgb",
"ValueWidgetColorRgba",
"ValueWidgetDouble",
"ValueWidgetDouble2",
"ValueWidgetDouble3",
"ValueWidgetDouble4",
"ValueWidgetInt",
"ValueWidgetInt2",
"ValueWidgetMat44",
"ValueWidgetString",
"ValueWidgetUint",
"ViewCollapsing",
"ViewFlat",
"ViewTreeGrid",
"WINDOW_FLAGS_FORCE_HORIZONTAL_SCROLLBAR",
"WINDOW_FLAGS_FORCE_VERTICAL_SCROLLBAR",
"WINDOW_FLAGS_MODAL",
"WINDOW_FLAGS_NONE",
"WINDOW_FLAGS_NO_CLOSE",
"WINDOW_FLAGS_NO_COLLAPSE",
"WINDOW_FLAGS_NO_FOCUS_ON_APPEARING",
"WINDOW_FLAGS_NO_MOVE",
"WINDOW_FLAGS_NO_RESIZE",
"WINDOW_FLAGS_NO_SAVED_SETTINGS",
"WINDOW_FLAGS_NO_SCROLLBAR",
"WINDOW_FLAGS_NO_TITLE_BAR",
"WINDOW_FLAGS_SHOW_HORIZONTAL_SCROLLBAR",
"Widget",
"Window",
"WindowEventType",
"WindowMainStandalone",
"WindowStandalone",
"activate_menu_item",
"get_custom_glyph_code",
"get_editor_menu_legacy",
"get_main_window"
]
class BroadcastModel(Model):
def __init__(self) -> None: ...
def add_target(self, arg0: Model, arg1: str, arg2: str) -> int: ...
def remove_target(self, arg0: int) -> None: ...
pass
class Button(Label, Widget):
"""
Button Widget.
Args:
text (str): Text on button.
is_image (bool): Text is an image filename.
"""
def __init__(self, text: str = '', is_image: bool = False, default_color: int = 4294967295) -> None: ...
def set_clicked_fn(self, arg0: typing.Callable[[Widget], None]) -> None: ...
@property
def url(self) -> str:
"""
:type: str
"""
@url.setter
def url(self, arg1: str) -> None:
pass
pass
class CheckBox(SimpleValueWidgetBool, ValueWidgetBool, ModelWidget, Widget):
"""
CheckBox Widget.
Args:
text (str, default=""): Text on label.
value (bool, default=False): Initial value.
left_handed (bool, default=False): Initial value.
styled (bool, default=False): Initial value
"""
def __init__(self, text: str = '', value: bool = False, left_handed: bool = False, styled: bool = False) -> None: ...
@property
def styled(self) -> bool:
"""
:type: bool
"""
@styled.setter
def styled(self, arg0: bool) -> None:
pass
pass
class ClippingType():
"""
Supported text clipping types.
Members:
NONE
ELLIPSIS_LEFT
ELLIPSIS_RIGHT
WRAP
"""
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
"""
ELLIPSIS_LEFT: omni.kit.ui._ui.ClippingType # value = <ClippingType.ELLIPSIS_LEFT: 1>
ELLIPSIS_RIGHT: omni.kit.ui._ui.ClippingType # value = <ClippingType.ELLIPSIS_RIGHT: 2>
NONE: omni.kit.ui._ui.ClippingType # value = <ClippingType.NONE: 0>
WRAP: omni.kit.ui._ui.ClippingType # value = <ClippingType.WRAP: 3>
__members__: dict # value = {'NONE': <ClippingType.NONE: 0>, 'ELLIPSIS_LEFT': <ClippingType.ELLIPSIS_LEFT: 1>, 'ELLIPSIS_RIGHT': <ClippingType.ELLIPSIS_RIGHT: 2>, 'WRAP': <ClippingType.WRAP: 3>}
pass
class CollapsingFrame(Container, Widget):
def __init__(self, arg0: str, arg1: bool) -> None: ...
@property
def open(self) -> bool:
"""
:type: bool
"""
@open.setter
def open(self, arg1: bool) -> None:
pass
@property
def title(self) -> str:
"""
:type: str
"""
@title.setter
def title(self, arg1: str) -> None:
pass
@property
def use_frame_background_color(self) -> bool:
"""
:type: bool
"""
@use_frame_background_color.setter
def use_frame_background_color(self, arg1: bool) -> None:
pass
@property
def visible(self) -> bool:
"""
:type: bool
"""
@visible.setter
def visible(self, arg1: bool) -> None:
pass
pass
class ColorRgb(SimpleValueWidgetColorRgb, ValueWidgetColorRgb, ModelWidget, Widget):
"""
Color Picker Widget (Tuple[float, float, float]).
Args:
text (str, default=""): Text on label.
value (Tuple[float, float, float], default=(0.0, 0.0, 0.0)): Initial value.
"""
def __init__(self, text: str = '', value: carb._carb.ColorRgb = carb.ColorRgb(0,0,0)) -> None: ...
pass
class ColorRgba(SimpleValueWidgetColorRgba, ValueWidgetColorRgba, ModelWidget, Widget):
"""
Color Picker Widget (Tuple[float, float, float, float]).
Args:
text (str, default=""): Text on label.
value (Tuple[float, float, float, float], default=(0.0, 0.0, 0.0)): Initial value.
"""
def __init__(self, text: str = '', value: carb._carb.ColorRgba = carb.ColorRgba(0,0,0,0)) -> None: ...
pass
class ColumnLayout(Container, Widget):
def __init__(self, spacing: int = -1, padding_x: int = -1, padding_y: int = -1) -> None: ...
pass
class ComboBox(SimpleValueWidgetString, ValueWidgetString, ModelWidget, Widget):
"""
ComboBox Widget.
Args:
text (str, default=""): Text on label.
items (List[[str], default=[]): List of elements.
display_names (List[str], default=[]): List of element display names. Optional.
"""
def __init__(self, text: str = '', items: typing.List[str] = [], display_names: typing.List[str] = []) -> None: ...
def add_item(self, item: str, display_name: str = '') -> None: ...
def clear_items(self) -> None: ...
def get_item_at(self, arg0: int) -> str: ...
def get_item_count(self) -> int: ...
def remove_item(self, arg0: int) -> None: ...
def set_items(self, items: typing.List[str], display_names: typing.List[str] = []) -> None: ...
@property
def selected_index(self) -> int:
"""
:type: int
"""
@selected_index.setter
def selected_index(self, arg1: int) -> None:
pass
pass
class ComboBoxInt(SimpleValueWidgetInt, ValueWidgetInt, ModelWidget, Widget):
"""
ComboBox Widget.
Args:
text (str, default=""): Text on label.
items (List[[int], default=[]): List of elements.
display_names (List[int], default=[]): List of element display names. Optional.
"""
def __init__(self, text: str = '', items: typing.List[int] = [], display_names: typing.List[str] = []) -> None: ...
def add_item(self, item: int, display_name: str = '') -> None: ...
def clear_items(self) -> None: ...
def get_item_at(self, arg0: int) -> int: ...
def get_item_count(self) -> int: ...
def remove_item(self, arg0: int) -> None: ...
def set_items(self, items: typing.List[int], display_names: typing.List[str] = []) -> None: ...
@property
def selected_index(self) -> int:
"""
:type: int
"""
@selected_index.setter
def selected_index(self, arg1: int) -> None:
pass
pass
class Container(Widget):
"""
Base class for all UI containers. Container can hold arbitrary number of other :class:`.Widget` s
"""
def add_child(self, arg0: Widget) -> Widget: ...
def clear(self) -> None: ...
def get_child_at(self, arg0: int) -> Widget: ...
def get_child_count(self) -> int: ...
def remove_child(self, arg0: Widget) -> None: ...
@property
def child_spacing(self) -> carb._carb.Float2:
"""
:type: carb._carb.Float2
"""
@child_spacing.setter
def child_spacing(self, arg1: carb._carb.Float2) -> None:
pass
pass
class ContainerBase(Widget):
"""
Class for the complex widget that can have children, but doesn;t allow to add children for the external user.
"""
def draw(self, arg0: float) -> None: ...
pass
class ContentWindow(Widget):
"""
Content Window.
Content Window is container that hosts a file picker widget.
"""
@typing.overload
def __init__(self) -> None: ...
@typing.overload
def __init__(self, arg0: int, arg1: int) -> None: ...
def get_selected_icon_paths(self) -> tuple: ...
def get_selected_node_paths(self) -> tuple: ...
def navigate_to(self, arg0: str) -> None: ...
def refresh(self) -> None: ...
def set_filter(self, arg0: str) -> None: ...
pass
class DelegateAction():
"""
Members:
CREATE_DEFAULT_WIDGET
SKIP_KEY
USE_CUSTOM_WIDGET
"""
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
"""
CREATE_DEFAULT_WIDGET: omni.kit.ui._ui.DelegateAction # value = <DelegateAction.CREATE_DEFAULT_WIDGET: 0>
SKIP_KEY: omni.kit.ui._ui.DelegateAction # value = <DelegateAction.SKIP_KEY: 1>
USE_CUSTOM_WIDGET: omni.kit.ui._ui.DelegateAction # value = <DelegateAction.USE_CUSTOM_WIDGET: 2>
__members__: dict # value = {'CREATE_DEFAULT_WIDGET': <DelegateAction.CREATE_DEFAULT_WIDGET: 0>, 'SKIP_KEY': <DelegateAction.SKIP_KEY: 1>, 'USE_CUSTOM_WIDGET': <DelegateAction.USE_CUSTOM_WIDGET: 2>}
pass
class DelegateResult():
@typing.overload
def __init__(self) -> None: ...
@typing.overload
def __init__(self, arg0: typing.Sequence) -> None: ...
@typing.overload
def __init__(self, arg0: DelegateAction) -> None: ...
@typing.overload
def __init__(self, arg0: Widget) -> None: ...
@property
def action(self) -> DelegateAction:
"""
:type: DelegateAction
"""
@action.setter
def action(self, arg0: DelegateAction) -> None:
pass
@property
def custom_widget(self) -> Widget:
"""
:type: Widget
"""
@custom_widget.setter
def custom_widget(self, arg0: Widget) -> None:
pass
pass
class DockPreference():
"""
Members:
DISABLED
MAIN
RIGHT
LEFT
RIGHT_TOP
RIGHT_BOTTOM
LEFT_BOTTOM
"""
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
"""
DISABLED: omni.kit.ui._ui.DockPreference # value = <DockPreference.DISABLED: 0>
LEFT: omni.kit.ui._ui.DockPreference # value = <DockPreference.LEFT: 3>
LEFT_BOTTOM: omni.kit.ui._ui.DockPreference # value = <DockPreference.LEFT_BOTTOM: 6>
MAIN: omni.kit.ui._ui.DockPreference # value = <DockPreference.MAIN: 1>
RIGHT: omni.kit.ui._ui.DockPreference # value = <DockPreference.RIGHT: 2>
RIGHT_BOTTOM: omni.kit.ui._ui.DockPreference # value = <DockPreference.RIGHT_BOTTOM: 5>
RIGHT_TOP: omni.kit.ui._ui.DockPreference # value = <DockPreference.RIGHT_TOP: 4>
__members__: dict # value = {'DISABLED': <DockPreference.DISABLED: 0>, 'MAIN': <DockPreference.MAIN: 1>, 'RIGHT': <DockPreference.RIGHT: 2>, 'LEFT': <DockPreference.LEFT: 3>, 'RIGHT_TOP': <DockPreference.RIGHT_TOP: 4>, 'RIGHT_BOTTOM': <DockPreference.RIGHT_BOTTOM: 5>, 'LEFT_BOTTOM': <DockPreference.LEFT_BOTTOM: 6>}
pass
class DragDouble(SimpleValueWidgetDouble, ValueWidgetDouble, ModelWidget, Widget):
"""
Drag Widget (double).
If `min` >= `max` widget value has no bound.
Args:
text (str, default=""): Text on label.
value (double, default=0): Initial value.
min (double, default=0): Lower value limit.
max (double, default=0): Upper value limit.
drag_speed (float, default=1.0): Drag speed.
"""
def __init__(self, text: str = '', value: float = 0.0, min: float = 0, max: float = 0, drag_speed: float = 1.0) -> None: ...
@property
def drag_speed(self) -> float:
"""
:type: float
"""
@drag_speed.setter
def drag_speed(self, arg0: float) -> None:
pass
@property
def format(self) -> str:
"""
:type: str
"""
@format.setter
def format(self, arg0: str) -> None:
pass
@property
def max(self) -> float:
"""
:type: float
"""
@max.setter
def max(self, arg0: float) -> None:
pass
@property
def min(self) -> float:
"""
:type: float
"""
@min.setter
def min(self, arg0: float) -> None:
pass
pass
class DragDouble2(SimpleValueWidgetDouble2, ValueWidgetDouble2, ModelWidget, Widget):
"""
Drag Widget (Tuple[double, double]).
If `min` >= `max` widget value has no bound.
Args:
text (str, default=""): Text on label.
value (Tuple[double, double], default=0): Initial value.
min (double, default=0): Lower value limit.
max (double, default=0): Upper value limit.
drag_speed (float, default=1.0): Drag speed.
"""
def __init__(self, text: str = '', value: carb._carb.Double2 = carb.Double2(0,0), min: float = 0, max: float = 0, drag_speed: float = 1.0) -> None: ...
@property
def drag_speed(self) -> float:
"""
:type: float
"""
@drag_speed.setter
def drag_speed(self, arg0: float) -> None:
pass
@property
def format(self) -> str:
"""
:type: str
"""
@format.setter
def format(self, arg0: str) -> None:
pass
@property
def max(self) -> float:
"""
:type: float
"""
@max.setter
def max(self, arg0: float) -> None:
pass
@property
def min(self) -> float:
"""
:type: float
"""
@min.setter
def min(self, arg0: float) -> None:
pass
pass
class DragDouble3(SimpleValueWidgetDouble3, ValueWidgetDouble3, ModelWidget, Widget):
"""
Drag Widget (Tuple[double, double, double]).
If `min` >= `max` widget value has no bound.
Args:
text (str, default=""): Text on label.
value (Tuple[double, double, double], default=0): Initial value.
min (double, default=0): Lower value limit.
max (double, default=0): Upper value limit.
drag_speed (float, default=1.0): Drag speed.
"""
def __init__(self, text: str = '', value: carb._carb.Double3 = carb.Double3(0,0,0), min: float = 0, max: float = 0, drag_speed: float = 1.0) -> None: ...
@property
def drag_speed(self) -> float:
"""
:type: float
"""
@drag_speed.setter
def drag_speed(self, arg0: float) -> None:
pass
@property
def format(self) -> str:
"""
:type: str
"""
@format.setter
def format(self, arg0: str) -> None:
pass
@property
def max(self) -> float:
"""
:type: float
"""
@max.setter
def max(self, arg0: float) -> None:
pass
@property
def min(self) -> float:
"""
:type: float
"""
@min.setter
def min(self, arg0: float) -> None:
pass
pass
class DragDouble4(SimpleValueWidgetDouble4, ValueWidgetDouble4, ModelWidget, Widget):
"""
Drag Widget (Tuple[double, double, double, double]).
If `min` >= `max` widget value has no bound.
Args:
text (str, default=""): Text on label.
value (Tuple[double, double, double, double], default=0): Initial value.
min (double, default=0): Lower value limit.
max (double, default=0): Upper value limit.
drag_speed (float, default=1.0): Drag speed.
"""
def __init__(self, text: str = '', value: carb._carb.Double4 = carb.Double4(0,0,0,0), min: float = 0, max: float = 0, drag_speed: float = 1.0) -> None: ...
@property
def drag_speed(self) -> float:
"""
:type: float
"""
@drag_speed.setter
def drag_speed(self, arg0: float) -> None:
pass
@property
def format(self) -> str:
"""
:type: str
"""
@format.setter
def format(self, arg0: str) -> None:
pass
@property
def max(self) -> float:
"""
:type: float
"""
@max.setter
def max(self, arg0: float) -> None:
pass
@property
def min(self) -> float:
"""
:type: float
"""
@min.setter
def min(self, arg0: float) -> None:
pass
pass
class DragInt(SimpleValueWidgetInt, ValueWidgetInt, ModelWidget, Widget):
"""
Drag Widget (int).
If `min` >= `max` widget value has no bound.
Args:
text (str, default=""): Text on label.
value (int, default=0): Initial value.
min (int, default=0): Lower value limit.
max (int, default=0): Upper value limit.
drag_speed (float, default=1.0): Drag speed.
"""
def __init__(self, text: str = '', value: int = 0, min: int = 0, max: int = 0, drag_speed: float = 1.0) -> None: ...
@property
def drag_speed(self) -> float:
"""
:type: float
"""
@drag_speed.setter
def drag_speed(self, arg0: float) -> None:
pass
@property
def format(self) -> str:
"""
:type: str
"""
@format.setter
def format(self, arg0: str) -> None:
pass
@property
def max(self) -> int:
"""
:type: int
"""
@max.setter
def max(self, arg0: int) -> None:
pass
@property
def min(self) -> int:
"""
:type: int
"""
@min.setter
def min(self, arg0: int) -> None:
pass
pass
class DragInt2(SimpleValueWidgetInt2, ValueWidgetInt2, ModelWidget, Widget):
"""
Drag Widget (Tuple[int, int]).
If `min` >= `max` widget value has no bound.
Args:
text (str, default=""): Text on label.
value (Tuple[int, int], default=0): Initial value.
min (int, default=0): Lower value limit.
max (int, default=0): Upper value limit.
drag_speed (float, default=1.0): Drag speed.
"""
def __init__(self, text: str = '', value: carb._carb.Int2 = carb.Int2(0,0), min: int = 0, max: int = 0, drag_speed: float = 1.0) -> None: ...
@property
def drag_speed(self) -> float:
"""
:type: float
"""
@drag_speed.setter
def drag_speed(self, arg0: float) -> None:
pass
@property
def format(self) -> str:
"""
:type: str
"""
@format.setter
def format(self, arg0: str) -> None:
pass
@property
def max(self) -> int:
"""
:type: int
"""
@max.setter
def max(self, arg0: int) -> None:
pass
@property
def min(self) -> int:
"""
:type: int
"""
@min.setter
def min(self, arg0: int) -> None:
pass
pass
class DragUInt(SimpleValueWidgetUint, ValueWidgetUint, ModelWidget, Widget):
"""
Drag Widget (uint32_t).
If `min` >= `max` widget value has no bound.
Args:
text (str, default=""): Text on label.
value (uint32_t, default=0): Initial value.
min (uint32_t, default=0): Lower value limit.
max (uint32_t, default=0): Upper value limit.
drag_speed (float, default=1.0): Drag speed.
"""
def __init__(self, text: str = '', value: int = 0, min: int = 0, max: int = 0, drag_speed: float = 1.0) -> None: ...
@property
def drag_speed(self) -> float:
"""
:type: float
"""
@drag_speed.setter
def drag_speed(self, arg0: float) -> None:
pass
@property
def format(self) -> str:
"""
:type: str
"""
@format.setter
def format(self, arg0: str) -> None:
pass
@property
def max(self) -> int:
"""
:type: int
"""
@max.setter
def max(self, arg0: int) -> None:
pass
@property
def min(self) -> int:
"""
:type: int
"""
@min.setter
def min(self, arg0: int) -> None:
pass
pass
class DraggingType():
"""
Supported dragging types.
Members:
STARTED
STOPPED
"""
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
"""
STARTED: omni.kit.ui._ui.DraggingType # value = <DraggingType.STARTED: 0>
STOPPED: omni.kit.ui._ui.DraggingType # value = <DraggingType.STOPPED: 1>
__members__: dict # value = {'STARTED': <DraggingType.STARTED: 0>, 'STOPPED': <DraggingType.STOPPED: 1>}
pass
class FieldDouble(SimpleValueWidgetDouble, ValueWidgetDouble, ModelWidget, Widget):
"""
Field Widget (double).
Args:
text (str, default=""): Text on label.
value (double, default=0): Initial value.
step (double, default=1): Value step.
step_fast (double, default=100): Fast value step.
"""
def __init__(self, text: str = '', value: float = 0.0, step: float = 1, step_fast: float = 100) -> None: ...
@property
def format(self) -> str:
"""
:type: str
"""
@format.setter
def format(self, arg0: str) -> None:
pass
@property
def step(self) -> float:
"""
:type: float
"""
@step.setter
def step(self, arg0: float) -> None:
pass
@property
def step_fast(self) -> float:
"""
:type: float
"""
@step_fast.setter
def step_fast(self, arg0: float) -> None:
pass
pass
class FieldInt(SimpleValueWidgetInt, ValueWidgetInt, ModelWidget, Widget):
"""
Field Widget (int).
Args:
text (str, default=""): Text on label.
value (int, default=0): Initial value.
step (int, default=1): Value step.
step_fast (int, default=100): Fast value step.
"""
def __init__(self, text: str = '', value: int = 0, step: int = 1, step_fast: int = 100) -> None: ...
@property
def format(self) -> str:
"""
:type: str
"""
@format.setter
def format(self, arg0: str) -> None:
pass
@property
def step(self) -> int:
"""
:type: int
"""
@step.setter
def step(self, arg0: int) -> None:
pass
@property
def step_fast(self) -> int:
"""
:type: int
"""
@step_fast.setter
def step_fast(self, arg0: int) -> None:
pass
pass
class FileDialogDataSource():
"""
Data source of File Dialog.
Members:
LOCAL
OMNIVERSE
ALL
"""
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
"""
ALL: omni.kit.ui._ui.FileDialogDataSource # value = <FileDialogDataSource.ALL: 2>
LOCAL: omni.kit.ui._ui.FileDialogDataSource # value = <FileDialogDataSource.LOCAL: 0>
OMNIVERSE: omni.kit.ui._ui.FileDialogDataSource # value = <FileDialogDataSource.OMNIVERSE: 1>
__members__: dict # value = {'LOCAL': <FileDialogDataSource.LOCAL: 0>, 'OMNIVERSE': <FileDialogDataSource.OMNIVERSE: 1>, 'ALL': <FileDialogDataSource.ALL: 2>}
pass
class FileDialogOpenMode():
"""
Open mode of File Dialog.
Members:
OPEN
SAVE
"""
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
"""
OPEN: omni.kit.ui._ui.FileDialogOpenMode # value = <FileDialogOpenMode.OPEN: 0>
SAVE: omni.kit.ui._ui.FileDialogOpenMode # value = <FileDialogOpenMode.SAVE: 1>
__members__: dict # value = {'OPEN': <FileDialogOpenMode.OPEN: 0>, 'SAVE': <FileDialogOpenMode.SAVE: 1>}
pass
class FileDialogSelectType():
"""
File selection type of File Dialog.
Members:
FILE
DIRECTORY
ALL
"""
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
"""
ALL: omni.kit.ui._ui.FileDialogSelectType # value = <FileDialogSelectType.ALL: 2>
DIRECTORY: omni.kit.ui._ui.FileDialogSelectType # value = <FileDialogSelectType.DIRECTORY: 1>
FILE: omni.kit.ui._ui.FileDialogSelectType # value = <FileDialogSelectType.FILE: 0>
__members__: dict # value = {'FILE': <FileDialogSelectType.FILE: 0>, 'DIRECTORY': <FileDialogSelectType.DIRECTORY: 1>, 'ALL': <FileDialogSelectType.ALL: 2>}
pass
class FilePicker():
def __init__(self, title: str, mode: FileDialogOpenMode = FileDialogOpenMode.OPEN, file_type: FileDialogSelectType = FileDialogSelectType.FILE, on_file_selected: typing.Callable[[str], None] = None, on_dialog_cancelled: typing.Callable[[], None] = None, width: float = 800.0, height: float = 440.0) -> None: ...
def add_filter(self, arg0: str, arg1: str) -> None: ...
def clear_all_filters(self) -> None: ...
def is_visible(self) -> bool: ...
def set_current_directory(self, arg0: str) -> None: ...
def set_default_save_name(self, name: str) -> None:
"""
sets the default name to use for the filename on save dialogs.
This sets the default filename to be used when saving a file. This name will
be ignored if the dialog is not in @ref FileDialogOpenMode::eSave mode. The
given name will still be stored regardless. This default filename may omit
the file extension to take the extension from the current filter. If an
extension is explicitly given here, no extension will be appended regardless
of the current filter.
Args:
name: the default filename to use for this dialog. This may be None
or an empty string to use the USD stage's default prim name. In
this case, if the prim name cannot be retrieved, "Untitled" will
be used instead. If a non-empty string is given here, this will
always be used as the initial suggested filename.
Returns:
No return value.
"""
def set_dialog_cancelled_fn(self, arg0: typing.Callable[[], None]) -> None: ...
def set_file_selected_fn(self, arg0: typing.Callable[[str], None]) -> None: ...
def show(self, data_source: FileDialogDataSource = FileDialogDataSource.ALL) -> None: ...
@property
def selection_type(self) -> FileDialogSelectType:
"""
:type: FileDialogSelectType
"""
@selection_type.setter
def selection_type(self, arg1: FileDialogSelectType) -> None:
pass
@property
def title(self) -> str:
"""
:type: str
"""
@title.setter
def title(self, arg1: str) -> None:
pass
pass
class Image(Widget):
def __init__(self, url: str = '', width: int = 0, height: int = 0) -> None: ...
@property
def url(self) -> str:
"""
:type: str
"""
@url.setter
def url(self, arg1: str) -> None:
pass
pass
class Label(Widget):
"""
Label Widget.
Displays non-editable text.
Args:
text (str, default=""): Text to display.
"""
def __init__(self, text: str = '', useclipboard: bool = False, clippingmode: ClippingType = ClippingType.NONE, font_style: omni.ui._ui.FontStyle = FontStyle.NONE) -> None: ...
def reset_text_color(self) -> None: ...
def set_clicked_fn(self, arg0: typing.Callable[[Widget], None]) -> None: ...
def set_text_color(self, arg0: carb._carb.ColorRgba) -> None: ...
@property
def text(self) -> str:
"""
:type: str
"""
@text.setter
def text(self, arg1: str) -> None:
pass
@property
def tooltip(self) -> Widget:
"""
Widget to be shown when mouse is over the Widget as a tooltip
:type: Widget
"""
@tooltip.setter
def tooltip(self, arg0: Widget) -> None:
"""
Widget to be shown when mouse is over the Widget as a tooltip
"""
pass
class Length():
"""
Length.
Represents any length as a value and unit type.
Examples:
>>> l1 = omni.kit.ui.Length(250, omni.kit.ui.UnitType.PIXEL)
>>> l2 = omni.kit.ui.Pixel(250)
>>> l3 = omni.kit.ui.Percent(30)
`l1` and `l2` represent the same value: 250 in pixels.
`l3` is 30%.
"""
@typing.overload
def __init__(self) -> None: ...
@staticmethod
@typing.overload
def __init__(*args, **kwargs) -> typing.Any: ...
@typing.overload
def __init__(self, arg0: float) -> None: ...
@typing.overload
def __init__(self, arg0: int) -> None: ...
def __str__(self) -> str: ...
@property
def unit(self) -> omni::kit::ui::UnitType:
"""
(:obj:`.UnitType.`) Unit.
:type: omni::kit::ui::UnitType
"""
@unit.setter
def unit(self, arg0: omni::kit::ui::UnitType) -> None:
"""
(:obj:`.UnitType.`) Unit.
"""
@property
def value(self) -> float:
"""
(float) Value
:type: float
"""
@value.setter
def value(self, arg0: float) -> None:
"""
(float) Value
"""
pass
class ListBox(Label, Widget):
"""
ListBox Widget.
Args:
text (str, default=""): Text on label.
multi_select (bool, default=True): Multi selection enabled.
item_height_count (int, default=-1): Height in items.
items (List[str], default=[]): List of elements.
"""
def __init__(self, text: str = '', multi_select: bool = True, item_height_count: int = -1, items: typing.List[str] = []) -> None: ...
def add_item(self, arg0: str) -> None: ...
def clear_items(self) -> None: ...
def clear_selection(self) -> None: ...
def get_item_at(self, arg0: int) -> str: ...
def get_item_count(self) -> int: ...
def get_selected(self) -> typing.List[int]: ...
def remove_item(self, arg0: int) -> None: ...
def set_selected(self, arg0: int, arg1: bool) -> None: ...
def set_selection_changed_fn(self, arg0: typing.Callable[[Widget], None]) -> None: ...
@property
def item_height_count(self) -> int:
"""
:type: int
"""
@item_height_count.setter
def item_height_count(self, arg1: int) -> None:
pass
@property
def multi_select(self) -> bool:
"""
:type: bool
"""
@multi_select.setter
def multi_select(self, arg1: bool) -> None:
pass
pass
class Mat44():
@typing.overload
def __getitem__(self, arg0: int) -> float: ...
@typing.overload
def __getitem__(self, arg0: slice) -> list: ...
@typing.overload
def __init__(self) -> None: ...
@typing.overload
def __init__(self, arg0: typing.Sequence) -> None: ...
def __len__(self) -> int: ...
def __repr__(self) -> str: ...
@typing.overload
def __setitem__(self, arg0: int, arg1: float) -> None: ...
@typing.overload
def __setitem__(self, arg0: slice, arg1: typing.Sequence) -> None: ...
def __str__(self) -> str: ...
def get_row(self, arg0: int) -> carb._carb.Double4: ...
def set_row(self, arg0: int, arg1: carb._carb.Double4) -> carb._carb.Double4: ...
pass
class Menu(Widget):
"""
Menu.
"""
def __init__(self) -> None: ...
def add_item(self, menu_path: str, on_click: typing.Callable[[str, bool], None] = None, toggle: bool = False, priority: int = 0, value: bool = False, enabled: bool = True, original_svg_color: bool = False, auto_release: bool = True) -> carb._carb.Subscription: ...
def get_item_count(self) -> int: ...
def get_items(self) -> typing.List[str]: ...
def get_value(self, arg0: str) -> bool: ...
def has_item(self, arg0: str) -> bool: ...
def remove_item(self, arg0: str) -> None: ...
def set_action(self, arg0: str, arg1: str, arg2: str) -> None: ...
def set_enabled(self, arg0: str, arg1: bool) -> None: ...
def set_hotkey(self, menu_path: str, modifier: int, key: int) -> None:
"""
Set menu hotkey.
Args:
menu_path (str): Path to menu item.
modifier(int): Keyboard modifier from :mod:`carb.input`.
key(int): Keyboard key code from :class:`carb.input.KeyboardInput`.
"""
def set_on_click(self, menu_path: str, on_click: typing.Callable[[str, bool], None] = None) -> None: ...
def set_on_right_click(self, menu_path: str, on_click: typing.Callable[[str, bool], None] = None) -> None: ...
def set_priority(self, arg0: str, arg1: int) -> None: ...
def set_value(self, arg0: str, arg1: bool) -> None: ...
static_class = None
pass
class MenuEventType():
"""
menu operation results.
Members:
ACTIVATE
"""
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
"""
ACTIVATE: omni.kit.ui._ui.MenuEventType # value = <MenuEventType.ACTIVATE: 0>
__members__: dict # value = {'ACTIVATE': <MenuEventType.ACTIVATE: 0>}
pass
class Model():
def __init__(self) -> None: ...
def get_type(self, arg0: str, arg1: str) -> ModelNodeType: ...
def signal_change(self, path: str, meta: str = '', type: ModelEventType = ModelEventType.NODE_VALUE_CHANGE, sender: int = 0) -> None: ...
pass
class ModelChangeInfo():
def __init__(self) -> None: ...
@property
def sender(self) -> int:
"""
:type: int
"""
@sender.setter
def sender(self, arg0: int) -> None:
pass
@property
def transient(self) -> bool:
"""
:type: bool
"""
@transient.setter
def transient(self, arg0: bool) -> None:
pass
pass
class ModelEventType():
"""
Model event types.
Members:
NODE_ADD
NODE_REMOVE
NODE_TYPE_CHANGE
NODE_VALUE_CHANGE
"""
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
"""
NODE_ADD: omni.kit.ui._ui.ModelEventType # value = <ModelEventType.NODE_ADD: 0>
NODE_REMOVE: omni.kit.ui._ui.ModelEventType # value = <ModelEventType.NODE_REMOVE: 1>
NODE_TYPE_CHANGE: omni.kit.ui._ui.ModelEventType # value = <ModelEventType.NODE_TYPE_CHANGE: 2>
NODE_VALUE_CHANGE: omni.kit.ui._ui.ModelEventType # value = <ModelEventType.NODE_VALUE_CHANGE: 3>
__members__: dict # value = {'NODE_ADD': <ModelEventType.NODE_ADD: 0>, 'NODE_REMOVE': <ModelEventType.NODE_REMOVE: 1>, 'NODE_TYPE_CHANGE': <ModelEventType.NODE_TYPE_CHANGE: 2>, 'NODE_VALUE_CHANGE': <ModelEventType.NODE_VALUE_CHANGE: 3>}
pass
class ModelNodeType():
"""
Model node types.
Members:
UNKNOWN
OBJECT
ARRAY
STRING
BOOL
NUMBER
"""
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
"""
ARRAY: omni.kit.ui._ui.ModelNodeType # value = <ModelNodeType.ARRAY: 2>
BOOL: omni.kit.ui._ui.ModelNodeType # value = <ModelNodeType.BOOL: 4>
NUMBER: omni.kit.ui._ui.ModelNodeType # value = <ModelNodeType.NUMBER: 5>
OBJECT: omni.kit.ui._ui.ModelNodeType # value = <ModelNodeType.OBJECT: 1>
STRING: omni.kit.ui._ui.ModelNodeType # value = <ModelNodeType.STRING: 3>
UNKNOWN: omni.kit.ui._ui.ModelNodeType # value = <ModelNodeType.UNKNOWN: 0>
__members__: dict # value = {'UNKNOWN': <ModelNodeType.UNKNOWN: 0>, 'OBJECT': <ModelNodeType.OBJECT: 1>, 'ARRAY': <ModelNodeType.ARRAY: 2>, 'STRING': <ModelNodeType.STRING: 3>, 'BOOL': <ModelNodeType.BOOL: 4>, 'NUMBER': <ModelNodeType.NUMBER: 5>}
pass
class ModelWidget(Widget):
"""
Model Widget.
"""
def get_model(self) -> Model: ...
def get_model_root(self) -> str: ...
def get_model_stream(self) -> carb.events._events.IEventStream: ...
def set_model(self, model: Model, root: str = '', isTimeSampled: bool = False, value: float = -1.0) -> None: ...
@property
def is_time_sampled_widget(self) -> bool:
"""
:type: bool
"""
@property
def time_code(self) -> float:
"""
:type: float
"""
pass
class Percent(Length):
"""
Convenience class to express :class:`.Length` in percents.
"""
def __init__(self, arg0: float) -> None: ...
pass
class Pixel(Length):
"""
Convenience class to express :class:`.Length` in pixels.
"""
def __init__(self, arg0: float) -> None: ...
pass
class Popup():
def __init__(self, title: str, modal: bool = False, width: float = 0.0, height: float = 0.0, auto_resize: bool = False) -> None: ...
def hide(self) -> None: ...
def is_visible(self) -> bool: ...
def set_close_fn(self, arg0: typing.Callable[[], None]) -> None: ...
def set_update_fn(self, arg0: typing.Callable[[float], None]) -> None: ...
def show(self) -> None: ...
@property
def height(self) -> float:
"""
:type: float
"""
@height.setter
def height(self, arg1: float) -> None:
pass
@property
def layout(self) -> Container:
"""
:type: Container
"""
@layout.setter
def layout(self, arg1: Container) -> None:
pass
@property
def pos(self) -> carb._carb.Float2:
"""
:type: carb._carb.Float2
"""
@pos.setter
def pos(self, arg1: carb._carb.Float2) -> None:
pass
@property
def title(self) -> str:
"""
:type: str
"""
@title.setter
def title(self, arg1: str) -> None:
pass
@property
def width(self) -> float:
"""
:type: float
"""
@width.setter
def width(self, arg1: float) -> None:
pass
pass
class ProgressBar(Widget):
"""
ProgressBar Widget.
Displays a progress bar.
Args:
width (:class:`.Length`): Width.
height (:class:`.Length`, default=omni.kit.ui.Pixel(0)): Height.
"""
@typing.overload
def __init__(self, width: Length, height: Length = ...) -> None: ...
@typing.overload
def __init__(self, width: float) -> None: ...
def set_progress(self, value: float, text: str = None) -> None: ...
@property
def overlay(self) -> str:
"""
:type: str
"""
@overlay.setter
def overlay(self, arg1: str) -> None:
pass
@property
def progress(self) -> float:
"""
:type: float
"""
@progress.setter
def progress(self, arg1: float) -> None:
pass
pass
class RowColumnLayout(Container, Widget):
def __init__(self, column_count: int, borders: bool = False) -> None: ...
def get_column_width(self, arg0: int) -> Length: ...
def set_column_width(self, index: int, val: object, min: float = 0.0, max: float = 0.0) -> None:
"""
Set column width.
Args:
index: column index.
val: width value. Should be either a :class:`.Length` or `float` (treated as :class:`.Pixel` length).
"""
pass
class RowLayout(Container, Widget):
def __init__(self) -> None: ...
pass
class ScalarXYZ(ValueWidgetDouble3, ModelWidget, Widget):
"""
ScalarXYZ Widget.
If `min` >= `max` widget value has no bound.
Args:
format_string (str, default="%0.1f"): Format string.
drag_speed (float, default=1.0): Drag speed.
value_wrap (float, default=0.0): Value wrap.
min (double, default=0.0): Lower value limit.
max (double, default=0.0): Upper value limit.
value (Tuple[double, double, double], default=(0, 0, 0)): Initial value.
"""
def __init__(self, format_string: str = '%0.1f', drag_speed: float = 1.0, wrap_value: float = 0.0, min: float = 0.0, max: float = 0.0, dead_zone: float = 0.0, value: carb._carb.Double3 = carb.Double3(0,0,0)) -> None: ...
def skip_ypos_update(self, arg0: bool) -> None: ...
pass
class ScalarXYZW(ValueWidgetDouble4, ModelWidget, Widget):
"""
ScalarXYZW Widget.
If `min` >= `max` widget value has no bound.
Args:
format_string (str, default="%0.1f"): Format string.
drag_speed (float, default=1.0): Drag speed.
value_wrap (float, default=0.0): Value wrap.
min (double, default=0.0): Lower value limit.
max (double, default=0.0): Upper value limit.
value (Tuple[double, double, double, double], default=(0, 0, 0, 0)): Initial value.
"""
def __init__(self, format_string: str = '%0.1f', drag_speed: float = 1.0, wrap_value: float = 0.0, min: float = 0.0, max: float = 0.0, value: carb._carb.Double4 = carb.Double4(0,0,0,0)) -> None: ...
pass
class ScrollingFrame(Container, Widget):
def __init__(self, arg0: str, arg1: float, arg2: float) -> None: ...
def scroll_to(self, arg0: float) -> None: ...
pass
class Separator(Widget):
"""
Separator.
Separator UI element.
"""
def __init__(self) -> None: ...
pass
class SimpleTreeView(Widget):
"""
SimpleTreeView Widget.
Args:
items (List[str], default=[]): List of string as the source of the Tree hierarchy.
separator(str, default='/'): A string separator to parse the strings into tree node tokens
"""
def __init__(self, items: typing.List[str] = [], separator: str = '/') -> None: ...
def clear_selection(self) -> None: ...
def get_selected_item_name(self) -> str: ...
def set_clicked_fn(self, arg0: typing.Callable[[Widget], None]) -> None: ...
def set_tree_data(self, arg0: typing.List[str]) -> None: ...
pass
class SimpleValueWidgetBool(ValueWidgetBool, ModelWidget, Widget):
"""
Model Widget with single value for simple controls.
"""
@property
def left_handed(self) -> bool:
"""
:type: bool
"""
@left_handed.setter
def left_handed(self, arg0: bool) -> None:
pass
@property
def text(self) -> str:
"""
:type: str
"""
@text.setter
def text(self, arg0: str) -> None:
pass
@property
def tooltip(self) -> Widget:
"""
Widget to be shown when mouse is over the Widget as a tooltip.
:type: Widget
"""
@tooltip.setter
def tooltip(self, arg0: Widget) -> None:
"""
Widget to be shown when mouse is over the Widget as a tooltip.
"""
pass
class SimpleValueWidgetColorRgb(ValueWidgetColorRgb, ModelWidget, Widget):
"""
Model Widget with single value for simple controls.
"""
@property
def left_handed(self) -> bool:
"""
:type: bool
"""
@left_handed.setter
def left_handed(self, arg0: bool) -> None:
pass
@property
def text(self) -> str:
"""
:type: str
"""
@text.setter
def text(self, arg0: str) -> None:
pass
@property
def tooltip(self) -> Widget:
"""
Widget to be shown when mouse is over the Widget as a tooltip.
:type: Widget
"""
@tooltip.setter
def tooltip(self, arg0: Widget) -> None:
"""
Widget to be shown when mouse is over the Widget as a tooltip.
"""
pass
class SimpleValueWidgetColorRgba(ValueWidgetColorRgba, ModelWidget, Widget):
"""
Model Widget with single value for simple controls.
"""
@property
def left_handed(self) -> bool:
"""
:type: bool
"""
@left_handed.setter
def left_handed(self, arg0: bool) -> None:
pass
@property
def text(self) -> str:
"""
:type: str
"""
@text.setter
def text(self, arg0: str) -> None:
pass
@property
def tooltip(self) -> Widget:
"""
Widget to be shown when mouse is over the Widget as a tooltip.
:type: Widget
"""
@tooltip.setter
def tooltip(self, arg0: Widget) -> None:
"""
Widget to be shown when mouse is over the Widget as a tooltip.
"""
pass
class SimpleValueWidgetDouble(ValueWidgetDouble, ModelWidget, Widget):
"""
Model Widget with single value for simple controls.
"""
@property
def left_handed(self) -> bool:
"""
:type: bool
"""
@left_handed.setter
def left_handed(self, arg0: bool) -> None:
pass
@property
def text(self) -> str:
"""
:type: str
"""
@text.setter
def text(self, arg0: str) -> None:
pass
@property
def tooltip(self) -> Widget:
"""
Widget to be shown when mouse is over the Widget as a tooltip.
:type: Widget
"""
@tooltip.setter
def tooltip(self, arg0: Widget) -> None:
"""
Widget to be shown when mouse is over the Widget as a tooltip.
"""
pass
class SimpleValueWidgetDouble2(ValueWidgetDouble2, ModelWidget, Widget):
"""
Model Widget with single value for simple controls.
"""
@property
def left_handed(self) -> bool:
"""
:type: bool
"""
@left_handed.setter
def left_handed(self, arg0: bool) -> None:
pass
@property
def text(self) -> str:
"""
:type: str
"""
@text.setter
def text(self, arg0: str) -> None:
pass
@property
def tooltip(self) -> Widget:
"""
Widget to be shown when mouse is over the Widget as a tooltip.
:type: Widget
"""
@tooltip.setter
def tooltip(self, arg0: Widget) -> None:
"""
Widget to be shown when mouse is over the Widget as a tooltip.
"""
pass
class SimpleValueWidgetDouble3(ValueWidgetDouble3, ModelWidget, Widget):
"""
Model Widget with single value for simple controls.
"""
@property
def left_handed(self) -> bool:
"""
:type: bool
"""
@left_handed.setter
def left_handed(self, arg0: bool) -> None:
pass
@property
def text(self) -> str:
"""
:type: str
"""
@text.setter
def text(self, arg0: str) -> None:
pass
@property
def tooltip(self) -> Widget:
"""
Widget to be shown when mouse is over the Widget as a tooltip.
:type: Widget
"""
@tooltip.setter
def tooltip(self, arg0: Widget) -> None:
"""
Widget to be shown when mouse is over the Widget as a tooltip.
"""
pass
class SimpleValueWidgetDouble4(ValueWidgetDouble4, ModelWidget, Widget):
"""
Model Widget with single value for simple controls.
"""
@property
def left_handed(self) -> bool:
"""
:type: bool
"""
@left_handed.setter
def left_handed(self, arg0: bool) -> None:
pass
@property
def text(self) -> str:
"""
:type: str
"""
@text.setter
def text(self, arg0: str) -> None:
pass
@property
def tooltip(self) -> Widget:
"""
Widget to be shown when mouse is over the Widget as a tooltip.
:type: Widget
"""
@tooltip.setter
def tooltip(self, arg0: Widget) -> None:
"""
Widget to be shown when mouse is over the Widget as a tooltip.
"""
pass
class SimpleValueWidgetInt(ValueWidgetInt, ModelWidget, Widget):
"""
Model Widget with single value for simple controls.
"""
@property
def left_handed(self) -> bool:
"""
:type: bool
"""
@left_handed.setter
def left_handed(self, arg0: bool) -> None:
pass
@property
def text(self) -> str:
"""
:type: str
"""
@text.setter
def text(self, arg0: str) -> None:
pass
@property
def tooltip(self) -> Widget:
"""
Widget to be shown when mouse is over the Widget as a tooltip.
:type: Widget
"""
@tooltip.setter
def tooltip(self, arg0: Widget) -> None:
"""
Widget to be shown when mouse is over the Widget as a tooltip.
"""
pass
class SimpleValueWidgetInt2(ValueWidgetInt2, ModelWidget, Widget):
"""
Model Widget with single value for simple controls.
"""
@property
def left_handed(self) -> bool:
"""
:type: bool
"""
@left_handed.setter
def left_handed(self, arg0: bool) -> None:
pass
@property
def text(self) -> str:
"""
:type: str
"""
@text.setter
def text(self, arg0: str) -> None:
pass
@property
def tooltip(self) -> Widget:
"""
Widget to be shown when mouse is over the Widget as a tooltip.
:type: Widget
"""
@tooltip.setter
def tooltip(self, arg0: Widget) -> None:
"""
Widget to be shown when mouse is over the Widget as a tooltip.
"""
pass
class SimpleValueWidgetMat44(ValueWidgetMat44, ModelWidget, Widget):
"""
Model Widget with single value for simple controls.
"""
@property
def left_handed(self) -> bool:
"""
:type: bool
"""
@left_handed.setter
def left_handed(self, arg0: bool) -> None:
pass
@property
def text(self) -> str:
"""
:type: str
"""
@text.setter
def text(self, arg0: str) -> None:
pass
@property
def tooltip(self) -> Widget:
"""
Widget to be shown when mouse is over the Widget as a tooltip.
:type: Widget
"""
@tooltip.setter
def tooltip(self, arg0: Widget) -> None:
"""
Widget to be shown when mouse is over the Widget as a tooltip.
"""
pass
class SimpleValueWidgetString(ValueWidgetString, ModelWidget, Widget):
"""
Model Widget with single value for simple controls.
"""
@property
def left_handed(self) -> bool:
"""
:type: bool
"""
@left_handed.setter
def left_handed(self, arg0: bool) -> None:
pass
@property
def text(self) -> str:
"""
:type: str
"""
@text.setter
def text(self, arg0: str) -> None:
pass
@property
def tooltip(self) -> Widget:
"""
Widget to be shown when mouse is over the Widget as a tooltip.
:type: Widget
"""
@tooltip.setter
def tooltip(self, arg0: Widget) -> None:
"""
Widget to be shown when mouse is over the Widget as a tooltip.
"""
pass
class SimpleValueWidgetUint(ValueWidgetUint, ModelWidget, Widget):
"""
Model Widget with single value for simple controls.
"""
@property
def left_handed(self) -> bool:
"""
:type: bool
"""
@left_handed.setter
def left_handed(self, arg0: bool) -> None:
pass
@property
def text(self) -> str:
"""
:type: str
"""
@text.setter
def text(self, arg0: str) -> None:
pass
@property
def tooltip(self) -> Widget:
"""
Widget to be shown when mouse is over the Widget as a tooltip.
:type: Widget
"""
@tooltip.setter
def tooltip(self, arg0: Widget) -> None:
"""
Widget to be shown when mouse is over the Widget as a tooltip.
"""
pass
class SliderDouble(SimpleValueWidgetDouble, ValueWidgetDouble, ModelWidget, Widget):
"""
Slider Widget (double).
Args:
text (str, default=""): Text on label.
value (double, default=0): Initial value.
min (double, default=0): Lower value limit.
max (double, default=100): Upper value limit.
"""
def __init__(self, text: str = '', value: float = 0.0, min: float = 0, max: float = 100) -> None: ...
@property
def format(self) -> str:
"""
:type: str
"""
@format.setter
def format(self, arg0: str) -> None:
pass
@property
def max(self) -> float:
"""
:type: float
"""
@max.setter
def max(self, arg0: float) -> None:
pass
@property
def min(self) -> float:
"""
:type: float
"""
@min.setter
def min(self, arg0: float) -> None:
pass
@property
def power(self) -> float:
"""
:type: float
"""
@power.setter
def power(self, arg0: float) -> None:
pass
pass
class SliderDouble2(SimpleValueWidgetDouble2, ValueWidgetDouble2, ModelWidget, Widget):
"""
Slider Widget (Tuple[double, double]).
Args:
text (str, default=""): Text on label.
value (Tuple[double, double], default=0): Initial value.
min (Tuple[double, double], default=0): Lower value limit.
max (Tuple[double, double], default=100): Upper value limit.
"""
def __init__(self, text: str = '', value: carb._carb.Double2 = carb.Double2(0,0), min: float = 0, max: float = 100) -> None: ...
@property
def format(self) -> str:
"""
:type: str
"""
@format.setter
def format(self, arg0: str) -> None:
pass
@property
def max(self) -> float:
"""
:type: float
"""
@max.setter
def max(self, arg0: float) -> None:
pass
@property
def min(self) -> float:
"""
:type: float
"""
@min.setter
def min(self, arg0: float) -> None:
pass
@property
def power(self) -> float:
"""
:type: float
"""
@power.setter
def power(self, arg0: float) -> None:
pass
pass
class SliderDouble3(SimpleValueWidgetDouble3, ValueWidgetDouble3, ModelWidget, Widget):
"""
Slider Widget (Tuple[double, double, double]).
Args:
text (str, default=""): Text on label.
value (Tuple[double, double, double], default=0): Initial value.
min (Tuple[double, double, double], default=0): Lower value limit.
max (Tuple[double, double, double], default=100): Upper value limit.
"""
def __init__(self, text: str = '', value: carb._carb.Double3 = carb.Double3(0,0,0), min: float = 0, max: float = 100) -> None: ...
@property
def format(self) -> str:
"""
:type: str
"""
@format.setter
def format(self, arg0: str) -> None:
pass
@property
def max(self) -> float:
"""
:type: float
"""
@max.setter
def max(self, arg0: float) -> None:
pass
@property
def min(self) -> float:
"""
:type: float
"""
@min.setter
def min(self, arg0: float) -> None:
pass
@property
def power(self) -> float:
"""
:type: float
"""
@power.setter
def power(self, arg0: float) -> None:
pass
pass
class SliderDouble4(SimpleValueWidgetDouble4, ValueWidgetDouble4, ModelWidget, Widget):
"""
Slider Widget (Tuple[double, double, double, double]).
Args:
text (str, default=""): Text on label.
value (Tuple[double, double, double, double], default=0): Initial value.
min (Tuple[double, double, double, double], default=0): Lower value limit.
max (Tuple[double, double, double, double], default=100): Upper value limit.
"""
def __init__(self, text: str = '', value: carb._carb.Double4 = carb.Double4(0,0,0,0), min: float = 0, max: float = 100) -> None: ...
@property
def format(self) -> str:
"""
:type: str
"""
@format.setter
def format(self, arg0: str) -> None:
pass
@property
def max(self) -> float:
"""
:type: float
"""
@max.setter
def max(self, arg0: float) -> None:
pass
@property
def min(self) -> float:
"""
:type: float
"""
@min.setter
def min(self, arg0: float) -> None:
pass
@property
def power(self) -> float:
"""
:type: float
"""
@power.setter
def power(self, arg0: float) -> None:
pass
pass
class SliderInt(SimpleValueWidgetInt, ValueWidgetInt, ModelWidget, Widget):
"""
Slider Widget (int).
Args:
text (str, default=""): Text on label.
value (int, default=0): Initial value.
min (int, default=0): Lower value limit.
max (int, default=100): Upper value limit.
"""
def __init__(self, text: str = '', value: int = 0, min: int = 0, max: int = 100) -> None: ...
@property
def format(self) -> str:
"""
:type: str
"""
@format.setter
def format(self, arg0: str) -> None:
pass
@property
def max(self) -> int:
"""
:type: int
"""
@max.setter
def max(self, arg0: int) -> None:
pass
@property
def min(self) -> int:
"""
:type: int
"""
@min.setter
def min(self, arg0: int) -> None:
pass
@property
def power(self) -> float:
"""
:type: float
"""
@power.setter
def power(self, arg0: float) -> None:
pass
pass
class SliderInt2(SimpleValueWidgetInt2, ValueWidgetInt2, ModelWidget, Widget):
"""
Slider Widget (Tuple[int, int]).
Args:
text (str, default=""): Text on label.
value (Tuple[int, int], default=0): Initial value.
min (Tuple[int, int], default=0): Lower value limit.
max (Tuple[int, int], default=100): Upper value limit.
"""
def __init__(self, text: str = '', value: carb._carb.Int2 = carb.Int2(0,0), min: int = 0, max: int = 100) -> None: ...
@property
def format(self) -> str:
"""
:type: str
"""
@format.setter
def format(self, arg0: str) -> None:
pass
@property
def max(self) -> int:
"""
:type: int
"""
@max.setter
def max(self, arg0: int) -> None:
pass
@property
def min(self) -> int:
"""
:type: int
"""
@min.setter
def min(self, arg0: int) -> None:
pass
@property
def power(self) -> float:
"""
:type: float
"""
@power.setter
def power(self, arg0: float) -> None:
pass
pass
class SliderUInt(SimpleValueWidgetUint, ValueWidgetUint, ModelWidget, Widget):
"""
Slider Widget (uint32_t).
Args:
text (str, default=""): Text on label.
value (uint32_t, default=0): Initial value.
min (uint32_t, default=0): Lower value limit.
max (uint32_t, default=100): Upper value limit.
"""
def __init__(self, text: str = '', value: int = 0, min: int = 0, max: int = 100) -> None: ...
@property
def format(self) -> str:
"""
:type: str
"""
@format.setter
def format(self, arg0: str) -> None:
pass
@property
def max(self) -> int:
"""
:type: int
"""
@max.setter
def max(self, arg0: int) -> None:
pass
@property
def min(self) -> int:
"""
:type: int
"""
@min.setter
def min(self, arg0: int) -> None:
pass
@property
def power(self) -> float:
"""
:type: float
"""
@power.setter
def power(self, arg0: float) -> None:
pass
pass
class Spacer(Widget):
"""
Spacer.
Dummy UI element to fill in space.
Args:
width (:class:`.Length`): Width.
height (:class:`.Length`, default=omni.kit.ui.Pixel(0)): Height.
"""
@typing.overload
def __init__(self, width: Length, height: Length = ...) -> None: ...
@typing.overload
def __init__(self, width: float) -> None: ...
pass
class TextBox(ValueWidgetString, ModelWidget, Widget):
"""
TextBox Widget.
Displays editable text.
Args:
value (str, default=""): Initial text.
"""
@typing.overload
def __init__(self, value: str = '', hint: str = '', change_on_enter: bool = False) -> None: ...
@typing.overload
def __init__(self, value: str = '', change_on_enter: bool = False) -> None: ...
def reset_text_color(self) -> None: ...
def set_list_suggestions_fn(self, arg0: typing.Callable[[Widget, str], typing.List[str]]) -> None: ...
def set_text_changed_fn(self, arg0: typing.Callable[[Widget], None]) -> None: ...
def set_text_color(self, arg0: carb._carb.ColorRgba) -> None: ...
def set_text_finalized_fn(self, arg0: typing.Callable[[Widget], None]) -> None: ...
def text_width(self) -> float: ...
@property
def clipping_mode(self) -> ClippingType:
"""
:type: ClippingType
"""
@clipping_mode.setter
def clipping_mode(self, arg1: ClippingType) -> None:
pass
@property
def readonly(self) -> bool:
"""
:type: bool
"""
@readonly.setter
def readonly(self, arg1: bool) -> None:
pass
@property
def show_background(self) -> bool:
"""
:type: bool
"""
@show_background.setter
def show_background(self, arg1: bool) -> None:
pass
@property
def text(self) -> str:
"""
:type: str
"""
@text.setter
def text(self, arg1: str) -> None:
pass
pass
class Transform(ValueWidgetMat44, ModelWidget, Widget):
def __init__(self, position_format_string: str = '%0.1f', position_drag_speed: float = 1.0, position_wrap_value: float = 0.0, position_min: float = 0.0, position_max: float = 0.0, rotation_format_string: str = '%0.1f', rotation_drag_speed: float = 1.0, rotation_wrap_value: float = 0.0, rotation_min: float = 0.0, rotation_max: float = 0.0) -> None: ...
pass
class UnitType():
"""
Unit types.
Widths, heights or other UI length can be specified in pixels or relative to window (or child window) size.
Members:
PIXEL
PERCENT
"""
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
"""
PERCENT: omni.kit.ui._ui.UnitType # value = <UnitType.PERCENT: 1>
PIXEL: omni.kit.ui._ui.UnitType # value = <UnitType.PIXEL: 0>
__members__: dict # value = {'PIXEL': <UnitType.PIXEL: 0>, 'PERCENT': <UnitType.PERCENT: 1>}
pass
class ValueWidgetBool(ModelWidget, Widget):
"""
Model Widget with single value.
"""
def get_value_ambiguous(self) -> bool: ...
def set_on_changed_fn(self, fn: typing.Callable[[bool], None]) -> None:
"""
Set a callback function to be called when value changes.
Args:
fn: Function to be called when value changes. New value is passed into the function.
"""
def set_on_right_click_fn(self, fn: typing.Callable[[ValueWidgetBool], None]) -> None:
"""
Set a callback function to be called when right mouse button is clicked.
Args:
fn: Function to be called when right mouse button is clicked. ValueWidget is passed into the function.
"""
def set_value_ambiguous(self, arg0: bool) -> None: ...
@property
def value(self) -> bool:
"""
: Widget value property.
:type: bool
"""
@value.setter
def value(self, arg1: bool) -> None:
"""
: Widget value property.
"""
pass
class ValueWidgetColorRgb(ModelWidget, Widget):
"""
Model Widget with single value.
"""
def get_value_ambiguous(self) -> bool: ...
def set_on_changed_fn(self, fn: typing.Callable[[carb._carb.ColorRgb], None]) -> None:
"""
Set a callback function to be called when value changes.
Args:
fn: Function to be called when value changes. New value is passed into the function.
"""
def set_on_right_click_fn(self, fn: typing.Callable[[ValueWidgetColorRgb], None]) -> None:
"""
Set a callback function to be called when right mouse button is clicked.
Args:
fn: Function to be called when right mouse button is clicked. ValueWidget is passed into the function.
"""
def set_value_ambiguous(self, arg0: bool) -> None: ...
@property
def value(self) -> carb._carb.ColorRgb:
"""
: Widget value property.
:type: carb._carb.ColorRgb
"""
@value.setter
def value(self, arg1: carb._carb.ColorRgb) -> None:
"""
: Widget value property.
"""
pass
class ValueWidgetColorRgba(ModelWidget, Widget):
"""
Model Widget with single value.
"""
def get_value_ambiguous(self) -> bool: ...
def set_on_changed_fn(self, fn: typing.Callable[[carb._carb.ColorRgba], None]) -> None:
"""
Set a callback function to be called when value changes.
Args:
fn: Function to be called when value changes. New value is passed into the function.
"""
def set_on_right_click_fn(self, fn: typing.Callable[[ValueWidgetColorRgba], None]) -> None:
"""
Set a callback function to be called when right mouse button is clicked.
Args:
fn: Function to be called when right mouse button is clicked. ValueWidget is passed into the function.
"""
def set_value_ambiguous(self, arg0: bool) -> None: ...
@property
def value(self) -> carb._carb.ColorRgba:
"""
: Widget value property.
:type: carb._carb.ColorRgba
"""
@value.setter
def value(self, arg1: carb._carb.ColorRgba) -> None:
"""
: Widget value property.
"""
pass
class ValueWidgetDouble(ModelWidget, Widget):
"""
Model Widget with single value.
"""
def get_value_ambiguous(self) -> bool: ...
def set_on_changed_fn(self, fn: typing.Callable[[float], None]) -> None:
"""
Set a callback function to be called when value changes.
Args:
fn: Function to be called when value changes. New value is passed into the function.
"""
def set_on_right_click_fn(self, fn: typing.Callable[[ValueWidgetDouble], None]) -> None:
"""
Set a callback function to be called when right mouse button is clicked.
Args:
fn: Function to be called when right mouse button is clicked. ValueWidget is passed into the function.
"""
def set_value_ambiguous(self, arg0: bool) -> None: ...
@property
def value(self) -> float:
"""
: Widget value property.
:type: float
"""
@value.setter
def value(self, arg1: float) -> None:
"""
: Widget value property.
"""
pass
class ValueWidgetDouble2(ModelWidget, Widget):
"""
Model Widget with single value.
"""
def get_value_ambiguous(self) -> bool: ...
def set_on_changed_fn(self, fn: typing.Callable[[carb._carb.Double2], None]) -> None:
"""
Set a callback function to be called when value changes.
Args:
fn: Function to be called when value changes. New value is passed into the function.
"""
def set_on_right_click_fn(self, fn: typing.Callable[[ValueWidgetDouble2], None]) -> None:
"""
Set a callback function to be called when right mouse button is clicked.
Args:
fn: Function to be called when right mouse button is clicked. ValueWidget is passed into the function.
"""
def set_value_ambiguous(self, arg0: bool) -> None: ...
@property
def value(self) -> carb._carb.Double2:
"""
: Widget value property.
:type: carb._carb.Double2
"""
@value.setter
def value(self, arg1: carb._carb.Double2) -> None:
"""
: Widget value property.
"""
pass
class ValueWidgetDouble3(ModelWidget, Widget):
"""
Model Widget with single value.
"""
def get_value_ambiguous(self) -> bool: ...
def set_on_changed_fn(self, fn: typing.Callable[[carb._carb.Double3], None]) -> None:
"""
Set a callback function to be called when value changes.
Args:
fn: Function to be called when value changes. New value is passed into the function.
"""
def set_on_right_click_fn(self, fn: typing.Callable[[ValueWidgetDouble3], None]) -> None:
"""
Set a callback function to be called when right mouse button is clicked.
Args:
fn: Function to be called when right mouse button is clicked. ValueWidget is passed into the function.
"""
def set_value_ambiguous(self, arg0: bool) -> None: ...
@property
def value(self) -> carb._carb.Double3:
"""
: Widget value property.
:type: carb._carb.Double3
"""
@value.setter
def value(self, arg1: carb._carb.Double3) -> None:
"""
: Widget value property.
"""
pass
class ValueWidgetDouble4(ModelWidget, Widget):
"""
Model Widget with single value.
"""
def get_value_ambiguous(self) -> bool: ...
def set_on_changed_fn(self, fn: typing.Callable[[carb._carb.Double4], None]) -> None:
"""
Set a callback function to be called when value changes.
Args:
fn: Function to be called when value changes. New value is passed into the function.
"""
def set_on_right_click_fn(self, fn: typing.Callable[[ValueWidgetDouble4], None]) -> None:
"""
Set a callback function to be called when right mouse button is clicked.
Args:
fn: Function to be called when right mouse button is clicked. ValueWidget is passed into the function.
"""
def set_value_ambiguous(self, arg0: bool) -> None: ...
@property
def value(self) -> carb._carb.Double4:
"""
: Widget value property.
:type: carb._carb.Double4
"""
@value.setter
def value(self, arg1: carb._carb.Double4) -> None:
"""
: Widget value property.
"""
pass
class ValueWidgetInt(ModelWidget, Widget):
"""
Model Widget with single value.
"""
def get_value_ambiguous(self) -> bool: ...
def set_on_changed_fn(self, fn: typing.Callable[[int], None]) -> None:
"""
Set a callback function to be called when value changes.
Args:
fn: Function to be called when value changes. New value is passed into the function.
"""
def set_on_right_click_fn(self, fn: typing.Callable[[ValueWidgetInt], None]) -> None:
"""
Set a callback function to be called when right mouse button is clicked.
Args:
fn: Function to be called when right mouse button is clicked. ValueWidget is passed into the function.
"""
def set_value_ambiguous(self, arg0: bool) -> None: ...
@property
def value(self) -> int:
"""
: Widget value property.
:type: int
"""
@value.setter
def value(self, arg1: int) -> None:
"""
: Widget value property.
"""
pass
class ValueWidgetInt2(ModelWidget, Widget):
"""
Model Widget with single value.
"""
def get_value_ambiguous(self) -> bool: ...
def set_on_changed_fn(self, fn: typing.Callable[[carb._carb.Int2], None]) -> None:
"""
Set a callback function to be called when value changes.
Args:
fn: Function to be called when value changes. New value is passed into the function.
"""
def set_on_right_click_fn(self, fn: typing.Callable[[ValueWidgetInt2], None]) -> None:
"""
Set a callback function to be called when right mouse button is clicked.
Args:
fn: Function to be called when right mouse button is clicked. ValueWidget is passed into the function.
"""
def set_value_ambiguous(self, arg0: bool) -> None: ...
@property
def value(self) -> carb._carb.Int2:
"""
: Widget value property.
:type: carb._carb.Int2
"""
@value.setter
def value(self, arg1: carb._carb.Int2) -> None:
"""
: Widget value property.
"""
pass
class ValueWidgetMat44(ModelWidget, Widget):
"""
Model Widget with single value.
"""
def get_value_ambiguous(self) -> bool: ...
def set_on_changed_fn(self, fn: typing.Callable[[Mat44], None]) -> None:
"""
Set a callback function to be called when value changes.
Args:
fn: Function to be called when value changes. New value is passed into the function.
"""
def set_on_right_click_fn(self, fn: typing.Callable[[ValueWidgetMat44], None]) -> None:
"""
Set a callback function to be called when right mouse button is clicked.
Args:
fn: Function to be called when right mouse button is clicked. ValueWidget is passed into the function.
"""
def set_value_ambiguous(self, arg0: bool) -> None: ...
@property
def value(self) -> Mat44:
"""
: Widget value property.
:type: Mat44
"""
@value.setter
def value(self, arg1: Mat44) -> None:
"""
: Widget value property.
"""
pass
class ValueWidgetString(ModelWidget, Widget):
"""
Model Widget with single value.
"""
def get_value_ambiguous(self) -> bool: ...
def set_on_changed_fn(self, fn: typing.Callable[[str], None]) -> None:
"""
Set a callback function to be called when value changes.
Args:
fn: Function to be called when value changes. New value is passed into the function.
"""
def set_on_right_click_fn(self, fn: typing.Callable[[ValueWidgetString], None]) -> None:
"""
Set a callback function to be called when right mouse button is clicked.
Args:
fn: Function to be called when right mouse button is clicked. ValueWidget is passed into the function.
"""
def set_value_ambiguous(self, arg0: bool) -> None: ...
@property
def value(self) -> str:
"""
: Widget value property.
:type: str
"""
@value.setter
def value(self, arg1: str) -> None:
"""
: Widget value property.
"""
pass
class ValueWidgetUint(ModelWidget, Widget):
"""
Model Widget with single value.
"""
def get_value_ambiguous(self) -> bool: ...
def set_on_changed_fn(self, fn: typing.Callable[[int], None]) -> None:
"""
Set a callback function to be called when value changes.
Args:
fn: Function to be called when value changes. New value is passed into the function.
"""
def set_on_right_click_fn(self, fn: typing.Callable[[ValueWidgetUint], None]) -> None:
"""
Set a callback function to be called when right mouse button is clicked.
Args:
fn: Function to be called when right mouse button is clicked. ValueWidget is passed into the function.
"""
def set_value_ambiguous(self, arg0: bool) -> None: ...
@property
def value(self) -> int:
"""
: Widget value property.
:type: int
"""
@value.setter
def value(self, arg1: int) -> None:
"""
: Widget value property.
"""
pass
class ViewCollapsing(ModelWidget, Widget):
def __init__(self, defaultOpen: bool, sort: bool = False) -> None: ...
def set_filter(self, arg0: str) -> None: ...
@property
def use_frame_background_color(self) -> bool:
"""
:type: bool
"""
@use_frame_background_color.setter
def use_frame_background_color(self, arg1: bool) -> None:
pass
pass
class ViewFlat(ModelWidget, Widget):
def __init__(self, sort: bool = False) -> None: ...
def set_filter(self, arg0: str) -> int: ...
pass
class ViewTreeGrid(ModelWidget, Widget):
def __init__(self, default_open: bool, sort: bool = False, column_count: int = 1) -> None: ...
def get_header_cell_widget(self, arg0: int) -> Widget: ...
def set_build_cell_fn(self, arg0: typing.Callable[[Model, str, int, int], DelegateResult]) -> None: ...
def set_header_cell_text(self, arg0: int, arg1: str) -> None: ...
def set_header_cell_widget(self, arg0: int, arg1: Widget) -> None: ...
@property
def draw_table_header(self) -> bool:
"""
:type: bool
"""
@draw_table_header.setter
def draw_table_header(self, arg1: bool) -> None:
pass
@property
def is_root(self) -> bool:
"""
:type: bool
"""
@is_root.setter
def is_root(self, arg1: bool) -> None:
pass
@property
def text(self) -> str:
"""
:type: str
"""
@text.setter
def text(self, arg1: str) -> None:
pass
pass
class Widget():
"""
Widget.
Base class for all UI elements.
"""
def get_font_size(self) -> float: ...
def set_dragdrop_fn(self, arg0: typing.Callable[[Widget, str], None], arg1: str) -> None: ...
@staticmethod
def set_dragged_fn(*args, **kwargs) -> typing.Any: ...
@property
def enabled(self) -> bool:
"""
:type: bool
"""
@enabled.setter
def enabled(self, arg1: bool) -> None:
pass
@property
def font_style(self) -> omni.ui._ui.FontStyle:
"""
:type: omni.ui._ui.FontStyle
"""
@font_style.setter
def font_style(self, arg1: omni.ui._ui.FontStyle) -> None:
pass
@property
def height(self) -> Length:
"""
(:class:`.Length`, default=omni.kit.ui.Pixel(0)): Height.
:type: Length
"""
@height.setter
def height(self, arg1: object) -> None:
"""
(:class:`.Length`, default=omni.kit.ui.Pixel(0)): Height.
"""
@property
def user_data(self) -> dict:
"""
:class:`dict` with additional user data attached to widget. Lifetime of it depends on lifetime of the widget.
:type: dict
"""
@user_data.setter
def user_data(self, arg1: dict) -> None:
"""
:class:`dict` with additional user data attached to widget. Lifetime of it depends on lifetime of the widget.
"""
@property
def visible(self) -> bool:
"""
:type: bool
"""
@visible.setter
def visible(self, arg1: bool) -> None:
pass
@property
def width(self) -> Length:
"""
(:class:`.Length`, default=omni.kit.ui.Pixel(0)): Width.
:type: Length
"""
@width.setter
def width(self, arg1: object) -> None:
"""
(:class:`.Length`, default=omni.kit.ui.Pixel(0)): Width.
"""
pass
class Window():
"""
UI Window.
Window is a starting point for every new UI. It contains a :class:`.Container`, which can contain other :class:`.Widget`'s.
Args:
title (str): The title to be displayed on window title bar.
width (int, default=640): Window width in pixels.
height (int, default=480): Window height in pixels.
open (bool, default=True): Is window opened when created.
add_to_menu (bool, default=True): Create main menu item with this window in the Kit.
menu_path (str, default=""): Menu path if add_to_menu is True. If empty string is passed it is added under "Extensions" menu item.
is_toggle_menu (bool, default=True): Can menu item be toggled?
dock (:obj:`omni.ui.DockPreference`, default=LEFT_BOTTOM): Docking preference for a window, see :class:`.DockPreference`
flags (:obj:`omni.kit.ui.Window`, default=NONE): flags for a window, see :class:`.Window`
"""
def hide(self) -> None: ...
def is_modal(self) -> bool: ...
def is_visible(self) -> bool: ...
def set_alpha(self, arg0: float) -> None: ...
def set_size(self, arg0: int, arg1: int) -> None: ...
def set_update_fn(self, arg0: typing.Callable[[float], None]) -> None: ...
def set_visibility_changed_fn(self, arg0: typing.Callable[[bool], None]) -> None: ...
def show(self) -> None: ...
def title(self) -> str: ...
@property
def event_stream(self) -> carb.events._events.IEventStream:
"""
Event stream with events of type: :class:`.WindowEventType`
:type: carb.events._events.IEventStream
"""
@property
def flags(self) -> int:
"""
:type: int
"""
@flags.setter
def flags(self, arg1: int) -> None:
pass
@property
def height(self) -> int:
"""
:type: int
"""
@height.setter
def height(self, arg1: int) -> None:
pass
@property
def layout(self) -> Container:
"""
:type: Container
"""
@layout.setter
def layout(self, arg1: Container) -> None:
pass
@property
def menu(self) -> omni::kit::ui::Menu:
"""
Window optional menu bar.
:type: omni::kit::ui::Menu
"""
@menu.setter
def menu(self, arg0: omni::kit::ui::Menu) -> None:
"""
Window optional menu bar.
"""
@property
def mouse_pos(self) -> carb._carb.Float2:
"""
:type: carb._carb.Float2
"""
@property
def width(self) -> int:
"""
:type: int
"""
@width.setter
def width(self, arg1: int) -> None:
pass
pass
class WindowEventType():
"""
Members:
VISIBILITY_CHANGE
UPDATE
"""
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
"""
UPDATE: omni.kit.ui._ui.WindowEventType # value = <WindowEventType.UPDATE: 1>
VISIBILITY_CHANGE: omni.kit.ui._ui.WindowEventType # value = <WindowEventType.VISIBILITY_CHANGE: 0>
__members__: dict # value = {'VISIBILITY_CHANGE': <WindowEventType.VISIBILITY_CHANGE: 0>, 'UPDATE': <WindowEventType.UPDATE: 1>}
pass
class WindowMainStandalone(Container, Widget):
def __init__(self) -> None: ...
pass
class WindowStandalone(ContainerBase, Widget):
"""
UI Window.
Window is a starting point for every new UI. It contains a :class:`.Container`, which can contain other :class:`.Widget`'s.
Args:
title (str): The title to be displayed on window title bar.
width (int, default=640): Window width in pixels.
height (int, default=480): Window height in pixels.
open (bool, default=True): Is window opened when created.
add_to_menu (bool, default=True): Create main menu item with this window in the Kit.
menu_path (str, default=""): Menu path if add_to_menu is True. If empty string is passed it is added under "Extensions" menu item.
is_toggle_menu (bool, default=True): Can menu item be toggled?
dock (:obj:`omni.ui.DockPreference`, default=LEFT_BOTTOM): Docking preference for a window, see :class:`.DockPreference`
flags (:obj:`omni.kit.ui.Window`, default=NONE): flags for a window, see :class:`.Window`
"""
def __init__(self, title: str, width: int = 640, height: int = 480, open: bool = True, add_to_menu: bool = True, menu_path: str = '', is_toggle_menu: bool = True, dock: DockPreference = DockPreference.LEFT_BOTTOM, flags: int = 0) -> None: ...
def hide(self) -> None: ...
def is_visible(self) -> bool: ...
def set_alpha(self, arg0: float) -> None: ...
def set_size(self, arg0: int, arg1: int) -> None: ...
def set_update_fn(self, arg0: typing.Callable[[float], None]) -> None: ...
def set_visibility_changed_fn(self, arg0: typing.Callable[[bool], None]) -> None: ...
def show(self) -> None: ...
@property
def event_stream(self) -> carb.events._events.IEventStream:
"""
Event stream with events of type: :class:`.WindowEventType`
:type: carb.events._events.IEventStream
"""
@property
def flags(self) -> int:
"""
:type: int
"""
@flags.setter
def flags(self, arg1: int) -> None:
pass
@property
def height(self) -> int:
"""
:type: int
"""
@height.setter
def height(self, arg1: int) -> None:
pass
@property
def layout(self) -> Container:
"""
:type: Container
"""
@layout.setter
def layout(self, arg1: Container) -> None:
pass
@property
def menu(self) -> omni::kit::ui::Menu:
"""
Window optional menu bar.
:type: omni::kit::ui::Menu
"""
@menu.setter
def menu(self, arg0: omni::kit::ui::Menu) -> None:
"""
Window optional menu bar.
"""
@property
def mouse_pos(self) -> carb._carb.Float2:
"""
:type: carb._carb.Float2
"""
@property
def width(self) -> int:
"""
:type: int
"""
@width.setter
def width(self, arg1: int) -> None:
pass
pass
def activate_menu_item(arg0: str) -> None:
pass
def get_custom_glyph_code(file_path: str, font_style: omni.ui._ui.FontStyle = FontStyle.NORMAL) -> str:
"""
Get glyph code.
Args:
file_path (str): Path to svg file
font_style(:class:`.FontStyle`): font style to use.
"""
def get_editor_menu_legacy() -> Menu:
pass
def get_main_window(*args, **kwargs) -> typing.Any:
pass
MODEL_META_SERIALIZED_CONTENTS = 'serializedContents'
MODEL_META_WIDGET_TYPE = 'widgetType'
WINDOW_FLAGS_FORCE_HORIZONTAL_SCROLLBAR = 512
WINDOW_FLAGS_FORCE_VERTICAL_SCROLLBAR = 256
WINDOW_FLAGS_MODAL = 4096
WINDOW_FLAGS_NONE = 0
WINDOW_FLAGS_NO_CLOSE = 2048
WINDOW_FLAGS_NO_COLLAPSE = 16
WINDOW_FLAGS_NO_FOCUS_ON_APPEARING = 1024
WINDOW_FLAGS_NO_MOVE = 4
WINDOW_FLAGS_NO_RESIZE = 2
WINDOW_FLAGS_NO_SAVED_SETTINGS = 32
WINDOW_FLAGS_NO_SCROLLBAR = 8
WINDOW_FLAGS_NO_TITLE_BAR = 1
WINDOW_FLAGS_SHOW_HORIZONTAL_SCROLLBAR = 128
|
omniverse-code/kit/exts/omni.kit.renderer.imgui/omni/kit/ui/__init__.py | """UI Toolkit
Starting with the release 2020.1, Omniverse Kit UI Toolkit has been replaced by the alternative UI toolkit :mod:`Omni::UI <omni.ui>`. Currently the Omniverse Kit UI Toolkit is deprecated.
Omniverse Kit UI Toolkit is retained mode UI library which enables extending and changing Omniverse Kit look and feel in any direction.
It contains fundamental building primitives, like windows, containers, layouts, widgets. As well as additional API (built on top of it) to create widgets for USD attributes and omni.kit settings.
Typical example to create a window with a drag slider widget:
.. code-block::
import omni.kit.ui
window = omni.kit.ui.Window('My Window')
d = omni.kit.ui.DragDouble()
d.width = omni.kit.ui.Percent(30)
window.layout.add_child(d)
All objects are python-friendly reference counted object. You don't need to explicitly release or control lifetime. In the code example above `window` will be kept alive until `window` is released.
Core:
------
* :class:`.Window`
* :class:`.Popup`
* :class:`.Container`
* :class:`.Value`
* :class:`.Length`
* :class:`.UnitType`
* :class:`.Widget`
Widgets:
--------
* :class:`.Label`
* :class:`.Button`
* :class:`.Spacer`
* :class:`.CheckBox`
* :class:`.ComboBox`
* :class:`.ComboBoxInt`
* :class:`.ListBox`
* :class:`.SliderInt`
* :class:`.SliderDouble`
* :class:`.DragInt`
* :class:`.DragInt2`
* :class:`.DragDouble`
* :class:`.DragDouble2`
* :class:`.DragDouble3`
* :class:`.DragDouble4`
* :class:`.Transform`
* :class:`.FieldInt`
* :class:`.FieldDouble`
* :class:`.TextBox`
* :class:`.ColorRgb`
* :class:`.ColorRgba`
* :class:`.Image`
Containers:
-----------
* :class:`.ColumnLayout`
* :class:`.RowLayout`
* :class:`.RowColumnLayout`
* :class:`.CollapsingFrame`
* :class:`.ScrollingFrame`
"""
# This module depends on other modules. VSCode python language server scrapes modules in an isolated environment
# (ignoring PYTHONPATH set). import fails and for that we have separate code path to explicitly add it's folder to
# sys.path and import again.
try:
import weakref
import carb
import carb.dictionary
import omni.ui
except:
import os, sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..", "..")))
import weakref
import carb
import carb.dictionary
import omni.ui
from ._ui import *
from .editor_menu import EditorMenu
legacy_mode = False
def add_item_attached(self: _ui.Menu, *args, **kwargs):
subscription = self.add_item(*args, **kwargs)
self.user_data.setdefault("items", []).append(subscription)
return subscription
def create_window_hook(self, title:str, *args, **kwargs):
menu_path = None
add_to_menu = True
if "menu_path" in kwargs:
menu_path = kwargs["menu_path"]
kwargs["menu_path"] = ""
if "add_to_menu" in kwargs:
add_to_menu = kwargs["add_to_menu"]
kwargs["add_to_menu"] = False
Window.create_window_hook(self, title, *args, **kwargs)
if add_to_menu and not menu_path:
menu_path = f"Window/{title}"
if menu_path:
def on_window_click(visible, weak_window):
window = weak_window()
if window:
if visible:
window.show()
else:
window.hide()
def on_window_showhide(visible, weak_window):
window = weak_window()
if window:
Menu.static_class.set_value(menu_path, visible)
EditorMenu.window_handler[title] = omni.kit.ui.get_editor_menu().add_item(menu_path, on_click=lambda m, v, w=weakref.ref(self): on_window_click(v, w), toggle=True, value=self.is_visible())
self.set_visibility_changed_fn(lambda v, w=weakref.ref(self): on_window_showhide(v, w))
def get_editor_menu():
if legacy_mode:
return get_editor_menu_legacy()
elif Menu.static_class == None:
Menu.static_class = EditorMenu()
return Menu.static_class
def using_legacy_mode():
carb.log_warn(f"using_legacy_mode: function is depricated as it always return False")
return legacy_mode
def init_ui():
import carb.settings
import carb
# Avoid calling code below at documentation building time with try/catch
try:
settings = carb.settings.get_settings()
except RuntimeError:
return
if not legacy_mode:
if hasattr(Window, "create_window_hook"):
carb.log_warn(f"init_ui window hook already initialized")
else:
# hook into omni.kit.ui.window to override menu creation
Window.create_window_hook = Window.__init__
Window.__init__ = create_window_hook
Menu.static_class = None
Menu.add_item_attached = add_item_attached
Menu.get_editor_menu = get_editor_menu
Menu.using_legacy_mode = using_legacy_mode
init_ui()
|
omniverse-code/kit/exts/omni.kit.renderer.imgui/omni/kit/extensionwindow/__init__.py | from ._extensionwindow import *
|
omniverse-code/kit/exts/omni.kit.renderer.imgui/omni/kit/ui_windowmanager/__init__.py | from ._window_manager import *
|
omniverse-code/kit/exts/omni.kit.renderer.imgui/data/regions/japanese_extended.txt | 串乍乎乞云亙些什仇仔佃佼侠侭侶俄俣俺倦倶傭僅僑僻儲兇兎兜其冥冨凄凋凧函剃剥劃劉劫勃勾勿匂匙匝匪卜卦卿厨厩厭叉叛叢叩叱吃吊吋吠吻呆
呑呪咋咳咽哨哩唖唾喉喋喧喰嘗嘘嘩噂噌噛噸噺嚢圃坐坤坦垢埜埠埴埼堆堰堵堺塘塙塞填塵壕壬壷夙夷奄套妓妖妬妾姐姑姥姦姪姶娃娩娼婁嫉嬬嬰
孜宋宍宕宛寓寵尖尤尻屍屑屠屡岡岨岱峨峯崖嶋巷巾帖幌幡庇庖庚庵廓廟廠廻廼廿弄弗弛弼彊徽忽怨怯恢恰悉悶惚惹愈慾憐戊戎或戚戟戴托扮拭拶
按挨挫挺挽捉捌捗捧捲捻掠掩掬掴掻揃揖摸摺撒撚撞撫播撰撹擢擾斌斑斡斧斬斯昏昧晒晦曝曳曽曾杓杖杢杭杵杷枇枕柁柏柑柘柴柵柿栂栃栖栢栴桁
桓桔桝桧桶梁梗梯梱梶梼棉棲椀椅椙椛椴楕楚楢楯楳榊榎榔槌槍樋樗樟樫樵樽橡橿檎櫓櫛櫨欝歎此歪殆毘氾汎汝汲沃沌沓沫洛洩浬涌涛涜淀淋淘淫
淵渠湊湘湛溌溜溢溺漉漕漣潅潰澗澱濠濡瀕瀞瀦瀧灘灸灼烏烹焔焚煉煎煤煽熔燈燐燕燭爪爺牌牒牙牝牟牡牢牽犀狐狗狙狛狸狼狽猷獅玩珂珊珪琵琶
瓜瓢瓦甑甜甥畏畠畢畦畷畿疋疏疹痔痕痩癌盃盈瞥矧砥砦砧砺砿硯硲碇碍碓碕碗磐祁祇祢祷禦禰禽禾禿秤稗稽穆穎穐穿窄窟窪窺竃竪竺竿笈笠笥筈
筏筑箆箔箕箪箭箸篇篠篭簸簾籾粁粂粍粕粟粥糊糎糞糟糠紐綬綴綻緬縞繋繍纂纏罫罵羨翫翰而耽聯聾肋肘股肱肴脆脇脊腎腔腫腺腿膏膝膳膿臆臥臼
舘舛舵舷艮芥芦芭芯苅苓苔苛苧苫茨茸荊荏荻莫莱菅菟菩菰菱萄萎萱葎葛葡董葦葱葺蒋蒐蒙蒜蒲蓋蓑蓬蔀蔑蔓蔚蔭蔽蕃蕊蕎蕨蕩蕪薗薙薩薮薯藁藷
蘇虻蚤蛋蛎蛙蛤蛭蛸蛾蜂蜘蜜蝉蝋蝕蝦蝿螺蟹蟻袖袴袷裡裳裾襖覗訊訣註詑詣詫詮誰誹諌諏諜諦諺謂謎謬讃讐豹貌貰貼賂賎賑賭贋赫趨跨蹄蹟蹴躯
輯輿轍轟轡辻辿迂迄迦迩逗這逢逼遁遜遡鄭酋酎醍醐醒醗醤釆釘釜釦釧鈎鈷鉦鉾銚鋒鋤鋪鋲鋸錆錐錨錫鍋鍍鍔鍬鍵鍾鎗鎚鎧鏑鐙鐸鑓閃閏閤闇阜阪
陀隈隙雀雁雫靭鞄鞍鞘鞭韓韮頁頃頓頗頚頬頴顎顛飴餅餌餐饗馳馴駁駈駕騨骸髭魯鮒鮪鮫鮭鯖鯵鰍鰐鰭鰯鰹鰻鱈鱒鱗鳶鴇鴎鴛鴨鴫鴬鵜鵠鵡鷲鷺鹸
麓麹麺黍鼎鼠龍
|
omniverse-code/kit/exts/omni.kit.renderer.imgui/data/regions/japanese.txt | 一丁七万丈三上下不与丑且世丘丙丞両並中丸丹主乃久之乏乗乙九也乱乳乾亀了予争事二互五井亘亜亡交亥亦亨享京亭亮人仁今介仏仕他付仙代令
以仮仰仲件任企伊伍伎伏伐休会伝伯伴伶伸伺似伽但位低住佐佑体何余作佳併使侃例侍侑供依価侮侯侵便係促俊俗保信修俳俵俸倉個倍倒倖候借倣
値倫倭倹偉偏停健偲側偵偶偽傍傑傘備催債傷傾働像僕僚僧儀億儒償優允元兄充兆先光克免児党入全八公六共兵具典兼内円冊再冒冗写冠冬冴冶冷
准凌凍凜凝凡処凪凱凶凸凹出刀刃分切刈刊刑列初判別利到制刷券刺刻則削前剖剛剣剤副剰割創劇力功加劣助努励労効劾勁勅勇勉動勘務勝募勢勤
勧勲勺匁包化北匠匡匹区医匿十千升午半卑卒卓協南単博占卯印危即却卵卸厄厘厚原厳去参又及友双反収叔取受叙叡口古句只叫召可台史右叶号司
各合吉同名后吏吐向君吟否含吸吹吾呂呈呉告周味呼命和咲哀品哉員哲唄唆唇唐唯唱啄商問啓善喚喜喝喪喫喬営嗣嘆嘉嘱器噴嚇囚四回因団困囲図
固国圏園土圧在圭地坂均坊坑坪垂型垣埋城域執培基堀堂堅堕堤堪報場塀塁塊塑塔塗塚塩塾境墓増墜墨墳墾壁壇壊壌士壮声壱売変夏夕外多夜夢大
天太夫央失奇奈奉奎奏契奔奥奨奪奮女奴好如妃妄妊妙妥妨妹妻姉始姓委姫姻姿威娘娠娯婆婚婦婿媒媛嫁嫌嫡嬉嬢子孔字存孝孟季孤学孫宅宇守安
完宏宗官宙定宜宝実客宣室宥宮宰害宴宵家容宿寂寄寅密富寒寛寝察寡寧審寮寸寺対寿封専射将尉尊尋導小少尚尭就尺尼尽尾尿局居屈届屋展属層
履屯山岐岩岬岳岸峠峡峰島峻崇崎崚崩嵐嵩嵯嶺巌川州巡巣工左巧巨差己巳巴巻巽市布帆希帝帥師席帯帰帳常帽幅幕幣干平年幸幹幻幼幽幾庁広庄
床序底店府度座庫庭庶康庸廃廉廊延廷建弁弊式弐弓弔引弘弟弥弦弧弱張強弾当彗形彦彩彪彫彬彰影役彼往征径待律後徐徒従得御復循微徳徴徹心
必忌忍志忘忙応忠快念怒怖怜思怠急性怪恋恐恒恕恥恨恩恭息恵悌悔悟悠患悦悩悪悲悼情惇惑惜惟惣惨惰想愁愉意愚愛感慈態慌慎慕慢慣慧慨慮慰
慶憂憎憤憧憩憲憶憾懇懐懲懸成我戒戦戯戸戻房所扇扉手才打払扱扶批承技抄把抑投抗折抜択披抱抵抹押抽担拍拐拒拓拘拙招拝拠拡括拳拷拾持指
挑挙挟振挿捕捜捨据捷捺掃授掌排掘掛採探接控推措掲描提揚換握揮援揺損搬搭携搾摂摘摩撃撤撮撲擁操擦擬支改攻放政故敏救敗教敢散敦敬数整
敵敷文斉斎斐斗料斜斤斥断新方於施旅旋族旗既日旦旧旨早旬旭旺昂昆昇昌明易昔星映春昨昭是昴昼時晃晋晏晟晨晩普景晴晶智暁暇暉暑暖暗暢暦
暫暮暴曇曙曜曲更書曹替最月有朋服朔朕朗望朝期木未末本札朱朴机朽杉李杏材村杜束条来杯東松板析林枚果枝枠枢枯架柄柊某染柔柚柱柳査柾栄
栓栗栞校株核根格栽桂桃案桐桑桜桟梅梓梢梧梨械棄棋棒棚棟森棺椋植椎検椰椿楊楓楠業極楼楽概榛構様槙槻槽標模権横樹樺橋橘機檀欄欠次欣欧
欲欺欽款歌歓止正武歩歯歳歴死殉殊残殖殴段殺殻殿毅母毎毒比毛毬氏民気水氷永汀汁求汐汗汚江池汰決汽沈沖沙没沢河沸油治沼沿況泉泊泌法泡
波泣泥注泰泳洋洗洞津洪洲洵洸活派流浄浅浜浦浩浪浮浴海浸消涙涯液涼淑淡深淳混添清渇済渉渋渓渚減渡渥渦温測港湖湧湯湾湿満源準溝溶滅滉
滋滑滝滞滴漁漂漆漏演漠漢漫漬漱漸潔潜潟潤潮澄澪激濁濃濫濯瀬火灯灰災炉炊炎炭点為烈無焦然焼煙照煩煮熊熙熟熱燃燎燥燦燿爆爵父爽爾片版
牛牧物牲特犠犬犯状狂狩独狭猛猟猪猫献猶猿獄獣獲玄率玉王玖玲珍珠班現球理琉琢琳琴瑚瑛瑞瑠瑳瑶璃環璽瓶甘甚生産用甫田由甲申男町画界畑
畔留畜畝略番異畳疎疑疫疲疾病症痘痛痢痴療癒癖発登白百的皆皇皐皓皮皿盆益盗盛盟監盤目盲直相盾省眉看県真眠眸眺眼着睡督睦瞬瞭瞳矛矢知
矩短矯石砂研砕砲破硝硫硬碁碑碧碩確磁磨磯礁礎示礼社祈祉祐祖祝神祥票祭禁禄禅禍禎福秀私秋科秒秘租秦秩称移稀程税稔稚稜種稲稼稿穀穂積
穏穣穫穴究空突窃窒窓窮窯立竜章竣童端競竹笑笙笛符第笹筆等筋筒答策箇算管箱節範築篤簡簿籍米粉粋粒粗粘粛粧精糖糧糸系糾紀約紅紋納純紗
紘紙級紛素紡索紫紬累細紳紹紺終絃組経結絞絡絢給統絵絶絹継続綜維綱網綸綺綾綿緊緋総緑緒線締編緩緯練縁縄縛縦縫縮績繁繊織繕繭繰缶罪置
罰署罷羅羊美群義羽翁翌習翔翠翻翼耀老考者耐耕耗耳耶聖聞聡聴職肇肉肌肖肝肢肥肩肪肯育肺胃胆背胎胞胡胤胴胸能脂脅脈脚脩脱脳脹腐腕腰腸
腹膚膜膨臓臣臨自臭至致興舌舎舗舜舞舟航般舶船艇艦良色艶芋芙芝花芳芸芹芽苑苗若苦英茂茄茅茉茎茜茶草荒荘荷莉莞菊菌菓菖菜菫華萌萩落葉
著葬葵蒔蒸蒼蓄蓉蓮蔦蔵蕉蕗薄薦薪薫薬藍藤藩藻蘭虎虐虚虜虞虫虹蚊蚕蛇蛍蛮蝶融血衆行術街衛衝衡衣表衰衷衿袈袋被裁裂装裏裕補裟裸製複褐
褒襟襲西要覆覇見規視覚覧親観角解触言訂計討訓託記訟訪設許訳訴診証詐詔評詞詠詢試詩詰話該詳誇誉誌認誓誕誘語誠誤説読課誼調諄談請諒論
諭諮諸諾謀謁謄謙講謝謡謹識譜警議譲護谷豆豊豚象豪貝貞負財貢貧貨販貫責貯貴買貸費貿賀賃賄資賊賓賛賜賞賠賢賦質購贈赤赦走赳赴起超越趣
足距跡路跳践踊踏躍身車軌軍軒軟転軸軽較載輔輝輩輪輸轄辛辞辰辱農辺込迅迎近返迪迫迭述迷追退送逃逆透逐逓途通逝速造連逮週進逸遂遅遇遊
運遍過道達違遠遣遥適遭遮遵遷選遺遼避還邑那邦邪邸郁郊郎郡部郭郵郷都酉酌配酒酔酢酪酬酵酷酸醇醜醸采釈里重野量金針釣鈍鈴鉄鉛鉢鉱銀銃
銅銑銘銭鋭鋳鋼錘錠錦錬錯録鍛鎌鎖鎮鏡鐘鑑長門閉開閑間関閣閥閲闘防阻阿附降限陛院陣除陥陪陰陳陵陶陸険陽隅隆隊階随隔際障隠隣隷隻隼雄
雅集雇雌雑雛離難雨雪雰雲零雷電需震霊霜霞霧露青靖静非面革靴鞠音韻響頂項順須頌預頑頒領頭頻頼題額顔顕願類顧風颯飛食飢飯飲飼飽飾養餓
館首香馨馬駄駅駆駐駒駿騎騒験騰驚骨髄高髪鬼魁魂魅魔魚鮎鮮鯉鯛鯨鳥鳩鳳鳴鴻鵬鶏鶴鷹鹿麗麟麦麻麿黄黎黒黙黛鼓鼻齢
|
omniverse-code/kit/exts/omni.graph.tutorials/ogn/nodes.json | {
"nodes": {
"omni.graph.tutorials.Empty": {
"description": "This is a tutorial node. It does absolutely nothing and is only meant to serve as an example to use for setting up your build.",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "C++"
},
"omni.graph.tutorials.SimpleDataPy": {
"description": "This is a tutorial node. It creates both an input and output attribute of every simple supported data type. The values are modified in a simple way so that the compute modifies values. It is the same as node omni.graph.tutorials.SimpleData, except it is implemented in Python instead of C++.",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "Python"
},
"omni.graph.tutorials.ComplexDataPy": {
"description": "This is a tutorial node written in Python. It will compute the point3f array by multiplying each element of the float array by the three element vector in the multiplier.",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "Python"
},
"omni.graph.tutorials.AbiPy": {
"description": "This tutorial node shows how to override ABI methods on your Python node. The algorithm of the node converts an RGB color into HSV components.",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "Python"
},
"omni.graph.tutorials.StatePy": {
"description": "This is a tutorial node. It makes use of internal state information to continuously increment an output.",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "Python"
},
"omni.graph.tutorials.Defaults": {
"description": "This is a tutorial node. It will move the values of inputs to corresponding outputs. Inputs all have unspecified, and therefore empty, default values.",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "C++"
},
"omni.graph.tutorials.BundleManipulation": {
"description": "This is a tutorial node. It exercises functionality for the manipulation of bundle attribute contents.",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "C++"
},
"omni.graph.tutorials.BundleManipulationPy": {
"description": "This is a tutorial node. It exercises functionality for the manipulation of bundle attribute contents. The configuration is the same as omni.graph.tutorials.BundleManipulation except that the implementation language is Python",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "Python"
},
"omni.graph.tutorials.BundleData": {
"description": "This is a tutorial node. It exercises functionality for access of data within bundle attributes.",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "C++"
},
"omni.graph.tutorials.BundleDataPy": {
"description": "This is a tutorial node. It exercises functionality for access of data within bundle attributes. The configuration is the same as omni.graph.tutorials.BundleData except that the implementation language is Python",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "Python"
},
"omni.graph.tutorials.StateAttributesPy": {
"description": "This is a tutorial node. It exercises state attributes to remember data from on evaluation to the next.",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "Python"
},
"omni.graph.tutorials.State": {
"description": "This is a tutorial node. It makes use of internal state information to continuously increment an output.",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "C++"
},
"omni.graph.tutorials.ExtendedTypes": {
"description": "This is a tutorial node. It exercises functionality for the manipulation of the extended attribute types.",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "C++"
},
"omni.graph.tutorials.ExtendedTypesPy": {
"description": "This is a tutorial node. It exercises functionality for the manipulation of the extended attribute types. It is identical to OgnTutorialExtendedTypes.ogn, except the language of implementation is selected to be python.",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "Python"
},
"omni.graph.tutorials.SimpleData": {
"description": "This is a tutorial node. It creates both an input and output attribute of every simple supported data type. The values are modified in a simple way so that the compute modifies values.",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "C++"
},
"omni.graph.tutorials.Tokens": {
"description": "This is a tutorial node. It exercises the feature of providing hardcoded token values in the database after a node type has been initialized. It sets output booleans to the truth value of whether corresponding inputs appear in the hardcoded token list.",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "C++"
},
"omni.graph.tutorials.TokensPy": {
"description": "This is a tutorial node. It exercises the feature of providing hardcoded token values in the database after a node type has been initialized. It sets output booleans to the truth value of whether corresponding inputs appear in the hardcoded token list.",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "Python"
},
"omni.graph.tutorials.BundleAddAttributes": {
"description": "This is a tutorial node. It exercises functionality for adding and removing attributes on output bundles.",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "C++"
},
"omni.graph.tutorials.BundleAddAttributesPy": {
"description": "This is a Python tutorial node. It exercises functionality for adding and removing attributes on output bundles.",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "Python"
},
"omni.graph.tutorials.CpuGpuBundles": {
"description": "This is a tutorial node. It exercises functionality for accessing data in bundles that are on the GPU as well as bundles whose CPU/GPU location is decided at runtime. The compute looks for bundled attributes named 'points' and, if they are found, computes their dot products. If the bundle on the output contains an integer array type named 'dotProducts' then the results are placed there, otherwise a new attribute of that name and type is created on the output bundle to hold the results. This node is identical to OgnTutorialCpuGpuBundlesPy.ogn, except it is implemented in C++.",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "C++"
},
"omni.graph.tutorials.CpuGpuBundlesPy": {
"description": "This is a tutorial node. It exercises functionality for accessing data in bundles that are on the GPU as well as bundles whose CPU/GPU location is decided at runtime. The compute looks for bundled attributes named 'points' and, if they are found, computes the dot products. If the bundle on the output contains an integer array type named 'dotProducts' then the results are placed there, otherwise a new attribute of that name and type is created on the output bundle to hold the results. This node is identical to OgnTutorialCpuGpuBundles.ogn, except is is implemented in Python.",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "Python"
},
"omni.graph.tutorials.CpuGpuExtended": {
"description": "This is a tutorial node. It exercises functionality for accessing data in extended attributes that are on the GPU as well as those whose CPU/GPU location is decided at runtime. The compute adds the two inputs 'gpuData' and 'cpuData' together, placing the result in `cpuGpuSum`, whose memory location is determined by the 'gpu' flag. This node is identical to OgnTutorialCpuGpuExtendedPy.ogn, except is is implemented in C++.",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "C++"
},
"omni.graph.tutorials.CpuGpuExtendedPy": {
"description": "This is a tutorial node. It exercises functionality for accessing data in extended attributes that are on the GPU as well as those whose CPU/GPU location is decided at runtime. The compute adds the two inputs 'gpuData' and 'cpuData' together, placing the result in `cpuGpuSum`, whose memory location is determined by the 'gpu' flag. This node is identical to OgnTutorialCpuGpuExtended.ogn, except is is implemented in Python.",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "Python"
},
"omni.graph.tutorials.OverrideType": {
"description": "This is a tutorial node. It has an input and output of type float[3], an input and output of type double[3], and a type override specification that lets the node use Carbonite types for the generated data on the float[3] attributes only. Ordinarily all of the types would be defined in a seperate configuration file so that it can be shared for a project. In that case the type definition build flag would also be used so that this information does not have to be embedded in every .ogn file in the project. It is placed directly in the file here solely for instructional purposes. The compute is just a rotation of components from x->y, y->z, and z->x, for each input type.",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "C++"
},
"omni.graph.tutorials.DynamicAttributes": {
"description": "This is a Python node that exercises the ability to add and remove database attribute accessors for dynamic attributes. When the dynamic attribute is added the property will exist and be able to get/set the attribute values. When it does not the property will not exist. The dynamic attribute names are found in the tokens below. If neither exist then the input value is copied to the output directly. If 'firstBit' exists then the 'firstBit'th bit of the input is x-ored for the copy. If 'secondBit' exists then the 'secondBit'th bit of the input is x-ored for the copy. (Recall bitwise match xor(0,0)=0, xor(0,1)=1, xor(1,0)=1, and xor(1,1)=0.) For example, if 'firstBit' is present and set to 1 then the bitmask will be b0010, where bit 1 is set. If the input is 7, or b0111, then the xor operation will flip bit 1, yielding b0101, or 5 as the result. If on the next run 'secondBit' is also present and set to 2 then its bitmask will be b0100, where bit 2 is set. The input of 7 (b0111) flips bit 1 because firstBit=1 and flips bit 2 because secondBit=2, yielding a final result of 1 (b0001).",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "C++"
},
"omni.graph.tutorials.DynamicAttributesPy": {
"description": "This is a Python node that exercises the ability to add and remove database attribute accessors for dynamic attributes. When the dynamic attribute is added the property will exist and be able to get/set the attribute values. When it does not the property will not exist. The dynamic attribute names are found in the tokens below. If neither exist then the input value is copied to the output directly. If 'firstBit' exists then the 'firstBit'th bit of the input is x-ored for the copy. If 'secondBit' exists then the 'secondBit'th bit of the input is x-ored for the copy. (Recall bitwise match xor(0,0)=0, xor(0,1)=1, xor(1,0)=1, and xor(1,1)=0.) For example, if 'firstBit' is present and set to 1 then the bitmask will be b0010, where bit 1 is set. If the input is 7, or b0111, then the xor operation will flip bit 1, yielding b0101, or 5 as the result. If on the next run 'secondBit' is also present and set to 2 then its bitmask will be b0100, where bit 2 is set. The input of 7 (b0111) flips bit 1 because firstBit=1 and flips bit 2 because secondBit=2, yielding a final result of 1 (b0001).",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "Python"
},
"omni.graph.tutorials.GenericMathNode": {
"description": "This is a tutorial node. It is functionally equivalent to the built-in Multiply node, but written in python as a practical demonstration of using extended attributes to write math nodes that work with any numeric types, including arrays and tuples.",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "Python"
},
"omni.graph.tutorials.CudaCpuArrays": {
"description": "This is a tutorial node. It illustrates the alternative method of extracting pointers to GPU array data in which the pointer returned is a CPU pointer and can be dereferenced on the CPU side. Without the cudaPointers value set that pointer would be a GPU pointer to an array of GPU pointers and could only be dereferenced on the device.",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "C++"
},
"omni.graph.tutorials.CudaCpuArraysPy": {
"description": "This is a tutorial node. It illustrates the alternative method of extracting pointers to GPU array data in which the pointer returned is a CPU pointer and can be dereferenced on the CPU side. Without the cudaPointers value set that pointer would be a GPU pointer to an array of GPU pointers and could only be dereferenced on the device. Both plain attribute and bundle attribute extraction are shown.",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "Python"
},
"omni.graph.tutorials.Abi": {
"description": "This tutorial node shows how to override ABI methods on your node.",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "C++"
},
"omni.tutorials.TupleData": {
"description": "This is a tutorial node. It creates both an input and output attribute of some of the supported tuple types. The values are modified in a simple way so that the compute can be tested.",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "C++"
},
"omni.graph.tutorials.ArrayData": {
"description": "This is a tutorial node. It will compute the array 'result' as the input array 'original' with every element multiplied by the constant 'multiplier'.",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "C++"
},
"omni.graph.tutorials.TupleArrays": {
"description": "This is a tutorial node. It will compute the float array 'result' as the elementwise dot product of the input arrays 'a' and 'b'.",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "C++"
},
"omni.graph.tutorials.RoleData": {
"description": "This is a tutorial node. It creates both an input and output attribute of every supported role-based data type. The values are modified in a simple way so that the compute modifies values. ",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "C++"
},
"omni.graph.tutorials.CudaData": {
"description": "This is a tutorial node. It performs different functions on the GPU to illustrate different types of data access. The first adds inputs 'a' and 'b' to yield output 'sum', all of which are on the GPU. The second is a sample expansion deformation that multiplies every point on a set of input points, stored on the GPU, by a constant value, stored on the CPU, to yield a set of output points, also on the GPU. The third is an assortment of different data types illustrating how different data is passed to the GPU. This particular node uses CUDA for its GPU computations, as indicated in the memory type value. Normal use case for GPU compute is large amounts of data. For testing purposes this node only handles a very small amount but the principle is the same.",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "C++"
},
"omni.graph.tutorials.CpuGpuData": {
"description": "This is a tutorial node. It illustrates how to access data whose memory location, CPU or GPU, is determined at runtime in the compute method. The data types are the same as for the purely CPU and purely GPU tutorials, it is only the access method that changes. The input 'is_gpu' determines where the data of the other attributes can be accessed.",
"version": 1,
"extension": "omni.graph.tutorials",
"language": "C++"
}
}
}
|
omniverse-code/kit/exts/omni.graph.tutorials/ogn/docs/OgnTutorialSimpleData.rst | .. _omni_graph_tutorials_SimpleData_1:
.. _omni_graph_tutorials_SimpleData:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Tutorial Node: Attributes With Simple Data
:keywords: lang-en omnigraph node tutorials threadsafe tutorials simple-data
Tutorial Node: Attributes With Simple Data
==========================================
.. <description>
This is a tutorial node. It creates both an input and output attribute of every simple supported data type. The values are modified in a simple way so that the compute modifies values.
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.tutorials<ext_omni_graph_tutorials>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"Sample Boolean Input (*inputs:a_bool*)", "``bool``", "This is an attribute of type boolean", "True"
"inputs:a_constant_input", "``int``", "This is an input attribute whose value can be set but can only be connected as a source.", "0"
"", "*outputOnly*", "1", ""
"inputs:a_double", "``double``", "This is an attribute of type 64 bit floating point", "0"
"inputs:a_float", "``float``", "This is an attribute of type 32 bit floating point", "0"
"Sample Half Precision Input (*inputs:a_half*)", "``half``", "This is an attribute of type 16 bit float", "0.0"
"inputs:a_int", "``int``", "This is an attribute of type 32 bit integer", "0"
"inputs:a_int64", "``int64``", "This is an attribute of type 64 bit integer", "0"
"inputs:a_objectId", "``objectId``", "This is an attribute of type objectId", "0"
"inputs:a_path", "``path``", "This is an attribute of type path", ""
"inputs:a_string", "``string``", "This is an attribute of type string", "helloString"
"inputs:a_token", "``token``", "This is an attribute of type interned string with fast comparison and hashing", "helloToken"
"inputs:unsigned:a_uchar", "``uchar``", "This is an attribute of type unsigned 8 bit integer", "0"
"inputs:unsigned:a_uint", "``uint``", "This is an attribute of type unsigned 32 bit integer", "0"
"inputs:unsigned:a_uint64", "``uint64``", "This is an attribute of type unsigned 64 bit integer", "0"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"Sample Boolean Output (*outputs:a_bool*)", "``bool``", "This is a computed attribute of type boolean", "False"
"outputs:a_double", "``double``", "This is a computed attribute of type 64 bit floating point", "5.0"
"outputs:a_float", "``float``", "This is a computed attribute of type 32 bit floating point", "4.0"
"Sample Half Precision Output (*outputs:a_half*)", "``half``", "This is a computed attribute of type 16 bit float", "1.0"
"outputs:a_int", "``int``", "This is a computed attribute of type 32 bit integer", "2"
"outputs:a_int64", "``int64``", "This is a computed attribute of type 64 bit integer", "3"
"outputs:a_objectId", "``objectId``", "This is a computed attribute of type objectId", "8"
"outputs:a_path", "``path``", "This is a computed attribute of type path", "/"
"outputs:a_string", "``string``", "This is a computed attribute of type string", "seven"
"outputs:a_token", "``token``", "This is a computed attribute of type interned string with fast comparison and hashing", "six"
"outputs:unsigned:a_uchar", "``uchar``", "This is a computed attribute of type unsigned 8 bit integer", "9"
"outputs:unsigned:a_uint", "``uint``", "This is a computed attribute of type unsigned 32 bit integer", "10"
"outputs:unsigned:a_uint64", "``uint64``", "This is a computed attribute of type unsigned 64 bit integer", "11"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.tutorials.SimpleData"
"Version", "1"
"Extension", "omni.graph.tutorials"
"Icon", "ogn/icons/omni.graph.tutorials.SimpleData.svg"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Tutorial Node: Attributes With Simple Data"
"Categories", "tutorials"
"Generated Class Name", "OgnTutorialSimpleDataDatabase"
"Python Module", "omni.graph.tutorials"
|
omniverse-code/kit/exts/omni.graph.tutorials/ogn/docs/OgnTutorialDynamicAttributesPy.rst | .. _omni_graph_tutorials_DynamicAttributesPy_1:
.. _omni_graph_tutorials_DynamicAttributesPy:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Tutorial Python Node: Dynamic Attributes
:keywords: lang-en omnigraph node tutorials tutorials dynamic-attributes-py
Tutorial Python Node: Dynamic Attributes
========================================
.. <description>
This is a Python node that exercises the ability to add and remove database attribute accessors for dynamic attributes. When the dynamic attribute is added the property will exist and be able to get/set the attribute values. When it does not the property will not exist. The dynamic attribute names are found in the tokens below. If neither exist then the input value is copied to the output directly. If 'firstBit' exists then the 'firstBit'th bit of the input is x-ored for the copy. If 'secondBit' exists then the 'secondBit'th bit of the input is x-ored for the copy. (Recall bitwise match xor(0,0)=0, xor(0,1)=1, xor(1,0)=1, and xor(1,1)=0.) For example, if 'firstBit' is present and set to 1 then the bitmask will be b0010, where bit 1 is set. If the input is 7, or b0111, then the xor operation will flip bit 1, yielding b0101, or 5 as the result. If on the next run 'secondBit' is also present and set to 2 then its bitmask will be b0100, where bit 2 is set. The input of 7 (b0111) flips bit 1 because firstBit=1 and flips bit 2 because secondBit=2, yielding a final result of 1 (b0001).
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.tutorials<ext_omni_graph_tutorials>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"inputs:value", "``uint``", "Original value to be modified.", "0"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"outputs:result", "``uint``", "Modified value", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.tutorials.DynamicAttributesPy"
"Version", "1"
"Extension", "omni.graph.tutorials"
"Icon", "ogn/icons/omni.graph.tutorials.DynamicAttributesPy.svg"
"Has State?", "False"
"Implementation Language", "Python"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Tutorial Python Node: Dynamic Attributes"
"__tokens", "{""firstBit"": ""inputs:firstBit"", ""secondBit"": ""inputs:secondBit"", ""invert"": ""inputs:invert""}"
"Categories", "tutorials"
"Generated Class Name", "OgnTutorialDynamicAttributesPyDatabase"
"Python Module", "omni.graph.tutorials"
|
omniverse-code/kit/exts/omni.graph.tutorials/ogn/docs/OgnTutorialTokensPy.rst | .. _omni_graph_tutorials_TokensPy_1:
.. _omni_graph_tutorials_TokensPy:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Tutorial Python Node: Tokens
:keywords: lang-en omnigraph node tutorials tutorials tokens-py
Tutorial Python Node: Tokens
============================
.. <description>
This is a tutorial node. It exercises the feature of providing hardcoded token values in the database after a node type has been initialized. It sets output booleans to the truth value of whether corresponding inputs appear in the hardcoded token list.
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.tutorials<ext_omni_graph_tutorials>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"inputs:valuesToCheck", "``token[]``", "Array of tokens that are to be checked", "[]"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"outputs:isColor", "``bool[]``", "True values if the corresponding input value appears in the token list", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.tutorials.TokensPy"
"Version", "1"
"Extension", "omni.graph.tutorials"
"Icon", "ogn/icons/omni.graph.tutorials.TokensPy.svg"
"Has State?", "False"
"Implementation Language", "Python"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Tutorial Python Node: Tokens"
"__tokens", "[""red"", ""green"", ""blue""]"
"Categories", "tutorials"
"Generated Class Name", "OgnTutorialTokensPyDatabase"
"Python Module", "omni.graph.tutorials"
|
omniverse-code/kit/exts/omni.graph.tutorials/ogn/docs/OgnTutorialStatePy.rst | .. _omni_graph_tutorials_StatePy_1:
.. _omni_graph_tutorials_StatePy:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Tutorial Python Node: Internal States
:keywords: lang-en omnigraph node tutorials tutorials state-py
Tutorial Python Node: Internal States
=====================================
.. <description>
This is a tutorial node. It makes use of internal state information to continuously increment an output.
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.tutorials<ext_omni_graph_tutorials>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"inputs:override", "``bool``", "When true get the output from the overrideValue, otherwise use the internal value", "False"
"inputs:overrideValue", "``int64``", "Value to use instead of the monotonically increasing internal one when 'override' is true", "0"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"outputs:monotonic", "``int64``", "Monotonically increasing output, set by internal state information", "0"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.tutorials.StatePy"
"Version", "1"
"Extension", "omni.graph.tutorials"
"Icon", "ogn/icons/omni.graph.tutorials.StatePy.svg"
"Has State?", "True"
"Implementation Language", "Python"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Tutorial Python Node: Internal States"
"Categories", "tutorials"
"Generated Class Name", "OgnTutorialStatePyDatabase"
"Python Module", "omni.graph.tutorials"
|
omniverse-code/kit/exts/omni.graph.tutorials/ogn/docs/OgnTutorialCpuGpuExtendedPy.rst | .. _omni_graph_tutorials_CpuGpuExtendedPy_1:
.. _omni_graph_tutorials_CpuGpuExtendedPy:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Tutorial Python Node: CPU/GPU Extended Attributes
:keywords: lang-en omnigraph node tutorials tutorials cpu-gpu-extended-py
Tutorial Python Node: CPU/GPU Extended Attributes
=================================================
.. <description>
This is a tutorial node. It exercises functionality for accessing data in extended attributes that are on the GPU as well as those whose CPU/GPU location is decided at runtime. The compute adds the two inputs 'gpuData' and 'cpuData' together, placing the result in `cpuGpuSum`, whose memory location is determined by the 'gpu' flag. This node is identical to OgnTutorialCpuGpuExtended.ogn, except is is implemented in Python.
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.tutorials<ext_omni_graph_tutorials>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"CPU Input Attribute (*inputs:cpuData*)", "``any``", "Input attribute whose data always lives on the CPU", "None"
"Results To GPU (*inputs:gpu*)", "``bool``", "If true then put the sum on the GPU, otherwise put it on the CPU", "False"
"GPU Input Attribute (*inputs:gpuData*)", "``any``", "Input attribute whose data always lives on the GPU", "None"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"Sum (*outputs:cpuGpuSum*)", "``any``", "This is the attribute with the selected data. If the 'gpu' attribute is set to true then this attribute's contents will be entirely on the GPU, otherwise it will be on the CPU.", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.tutorials.CpuGpuExtendedPy"
"Version", "1"
"Extension", "omni.graph.tutorials"
"Icon", "ogn/icons/omni.graph.tutorials.CpuGpuExtendedPy.svg"
"Has State?", "False"
"Implementation Language", "Python"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"tags", "tutorial,extended,gpu"
"uiName", "Tutorial Python Node: CPU/GPU Extended Attributes"
"Categories", "tutorials"
"Generated Class Name", "OgnTutorialCpuGpuExtendedPyDatabase"
"Python Module", "omni.graph.tutorials"
|
omniverse-code/kit/exts/omni.graph.tutorials/ogn/docs/OgnTutorialBundleAddAttributesPy.rst | .. _omni_graph_tutorials_BundleAddAttributesPy_1:
.. _omni_graph_tutorials_BundleAddAttributesPy:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Tutorial Python Node: Bundle Add Attributes
:keywords: lang-en omnigraph node tutorials tutorials bundle-add-attributes-py
Tutorial Python Node: Bundle Add Attributes
===========================================
.. <description>
This is a Python tutorial node. It exercises functionality for adding and removing attributes on output bundles.
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.tutorials<ext_omni_graph_tutorials>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"inputs:addedAttributeNames", "``token[]``", "Names for the attribute types to be added. The size of this array must match the size of the 'typesToAdd' array to be legal.", "[]"
"inputs:removedAttributeNames", "``token[]``", "Names for the attribute types to be removed. Non-existent attributes will be ignored.", "[]"
"Attribute Types To Add (*inputs:typesToAdd*)", "``token[]``", "List of type descriptions to add to the bundle. The strings in this list correspond to the strings that represent the attribute types in the .ogn file (e.g. float[3][], colord[3], bool", "[]"
"inputs:useBatchedAPI", "``bool``", "Controls whether or not to used batched APIS for adding/removing attributes", "False"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"Constructed Bundle (*outputs:bundle*)", "``bundle``", "This is the bundle with all attributes added by compute.", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.tutorials.BundleAddAttributesPy"
"Version", "1"
"Extension", "omni.graph.tutorials"
"Icon", "ogn/icons/omni.graph.tutorials.BundleAddAttributesPy.svg"
"Has State?", "False"
"Implementation Language", "Python"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Tutorial Python Node: Bundle Add Attributes"
"Categories", "tutorials"
"Generated Class Name", "OgnTutorialBundleAddAttributesPyDatabase"
"Python Module", "omni.graph.tutorials"
|
omniverse-code/kit/exts/omni.graph.tutorials/ogn/docs/OgnTutorialTupleData.rst | .. _omni_tutorials_TupleData_1:
.. _omni_tutorials_TupleData:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Tutorial Node: Tuple Attributes
:keywords: lang-en omnigraph node tutorials threadsafe tutorials tuple-data
Tutorial Node: Tuple Attributes
===============================
.. <description>
This is a tutorial node. It creates both an input and output attribute of some of the supported tuple types. The values are modified in a simple way so that the compute can be tested.
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.tutorials<ext_omni_graph_tutorials>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"inputs:a_double2", "``double[2]``", "This is an attribute with two double values", "[1.1, 2.2]"
"inputs:a_double3", "``double[3]``", "This is an attribute with three double values", "[1.1, 2.2, 3.3]"
"inputs:a_float2", "``float[2]``", "This is an attribute with two float values", "[4.4, 5.5]"
"inputs:a_float3", "``float[3]``", "This is an attribute with three float values", "[6.6, 7.7, 8.8]"
"inputs:a_half2", "``half[2]``", "This is an attribute with two 16-bit float values", "[7.0, 8.0]"
"inputs:a_int2", "``int[2]``", "This is an attribute with two 32-bit integer values", "[10, 11]"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"outputs:a_double2", "``double[2]``", "This is a computed attribute with two double values", "None"
"outputs:a_double3", "``double[3]``", "This is a computed attribute with three double values", "None"
"outputs:a_float2", "``float[2]``", "This is a computed attribute with two float values", "None"
"outputs:a_float3", "``float[3]``", "This is a computed attribute with three float values", "None"
"outputs:a_half2", "``half[2]``", "This is a computed attribute with two 16-bit float values", "None"
"outputs:a_int2", "``int[2]``", "This is a computed attribute with two 32-bit integer values", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.tutorials.TupleData"
"Version", "1"
"Extension", "omni.graph.tutorials"
"Icon", "ogn/icons/omni.tutorials.TupleData.svg"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Tutorial Node: Tuple Attributes"
"tags", "tuple,tutorial,internal"
"Categories", "tutorials"
"Generated Class Name", "OgnTutorialTupleDataDatabase"
"Python Module", "omni.graph.tutorials"
|
omniverse-code/kit/exts/omni.graph.tutorials/ogn/docs/OgnTutorialOverrideType.rst | .. _omni_graph_tutorials_OverrideType_1:
.. _omni_graph_tutorials_OverrideType:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Tutorial Node: Overriding C++ Data Types
:keywords: lang-en omnigraph node tutorials threadsafe tutorials override-type
Tutorial Node: Overriding C++ Data Types
========================================
.. <description>
This is a tutorial node. It has an input and output of type float[3], an input and output of type double[3], and a type override specification that lets the node use Carbonite types for the generated data on the float[3] attributes only. Ordinarily all of the types would be defined in a seperate configuration file so that it can be shared for a project. In that case the type definition build flag would also be used so that this information does not have to be embedded in every .ogn file in the project. It is placed directly in the file here solely for instructional purposes. The compute is just a rotation of components from x->y, y->z, and z->x, for each input type.
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.tutorials<ext_omni_graph_tutorials>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"Input value with a standard double type (*inputs:data*)", "``double[3]``", "The value to rotate", "[0.0, 0.0, 0.0]"
"Input value with a modified float type (*inputs:typedData*)", "``float[3]``", "The value to rotate", "[0.0, 0.0, 0.0]"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"Output value with a standard double type (*outputs:data*)", "``double[3]``", "The rotated version of inputs::data", "None"
"Output value with a modified float type (*outputs:typedData*)", "``float[3]``", "The rotated version of inputs::typedData", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.tutorials.OverrideType"
"Version", "1"
"Extension", "omni.graph.tutorials"
"Icon", "ogn/icons/omni.graph.tutorials.OverrideType.svg"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Tutorial Node: Overriding C++ Data Types"
"Categories", "tutorials"
"Generated Class Name", "OgnTutorialOverrideTypeDatabase"
"Python Module", "omni.graph.tutorials"
|
omniverse-code/kit/exts/omni.graph.tutorials/ogn/docs/OgnTutorialGenericMathNode.rst | .. _omni_graph_tutorials_GenericMathNode_1:
.. _omni_graph_tutorials_GenericMathNode:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Tutorial Python Node: Generic Math Node
:keywords: lang-en omnigraph node tutorials tutorials generic-math-node
Tutorial Python Node: Generic Math Node
=======================================
.. <description>
This is a tutorial node. It is functionally equivalent to the built-in Multiply node, but written in python as a practical demonstration of using extended attributes to write math nodes that work with any numeric types, including arrays and tuples.
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.tutorials<ext_omni_graph_tutorials>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"A (*inputs:a*)", "``['colord[3]', 'colord[3][]', 'colord[4]', 'colord[4][]', 'colorf[3]', 'colorf[3][]', 'colorf[4]', 'colorf[4][]', 'colorh[3]', 'colorh[3][]', 'colorh[4]', 'colorh[4][]', 'double', 'double[2]', 'double[2][]', 'double[3]', 'double[3][]', 'double[4]', 'double[4][]', 'double[]', 'float', 'float[2]', 'float[2][]', 'float[3]', 'float[3][]', 'float[4]', 'float[4][]', 'float[]', 'frame[4]', 'frame[4][]', 'half', 'half[2]', 'half[2][]', 'half[3]', 'half[3][]', 'half[4]', 'half[4][]', 'half[]', 'int', 'int64', 'int64[]', 'int[2]', 'int[2][]', 'int[3]', 'int[3][]', 'int[4]', 'int[4][]', 'int[]', 'matrixd[3]', 'matrixd[3][]', 'matrixd[4]', 'matrixd[4][]', 'normald[3]', 'normald[3][]', 'normalf[3]', 'normalf[3][]', 'normalh[3]', 'normalh[3][]', 'pointd[3]', 'pointd[3][]', 'pointf[3]', 'pointf[3][]', 'pointh[3]', 'pointh[3][]', 'quatd[4]', 'quatd[4][]', 'quatf[4]', 'quatf[4][]', 'quath[4]', 'quath[4][]', 'texcoordd[2]', 'texcoordd[2][]', 'texcoordd[3]', 'texcoordd[3][]', 'texcoordf[2]', 'texcoordf[2][]', 'texcoordf[3]', 'texcoordf[3][]', 'texcoordh[2]', 'texcoordh[2][]', 'texcoordh[3]', 'texcoordh[3][]', 'timecode', 'timecode[]', 'transform[4]', 'transform[4][]', 'uchar', 'uchar[]', 'uint', 'uint64', 'uint64[]', 'uint[]', 'vectord[3]', 'vectord[3][]', 'vectorf[3]', 'vectorf[3][]', 'vectorh[3]', 'vectorh[3][]']``", "First number to multiply", "None"
"B (*inputs:b*)", "``['colord[3]', 'colord[3][]', 'colord[4]', 'colord[4][]', 'colorf[3]', 'colorf[3][]', 'colorf[4]', 'colorf[4][]', 'colorh[3]', 'colorh[3][]', 'colorh[4]', 'colorh[4][]', 'double', 'double[2]', 'double[2][]', 'double[3]', 'double[3][]', 'double[4]', 'double[4][]', 'double[]', 'float', 'float[2]', 'float[2][]', 'float[3]', 'float[3][]', 'float[4]', 'float[4][]', 'float[]', 'frame[4]', 'frame[4][]', 'half', 'half[2]', 'half[2][]', 'half[3]', 'half[3][]', 'half[4]', 'half[4][]', 'half[]', 'int', 'int64', 'int64[]', 'int[2]', 'int[2][]', 'int[3]', 'int[3][]', 'int[4]', 'int[4][]', 'int[]', 'matrixd[3]', 'matrixd[3][]', 'matrixd[4]', 'matrixd[4][]', 'normald[3]', 'normald[3][]', 'normalf[3]', 'normalf[3][]', 'normalh[3]', 'normalh[3][]', 'pointd[3]', 'pointd[3][]', 'pointf[3]', 'pointf[3][]', 'pointh[3]', 'pointh[3][]', 'quatd[4]', 'quatd[4][]', 'quatf[4]', 'quatf[4][]', 'quath[4]', 'quath[4][]', 'texcoordd[2]', 'texcoordd[2][]', 'texcoordd[3]', 'texcoordd[3][]', 'texcoordf[2]', 'texcoordf[2][]', 'texcoordf[3]', 'texcoordf[3][]', 'texcoordh[2]', 'texcoordh[2][]', 'texcoordh[3]', 'texcoordh[3][]', 'timecode', 'timecode[]', 'transform[4]', 'transform[4][]', 'uchar', 'uchar[]', 'uint', 'uint64', 'uint64[]', 'uint[]', 'vectord[3]', 'vectord[3][]', 'vectorf[3]', 'vectorf[3][]', 'vectorh[3]', 'vectorh[3][]']``", "Second number to multiply", "None"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"Product (*outputs:product*)", "``['colord[3]', 'colord[3][]', 'colord[4]', 'colord[4][]', 'colorf[3]', 'colorf[3][]', 'colorf[4]', 'colorf[4][]', 'colorh[3]', 'colorh[3][]', 'colorh[4]', 'colorh[4][]', 'double', 'double[2]', 'double[2][]', 'double[3]', 'double[3][]', 'double[4]', 'double[4][]', 'double[]', 'float', 'float[2]', 'float[2][]', 'float[3]', 'float[3][]', 'float[4]', 'float[4][]', 'float[]', 'frame[4]', 'frame[4][]', 'half', 'half[2]', 'half[2][]', 'half[3]', 'half[3][]', 'half[4]', 'half[4][]', 'half[]', 'int', 'int64', 'int64[]', 'int[2]', 'int[2][]', 'int[3]', 'int[3][]', 'int[4]', 'int[4][]', 'int[]', 'matrixd[3]', 'matrixd[3][]', 'matrixd[4]', 'matrixd[4][]', 'normald[3]', 'normald[3][]', 'normalf[3]', 'normalf[3][]', 'normalh[3]', 'normalh[3][]', 'pointd[3]', 'pointd[3][]', 'pointf[3]', 'pointf[3][]', 'pointh[3]', 'pointh[3][]', 'quatd[4]', 'quatd[4][]', 'quatf[4]', 'quatf[4][]', 'quath[4]', 'quath[4][]', 'texcoordd[2]', 'texcoordd[2][]', 'texcoordd[3]', 'texcoordd[3][]', 'texcoordf[2]', 'texcoordf[2][]', 'texcoordf[3]', 'texcoordf[3][]', 'texcoordh[2]', 'texcoordh[2][]', 'texcoordh[3]', 'texcoordh[3][]', 'timecode', 'timecode[]', 'transform[4]', 'transform[4][]', 'uchar', 'uchar[]', 'uint', 'uint64', 'uint64[]', 'uint[]', 'vectord[3]', 'vectord[3][]', 'vectorf[3]', 'vectorf[3][]', 'vectorh[3]', 'vectorh[3][]']``", "Product of the two numbers", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.tutorials.GenericMathNode"
"Version", "1"
"Extension", "omni.graph.tutorials"
"Icon", "ogn/icons/omni.graph.tutorials.GenericMathNode.svg"
"Has State?", "False"
"Implementation Language", "Python"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Tutorial Python Node: Generic Math Node"
"Categories", "tutorials"
"Generated Class Name", "OgnTutorialGenericMathNodeDatabase"
"Python Module", "omni.graph.tutorials"
|
omniverse-code/kit/exts/omni.graph.tutorials/ogn/docs/OgnTutorialSimpleDataPy.rst | .. _omni_graph_tutorials_SimpleDataPy_1:
.. _omni_graph_tutorials_SimpleDataPy:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Tutorial Python Node: Attributes With Simple Data
:keywords: lang-en omnigraph node tutorials tutorials simple-data-py
Tutorial Python Node: Attributes With Simple Data
=================================================
.. <description>
This is a tutorial node. It creates both an input and output attribute of every simple supported data type. The values are modified in a simple way so that the compute modifies values. It is the same as node omni.graph.tutorials.SimpleData, except it is implemented in Python instead of C++.
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.tutorials<ext_omni_graph_tutorials>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"Simple Boolean Input (*inputs:a_bool*)", "``bool``", "This is an attribute of type boolean", "True"
"inputs:a_constant_input", "``int``", "This is an input attribute whose value can be set but can only be connected as a source.", "0"
"", "*outputOnly*", "1", ""
"inputs:a_double", "``double``", "This is an attribute of type 64 bit floating point", "0"
"inputs:a_float", "``float``", "This is an attribute of type 32 bit floating point", "0"
"inputs:a_half", "``half``", "This is an attribute of type 16 bit float", "0.0"
"inputs:a_int", "``int``", "This is an attribute of type 32 bit integer", "0"
"inputs:a_int64", "``int64``", "This is an attribute of type 64 bit integer", "0"
"inputs:a_objectId", "``objectId``", "This is an attribute of type objectId", "0"
"inputs:a_path", "``path``", "This is an attribute of type path", ""
"inputs:a_string", "``string``", "This is an attribute of type string", "helloString"
"inputs:a_token", "``token``", "This is an attribute of type interned string with fast comparison and hashing", "helloToken"
"inputs:a_uchar", "``uchar``", "This is an attribute of type unsigned 8 bit integer", "0"
"inputs:a_uint", "``uint``", "This is an attribute of type unsigned 32 bit integer", "0"
"inputs:a_uint64", "``uint64``", "This is an attribute of type unsigned 64 bit integer", "0"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"outputs:a_a_boolUiName", "``string``", "Computed attribute containing the UI name of input a_bool", "None"
"outputs:a_bool", "``bool``", "This is a computed attribute of type boolean", "None"
"outputs:a_double", "``double``", "This is a computed attribute of type 64 bit floating point", "None"
"outputs:a_float", "``float``", "This is a computed attribute of type 32 bit floating point", "None"
"outputs:a_half", "``half``", "This is a computed attribute of type 16 bit float", "None"
"outputs:a_int", "``int``", "This is a computed attribute of type 32 bit integer", "None"
"outputs:a_int64", "``int64``", "This is a computed attribute of type 64 bit integer", "None"
"outputs:a_nodeTypeUiName", "``string``", "Computed attribute containing the UI name of this node type", "None"
"outputs:a_objectId", "``objectId``", "This is a computed attribute of type objectId", "None"
"outputs:a_path", "``path``", "This is a computed attribute of type path", "/Child"
"outputs:a_string", "``string``", "This is a computed attribute of type string", "This string is empty"
"outputs:a_token", "``token``", "This is a computed attribute of type interned string with fast comparison and hashing", "None"
"outputs:a_uchar", "``uchar``", "This is a computed attribute of type unsigned 8 bit integer", "None"
"outputs:a_uint", "``uint``", "This is a computed attribute of type unsigned 32 bit integer", "None"
"outputs:a_uint64", "``uint64``", "This is a computed attribute of type unsigned 64 bit integer", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.tutorials.SimpleDataPy"
"Version", "1"
"Extension", "omni.graph.tutorials"
"Icon", "ogn/icons/omni.graph.tutorials.SimpleDataPy.svg"
"Has State?", "False"
"Implementation Language", "Python"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Tutorial Python Node: Attributes With Simple Data"
"__iconColor", "#FF00FF00"
"__iconBackgroundColor", "#7FFF0000"
"__iconBorderColor", "#FF0000FF"
"Categories", "tutorials"
"Generated Class Name", "OgnTutorialSimpleDataPyDatabase"
"Python Module", "omni.graph.tutorials"
|
omniverse-code/kit/exts/omni.graph.tutorials/ogn/docs/OgnTutorialSIMDAdd.rst | .. _omni_graph_tutorials_TutorialSIMDFloatAdd_1:
.. _omni_graph_tutorials_TutorialSIMDFloatAdd:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Tutorial Node: SIMD Add
:keywords: lang-en omnigraph node tutorials tutorials tutorial-s-i-m-d-float-add
Tutorial Node: SIMD Add
=======================
.. <description>
Add 2 floats together using SIMD instruction set
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.tutorials<ext_omni_graph_tutorials>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"inputs:a", "``float``", "first input operand", "0.0"
"inputs:b", "``float``", "second input operand", "0.0"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"outputs:result", "``float``", "the sum of a and b", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.tutorials.TutorialSIMDFloatAdd"
"Version", "1"
"Extension", "omni.graph.tutorials"
"Icon", "ogn/icons/omni.graph.tutorials.TutorialSIMDFloatAdd.svg"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Tutorial Node: SIMD Add"
"Categories", "tutorials"
"Generated Class Name", "OgnTutorialSIMDAddDatabase"
"Python Module", "omni.graph.tutorials"
|
omniverse-code/kit/exts/omni.graph.tutorials/ogn/docs/OgnTutorialTokens.rst | .. _omni_graph_tutorials_Tokens_1:
.. _omni_graph_tutorials_Tokens:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Tutorial Node: Tokens
:keywords: lang-en omnigraph node tutorials threadsafe tutorials tokens
Tutorial Node: Tokens
=====================
.. <description>
This is a tutorial node. It exercises the feature of providing hardcoded token values in the database after a node type has been initialized. It sets output booleans to the truth value of whether corresponding inputs appear in the hardcoded token list.
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.tutorials<ext_omni_graph_tutorials>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"inputs:valuesToCheck", "``token[]``", "Array of tokens that are to be checked", "[]"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"outputs:isColor", "``bool[]``", "True values if the corresponding input value appears in the token list", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.tutorials.Tokens"
"Version", "1"
"Extension", "omni.graph.tutorials"
"Icon", "ogn/icons/omni.graph.tutorials.Tokens.svg"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Tutorial Node: Tokens"
"__tokens", "[""red"", ""green"", ""blue""]"
"Categories", "tutorials"
"Generated Class Name", "OgnTutorialTokensDatabase"
"Python Module", "omni.graph.tutorials"
|
omniverse-code/kit/exts/omni.graph.tutorials/ogn/docs/OgnTutorialCpuGpuData.rst | .. _omni_graph_tutorials_CpuGpuData_1:
.. _omni_graph_tutorials_CpuGpuData:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Tutorial Node: Attributes With CPU/GPU Data
:keywords: lang-en omnigraph node tutorials tutorials cpu-gpu-data
Tutorial Node: Attributes With CPU/GPU Data
===========================================
.. <description>
This is a tutorial node. It illustrates how to access data whose memory location, CPU or GPU, is determined at runtime in the compute method. The data types are the same as for the purely CPU and purely GPU tutorials, it is only the access method that changes. The input 'is_gpu' determines where the data of the other attributes can be accessed.
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.tutorials<ext_omni_graph_tutorials>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"inputs:a", "``float``", "First value to be added in algorithm 1", "0.0"
"inputs:b", "``float``", "Second value to be added in algorithm 1", "0.0"
"inputs:is_gpu", "``bool``", "Runtime switch determining where the data for the other attributes lives.", "False"
"inputs:multiplier", "``float[3]``", "Amplitude of the expansion for the input points in algorithm 2", "[1.0, 1.0, 1.0]"
"inputs:points", "``float[3][]``", "Points to be moved by algorithm 2", "[]"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"outputs:points", "``float[3][]``", "Final positions of points from algorithm 2", "None"
"outputs:sum", "``float``", "Sum of the two inputs from algorithm 1", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.tutorials.CpuGpuData"
"Version", "1"
"Extension", "omni.graph.tutorials"
"Icon", "ogn/icons/omni.graph.tutorials.CpuGpuData.svg"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "any"
"Generated Code Exclusions", "None"
"uiName", "Tutorial Node: Attributes With CPU/GPU Data"
"__memoryType", "any"
"Categories", "tutorials"
"Generated Class Name", "OgnTutorialCpuGpuDataDatabase"
"Python Module", "omni.graph.tutorials"
|
omniverse-code/kit/exts/omni.graph.tutorials/ogn/docs/OgnTutorialExtendedTypesPy.rst | .. _omni_graph_tutorials_ExtendedTypesPy_1:
.. _omni_graph_tutorials_ExtendedTypesPy:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Tutorial Python Node: Extended Attribute Types
:keywords: lang-en omnigraph node tutorials tutorials extended-types-py
Tutorial Python Node: Extended Attribute Types
==============================================
.. <description>
This is a tutorial node. It exercises functionality for the manipulation of the extended attribute types. It is identical to OgnTutorialExtendedTypes.ogn, except the language of implementation is selected to be python.
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.tutorials<ext_omni_graph_tutorials>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"Flexible Values (*inputs:flexible*)", "``['float[3][]', 'token']``", "Flexible data type input", "None"
"Float Or Token (*inputs:floatOrToken*)", "``['float', 'token']``", "Attribute that can either be a float value or a token value", "None"
"To Negate (*inputs:toNegate*)", "``['bool[]', 'float[]']``", "Attribute that can either be an array of booleans or an array of floats", "None"
"Tuple Values (*inputs:tuple*)", "``any``", "Variable size/type tuple values", "None"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"Doubled Input Value (*outputs:doubledResult*)", "``any``", "If the input 'floatOrToken' is a float this is 2x the value. If it is a token this contains the input token repeated twice.", "None"
"Inverted Flexible Values (*outputs:flexible*)", "``['float[3][]', 'token']``", "Flexible data type output", "None"
"Negated Array Values (*outputs:negatedResult*)", "``['bool[]', 'float[]']``", "Result of negating the data from the 'toNegate' input", "None"
"Negative Tuple Values (*outputs:tuple*)", "``any``", "Negated values of the tuple input", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.tutorials.ExtendedTypesPy"
"Version", "1"
"Extension", "omni.graph.tutorials"
"Icon", "ogn/icons/omni.graph.tutorials.ExtendedTypesPy.svg"
"Has State?", "False"
"Implementation Language", "Python"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Tutorial Python Node: Extended Attribute Types"
"Categories", "tutorials"
"Generated Class Name", "OgnTutorialExtendedTypesPyDatabase"
"Python Module", "omni.graph.tutorials"
|
omniverse-code/kit/exts/omni.graph.tutorials/ogn/docs/OgnTutorialStateAttributesPy.rst | .. _omni_graph_tutorials_StateAttributesPy_1:
.. _omni_graph_tutorials_StateAttributesPy:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Tutorial Python Node: State Attributes
:keywords: lang-en omnigraph node tutorials tutorials state-attributes-py
Tutorial Python Node: State Attributes
======================================
.. <description>
This is a tutorial node. It exercises state attributes to remember data from on evaluation to the next.
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.tutorials<ext_omni_graph_tutorials>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"inputs:ignored", "``bool``", "Ignore me", "False"
State
-----
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"state:monotonic", "``int``", "The monotonically increasing output value, reset to 0 when the reset value is true", "None"
"state:reset", "``bool``", "If true then the inputs are ignored and outputs are set to default values, then this flag is set to false for subsequent evaluations.", "True"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.tutorials.StateAttributesPy"
"Version", "1"
"Extension", "omni.graph.tutorials"
"Icon", "ogn/icons/omni.graph.tutorials.StateAttributesPy.svg"
"Has State?", "True"
"Implementation Language", "Python"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Tutorial Python Node: State Attributes"
"Categories", "tutorials"
"Generated Class Name", "OgnTutorialStateAttributesPyDatabase"
"Python Module", "omni.graph.tutorials"
|
omniverse-code/kit/exts/omni.graph.tutorials/ogn/docs/OgnTutorialDefaults.rst | .. _omni_graph_tutorials_Defaults_1:
.. _omni_graph_tutorials_Defaults:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Tutorial Node: Defaults
:keywords: lang-en omnigraph node tutorials threadsafe tutorials defaults
Tutorial Node: Defaults
=======================
.. <description>
This is a tutorial node. It will move the values of inputs to corresponding outputs. Inputs all have unspecified, and therefore empty, default values.
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.tutorials<ext_omni_graph_tutorials>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"inputs:a_array", "``float[]``", "This is an attribute of type array of floats", "[]"
"inputs:a_bool", "``bool``", "This is an attribute of type boolean", "False"
"inputs:a_double", "``double``", "This is an attribute of type 64 bit floating point", "0.0"
"inputs:a_float", "``float``", "This is an attribute of type 32 bit floating point", "0.0"
"inputs:a_half", "``half``", "This is an attribute of type 16 bit floating point", "0.0"
"inputs:a_int", "``int``", "This is an attribute of type 32 bit integer", "0"
"inputs:a_int2", "``int[2]``", "This is an attribute of type 2-tuple of integers", "[0, 0]"
"inputs:a_int64", "``int64``", "This is an attribute of type 64 bit integer", "0"
"inputs:a_matrix", "``matrixd[2]``", "This is an attribute of type 2x2 matrix", "[[1.0, 0.0], [0.0, 1.0]]"
"inputs:a_string", "``string``", "This is an attribute of type string", ""
"inputs:a_token", "``token``", "This is an attribute of type interned string with fast comparison and hashing", ""
"inputs:a_uchar", "``uchar``", "This is an attribute of type unsigned 8 bit integer", "0"
"inputs:a_uint", "``uint``", "This is an attribute of type unsigned 32 bit integer", "0"
"inputs:a_uint64", "``uint64``", "This is an attribute of type unsigned 64 bit integer", "0"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"outputs:a_array", "``float[]``", "This is a computed attribute of type array of floats", "None"
"outputs:a_bool", "``bool``", "This is a computed attribute of type boolean", "None"
"outputs:a_double", "``double``", "This is a computed attribute of type 64 bit floating point", "None"
"outputs:a_float", "``float``", "This is a computed attribute of type 32 bit floating point", "None"
"outputs:a_half", "``half``", "This is a computed attribute of type 16 bit floating point", "None"
"outputs:a_int", "``int``", "This is a computed attribute of type 32 bit integer", "None"
"outputs:a_int2", "``int[2]``", "This is a computed attribute of type 2-tuple of integers", "None"
"outputs:a_int64", "``int64``", "This is a computed attribute of type 64 bit integer", "None"
"outputs:a_matrix", "``matrixd[2]``", "This is a computed attribute of type 2x2 matrix", "None"
"outputs:a_string", "``string``", "This is a computed attribute of type string", "None"
"outputs:a_token", "``token``", "This is a computed attribute of type interned string with fast comparison and hashing", "None"
"outputs:a_uchar", "``uchar``", "This is a computed attribute of type unsigned 8 bit integer", "None"
"outputs:a_uint", "``uint``", "This is a computed attribute of type unsigned 32 bit integer", "None"
"outputs:a_uint64", "``uint64``", "This is a computed attribute of type unsigned 64 bit integer", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.tutorials.Defaults"
"Version", "1"
"Extension", "omni.graph.tutorials"
"Icon", "ogn/icons/omni.graph.tutorials.Defaults.svg"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Tutorial Node: Defaults"
"Categories", "tutorials"
"Generated Class Name", "OgnTutorialDefaultsDatabase"
"Python Module", "omni.graph.tutorials"
|
omniverse-code/kit/exts/omni.graph.tutorials/ogn/docs/OgnTutorialCudaData.rst | .. _omni_graph_tutorials_CudaData_1:
.. _omni_graph_tutorials_CudaData:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Tutorial Node: Attributes With CUDA Data
:keywords: lang-en omnigraph node tutorials threadsafe tutorials cuda-data
Tutorial Node: Attributes With CUDA Data
========================================
.. <description>
This is a tutorial node. It performs different functions on the GPU to illustrate different types of data access. The first adds inputs 'a' and 'b' to yield output 'sum', all of which are on the GPU. The second is a sample expansion deformation that multiplies every point on a set of input points, stored on the GPU, by a constant value, stored on the CPU, to yield a set of output points, also on the GPU. The third is an assortment of different data types illustrating how different data is passed to the GPU. This particular node uses CUDA for its GPU computations, as indicated in the memory type value. Normal use case for GPU compute is large amounts of data. For testing purposes this node only handles a very small amount but the principle is the same.
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.tutorials<ext_omni_graph_tutorials>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"inputs:a", "``float``", "First value to be added in algorithm 1", "0.0"
"inputs:b", "``float``", "Second value to be added in algorithm 1", "0.0"
"inputs:color", "``colord[3]``", "Input with three doubles as a color for algorithm 3", "[1.0, 0.5, 1.0]"
"inputs:half", "``half``", "Input of type half for algorithm 3", "1.0"
"inputs:matrix", "``matrixd[4]``", "Input with 16 doubles interpreted as a double-precision 4d matrix", "[[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]]"
"inputs:multiplier", "``float[3]``", "Amplitude of the expansion for the input points in algorithm 2", "[1.0, 1.0, 1.0]"
"inputs:points", "``float[3][]``", "Points to be moved by algorithm 2", "[]"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"outputs:color", "``colord[3]``", "Output with three doubles as a color for algorithm 3", "None"
"outputs:half", "``half``", "Output of type half for algorithm 3", "None"
"outputs:matrix", "``matrixd[4]``", "Output with 16 doubles interpreted as a double-precision 4d matrix", "None"
"outputs:points", "``float[3][]``", "Final positions of points from algorithm 2", "None"
"outputs:sum", "``float``", "Sum of the two inputs from algorithm 1", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.tutorials.CudaData"
"Version", "1"
"Extension", "omni.graph.tutorials"
"Icon", "ogn/icons/omni.graph.tutorials.CudaData.svg"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cuda"
"Generated Code Exclusions", "None"
"uiName", "Tutorial Node: Attributes With CUDA Data"
"__memoryType", "cuda"
"Categories", "tutorials"
"Generated Class Name", "OgnTutorialCudaDataDatabase"
"Python Module", "omni.graph.tutorials"
|
omniverse-code/kit/exts/omni.graph.tutorials/ogn/docs/OgnTutorialCudaDataCpuPy.rst | .. _omni_graph_tutorials_CudaCpuArraysPy_1:
.. _omni_graph_tutorials_CudaCpuArraysPy:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Python Tutorial Node: Attributes With CUDA Array Pointers In Cpu Memory
:keywords: lang-en omnigraph node tutorials tutorials cuda-cpu-arrays-py
Python Tutorial Node: Attributes With CUDA Array Pointers In Cpu Memory
=======================================================================
.. <description>
This is a tutorial node. It illustrates the alternative method of extracting pointers to GPU array data in which the pointer returned is a CPU pointer and can be dereferenced on the CPU side. Without the cudaPointers value set that pointer would be a GPU pointer to an array of GPU pointers and could only be dereferenced on the device. Both plain attribute and bundle attribute extraction are shown.
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.tutorials<ext_omni_graph_tutorials>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"inputs:multiplier", "``float[3]``", "Amplitude of the expansion for the input points", "[1.0, 1.0, 1.0]"
"inputs:points", "``float[3][]``", "Array of points to be moved", "[]"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"outputs:outBundle", "``bundle``", "Bundle containing a copy of the output points", "None"
"outputs:points", "``float[3][]``", "Final positions of points", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.tutorials.CudaCpuArraysPy"
"Version", "1"
"Extension", "omni.graph.tutorials"
"Icon", "ogn/icons/omni.graph.tutorials.CudaCpuArraysPy.svg"
"Has State?", "False"
"Implementation Language", "Python"
"Default Memory Type", "cuda"
"Generated Code Exclusions", "None"
"__memoryType", "cuda"
"uiName", "Python Tutorial Node: Attributes With CUDA Array Pointers In Cpu Memory"
"Categories", "tutorials"
"Generated Class Name", "OgnTutorialCudaDataCpuPyDatabase"
"Python Module", "omni.graph.tutorials"
|
omniverse-code/kit/exts/omni.graph.tutorials/ogn/docs/OgnTutorialBundleDataPy.rst | .. _omni_graph_tutorials_BundleDataPy_1:
.. _omni_graph_tutorials_BundleDataPy:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Tutorial Python Node: Bundle Data
:keywords: lang-en omnigraph node tutorials tutorials bundle-data-py
Tutorial Python Node: Bundle Data
=================================
.. <description>
This is a tutorial node. It exercises functionality for access of data within bundle attributes. The configuration is the same as omni.graph.tutorials.BundleData except that the implementation language is Python
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.tutorials<ext_omni_graph_tutorials>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"Input Bundle (*inputs:bundle*)", "``bundle``", "Bundle whose contents are modified for passing to the output", "None"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"Output Bundle (*outputs:bundle*)", "``bundle``", "This is the bundle with values of known types doubled.", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.tutorials.BundleDataPy"
"Version", "1"
"Extension", "omni.graph.tutorials"
"Icon", "ogn/icons/omni.graph.tutorials.BundleDataPy.svg"
"Has State?", "False"
"Implementation Language", "Python"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Tutorial Python Node: Bundle Data"
"Categories", "tutorials"
"Generated Class Name", "OgnTutorialBundleDataPyDatabase"
"Python Module", "omni.graph.tutorials"
|
omniverse-code/kit/exts/omni.graph.tutorials/ogn/docs/OgnTutorialRoleData.rst | .. _omni_graph_tutorials_RoleData_1:
.. _omni_graph_tutorials_RoleData:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Tutorial Node: Role-Based Attributes
:keywords: lang-en omnigraph node tutorials threadsafe tutorials role-data
Tutorial Node: Role-Based Attributes
====================================
.. <description>
This is a tutorial node. It creates both an input and output attribute of every supported role-based data type. The values are modified in a simple way so that the compute modifies values.
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.tutorials<ext_omni_graph_tutorials>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"inputs:a_color3d", "``colord[3]``", "This is an attribute interpreted as a double-precision 3d color", "[0.0, 0.0, 0.0]"
"inputs:a_color3f", "``colorf[3]``", "This is an attribute interpreted as a single-precision 3d color", "[0.0, 0.0, 0.0]"
"inputs:a_color3h", "``colorh[3]``", "This is an attribute interpreted as a half-precision 3d color", "[0.0, 0.0, 0.0]"
"inputs:a_color4d", "``colord[4]``", "This is an attribute interpreted as a double-precision 4d color", "[0.0, 0.0, 0.0, 0.0]"
"inputs:a_color4f", "``colorf[4]``", "This is an attribute interpreted as a single-precision 4d color", "[0.0, 0.0, 0.0, 0.0]"
"inputs:a_color4h", "``colorh[4]``", "This is an attribute interpreted as a half-precision 4d color", "[0.0, 0.0, 0.0, 0.0]"
"inputs:a_frame", "``frame[4]``", "This is an attribute interpreted as a coordinate frame", "[[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]]"
"inputs:a_matrix2d", "``matrixd[2]``", "This is an attribute interpreted as a double-precision 2d matrix", "[[1.0, 0.0], [0.0, 1.0]]"
"inputs:a_matrix3d", "``matrixd[3]``", "This is an attribute interpreted as a double-precision 3d matrix", "[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]"
"inputs:a_matrix4d", "``matrixd[4]``", "This is an attribute interpreted as a double-precision 4d matrix", "[[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]]"
"inputs:a_normal3d", "``normald[3]``", "This is an attribute interpreted as a double-precision 3d normal", "[0.0, 0.0, 0.0]"
"inputs:a_normal3f", "``normalf[3]``", "This is an attribute interpreted as a single-precision 3d normal", "[0.0, 0.0, 0.0]"
"inputs:a_normal3h", "``normalh[3]``", "This is an attribute interpreted as a half-precision 3d normal", "[0.0, 0.0, 0.0]"
"inputs:a_point3d", "``pointd[3]``", "This is an attribute interpreted as a double-precision 3d point", "[0.0, 0.0, 0.0]"
"inputs:a_point3f", "``pointf[3]``", "This is an attribute interpreted as a single-precision 3d point", "[0.0, 0.0, 0.0]"
"inputs:a_point3h", "``pointh[3]``", "This is an attribute interpreted as a half-precision 3d point", "[0.0, 0.0, 0.0]"
"inputs:a_quatd", "``quatd[4]``", "This is an attribute interpreted as a double-precision 4d quaternion", "[0.0, 0.0, 0.0, 0.0]"
"inputs:a_quatf", "``quatf[4]``", "This is an attribute interpreted as a single-precision 4d quaternion", "[0.0, 0.0, 0.0, 0.0]"
"inputs:a_quath", "``quath[4]``", "This is an attribute interpreted as a half-precision 4d quaternion", "[0.0, 0.0, 0.0, 0.0]"
"inputs:a_texcoord2d", "``texcoordd[2]``", "This is an attribute interpreted as a double-precision 2d texcoord", "[0.0, 0.0]"
"inputs:a_texcoord2f", "``texcoordf[2]``", "This is an attribute interpreted as a single-precision 2d texcoord", "[0.0, 0.0]"
"inputs:a_texcoord2h", "``texcoordh[2]``", "This is an attribute interpreted as a half-precision 2d texcoord", "[0.0, 0.0]"
"inputs:a_texcoord3d", "``texcoordd[3]``", "This is an attribute interpreted as a double-precision 3d texcoord", "[0.0, 0.0, 0.0]"
"inputs:a_texcoord3f", "``texcoordf[3]``", "This is an attribute interpreted as a single-precision 3d texcoord", "[0.0, 0.0, 0.0]"
"inputs:a_texcoord3h", "``texcoordh[3]``", "This is an attribute interpreted as a half-precision 3d texcoord", "[0.0, 0.0, 0.0]"
"inputs:a_timecode", "``timecode``", "This is a computed attribute interpreted as a timecode", "1.0"
"inputs:a_vector3d", "``vectord[3]``", "This is an attribute interpreted as a double-precision 3d vector", "[0.0, 0.0, 0.0]"
"inputs:a_vector3f", "``vectorf[3]``", "This is an attribute interpreted as a single-precision 3d vector", "[0.0, 0.0, 0.0]"
"inputs:a_vector3h", "``vectorh[3]``", "This is an attribute interpreted as a half-precision 3d vector", "[0.0, 0.0, 0.0]"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"outputs:a_color3d", "``colord[3]``", "This is a computed attribute interpreted as a double-precision 3d color", "None"
"outputs:a_color3f", "``colorf[3]``", "This is a computed attribute interpreted as a single-precision 3d color", "None"
"outputs:a_color3h", "``colorh[3]``", "This is a computed attribute interpreted as a half-precision 3d color", "None"
"outputs:a_color4d", "``colord[4]``", "This is a computed attribute interpreted as a double-precision 4d color", "None"
"outputs:a_color4f", "``colorf[4]``", "This is a computed attribute interpreted as a single-precision 4d color", "None"
"outputs:a_color4h", "``colorh[4]``", "This is a computed attribute interpreted as a half-precision 4d color", "None"
"outputs:a_frame", "``frame[4]``", "This is a computed attribute interpreted as a coordinate frame", "None"
"outputs:a_matrix2d", "``matrixd[2]``", "This is a computed attribute interpreted as a double-precision 2d matrix", "None"
"outputs:a_matrix3d", "``matrixd[3]``", "This is a computed attribute interpreted as a double-precision 3d matrix", "None"
"outputs:a_matrix4d", "``matrixd[4]``", "This is a computed attribute interpreted as a double-precision 4d matrix", "None"
"outputs:a_normal3d", "``normald[3]``", "This is a computed attribute interpreted as a double-precision 3d normal", "None"
"outputs:a_normal3f", "``normalf[3]``", "This is a computed attribute interpreted as a single-precision 3d normal", "None"
"outputs:a_normal3h", "``normalh[3]``", "This is a computed attribute interpreted as a half-precision 3d normal", "None"
"outputs:a_point3d", "``pointd[3]``", "This is a computed attribute interpreted as a double-precision 3d point", "None"
"outputs:a_point3f", "``pointf[3]``", "This is a computed attribute interpreted as a single-precision 3d point", "None"
"outputs:a_point3h", "``pointh[3]``", "This is a computed attribute interpreted as a half-precision 3d point", "None"
"outputs:a_quatd", "``quatd[4]``", "This is a computed attribute interpreted as a double-precision 4d quaternion", "None"
"outputs:a_quatf", "``quatf[4]``", "This is a computed attribute interpreted as a single-precision 4d quaternion", "None"
"outputs:a_quath", "``quath[4]``", "This is a computed attribute interpreted as a half-precision 4d quaternion", "None"
"outputs:a_texcoord2d", "``texcoordd[2]``", "This is a computed attribute interpreted as a double-precision 2d texcoord", "None"
"outputs:a_texcoord2f", "``texcoordf[2]``", "This is a computed attribute interpreted as a single-precision 2d texcoord", "None"
"outputs:a_texcoord2h", "``texcoordh[2]``", "This is a computed attribute interpreted as a half-precision 2d texcoord", "None"
"outputs:a_texcoord3d", "``texcoordd[3]``", "This is a computed attribute interpreted as a double-precision 3d texcoord", "None"
"outputs:a_texcoord3f", "``texcoordf[3]``", "This is a computed attribute interpreted as a single-precision 3d texcoord", "None"
"outputs:a_texcoord3h", "``texcoordh[3]``", "This is a computed attribute interpreted as a half-precision 3d texcoord", "None"
"outputs:a_timecode", "``timecode``", "This is a computed attribute interpreted as a timecode", "None"
"outputs:a_vector3d", "``vectord[3]``", "This is a computed attribute interpreted as a double-precision 3d vector", "None"
"outputs:a_vector3f", "``vectorf[3]``", "This is a computed attribute interpreted as a single-precision 3d vector", "None"
"outputs:a_vector3h", "``vectorh[3]``", "This is a computed attribute interpreted as a half-precision 3d vector", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.tutorials.RoleData"
"Version", "1"
"Extension", "omni.graph.tutorials"
"Icon", "ogn/icons/omni.graph.tutorials.RoleData.svg"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Tutorial Node: Role-Based Attributes"
"Categories", "tutorials"
"Generated Class Name", "OgnTutorialRoleDataDatabase"
"Python Module", "omni.graph.tutorials"
|
omniverse-code/kit/exts/omni.graph.tutorials/ogn/docs/OgnTutorialDynamicAttributes.rst | .. _omni_graph_tutorials_DynamicAttributes_1:
.. _omni_graph_tutorials_DynamicAttributes:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Tutorial Node: Dynamic Attributes
:keywords: lang-en omnigraph node tutorials threadsafe tutorials dynamic-attributes
Tutorial Node: Dynamic Attributes
=================================
.. <description>
This is a C++ node that exercises the ability to add and remove database attribute accessors for dynamic attributes. When the dynamic attribute is added the property will exist and be able to get/set the attribute values. When it does not the property will not exist. The dynamic attribute names are found in the tokens below. If neither exist then the input value is copied to the output directly. If 'firstBit' exists then the 'firstBit'th bit of the input is x-ored for the copy. If 'secondBit' exists then the 'secondBit'th bit of the input is x-ored for the copy. (Recall bitwise match xor(0,0)=0, xor(0,1)=1, xor(1,0)=1, and xor(1,1)=0.) For example, if 'firstBit' is present and set to 1 then the bitmask will be b0010, where bit 1 is set. If the input is 7, or b0111, then the xor operation will flip bit 1, yielding b0101, or 5 as the result. If on the next run 'secondBit' is also present and set to 2 then its bitmask will be b0100, where bit 2 is set. The input of 7 (b0111) flips bit 1 because firstBit=1 and flips bit 2 because secondBit=2, yielding a final result of 1 (b0001).
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.tutorials<ext_omni_graph_tutorials>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"inputs:value", "``uint``", "Original value to be modified.", "0"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"outputs:result", "``uint``", "Modified value", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.tutorials.DynamicAttributes"
"Version", "1"
"Extension", "omni.graph.tutorials"
"Icon", "ogn/icons/omni.graph.tutorials.DynamicAttributes.svg"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Tutorial Node: Dynamic Attributes"
"__tokens", "{""firstBit"": ""inputs:firstBit"", ""secondBit"": ""inputs:secondBit"", ""invert"": ""inputs:invert""}"
"Categories", "tutorials"
"Generated Class Name", "OgnTutorialDynamicAttributesDatabase"
"Python Module", "omni.graph.tutorials"
|
omniverse-code/kit/exts/omni.graph.tutorials/ogn/docs/OgnTutorialVectorizedABIPassthrough.rst | .. _omni_graph_tutorials_TutorialVectorizedABIPassThrough_1:
.. _omni_graph_tutorials_TutorialVectorizedABIPassThrough:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Tutorial Node: Vectorized Passthrough via ABI
:keywords: lang-en omnigraph node tutorials tutorials tutorial-vectorized-a-b-i-pass-through
Tutorial Node: Vectorized Passthrough via ABI
=============================================
.. <description>
Simple passthrough node that copy its input to its output in a vectorized way
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.tutorials<ext_omni_graph_tutorials>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"inputs:value", "``float``", "input value", "0.0"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"outputs:value", "``float``", "output value", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.tutorials.TutorialVectorizedABIPassThrough"
"Version", "1"
"Extension", "omni.graph.tutorials"
"Icon", "ogn/icons/omni.graph.tutorials.TutorialVectorizedABIPassThrough.svg"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Tutorial Node: Vectorized Passthrough via ABI"
"Categories", "tutorials"
"Generated Class Name", "OgnTutorialVectorizedABIPassthroughDatabase"
"Python Module", "omni.graph.tutorials"
|
omniverse-code/kit/exts/omni.graph.tutorials/ogn/docs/OgnTutorialVectorizedPassthrough.rst | .. _omni_graph_tutorials_TutorialVectorizedPassThrough_1:
.. _omni_graph_tutorials_TutorialVectorizedPassThrough:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Tutorial Node: Vectorized Passthrough
:keywords: lang-en omnigraph node tutorials tutorials tutorial-vectorized-pass-through
Tutorial Node: Vectorized Passthrough
=====================================
.. <description>
Simple passthrough node that copy its input to its output in a vectorized way
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.tutorials<ext_omni_graph_tutorials>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"inputs:value", "``float``", "input value", "0.0"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"outputs:value", "``float``", "output value", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.tutorials.TutorialVectorizedPassThrough"
"Version", "1"
"Extension", "omni.graph.tutorials"
"Icon", "ogn/icons/omni.graph.tutorials.TutorialVectorizedPassThrough.svg"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Tutorial Node: Vectorized Passthrough"
"Categories", "tutorials"
"Generated Class Name", "OgnTutorialVectorizedPassthroughDatabase"
"Python Module", "omni.graph.tutorials"
|
omniverse-code/kit/exts/omni.graph.tutorials/ogn/docs/OgnTutorialComplexDataPy.rst | .. _omni_graph_tutorials_ComplexDataPy_1:
.. _omni_graph_tutorials_ComplexDataPy:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Tutorial Python Node: Attributes With Arrays of Tuples
:keywords: lang-en omnigraph node tutorials tutorials complex-data-py
Tutorial Python Node: Attributes With Arrays of Tuples
======================================================
.. <description>
This is a tutorial node written in Python. It will compute the point3f array by multiplying each element of the float array by the three element vector in the multiplier.
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.tutorials<ext_omni_graph_tutorials>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"inputs:a_inputArray", "``float[]``", "Input array", "[]"
"inputs:a_vectorMultiplier", "``float[3]``", "Vector multiplier", "[1.0, 2.0, 3.0]"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"outputs:a_productArray", "``pointf[3][]``", "Output array", "[]"
"outputs:a_tokenArray", "``token[]``", "String representations of the input array", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.tutorials.ComplexDataPy"
"Version", "1"
"Extension", "omni.graph.tutorials"
"Icon", "ogn/icons/omni.graph.tutorials.ComplexDataPy.svg"
"Has State?", "False"
"Implementation Language", "Python"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Tutorial Python Node: Attributes With Arrays of Tuples"
"Categories", "tutorials"
"Generated Class Name", "OgnTutorialComplexDataPyDatabase"
"Python Module", "omni.graph.tutorials"
|