file_path
stringlengths
21
202
content
stringlengths
12
1.02M
size
int64
12
1.02M
lang
stringclasses
9 values
avg_line_length
float64
3.33
100
max_line_length
int64
10
993
alphanum_fraction
float64
0.27
0.93
omniverse-code/kit/exts/omni.graph.examples.python/ogn/docs/OgnTestSingleton.rst
.. _omni_graph_examples_python_TestSingleton_1: .. _omni_graph_examples_python_TestSingleton: .. ================================================================================ .. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT. .. ================================================================================ :orphan: .. meta:: :title: Test Singleton :keywords: lang-en omnigraph node examples python test-singleton Test Singleton ============== .. <description> Example node that showcases the use of singleton nodes (nodes that can have only 1 instance) .. </description> Installation ------------ To use this node enable :ref:`omni.graph.examples.python<ext_omni_graph_examples_python>` in the Extension Manager. Outputs ------- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "outputs:out", "``double``", "The unique output of the only instance of this node", "None" Metadata -------- .. csv-table:: :header: "Name", "Value" :widths: 30,70 "Unique ID", "omni.graph.examples.python.TestSingleton" "Version", "1" "Extension", "omni.graph.examples.python" "Has State?", "False" "Implementation Language", "Python" "Default Memory Type", "cpu" "Generated Code Exclusions", "None" "singleton", "1" "uiName", "Test Singleton" "Categories", "examples" "Generated Class Name", "OgnTestSingletonDatabase" "Python Module", "omni.graph.examples.python"
1,488
reStructuredText
23.816666
115
0.583333
omniverse-code/kit/exts/omni.graph.examples.python/config/extension.toml
[package] title = "OmniGraph Python Examples" version = "1.3.2" category = "Graph" readme = "docs/README.md" changelog = "docs/CHANGELOG.md" description = "Contains a set of sample OmniGraph nodes implemented in Python." repository = "" keywords = ["kit", "omnigraph", "nodes", "python"] # Main module for the Python interface [[python.module]] name = "omni.graph.examples.python" # Watch the .ogn files for hot reloading (only works for Python files) [fswatcher.patterns] include = ["*.ogn", "*.py"] exclude = ["Ogn*Database.py"] # Python array data uses numpy as its format [python.pipapi] requirements = ["numpy"] # SWIPAT filed under: http://nvbugs/3193231 # Other extensions that need to load in order for this one to work [dependencies] "omni.graph" = {} "omni.graph.tools" = {} "omni.kit.test" = {} "omni.kit.pipapi" = {} [[test]] stdoutFailPatterns.exclude = [ "*[omni.graph.core.plugin] getTypes called on non-existent path*", "*Trying to create multiple instances of singleton*" ] [documentation] deps = [ ["kit-sdk", "_build/docs/kit-sdk/latest"], # WAR to include omni.graph refs until that workflow is moved ] pages = [ "docs/Overview.md", "docs/CHANGELOG.md", ]
1,199
TOML
25.666666
108
0.69558
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/__init__.py
"""Module containing example nodes written in pure Python. There is no public API to this module. """ __all__ = [] from ._impl.extension import _PublicExtension # noqa: F401
177
Python
21.249997
59
0.711864
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/ogn/OgnBouncingCubesGpuDatabase.py
"""Support for simplified access to data on nodes of type omni.graph.examples.python.BouncingCubesGpu Deprecated node - no longer supported """ import sys import traceback import omni.graph.core as og import omni.graph.core._omni_graph_core as _og import omni.graph.tools.ogn as ogn class OgnBouncingCubesGpuDatabase(og.Database): """Helper class providing simplified access to data on nodes of type omni.graph.examples.python.BouncingCubesGpu Class Members: node: Node being evaluated """ # Imprint the generator and target ABI versions in the file for JIT generation GENERATOR_VERSION = (1, 41, 3) TARGET_VERSION = (2, 139, 12) # This is an internal object that provides per-class storage of a per-node data dictionary PER_NODE_DATA = {} # This is an internal object that describes unchanging attributes in a generic way # The values in this list are in no particular order, as a per-attribute tuple # Name, Type, ExtendedTypeIndex, UiName, Description, Metadata, # Is_Required, DefaultValue, Is_Deprecated, DeprecationMsg # You should not need to access any of this data directly, use the defined database interfaces INTERFACE = og.Database._get_interface([ ]) class ValuesForInputs(og.DynamicAttributeAccess): LOCAL_PROPERTY_NAMES = { } """Helper class that creates natural hierarchical access to input attributes""" def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface): """Initialize simplified access for the attribute data""" context = node.get_graph().get_default_graph_context() super().__init__(context, node, attributes, dynamic_attributes) self._batchedReadAttributes = [] self._batchedReadValues = [] def _prefetch(self): readAttributes = self._batchedReadAttributes newValues = _og._prefetch_input_attributes_data(readAttributes) if len(readAttributes) == len(newValues): self._batchedReadValues = newValues class ValuesForOutputs(og.DynamicAttributeAccess): LOCAL_PROPERTY_NAMES = { } """Helper class that creates natural hierarchical access to output attributes""" def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface): """Initialize simplified access for the attribute data""" context = node.get_graph().get_default_graph_context() super().__init__(context, node, attributes, dynamic_attributes) self._batchedWriteValues = { } def _commit(self): _og._commit_output_attributes_data(self._batchedWriteValues) self._batchedWriteValues = { } class ValuesForState(og.DynamicAttributeAccess): """Helper class that creates natural hierarchical access to state attributes""" def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface): """Initialize simplified access for the attribute data""" context = node.get_graph().get_default_graph_context() super().__init__(context, node, attributes, dynamic_attributes) def __init__(self, node): super().__init__(node) dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT) self.inputs = OgnBouncingCubesGpuDatabase.ValuesForInputs(node, self.attributes.inputs, dynamic_attributes) dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_OUTPUT) self.outputs = OgnBouncingCubesGpuDatabase.ValuesForOutputs(node, self.attributes.outputs, dynamic_attributes) dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_STATE) self.state = OgnBouncingCubesGpuDatabase.ValuesForState(node, self.attributes.state, dynamic_attributes) class abi: """Class defining the ABI interface for the node type""" @staticmethod def get_node_type(): get_node_type_function = getattr(OgnBouncingCubesGpuDatabase.NODE_TYPE_CLASS, 'get_node_type', None) if callable(get_node_type_function): return get_node_type_function() return 'omni.graph.examples.python.BouncingCubesGpu' @staticmethod def compute(context, node): def database_valid(): return True try: per_node_data = OgnBouncingCubesGpuDatabase.PER_NODE_DATA[node.node_id()] db = per_node_data.get('_db') if db is None: db = OgnBouncingCubesGpuDatabase(node) per_node_data['_db'] = db if not database_valid(): per_node_data['_db'] = None return False except: db = OgnBouncingCubesGpuDatabase(node) try: compute_function = getattr(OgnBouncingCubesGpuDatabase.NODE_TYPE_CLASS, 'compute', None) if callable(compute_function) and compute_function.__code__.co_argcount > 1: return compute_function(context, node) db.inputs._prefetch() db.inputs._setting_locked = True with og.in_compute(): return OgnBouncingCubesGpuDatabase.NODE_TYPE_CLASS.compute(db) except Exception as error: stack_trace = "".join(traceback.format_tb(sys.exc_info()[2].tb_next)) db.log_error(f'Assertion raised in compute - {error}\n{stack_trace}', add_context=False) finally: db.inputs._setting_locked = False db.outputs._commit() return False @staticmethod def initialize(context, node): OgnBouncingCubesGpuDatabase._initialize_per_node_data(node) initialize_function = getattr(OgnBouncingCubesGpuDatabase.NODE_TYPE_CLASS, 'initialize', None) if callable(initialize_function): initialize_function(context, node) per_node_data = OgnBouncingCubesGpuDatabase.PER_NODE_DATA[node.node_id()] def on_connection_or_disconnection(*args): per_node_data['_db'] = None node.register_on_connected_callback(on_connection_or_disconnection) node.register_on_disconnected_callback(on_connection_or_disconnection) @staticmethod def release(node): release_function = getattr(OgnBouncingCubesGpuDatabase.NODE_TYPE_CLASS, 'release', None) if callable(release_function): release_function(node) OgnBouncingCubesGpuDatabase._release_per_node_data(node) @staticmethod def release_instance(node, target): OgnBouncingCubesGpuDatabase._release_per_node_instance_data(node, target) @staticmethod def update_node_version(context, node, old_version, new_version): update_node_version_function = getattr(OgnBouncingCubesGpuDatabase.NODE_TYPE_CLASS, 'update_node_version', None) if callable(update_node_version_function): return update_node_version_function(context, node, old_version, new_version) return False @staticmethod def initialize_type(node_type): initialize_type_function = getattr(OgnBouncingCubesGpuDatabase.NODE_TYPE_CLASS, 'initialize_type', None) needs_initializing = True if callable(initialize_type_function): needs_initializing = initialize_type_function(node_type) if needs_initializing: node_type.set_metadata(ogn.MetadataKeys.EXTENSION, "omni.graph.examples.python") node_type.set_metadata(ogn.MetadataKeys.UI_NAME, "Deprecated Node - Bouncing Cubes (GPU)") node_type.set_metadata(ogn.MetadataKeys.MEMORY_TYPE, "cuda") node_type.set_metadata(ogn.MetadataKeys.CATEGORIES, "examples") node_type.set_metadata(ogn.MetadataKeys.DESCRIPTION, "Deprecated node - no longer supported") node_type.set_metadata(ogn.MetadataKeys.EXCLUSIONS, "usd,test") node_type.set_metadata(ogn.MetadataKeys.LANGUAGE, "Python") node_type.set_metadata(ogn.MetadataKeys.MEMORY_TYPE, "cuda") node_type.set_has_state(True) @staticmethod def on_connection_type_resolve(node): on_connection_type_resolve_function = getattr(OgnBouncingCubesGpuDatabase.NODE_TYPE_CLASS, 'on_connection_type_resolve', None) if callable(on_connection_type_resolve_function): on_connection_type_resolve_function(node) NODE_TYPE_CLASS = None @staticmethod def register(node_type_class): OgnBouncingCubesGpuDatabase.NODE_TYPE_CLASS = node_type_class og.register_node_type(OgnBouncingCubesGpuDatabase.abi, 1) @staticmethod def deregister(): og.deregister_node_type("omni.graph.examples.python.BouncingCubesGpu")
9,183
Python
47.336842
138
0.653055
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/ogn/OgnBouncingCubesCpuDatabase.py
"""Support for simplified access to data on nodes of type omni.graph.examples.python.BouncingCubes Deprecated node - no longer supported """ import numpy import sys import traceback import omni.graph.core as og import omni.graph.core._omni_graph_core as _og import omni.graph.tools.ogn as ogn class OgnBouncingCubesCpuDatabase(og.Database): """Helper class providing simplified access to data on nodes of type omni.graph.examples.python.BouncingCubes Class Members: node: Node being evaluated Attribute Value Properties: State: state.translations state.velocities """ # Imprint the generator and target ABI versions in the file for JIT generation GENERATOR_VERSION = (1, 41, 3) TARGET_VERSION = (2, 139, 12) # This is an internal object that provides per-class storage of a per-node data dictionary PER_NODE_DATA = {} # This is an internal object that describes unchanging attributes in a generic way # The values in this list are in no particular order, as a per-attribute tuple # Name, Type, ExtendedTypeIndex, UiName, Description, Metadata, # Is_Required, DefaultValue, Is_Deprecated, DeprecationMsg # You should not need to access any of this data directly, use the defined database interfaces INTERFACE = og.Database._get_interface([ ('state:translations', 'float3[]', 0, 'Translations', 'Set of translation attributes gathered from the inputs.\nTranslations have velocities applied to them each evaluation.', {}, True, None, False, ''), ('state:velocities', 'float[]', 0, 'Velocities', 'Set of velocity attributes gathered from the inputs', {}, True, None, False, ''), ]) class ValuesForInputs(og.DynamicAttributeAccess): LOCAL_PROPERTY_NAMES = { } """Helper class that creates natural hierarchical access to input attributes""" def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface): """Initialize simplified access for the attribute data""" context = node.get_graph().get_default_graph_context() super().__init__(context, node, attributes, dynamic_attributes) self._batchedReadAttributes = [] self._batchedReadValues = [] def _prefetch(self): readAttributes = self._batchedReadAttributes newValues = _og._prefetch_input_attributes_data(readAttributes) if len(readAttributes) == len(newValues): self._batchedReadValues = newValues class ValuesForOutputs(og.DynamicAttributeAccess): LOCAL_PROPERTY_NAMES = { } """Helper class that creates natural hierarchical access to output attributes""" def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface): """Initialize simplified access for the attribute data""" context = node.get_graph().get_default_graph_context() super().__init__(context, node, attributes, dynamic_attributes) self._batchedWriteValues = { } def _commit(self): _og._commit_output_attributes_data(self._batchedWriteValues) self._batchedWriteValues = { } class ValuesForState(og.DynamicAttributeAccess): """Helper class that creates natural hierarchical access to state attributes""" def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface): """Initialize simplified access for the attribute data""" context = node.get_graph().get_default_graph_context() super().__init__(context, node, attributes, dynamic_attributes) self.translations_size = None self.velocities_size = None @property def translations(self): data_view = og.AttributeValueHelper(self._attributes.translations) self.translations_size = data_view.get_array_size() return data_view.get() @translations.setter def translations(self, value): data_view = og.AttributeValueHelper(self._attributes.translations) data_view.set(value) self.translations_size = data_view.get_array_size() @property def velocities(self): data_view = og.AttributeValueHelper(self._attributes.velocities) self.velocities_size = data_view.get_array_size() return data_view.get() @velocities.setter def velocities(self, value): data_view = og.AttributeValueHelper(self._attributes.velocities) data_view.set(value) self.velocities_size = data_view.get_array_size() def __init__(self, node): super().__init__(node) dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT) self.inputs = OgnBouncingCubesCpuDatabase.ValuesForInputs(node, self.attributes.inputs, dynamic_attributes) dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_OUTPUT) self.outputs = OgnBouncingCubesCpuDatabase.ValuesForOutputs(node, self.attributes.outputs, dynamic_attributes) dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_STATE) self.state = OgnBouncingCubesCpuDatabase.ValuesForState(node, self.attributes.state, dynamic_attributes) class abi: """Class defining the ABI interface for the node type""" @staticmethod def get_node_type(): get_node_type_function = getattr(OgnBouncingCubesCpuDatabase.NODE_TYPE_CLASS, 'get_node_type', None) if callable(get_node_type_function): return get_node_type_function() return 'omni.graph.examples.python.BouncingCubes' @staticmethod def compute(context, node): def database_valid(): return True try: per_node_data = OgnBouncingCubesCpuDatabase.PER_NODE_DATA[node.node_id()] db = per_node_data.get('_db') if db is None: db = OgnBouncingCubesCpuDatabase(node) per_node_data['_db'] = db if not database_valid(): per_node_data['_db'] = None return False except: db = OgnBouncingCubesCpuDatabase(node) try: compute_function = getattr(OgnBouncingCubesCpuDatabase.NODE_TYPE_CLASS, 'compute', None) if callable(compute_function) and compute_function.__code__.co_argcount > 1: return compute_function(context, node) db.inputs._prefetch() db.inputs._setting_locked = True with og.in_compute(): return OgnBouncingCubesCpuDatabase.NODE_TYPE_CLASS.compute(db) except Exception as error: stack_trace = "".join(traceback.format_tb(sys.exc_info()[2].tb_next)) db.log_error(f'Assertion raised in compute - {error}\n{stack_trace}', add_context=False) finally: db.inputs._setting_locked = False db.outputs._commit() return False @staticmethod def initialize(context, node): OgnBouncingCubesCpuDatabase._initialize_per_node_data(node) initialize_function = getattr(OgnBouncingCubesCpuDatabase.NODE_TYPE_CLASS, 'initialize', None) if callable(initialize_function): initialize_function(context, node) per_node_data = OgnBouncingCubesCpuDatabase.PER_NODE_DATA[node.node_id()] def on_connection_or_disconnection(*args): per_node_data['_db'] = None node.register_on_connected_callback(on_connection_or_disconnection) node.register_on_disconnected_callback(on_connection_or_disconnection) @staticmethod def release(node): release_function = getattr(OgnBouncingCubesCpuDatabase.NODE_TYPE_CLASS, 'release', None) if callable(release_function): release_function(node) OgnBouncingCubesCpuDatabase._release_per_node_data(node) @staticmethod def release_instance(node, target): OgnBouncingCubesCpuDatabase._release_per_node_instance_data(node, target) @staticmethod def update_node_version(context, node, old_version, new_version): update_node_version_function = getattr(OgnBouncingCubesCpuDatabase.NODE_TYPE_CLASS, 'update_node_version', None) if callable(update_node_version_function): return update_node_version_function(context, node, old_version, new_version) return False @staticmethod def initialize_type(node_type): initialize_type_function = getattr(OgnBouncingCubesCpuDatabase.NODE_TYPE_CLASS, 'initialize_type', None) needs_initializing = True if callable(initialize_type_function): needs_initializing = initialize_type_function(node_type) if needs_initializing: node_type.set_metadata(ogn.MetadataKeys.EXTENSION, "omni.graph.examples.python") node_type.set_metadata(ogn.MetadataKeys.UI_NAME, "Deprecated Node - Bouncing Cubes (GPU)") node_type.set_metadata(ogn.MetadataKeys.CATEGORIES, "examples") node_type.set_metadata(ogn.MetadataKeys.DESCRIPTION, "Deprecated node - no longer supported") node_type.set_metadata(ogn.MetadataKeys.LANGUAGE, "Python") OgnBouncingCubesCpuDatabase.INTERFACE.add_to_node_type(node_type) node_type.set_has_state(True) @staticmethod def on_connection_type_resolve(node): on_connection_type_resolve_function = getattr(OgnBouncingCubesCpuDatabase.NODE_TYPE_CLASS, 'on_connection_type_resolve', None) if callable(on_connection_type_resolve_function): on_connection_type_resolve_function(node) NODE_TYPE_CLASS = None @staticmethod def register(node_type_class): OgnBouncingCubesCpuDatabase.NODE_TYPE_CLASS = node_type_class og.register_node_type(OgnBouncingCubesCpuDatabase.abi, 1) @staticmethod def deregister(): og.deregister_node_type("omni.graph.examples.python.BouncingCubes")
10,508
Python
46.337838
211
0.649505
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/ogn/OgnPositionToColorDatabase.py
"""Support for simplified access to data on nodes of type omni.graph.examples.python.PositionToColor This node takes positional data (double3) and converts to a color, and outputs as color3f[] (which seems to be the default color connection in USD) """ import numpy import sys import traceback import omni.graph.core as og import omni.graph.core._omni_graph_core as _og import omni.graph.tools.ogn as ogn class OgnPositionToColorDatabase(og.Database): """Helper class providing simplified access to data on nodes of type omni.graph.examples.python.PositionToColor Class Members: node: Node being evaluated Attribute Value Properties: Inputs: inputs.color_offset inputs.position inputs.scale Outputs: outputs.color """ # Imprint the generator and target ABI versions in the file for JIT generation GENERATOR_VERSION = (1, 41, 3) TARGET_VERSION = (2, 139, 12) # This is an internal object that provides per-class storage of a per-node data dictionary PER_NODE_DATA = {} # This is an internal object that describes unchanging attributes in a generic way # The values in this list are in no particular order, as a per-attribute tuple # Name, Type, ExtendedTypeIndex, UiName, Description, Metadata, # Is_Required, DefaultValue, Is_Deprecated, DeprecationMsg # You should not need to access any of this data directly, use the defined database interfaces INTERFACE = og.Database._get_interface([ ('inputs:color_offset', 'color3f', 0, None, 'Offset added to the scaled color to get the final result', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''), ('inputs:position', 'double3', 0, None, 'Position to be converted to a color', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''), ('inputs:scale', 'float', 0, None, 'Constant by which to multiply the position to get the color', {ogn.MetadataKeys.DEFAULT: '1.0'}, True, 1.0, False, ''), ('outputs:color', 'color3f[]', 0, None, 'Color value extracted from the position', {}, True, None, False, ''), ]) @classmethod def _populate_role_data(cls): """Populate a role structure with the non-default roles on this node type""" role_data = super()._populate_role_data() role_data.inputs.color_offset = og.AttributeRole.COLOR role_data.outputs.color = og.AttributeRole.COLOR return role_data class ValuesForInputs(og.DynamicAttributeAccess): LOCAL_PROPERTY_NAMES = {"color_offset", "position", "scale", "_setting_locked", "_batchedReadAttributes", "_batchedReadValues"} """Helper class that creates natural hierarchical access to input attributes""" def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface): """Initialize simplified access for the attribute data""" context = node.get_graph().get_default_graph_context() super().__init__(context, node, attributes, dynamic_attributes) self._batchedReadAttributes = [self._attributes.color_offset, self._attributes.position, self._attributes.scale] self._batchedReadValues = [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], 1.0] @property def color_offset(self): return self._batchedReadValues[0] @color_offset.setter def color_offset(self, value): self._batchedReadValues[0] = value @property def position(self): return self._batchedReadValues[1] @position.setter def position(self, value): self._batchedReadValues[1] = value @property def scale(self): return self._batchedReadValues[2] @scale.setter def scale(self, value): self._batchedReadValues[2] = value def __getattr__(self, item: str): if item in self.LOCAL_PROPERTY_NAMES: return object.__getattribute__(self, item) else: return super().__getattr__(item) def __setattr__(self, item: str, new_value): if item in self.LOCAL_PROPERTY_NAMES: object.__setattr__(self, item, new_value) else: super().__setattr__(item, new_value) def _prefetch(self): readAttributes = self._batchedReadAttributes newValues = _og._prefetch_input_attributes_data(readAttributes) if len(readAttributes) == len(newValues): self._batchedReadValues = newValues class ValuesForOutputs(og.DynamicAttributeAccess): LOCAL_PROPERTY_NAMES = { } """Helper class that creates natural hierarchical access to output attributes""" def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface): """Initialize simplified access for the attribute data""" context = node.get_graph().get_default_graph_context() super().__init__(context, node, attributes, dynamic_attributes) self.color_size = None self._batchedWriteValues = { } @property def color(self): data_view = og.AttributeValueHelper(self._attributes.color) return data_view.get(reserved_element_count=self.color_size) @color.setter def color(self, value): data_view = og.AttributeValueHelper(self._attributes.color) data_view.set(value) self.color_size = data_view.get_array_size() def _commit(self): _og._commit_output_attributes_data(self._batchedWriteValues) self._batchedWriteValues = { } class ValuesForState(og.DynamicAttributeAccess): """Helper class that creates natural hierarchical access to state attributes""" def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface): """Initialize simplified access for the attribute data""" context = node.get_graph().get_default_graph_context() super().__init__(context, node, attributes, dynamic_attributes) def __init__(self, node): super().__init__(node) dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT) self.inputs = OgnPositionToColorDatabase.ValuesForInputs(node, self.attributes.inputs, dynamic_attributes) dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_OUTPUT) self.outputs = OgnPositionToColorDatabase.ValuesForOutputs(node, self.attributes.outputs, dynamic_attributes) dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_STATE) self.state = OgnPositionToColorDatabase.ValuesForState(node, self.attributes.state, dynamic_attributes) class abi: """Class defining the ABI interface for the node type""" @staticmethod def get_node_type(): get_node_type_function = getattr(OgnPositionToColorDatabase.NODE_TYPE_CLASS, 'get_node_type', None) if callable(get_node_type_function): return get_node_type_function() return 'omni.graph.examples.python.PositionToColor' @staticmethod def compute(context, node): def database_valid(): return True try: per_node_data = OgnPositionToColorDatabase.PER_NODE_DATA[node.node_id()] db = per_node_data.get('_db') if db is None: db = OgnPositionToColorDatabase(node) per_node_data['_db'] = db if not database_valid(): per_node_data['_db'] = None return False except: db = OgnPositionToColorDatabase(node) try: compute_function = getattr(OgnPositionToColorDatabase.NODE_TYPE_CLASS, 'compute', None) if callable(compute_function) and compute_function.__code__.co_argcount > 1: return compute_function(context, node) db.inputs._prefetch() db.inputs._setting_locked = True with og.in_compute(): return OgnPositionToColorDatabase.NODE_TYPE_CLASS.compute(db) except Exception as error: stack_trace = "".join(traceback.format_tb(sys.exc_info()[2].tb_next)) db.log_error(f'Assertion raised in compute - {error}\n{stack_trace}', add_context=False) finally: db.inputs._setting_locked = False db.outputs._commit() return False @staticmethod def initialize(context, node): OgnPositionToColorDatabase._initialize_per_node_data(node) initialize_function = getattr(OgnPositionToColorDatabase.NODE_TYPE_CLASS, 'initialize', None) if callable(initialize_function): initialize_function(context, node) per_node_data = OgnPositionToColorDatabase.PER_NODE_DATA[node.node_id()] def on_connection_or_disconnection(*args): per_node_data['_db'] = None node.register_on_connected_callback(on_connection_or_disconnection) node.register_on_disconnected_callback(on_connection_or_disconnection) @staticmethod def release(node): release_function = getattr(OgnPositionToColorDatabase.NODE_TYPE_CLASS, 'release', None) if callable(release_function): release_function(node) OgnPositionToColorDatabase._release_per_node_data(node) @staticmethod def release_instance(node, target): OgnPositionToColorDatabase._release_per_node_instance_data(node, target) @staticmethod def update_node_version(context, node, old_version, new_version): update_node_version_function = getattr(OgnPositionToColorDatabase.NODE_TYPE_CLASS, 'update_node_version', None) if callable(update_node_version_function): return update_node_version_function(context, node, old_version, new_version) return False @staticmethod def initialize_type(node_type): initialize_type_function = getattr(OgnPositionToColorDatabase.NODE_TYPE_CLASS, 'initialize_type', None) needs_initializing = True if callable(initialize_type_function): needs_initializing = initialize_type_function(node_type) if needs_initializing: node_type.set_metadata(ogn.MetadataKeys.EXTENSION, "omni.graph.examples.python") node_type.set_metadata(ogn.MetadataKeys.UI_NAME, "PositionToColor") node_type.set_metadata(ogn.MetadataKeys.CATEGORIES, "examples") node_type.set_metadata(ogn.MetadataKeys.DESCRIPTION, "This node takes positional data (double3) and converts to a color, and outputs as color3f[] (which seems to be the default color connection in USD)") node_type.set_metadata(ogn.MetadataKeys.LANGUAGE, "Python") OgnPositionToColorDatabase.INTERFACE.add_to_node_type(node_type) @staticmethod def on_connection_type_resolve(node): on_connection_type_resolve_function = getattr(OgnPositionToColorDatabase.NODE_TYPE_CLASS, 'on_connection_type_resolve', None) if callable(on_connection_type_resolve_function): on_connection_type_resolve_function(node) NODE_TYPE_CLASS = None @staticmethod def register(node_type_class): OgnPositionToColorDatabase.NODE_TYPE_CLASS = node_type_class og.register_node_type(OgnPositionToColorDatabase.abi, 1) @staticmethod def deregister(): og.deregister_node_type("omni.graph.examples.python.PositionToColor")
12,043
Python
45.863813
220
0.639708
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/ogn/python/nodes/tutorial1/OgnAbsDouble.py
""" Implementation of an OmniGraph node takes the absolute value of a number """ class OgnAbsDouble: @staticmethod def compute(db): db.outputs.out = abs(db.inputs.num) return True
206
Python
17.81818
72
0.669903
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/ogn/python/nodes/tutorial1/OgnComposeDouble3.py
""" Implementation of an OmniGraph node that composes a double3 from its components """ class OgnComposeDouble3: @staticmethod def compute(db): db.outputs.double3 = (db.inputs.x, db.inputs.y, db.inputs.z) return True
243
Python
21.181816
79
0.687243
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/ogn/python/nodes/tutorial1/OgnDeformerYAxis.py
""" Implementation of an OmniGraph node that deforms a surface using a sine wave """ import numpy as np class OgnDeformerYAxis: @staticmethod def compute(db): """Deform the input points by a multiple of the sine wave""" points = db.inputs.points multiplier = db.inputs.multiplier wavelength = db.inputs.wavelength offset = db.inputs.offset db.outputs.points_size = points.shape[0] # Nothing to evaluate if there are no input points if db.outputs.points_size == 0: return True output_points = db.outputs.points if wavelength <= 0: wavelength = 1.0 pt = points.copy() # we still need to do a copy here because we do not want to modify points tx = pt[:, 0] offset_tx = tx + offset disp = np.sin(offset_tx / wavelength) pt[:, 1] += disp * multiplier output_points[:] = pt[:] # we modify output_points in memory so we do not need to set the value again return True
1,037
Python
29.529411
110
0.612343
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/ogn/python/nodes/tutorial1/OgnClampDouble.py
""" Implementation of an OmniGraph node that clamps a double value """ class OgnClampDouble: @staticmethod def compute(db): if db.inputs.num < db.inputs.min: db.outputs.out = db.inputs.min elif db.inputs.num > db.inputs.max: db.outputs.out = db.inputs.max else: db.outputs.out = db.inputs.num return True
384
Python
21.647058
62
0.596354
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/ogn/python/nodes/tutorial1/OgnDecomposeDouble3.py
""" Implementation of an OmniGraph node that decomposes a double3 into its comonents """ class OgnDecomposeDouble3: @staticmethod def compute(db): in_double3 = db.inputs.double3 db.outputs.x = in_double3[0] db.outputs.y = in_double3[1] db.outputs.z = in_double3[2] return True
327
Python
22.42857
80
0.64526
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/ogn/python/nodes/tutorial1/OgnMultDouble.py
""" Implementation of an OmniGraph node that calculates a * b """ class OgnMultDouble: @staticmethod def compute(db): db.outputs.out = db.inputs.a * db.inputs.b return True
199
Python
17.181817
57
0.648241
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/ogn/python/nodes/tutorial1/OgnSubtractDouble.py
""" Implementation of an OmniGraph node that subtracts b from a """ class OgnSubtractDouble: @staticmethod def compute(db): db.outputs.out = db.inputs.a - db.inputs.b return True
205
Python
17.727271
59
0.663415
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/ogn/python/nodes/tutorial1/OgnPositionToColor.py
""" Implementation of the node algorith to convert a position to a color """ class OgnPositionToColor: """ This node takes positional data (double3) and converts to a color, and outputs as color3f[] (which seems to be the default color connection in USD) """ @staticmethod def compute(db): """Run the algorithm to convert a position to a color""" position = db.inputs.position scale_value = db.inputs.scale color_offset = db.inputs.color_offset color = (abs(position[:])) / scale_value color += color_offset ramp = (scale_value - abs(position[0])) / scale_value ramp = max(ramp, 0) color[0] -= ramp if color[0] < 0: color[0] = 0 color[1] += ramp if color[1] > 1: color[1] = 1 color[2] -= ramp if color[2] < 0: color[2] = 0 db.outputs.color_size = 1 db.outputs.color[0] = color return True
993
Python
24.487179
82
0.558912
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/ogn/python/nodes/realtime/OgnBouncingCubesCpu.py
""" Example node showing realtime update from gathered data. """ class OgnBouncingCubesCpu: @staticmethod def compute(db): velocities = db.state.velocities translations = db.state.translations # Empty input means nothing to do if translations.size == 0 or velocities.size == 0: return True h = 1.0 / 60.0 g = -1000.0 for ii, velocity in enumerate(velocities): velocity += h * g translations[ii][2] += h * velocity if translations[ii][2] < 1.0: translations[ii][2] = 1.0 velocity = -5 * h * g translations[0][0] += 0.03 translations[1][0] += 0.03 # We no longer need to set values because we do not copy memory of the numpy arrays # Mutating the numpy array will also mutate the attribute data # Alternative, setting values using the below lines will also work # context.set_attr_value(translations, attr_translations) # context.set_attr_value(velocities, attr_translations) return True
1,102
Python
29.638888
91
0.598004
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/ogn/python/nodes/realtime/OgnBouncingCubesGpu.py
""" Example node showing realtime update from gathered data computed on the GPU. """ class OgnBouncingCubesGpu: @staticmethod def compute(db): # This is how it should work when gather is fully supported # velocities = db.state.velocities # translations = db.state.translations attr_velocities = db.node.get_attribute("state:velocities") attr_translations = db.node.get_attribute("state:translations") velocities = db.context_helper.get_attr_value(attr_velocities, isGPU=True, isTensor=True) translations = db.context_helper.get_attr_value(attr_translations, isGPU=True, isTensor=True) # When there is no data there is nothing to do if velocities.size == 0 or translations.size == 0: return True h = 1.0 / 60.0 g = -1000.0 velocities += h * g translations[:, 2] += h * velocities translations_z = translations.split(1, dim=1)[2].squeeze(-1) update_idx = (translations_z < 1.0).nonzero().squeeze(-1) if update_idx.shape[0] > 0: translations[update_idx, 2] = 1 velocities[update_idx] = -5 * h * g translations[:, 0] += 0.03 # We no longer need to set values because we do not copy memory of the numpy arrays # Mutating the numpy array will also mutate the attribute data # Computegraph APIs using torch tensors currently do not have support for setting values. # context.set_attr_value(translations, attr_translations) # context.set_attr_value(velocities, attr_translations) return True
1,624
Python
35.11111
101
0.644089
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/ogn/python/nodes/utility/OgnPyUniversalAdd.py
class OgnPyUniversalAdd: @staticmethod def compute(db): db.outputs.bool_0 = db.inputs.bool_0 ^ db.inputs.bool_1 db.outputs.bool_arr_0 = [ db.inputs.bool_arr_0[i] ^ db.inputs.bool_arr_1[i] for i in range(len(db.inputs.bool_arr_0)) ] db.outputs.colord3_0 = db.inputs.colord3_0 + db.inputs.colord3_1 db.outputs.colord4_0 = db.inputs.colord4_0 + db.inputs.colord4_1 db.outputs.colord3_arr_0 = db.inputs.colord3_arr_0 + db.inputs.colord3_arr_1 db.outputs.colord4_arr_0 = db.inputs.colord4_arr_0 + db.inputs.colord4_arr_1 db.outputs.colorf3_0 = db.inputs.colorf3_0 + db.inputs.colorf3_1 db.outputs.colorf4_0 = db.inputs.colorf4_0 + db.inputs.colorf4_1 db.outputs.colorf3_arr_0 = db.inputs.colorf3_arr_0 + db.inputs.colorf3_arr_1 db.outputs.colorf4_arr_0 = db.inputs.colorf4_arr_0 + db.inputs.colorf4_arr_1 db.outputs.colorh3_0 = db.inputs.colorh3_0 + db.inputs.colorh3_1 db.outputs.colorh4_0 = db.inputs.colorh4_0 + db.inputs.colorh4_1 db.outputs.colorh3_arr_0 = db.inputs.colorh3_arr_0 + db.inputs.colorh3_arr_1 db.outputs.colorh4_arr_0 = db.inputs.colorh4_arr_0 + db.inputs.colorh4_arr_1 db.outputs.double_0 = db.inputs.double_0 + db.inputs.double_1 db.outputs.double2_0 = db.inputs.double2_0 + db.inputs.double2_1 db.outputs.double3_0 = db.inputs.double3_0 + db.inputs.double3_1 db.outputs.double4_0 = db.inputs.double4_0 + db.inputs.double4_1 db.outputs.double_arr_0 = db.inputs.double_arr_0 + db.inputs.double_arr_1 db.outputs.double2_arr_0 = db.inputs.double2_arr_0 + db.inputs.double2_arr_1 db.outputs.double3_arr_0 = db.inputs.double3_arr_0 + db.inputs.double3_arr_1 db.outputs.double4_arr_0 = db.inputs.double4_arr_0 + db.inputs.double4_arr_1 db.outputs.float_0 = db.inputs.float_0 + db.inputs.float_1 db.outputs.float2_0 = db.inputs.float2_0 + db.inputs.float2_1 db.outputs.float3_0 = db.inputs.float3_0 + db.inputs.float3_1 db.outputs.float4_0 = db.inputs.float4_0 + db.inputs.float4_1 db.outputs.float_arr_0 = db.inputs.float_arr_0 + db.inputs.float_arr_1 db.outputs.float2_arr_0 = db.inputs.float2_arr_0 + db.inputs.float2_arr_1 db.outputs.float3_arr_0 = db.inputs.float3_arr_0 + db.inputs.float3_arr_1 db.outputs.float4_arr_0 = db.inputs.float4_arr_0 + db.inputs.float4_arr_1 db.outputs.frame4_0 = db.inputs.frame4_0 + db.inputs.frame4_1 db.outputs.frame4_arr_0 = db.inputs.frame4_arr_0 + db.inputs.frame4_arr_1 db.outputs.half_0 = db.inputs.half_0 + db.inputs.half_1 db.outputs.half2_0 = db.inputs.half2_0 + db.inputs.half2_1 db.outputs.half3_0 = db.inputs.half3_0 + db.inputs.half3_1 db.outputs.half4_0 = db.inputs.half4_0 + db.inputs.half4_1 db.outputs.half_arr_0 = db.inputs.half_arr_0 + db.inputs.half_arr_1 db.outputs.half2_arr_0 = db.inputs.half2_arr_0 + db.inputs.half2_arr_1 db.outputs.half3_arr_0 = db.inputs.half3_arr_0 + db.inputs.half3_arr_1 db.outputs.half4_arr_0 = db.inputs.half4_arr_0 + db.inputs.half4_arr_1 db.outputs.int_0 = db.inputs.int_0 + db.inputs.int_1 db.outputs.int2_0 = db.inputs.int2_0 + db.inputs.int2_1 db.outputs.int3_0 = db.inputs.int3_0 + db.inputs.int3_1 db.outputs.int4_0 = db.inputs.int4_0 + db.inputs.int4_1 db.outputs.int_arr_0 = db.inputs.int_arr_0 + db.inputs.int_arr_1 db.outputs.int2_arr_0 = db.inputs.int2_arr_0 + db.inputs.int2_arr_1 db.outputs.int3_arr_0 = db.inputs.int3_arr_0 + db.inputs.int3_arr_1 db.outputs.int4_arr_0 = db.inputs.int4_arr_0 + db.inputs.int4_arr_1 db.outputs.int64_0 = db.inputs.int64_0 + db.inputs.int64_1 db.outputs.int64_arr_0 = db.inputs.int64_arr_0 + db.inputs.int64_arr_1 db.outputs.matrixd2_0 = db.inputs.matrixd2_0 + db.inputs.matrixd2_1 db.outputs.matrixd3_0 = db.inputs.matrixd3_0 + db.inputs.matrixd3_1 db.outputs.matrixd4_0 = db.inputs.matrixd4_0 + db.inputs.matrixd4_1 db.outputs.matrixd2_arr_0 = db.inputs.matrixd2_arr_0 + db.inputs.matrixd2_arr_1 db.outputs.matrixd3_arr_0 = db.inputs.matrixd3_arr_0 + db.inputs.matrixd3_arr_1 db.outputs.matrixd4_arr_0 = db.inputs.matrixd4_arr_0 + db.inputs.matrixd4_arr_1 db.outputs.normald3_0 = db.inputs.normald3_0 + db.inputs.normald3_1 db.outputs.normald3_arr_0 = db.inputs.normald3_arr_0 + db.inputs.normald3_arr_1 db.outputs.normalf3_0 = db.inputs.normalf3_0 + db.inputs.normalf3_1 db.outputs.normalf3_arr_0 = db.inputs.normalf3_arr_0 + db.inputs.normalf3_arr_1 db.outputs.normalh3_0 = db.inputs.normalh3_0 + db.inputs.normalh3_1 db.outputs.normalh3_arr_0 = db.inputs.normalh3_arr_0 + db.inputs.normalh3_arr_1 db.outputs.pointd3_0 = db.inputs.pointd3_0 + db.inputs.pointd3_1 db.outputs.pointd3_arr_0 = db.inputs.pointd3_arr_0 + db.inputs.pointd3_arr_1 db.outputs.pointf3_0 = db.inputs.pointf3_0 + db.inputs.pointf3_1 db.outputs.pointf3_arr_0 = db.inputs.pointf3_arr_0 + db.inputs.pointf3_arr_1 db.outputs.pointh3_0 = db.inputs.pointh3_0 + db.inputs.pointh3_1 db.outputs.pointh3_arr_0 = db.inputs.pointh3_arr_0 + db.inputs.pointh3_arr_1 db.outputs.quatd4_0 = db.inputs.quatd4_0 + db.inputs.quatd4_1 db.outputs.quatd4_arr_0 = db.inputs.quatd4_arr_0 + db.inputs.quatd4_arr_1 db.outputs.quatf4_0 = db.inputs.quatf4_0 + db.inputs.quatf4_1 db.outputs.quatf4_arr_0 = db.inputs.quatf4_arr_0 + db.inputs.quatf4_arr_1 db.outputs.quath4_0 = db.inputs.quath4_0 + db.inputs.quath4_1 db.outputs.quath4_arr_0 = db.inputs.quath4_arr_0 + db.inputs.quath4_arr_1 db.outputs.texcoordd2_0 = db.inputs.texcoordd2_0 + db.inputs.texcoordd2_1 db.outputs.texcoordd3_0 = db.inputs.texcoordd3_0 + db.inputs.texcoordd3_1 db.outputs.texcoordd2_arr_0 = db.inputs.texcoordd2_arr_0 + db.inputs.texcoordd2_arr_1 db.outputs.texcoordd3_arr_0 = db.inputs.texcoordd3_arr_0 + db.inputs.texcoordd3_arr_1 db.outputs.texcoordf2_0 = db.inputs.texcoordf2_0 + db.inputs.texcoordf2_1 db.outputs.texcoordf3_0 = db.inputs.texcoordf3_0 + db.inputs.texcoordf3_1 db.outputs.texcoordf2_arr_0 = db.inputs.texcoordf2_arr_0 + db.inputs.texcoordf2_arr_1 db.outputs.texcoordf3_arr_0 = db.inputs.texcoordf3_arr_0 + db.inputs.texcoordf3_arr_1 db.outputs.texcoordh2_0 = db.inputs.texcoordh2_0 + db.inputs.texcoordh2_1 db.outputs.texcoordh3_0 = db.inputs.texcoordh3_0 + db.inputs.texcoordh3_1 db.outputs.texcoordh2_arr_0 = db.inputs.texcoordh2_arr_0 + db.inputs.texcoordh2_arr_1 db.outputs.texcoordh3_arr_0 = db.inputs.texcoordh3_arr_0 + db.inputs.texcoordh3_arr_1 db.outputs.timecode_0 = db.inputs.timecode_0 + db.inputs.timecode_1 db.outputs.timecode_arr_0 = db.inputs.timecode_arr_0 + db.inputs.timecode_arr_1 db.outputs.token_0 = db.inputs.token_0 + db.inputs.token_1 db.outputs.token_arr_0 = [ db.inputs.token_arr_0[i] + db.inputs.token_arr_1[i] for i in range(len(db.inputs.token_arr_0)) ] db.outputs.transform4_0 = db.inputs.transform4_0 + db.inputs.transform4_1 db.outputs.transform4_arr_0 = db.inputs.transform4_arr_0 + db.inputs.transform4_arr_1 db.outputs.uchar_0 = db.inputs.uchar_0 + db.inputs.uchar_1 db.outputs.uchar_arr_0 = db.inputs.uchar_arr_0 + db.inputs.uchar_arr_1 db.outputs.uint_0 = db.inputs.uint_0 + db.inputs.uint_1 db.outputs.uint_arr_0 = db.inputs.uint_arr_0 + db.inputs.uint_arr_1 db.outputs.uint64_0 = db.inputs.uint64_0 + db.inputs.uint64_1 db.outputs.uint64_arr_0 = db.inputs.uint64_arr_0 + db.inputs.uint64_arr_1 db.outputs.vectord3_0 = db.inputs.vectord3_0 + db.inputs.vectord3_1 db.outputs.vectord3_arr_0 = db.inputs.vectord3_arr_0 + db.inputs.vectord3_arr_1 db.outputs.vectorf3_0 = db.inputs.vectorf3_0 + db.inputs.vectorf3_1 db.outputs.vectorf3_arr_0 = db.inputs.vectorf3_arr_0 + db.inputs.vectorf3_arr_1 db.outputs.vectorh3_0 = db.inputs.vectorh3_0 + db.inputs.vectorh3_1 db.outputs.vectorh3_arr_0 = db.inputs.vectorh3_arr_0 + db.inputs.vectorh3_arr_1 return True
8,362
Python
72.359648
106
0.669816
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/ogn/python/nodes/utility/OgnDynamicSwitch.py
""" Implementation of an stateful OmniGraph node that enables 1 branch or another using dynamic scheduling """ class OgnDynamicSwitch: @staticmethod def compute(db): db.node.set_dynamic_downstream_control(True) left_out_attr = db.node.get_attribute("outputs:left_out") right_out_attr = db.node.get_attribute("outputs:right_out") if db.inputs.switch > 0: left_out_attr.set_disable_dynamic_downstream_work(True) right_out_attr.set_disable_dynamic_downstream_work(False) else: left_out_attr.set_disable_dynamic_downstream_work(False) right_out_attr.set_disable_dynamic_downstream_work(True) db.outputs.left_out = db.inputs.left_value db.outputs.right_out = db.inputs.right_value return True
812
Python
34.347825
102
0.671182
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/ogn/python/nodes/stateful/OgnCountTo.py
""" Implementation of an stateful OmniGraph node that counts to a number defined by countTo """ class OgnCountTo: @staticmethod def compute(db): if db.inputs.reset: db.outputs.count = 0 else: db.outputs.count = db.outputs.count + db.inputs.increment if db.outputs.count > db.inputs.countTo: db.outputs.count = db.inputs.countTo else: db.node.set_compute_incomplete() return True
495
Python
23.799999
87
0.589899
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/ogn/python/nodes/stateful/OgnIntCounter.py
""" Implementation of an stateful OmniGraph node that counts up by an increment """ class OgnIntCounter: @staticmethod def compute(db): if db.inputs.reset: db.outputs.count = 0 else: db.outputs.count = db.outputs.count + db.inputs.increment return True
312
Python
19.866665
75
0.625
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/ogn/python/nodes/tests/OgnTestInitNode.py
import omni.graph.core as og class OgnTestInitNode: @staticmethod def initialize(context, node): _ = og.Controller() @staticmethod def release(node): pass @staticmethod def compute(db): db.outputs.value = 1.0 return True
281
Python
15.588234
34
0.608541
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/ogn/python/nodes/tests/OgnTestSingleton.py
class OgnTestSingleton: @staticmethod def compute(db): db.outputs.out = 88.8 return True
113
Python
17.999997
29
0.619469
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/ogn/python/nodes/deformers/OgnVersionedDeformerPy.py
""" Implementation of a Python node that handles a simple version upgrade where the different versions contain different attributes: Version 0: multiplier Version 1: multiplier, wavelength Version 2: wavelength Depending on the version that was received the upgrade will remove the obsolete "multiplier" attribute and/or insert the new "wavelength" attribute. """ import numpy as np import omni.graph.core as og class OgnVersionedDeformerPy: @staticmethod def compute(db): input_points = db.inputs.points if len(input_points) <= 0: return False wavelength = db.inputs.wavelength if wavelength <= 0.0: wavelength = 310.0 db.outputs.points_size = input_points.shape[0] # Nothing to evaluate if there are no input points if db.outputs.points_size == 0: return True output_points = db.outputs.points pt = input_points.copy() # we still need to do a copy here because we do not want to modify points tx = (pt[:, 0] - wavelength) / wavelength ty = (pt[:, 1] - wavelength) / wavelength disp = 10.0 * (np.sin(tx * 10.0) + np.cos(ty * 15.0)) pt[:, 2] += disp * 5 output_points[:] = pt[:] # we modify output_points in memory so we do not need to set the value again return True @staticmethod def update_node_version(context, node, old_version, new_version): if old_version < new_version: if old_version < 1: node.create_attribute( "inputs:wavelength", og.Type(og.BaseDataType.FLOAT), og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT, 50.0, ) if old_version < 2: node.remove_attribute("inputs:multiplier") return True return False @staticmethod def initialize_type(node_type): node_type.add_input("test_input", "int", True) node_type.add_output("test_output", "float", True) node_type.add_extended_input( "test_union_input", "float,double", True, og.ExtendedAttributeType.EXTENDED_ATTR_TYPE_UNION ) return True
2,233
Python
33.906249
110
0.605911
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/ogn/python/nodes/deformers/OgnDeformerGpu.py
""" Implementation of an OmniGraph node that runs a simple deformer on the GPU """ from contextlib import suppress with suppress(ImportError): import torch class OgnDeformerGpu: @staticmethod def compute(db) -> bool: try: # TODO: This method of GPU compute isn't recommended. Use CPU compute or Warp. if torch: input_points = db.inputs.points multiplier = db.inputs.multiplier db.outputs.points_size = input_points.shape[0] # Nothing to evaluate if there are no input points if db.outputs.points_size == 0: return True output_points = db.outputs.points pt = input_points.copy() tx = (pt[:, 0] - 310.0) / 310.0 ty = (pt[:, 1] - 310.0) / 310.0 disp = 10.0 * (torch.sin(tx * 10.0) + torch.cos(ty * 15.0)) pt[:, 2] += disp * multiplier output_points[:] = pt[:] return True except NameError: db.log_warning("Torch not found, no compute") return False
1,153
Python
30.189188
90
0.525585
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/ogn/tests/TestOgnDynamicSwitch.py
import omni.kit.test import omni.graph.core as og import omni.graph.core.tests as ogts from omni.graph.core.tests.omnigraph_test_utils import _TestGraphAndNode from omni.graph.core.tests.omnigraph_test_utils import _test_clear_scene from omni.graph.core.tests.omnigraph_test_utils import _test_setup_scene from omni.graph.core.tests.omnigraph_test_utils import _test_verify_scene class TestOgn(ogts.OmniGraphTestCase): async def test_data_access(self): from omni.graph.examples.python.ogn.OgnDynamicSwitchDatabase import OgnDynamicSwitchDatabase (_, (test_node,), _, _) = og.Controller.edit("/TestGraph", { og.Controller.Keys.CREATE_NODES: ("Template_omni_graph_examples_python_DynamicSwitch", "omni.graph.examples.python.DynamicSwitch") }) database = OgnDynamicSwitchDatabase(test_node) self.assertTrue(test_node.is_valid()) node_type_name = test_node.get_type_name() self.assertEqual(og.GraphRegistry().get_node_type_version(node_type_name), 1) def _attr_error(attribute: og.Attribute, usd_test: bool) -> str: test_type = "USD Load" if usd_test else "Database Access" return f"{node_type_name} {test_type} Test - {attribute.get_name()} value error" self.assertTrue(test_node.get_attribute_exists("inputs:left_value")) attribute = test_node.get_attribute("inputs:left_value") db_value = database.inputs.left_value expected_value = -1 ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:right_value")) attribute = test_node.get_attribute("inputs:right_value") db_value = database.inputs.right_value expected_value = 1 ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:switch")) attribute = test_node.get_attribute("inputs:switch") db_value = database.inputs.switch expected_value = 0 ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("outputs:left_out")) attribute = test_node.get_attribute("outputs:left_out") db_value = database.outputs.left_out self.assertTrue(test_node.get_attribute_exists("outputs:right_out")) attribute = test_node.get_attribute("outputs:right_out") db_value = database.outputs.right_out
2,527
Python
47.615384
142
0.695291
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/ogn/tests/TestOgnPyUniversalAdd.py
import omni.kit.test import omni.graph.core as og import omni.graph.core.tests as ogts from omni.graph.core.tests.omnigraph_test_utils import _TestGraphAndNode from omni.graph.core.tests.omnigraph_test_utils import _test_clear_scene from omni.graph.core.tests.omnigraph_test_utils import _test_setup_scene from omni.graph.core.tests.omnigraph_test_utils import _test_verify_scene class TestOgn(ogts.OmniGraphTestCase): async def test_data_access(self): from omni.graph.examples.python.ogn.OgnPyUniversalAddDatabase import OgnPyUniversalAddDatabase (_, (test_node,), _, _) = og.Controller.edit("/TestGraph", { og.Controller.Keys.CREATE_NODES: ("Template_omni_graph_examples_python_UniversalAdd", "omni.graph.examples.python.UniversalAdd") }) database = OgnPyUniversalAddDatabase(test_node) self.assertTrue(test_node.is_valid()) node_type_name = test_node.get_type_name() self.assertEqual(og.GraphRegistry().get_node_type_version(node_type_name), 1) def _attr_error(attribute: og.Attribute, usd_test: bool) -> str: test_type = "USD Load" if usd_test else "Database Access" return f"{node_type_name} {test_type} Test - {attribute.get_name()} value error" self.assertTrue(test_node.get_attribute_exists("inputs:bool_0")) attribute = test_node.get_attribute("inputs:bool_0") db_value = database.inputs.bool_0 expected_value = False ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:bool_1")) attribute = test_node.get_attribute("inputs:bool_1") db_value = database.inputs.bool_1 expected_value = False ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:bool_arr_0")) attribute = test_node.get_attribute("inputs:bool_arr_0") db_value = database.inputs.bool_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:bool_arr_1")) attribute = test_node.get_attribute("inputs:bool_arr_1") db_value = database.inputs.bool_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:colord3_0")) attribute = test_node.get_attribute("inputs:colord3_0") db_value = database.inputs.colord3_0 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:colord3_1")) attribute = test_node.get_attribute("inputs:colord3_1") db_value = database.inputs.colord3_1 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:colord3_arr_0")) attribute = test_node.get_attribute("inputs:colord3_arr_0") db_value = database.inputs.colord3_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:colord3_arr_1")) attribute = test_node.get_attribute("inputs:colord3_arr_1") db_value = database.inputs.colord3_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:colord4_0")) attribute = test_node.get_attribute("inputs:colord4_0") db_value = database.inputs.colord4_0 expected_value = [0.0, 0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:colord4_1")) attribute = test_node.get_attribute("inputs:colord4_1") db_value = database.inputs.colord4_1 expected_value = [0.0, 0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:colord4_arr_0")) attribute = test_node.get_attribute("inputs:colord4_arr_0") db_value = database.inputs.colord4_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:colord4_arr_1")) attribute = test_node.get_attribute("inputs:colord4_arr_1") db_value = database.inputs.colord4_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:colorf3_0")) attribute = test_node.get_attribute("inputs:colorf3_0") db_value = database.inputs.colorf3_0 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:colorf3_1")) attribute = test_node.get_attribute("inputs:colorf3_1") db_value = database.inputs.colorf3_1 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:colorf3_arr_0")) attribute = test_node.get_attribute("inputs:colorf3_arr_0") db_value = database.inputs.colorf3_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:colorf3_arr_1")) attribute = test_node.get_attribute("inputs:colorf3_arr_1") db_value = database.inputs.colorf3_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:colorf4_0")) attribute = test_node.get_attribute("inputs:colorf4_0") db_value = database.inputs.colorf4_0 expected_value = [0.0, 0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:colorf4_1")) attribute = test_node.get_attribute("inputs:colorf4_1") db_value = database.inputs.colorf4_1 expected_value = [0.0, 0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:colorf4_arr_0")) attribute = test_node.get_attribute("inputs:colorf4_arr_0") db_value = database.inputs.colorf4_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:colorf4_arr_1")) attribute = test_node.get_attribute("inputs:colorf4_arr_1") db_value = database.inputs.colorf4_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:colorh3_0")) attribute = test_node.get_attribute("inputs:colorh3_0") db_value = database.inputs.colorh3_0 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:colorh3_1")) attribute = test_node.get_attribute("inputs:colorh3_1") db_value = database.inputs.colorh3_1 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:colorh3_arr_0")) attribute = test_node.get_attribute("inputs:colorh3_arr_0") db_value = database.inputs.colorh3_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:colorh3_arr_1")) attribute = test_node.get_attribute("inputs:colorh3_arr_1") db_value = database.inputs.colorh3_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:colorh4_0")) attribute = test_node.get_attribute("inputs:colorh4_0") db_value = database.inputs.colorh4_0 expected_value = [0.0, 0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:colorh4_1")) attribute = test_node.get_attribute("inputs:colorh4_1") db_value = database.inputs.colorh4_1 expected_value = [0.0, 0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:colorh4_arr_0")) attribute = test_node.get_attribute("inputs:colorh4_arr_0") db_value = database.inputs.colorh4_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:colorh4_arr_1")) attribute = test_node.get_attribute("inputs:colorh4_arr_1") db_value = database.inputs.colorh4_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:double2_0")) attribute = test_node.get_attribute("inputs:double2_0") db_value = database.inputs.double2_0 expected_value = [0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:double2_1")) attribute = test_node.get_attribute("inputs:double2_1") db_value = database.inputs.double2_1 expected_value = [0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:double2_arr_0")) attribute = test_node.get_attribute("inputs:double2_arr_0") db_value = database.inputs.double2_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:double2_arr_1")) attribute = test_node.get_attribute("inputs:double2_arr_1") db_value = database.inputs.double2_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:double3_0")) attribute = test_node.get_attribute("inputs:double3_0") db_value = database.inputs.double3_0 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:double3_1")) attribute = test_node.get_attribute("inputs:double3_1") db_value = database.inputs.double3_1 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:double3_arr_0")) attribute = test_node.get_attribute("inputs:double3_arr_0") db_value = database.inputs.double3_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:double3_arr_1")) attribute = test_node.get_attribute("inputs:double3_arr_1") db_value = database.inputs.double3_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:double4_0")) attribute = test_node.get_attribute("inputs:double4_0") db_value = database.inputs.double4_0 expected_value = [0.0, 0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:double4_1")) attribute = test_node.get_attribute("inputs:double4_1") db_value = database.inputs.double4_1 expected_value = [0.0, 0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:double4_arr_0")) attribute = test_node.get_attribute("inputs:double4_arr_0") db_value = database.inputs.double4_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:double4_arr_1")) attribute = test_node.get_attribute("inputs:double4_arr_1") db_value = database.inputs.double4_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:double_0")) attribute = test_node.get_attribute("inputs:double_0") db_value = database.inputs.double_0 expected_value = 0.0 ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:double_1")) attribute = test_node.get_attribute("inputs:double_1") db_value = database.inputs.double_1 expected_value = 0.0 ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:double_arr_0")) attribute = test_node.get_attribute("inputs:double_arr_0") db_value = database.inputs.double_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:double_arr_1")) attribute = test_node.get_attribute("inputs:double_arr_1") db_value = database.inputs.double_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:float2_0")) attribute = test_node.get_attribute("inputs:float2_0") db_value = database.inputs.float2_0 expected_value = [0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:float2_1")) attribute = test_node.get_attribute("inputs:float2_1") db_value = database.inputs.float2_1 expected_value = [0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:float2_arr_0")) attribute = test_node.get_attribute("inputs:float2_arr_0") db_value = database.inputs.float2_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:float2_arr_1")) attribute = test_node.get_attribute("inputs:float2_arr_1") db_value = database.inputs.float2_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:float3_0")) attribute = test_node.get_attribute("inputs:float3_0") db_value = database.inputs.float3_0 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:float3_1")) attribute = test_node.get_attribute("inputs:float3_1") db_value = database.inputs.float3_1 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:float3_arr_0")) attribute = test_node.get_attribute("inputs:float3_arr_0") db_value = database.inputs.float3_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:float3_arr_1")) attribute = test_node.get_attribute("inputs:float3_arr_1") db_value = database.inputs.float3_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:float4_0")) attribute = test_node.get_attribute("inputs:float4_0") db_value = database.inputs.float4_0 expected_value = [0.0, 0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:float4_1")) attribute = test_node.get_attribute("inputs:float4_1") db_value = database.inputs.float4_1 expected_value = [0.0, 0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:float4_arr_0")) attribute = test_node.get_attribute("inputs:float4_arr_0") db_value = database.inputs.float4_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:float4_arr_1")) attribute = test_node.get_attribute("inputs:float4_arr_1") db_value = database.inputs.float4_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:float_0")) attribute = test_node.get_attribute("inputs:float_0") db_value = database.inputs.float_0 expected_value = 0.0 ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:float_1")) attribute = test_node.get_attribute("inputs:float_1") db_value = database.inputs.float_1 expected_value = 0.0 ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:float_arr_0")) attribute = test_node.get_attribute("inputs:float_arr_0") db_value = database.inputs.float_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:float_arr_1")) attribute = test_node.get_attribute("inputs:float_arr_1") db_value = database.inputs.float_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:frame4_0")) attribute = test_node.get_attribute("inputs:frame4_0") db_value = database.inputs.frame4_0 expected_value = [[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:frame4_1")) attribute = test_node.get_attribute("inputs:frame4_1") db_value = database.inputs.frame4_1 expected_value = [[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:frame4_arr_0")) attribute = test_node.get_attribute("inputs:frame4_arr_0") db_value = database.inputs.frame4_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:frame4_arr_1")) attribute = test_node.get_attribute("inputs:frame4_arr_1") db_value = database.inputs.frame4_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:half2_0")) attribute = test_node.get_attribute("inputs:half2_0") db_value = database.inputs.half2_0 expected_value = [0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:half2_1")) attribute = test_node.get_attribute("inputs:half2_1") db_value = database.inputs.half2_1 expected_value = [0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:half2_arr_0")) attribute = test_node.get_attribute("inputs:half2_arr_0") db_value = database.inputs.half2_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:half2_arr_1")) attribute = test_node.get_attribute("inputs:half2_arr_1") db_value = database.inputs.half2_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:half3_0")) attribute = test_node.get_attribute("inputs:half3_0") db_value = database.inputs.half3_0 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:half3_1")) attribute = test_node.get_attribute("inputs:half3_1") db_value = database.inputs.half3_1 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:half3_arr_0")) attribute = test_node.get_attribute("inputs:half3_arr_0") db_value = database.inputs.half3_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:half3_arr_1")) attribute = test_node.get_attribute("inputs:half3_arr_1") db_value = database.inputs.half3_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:half4_0")) attribute = test_node.get_attribute("inputs:half4_0") db_value = database.inputs.half4_0 expected_value = [0.0, 0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:half4_1")) attribute = test_node.get_attribute("inputs:half4_1") db_value = database.inputs.half4_1 expected_value = [0.0, 0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:half4_arr_0")) attribute = test_node.get_attribute("inputs:half4_arr_0") db_value = database.inputs.half4_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:half4_arr_1")) attribute = test_node.get_attribute("inputs:half4_arr_1") db_value = database.inputs.half4_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:half_0")) attribute = test_node.get_attribute("inputs:half_0") db_value = database.inputs.half_0 expected_value = 0.0 ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:half_1")) attribute = test_node.get_attribute("inputs:half_1") db_value = database.inputs.half_1 expected_value = 0.0 ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:half_arr_0")) attribute = test_node.get_attribute("inputs:half_arr_0") db_value = database.inputs.half_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:half_arr_1")) attribute = test_node.get_attribute("inputs:half_arr_1") db_value = database.inputs.half_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:int2_0")) attribute = test_node.get_attribute("inputs:int2_0") db_value = database.inputs.int2_0 expected_value = [0, 0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:int2_1")) attribute = test_node.get_attribute("inputs:int2_1") db_value = database.inputs.int2_1 expected_value = [0, 0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:int2_arr_0")) attribute = test_node.get_attribute("inputs:int2_arr_0") db_value = database.inputs.int2_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:int2_arr_1")) attribute = test_node.get_attribute("inputs:int2_arr_1") db_value = database.inputs.int2_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:int3_0")) attribute = test_node.get_attribute("inputs:int3_0") db_value = database.inputs.int3_0 expected_value = [0, 0, 0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:int3_1")) attribute = test_node.get_attribute("inputs:int3_1") db_value = database.inputs.int3_1 expected_value = [0, 0, 0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:int3_arr_0")) attribute = test_node.get_attribute("inputs:int3_arr_0") db_value = database.inputs.int3_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:int3_arr_1")) attribute = test_node.get_attribute("inputs:int3_arr_1") db_value = database.inputs.int3_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:int4_0")) attribute = test_node.get_attribute("inputs:int4_0") db_value = database.inputs.int4_0 expected_value = [0, 0, 0, 0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:int4_1")) attribute = test_node.get_attribute("inputs:int4_1") db_value = database.inputs.int4_1 expected_value = [0, 0, 0, 0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:int4_arr_0")) attribute = test_node.get_attribute("inputs:int4_arr_0") db_value = database.inputs.int4_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:int4_arr_1")) attribute = test_node.get_attribute("inputs:int4_arr_1") db_value = database.inputs.int4_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:int64_0")) attribute = test_node.get_attribute("inputs:int64_0") db_value = database.inputs.int64_0 expected_value = 0 ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:int64_1")) attribute = test_node.get_attribute("inputs:int64_1") db_value = database.inputs.int64_1 expected_value = 0 ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:int64_arr_0")) attribute = test_node.get_attribute("inputs:int64_arr_0") db_value = database.inputs.int64_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:int64_arr_1")) attribute = test_node.get_attribute("inputs:int64_arr_1") db_value = database.inputs.int64_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:int_0")) attribute = test_node.get_attribute("inputs:int_0") db_value = database.inputs.int_0 expected_value = 0 ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:int_1")) attribute = test_node.get_attribute("inputs:int_1") db_value = database.inputs.int_1 expected_value = 0 ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:int_arr_0")) attribute = test_node.get_attribute("inputs:int_arr_0") db_value = database.inputs.int_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:int_arr_1")) attribute = test_node.get_attribute("inputs:int_arr_1") db_value = database.inputs.int_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:matrixd2_0")) attribute = test_node.get_attribute("inputs:matrixd2_0") db_value = database.inputs.matrixd2_0 expected_value = [[0.0, 0.0], [0.0, 0.0]] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:matrixd2_1")) attribute = test_node.get_attribute("inputs:matrixd2_1") db_value = database.inputs.matrixd2_1 expected_value = [[0.0, 0.0], [0.0, 0.0]] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:matrixd2_arr_0")) attribute = test_node.get_attribute("inputs:matrixd2_arr_0") db_value = database.inputs.matrixd2_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:matrixd2_arr_1")) attribute = test_node.get_attribute("inputs:matrixd2_arr_1") db_value = database.inputs.matrixd2_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:matrixd3_0")) attribute = test_node.get_attribute("inputs:matrixd3_0") db_value = database.inputs.matrixd3_0 expected_value = [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:matrixd3_1")) attribute = test_node.get_attribute("inputs:matrixd3_1") db_value = database.inputs.matrixd3_1 expected_value = [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:matrixd3_arr_0")) attribute = test_node.get_attribute("inputs:matrixd3_arr_0") db_value = database.inputs.matrixd3_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:matrixd3_arr_1")) attribute = test_node.get_attribute("inputs:matrixd3_arr_1") db_value = database.inputs.matrixd3_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:matrixd4_0")) attribute = test_node.get_attribute("inputs:matrixd4_0") db_value = database.inputs.matrixd4_0 expected_value = [[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:matrixd4_1")) attribute = test_node.get_attribute("inputs:matrixd4_1") db_value = database.inputs.matrixd4_1 expected_value = [[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:matrixd4_arr_0")) attribute = test_node.get_attribute("inputs:matrixd4_arr_0") db_value = database.inputs.matrixd4_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:matrixd4_arr_1")) attribute = test_node.get_attribute("inputs:matrixd4_arr_1") db_value = database.inputs.matrixd4_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:normald3_0")) attribute = test_node.get_attribute("inputs:normald3_0") db_value = database.inputs.normald3_0 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:normald3_1")) attribute = test_node.get_attribute("inputs:normald3_1") db_value = database.inputs.normald3_1 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:normald3_arr_0")) attribute = test_node.get_attribute("inputs:normald3_arr_0") db_value = database.inputs.normald3_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:normald3_arr_1")) attribute = test_node.get_attribute("inputs:normald3_arr_1") db_value = database.inputs.normald3_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:normalf3_0")) attribute = test_node.get_attribute("inputs:normalf3_0") db_value = database.inputs.normalf3_0 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:normalf3_1")) attribute = test_node.get_attribute("inputs:normalf3_1") db_value = database.inputs.normalf3_1 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:normalf3_arr_0")) attribute = test_node.get_attribute("inputs:normalf3_arr_0") db_value = database.inputs.normalf3_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:normalf3_arr_1")) attribute = test_node.get_attribute("inputs:normalf3_arr_1") db_value = database.inputs.normalf3_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:normalh3_0")) attribute = test_node.get_attribute("inputs:normalh3_0") db_value = database.inputs.normalh3_0 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:normalh3_1")) attribute = test_node.get_attribute("inputs:normalh3_1") db_value = database.inputs.normalh3_1 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:normalh3_arr_0")) attribute = test_node.get_attribute("inputs:normalh3_arr_0") db_value = database.inputs.normalh3_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:normalh3_arr_1")) attribute = test_node.get_attribute("inputs:normalh3_arr_1") db_value = database.inputs.normalh3_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:pointd3_0")) attribute = test_node.get_attribute("inputs:pointd3_0") db_value = database.inputs.pointd3_0 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:pointd3_1")) attribute = test_node.get_attribute("inputs:pointd3_1") db_value = database.inputs.pointd3_1 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:pointd3_arr_0")) attribute = test_node.get_attribute("inputs:pointd3_arr_0") db_value = database.inputs.pointd3_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:pointd3_arr_1")) attribute = test_node.get_attribute("inputs:pointd3_arr_1") db_value = database.inputs.pointd3_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:pointf3_0")) attribute = test_node.get_attribute("inputs:pointf3_0") db_value = database.inputs.pointf3_0 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:pointf3_1")) attribute = test_node.get_attribute("inputs:pointf3_1") db_value = database.inputs.pointf3_1 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:pointf3_arr_0")) attribute = test_node.get_attribute("inputs:pointf3_arr_0") db_value = database.inputs.pointf3_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:pointf3_arr_1")) attribute = test_node.get_attribute("inputs:pointf3_arr_1") db_value = database.inputs.pointf3_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:pointh3_0")) attribute = test_node.get_attribute("inputs:pointh3_0") db_value = database.inputs.pointh3_0 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:pointh3_1")) attribute = test_node.get_attribute("inputs:pointh3_1") db_value = database.inputs.pointh3_1 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:pointh3_arr_0")) attribute = test_node.get_attribute("inputs:pointh3_arr_0") db_value = database.inputs.pointh3_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:pointh3_arr_1")) attribute = test_node.get_attribute("inputs:pointh3_arr_1") db_value = database.inputs.pointh3_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:quatd4_0")) attribute = test_node.get_attribute("inputs:quatd4_0") db_value = database.inputs.quatd4_0 expected_value = [0.0, 0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:quatd4_1")) attribute = test_node.get_attribute("inputs:quatd4_1") db_value = database.inputs.quatd4_1 expected_value = [0.0, 0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:quatd4_arr_0")) attribute = test_node.get_attribute("inputs:quatd4_arr_0") db_value = database.inputs.quatd4_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:quatd4_arr_1")) attribute = test_node.get_attribute("inputs:quatd4_arr_1") db_value = database.inputs.quatd4_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:quatf4_0")) attribute = test_node.get_attribute("inputs:quatf4_0") db_value = database.inputs.quatf4_0 expected_value = [0.0, 0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:quatf4_1")) attribute = test_node.get_attribute("inputs:quatf4_1") db_value = database.inputs.quatf4_1 expected_value = [0.0, 0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:quatf4_arr_0")) attribute = test_node.get_attribute("inputs:quatf4_arr_0") db_value = database.inputs.quatf4_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:quatf4_arr_1")) attribute = test_node.get_attribute("inputs:quatf4_arr_1") db_value = database.inputs.quatf4_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:quath4_0")) attribute = test_node.get_attribute("inputs:quath4_0") db_value = database.inputs.quath4_0 expected_value = [0.0, 0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:quath4_1")) attribute = test_node.get_attribute("inputs:quath4_1") db_value = database.inputs.quath4_1 expected_value = [0.0, 0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:quath4_arr_0")) attribute = test_node.get_attribute("inputs:quath4_arr_0") db_value = database.inputs.quath4_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:quath4_arr_1")) attribute = test_node.get_attribute("inputs:quath4_arr_1") db_value = database.inputs.quath4_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:texcoordd2_0")) attribute = test_node.get_attribute("inputs:texcoordd2_0") db_value = database.inputs.texcoordd2_0 expected_value = [0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:texcoordd2_1")) attribute = test_node.get_attribute("inputs:texcoordd2_1") db_value = database.inputs.texcoordd2_1 expected_value = [0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:texcoordd2_arr_0")) attribute = test_node.get_attribute("inputs:texcoordd2_arr_0") db_value = database.inputs.texcoordd2_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:texcoordd2_arr_1")) attribute = test_node.get_attribute("inputs:texcoordd2_arr_1") db_value = database.inputs.texcoordd2_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:texcoordd3_0")) attribute = test_node.get_attribute("inputs:texcoordd3_0") db_value = database.inputs.texcoordd3_0 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:texcoordd3_1")) attribute = test_node.get_attribute("inputs:texcoordd3_1") db_value = database.inputs.texcoordd3_1 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:texcoordd3_arr_0")) attribute = test_node.get_attribute("inputs:texcoordd3_arr_0") db_value = database.inputs.texcoordd3_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:texcoordd3_arr_1")) attribute = test_node.get_attribute("inputs:texcoordd3_arr_1") db_value = database.inputs.texcoordd3_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:texcoordf2_0")) attribute = test_node.get_attribute("inputs:texcoordf2_0") db_value = database.inputs.texcoordf2_0 expected_value = [0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:texcoordf2_1")) attribute = test_node.get_attribute("inputs:texcoordf2_1") db_value = database.inputs.texcoordf2_1 expected_value = [0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:texcoordf2_arr_0")) attribute = test_node.get_attribute("inputs:texcoordf2_arr_0") db_value = database.inputs.texcoordf2_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:texcoordf2_arr_1")) attribute = test_node.get_attribute("inputs:texcoordf2_arr_1") db_value = database.inputs.texcoordf2_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:texcoordf3_0")) attribute = test_node.get_attribute("inputs:texcoordf3_0") db_value = database.inputs.texcoordf3_0 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:texcoordf3_1")) attribute = test_node.get_attribute("inputs:texcoordf3_1") db_value = database.inputs.texcoordf3_1 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:texcoordf3_arr_0")) attribute = test_node.get_attribute("inputs:texcoordf3_arr_0") db_value = database.inputs.texcoordf3_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:texcoordf3_arr_1")) attribute = test_node.get_attribute("inputs:texcoordf3_arr_1") db_value = database.inputs.texcoordf3_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:texcoordh2_0")) attribute = test_node.get_attribute("inputs:texcoordh2_0") db_value = database.inputs.texcoordh2_0 expected_value = [0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:texcoordh2_1")) attribute = test_node.get_attribute("inputs:texcoordh2_1") db_value = database.inputs.texcoordh2_1 expected_value = [0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:texcoordh2_arr_0")) attribute = test_node.get_attribute("inputs:texcoordh2_arr_0") db_value = database.inputs.texcoordh2_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:texcoordh2_arr_1")) attribute = test_node.get_attribute("inputs:texcoordh2_arr_1") db_value = database.inputs.texcoordh2_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:texcoordh3_0")) attribute = test_node.get_attribute("inputs:texcoordh3_0") db_value = database.inputs.texcoordh3_0 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:texcoordh3_1")) attribute = test_node.get_attribute("inputs:texcoordh3_1") db_value = database.inputs.texcoordh3_1 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:texcoordh3_arr_0")) attribute = test_node.get_attribute("inputs:texcoordh3_arr_0") db_value = database.inputs.texcoordh3_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:texcoordh3_arr_1")) attribute = test_node.get_attribute("inputs:texcoordh3_arr_1") db_value = database.inputs.texcoordh3_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:timecode_0")) attribute = test_node.get_attribute("inputs:timecode_0") db_value = database.inputs.timecode_0 expected_value = 0.0 ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:timecode_1")) attribute = test_node.get_attribute("inputs:timecode_1") db_value = database.inputs.timecode_1 expected_value = 0.0 ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:timecode_arr_0")) attribute = test_node.get_attribute("inputs:timecode_arr_0") db_value = database.inputs.timecode_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:timecode_arr_1")) attribute = test_node.get_attribute("inputs:timecode_arr_1") db_value = database.inputs.timecode_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:token_0")) attribute = test_node.get_attribute("inputs:token_0") db_value = database.inputs.token_0 expected_value = "default_token" ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:token_1")) attribute = test_node.get_attribute("inputs:token_1") db_value = database.inputs.token_1 expected_value = "default_token" ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:token_arr_0")) attribute = test_node.get_attribute("inputs:token_arr_0") db_value = database.inputs.token_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:token_arr_1")) attribute = test_node.get_attribute("inputs:token_arr_1") db_value = database.inputs.token_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:transform4_0")) attribute = test_node.get_attribute("inputs:transform4_0") db_value = database.inputs.transform4_0 expected_value = [[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:transform4_1")) attribute = test_node.get_attribute("inputs:transform4_1") db_value = database.inputs.transform4_1 expected_value = [[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:transform4_arr_0")) attribute = test_node.get_attribute("inputs:transform4_arr_0") db_value = database.inputs.transform4_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:transform4_arr_1")) attribute = test_node.get_attribute("inputs:transform4_arr_1") db_value = database.inputs.transform4_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:uchar_0")) attribute = test_node.get_attribute("inputs:uchar_0") db_value = database.inputs.uchar_0 expected_value = 0 ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:uchar_1")) attribute = test_node.get_attribute("inputs:uchar_1") db_value = database.inputs.uchar_1 expected_value = 0 ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:uchar_arr_0")) attribute = test_node.get_attribute("inputs:uchar_arr_0") db_value = database.inputs.uchar_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:uchar_arr_1")) attribute = test_node.get_attribute("inputs:uchar_arr_1") db_value = database.inputs.uchar_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:uint64_0")) attribute = test_node.get_attribute("inputs:uint64_0") db_value = database.inputs.uint64_0 expected_value = 0 ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:uint64_1")) attribute = test_node.get_attribute("inputs:uint64_1") db_value = database.inputs.uint64_1 expected_value = 0 ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:uint64_arr_0")) attribute = test_node.get_attribute("inputs:uint64_arr_0") db_value = database.inputs.uint64_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:uint64_arr_1")) attribute = test_node.get_attribute("inputs:uint64_arr_1") db_value = database.inputs.uint64_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:uint_0")) attribute = test_node.get_attribute("inputs:uint_0") db_value = database.inputs.uint_0 expected_value = 0 ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:uint_1")) attribute = test_node.get_attribute("inputs:uint_1") db_value = database.inputs.uint_1 expected_value = 0 ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:uint_arr_0")) attribute = test_node.get_attribute("inputs:uint_arr_0") db_value = database.inputs.uint_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:uint_arr_1")) attribute = test_node.get_attribute("inputs:uint_arr_1") db_value = database.inputs.uint_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:vectord3_0")) attribute = test_node.get_attribute("inputs:vectord3_0") db_value = database.inputs.vectord3_0 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:vectord3_1")) attribute = test_node.get_attribute("inputs:vectord3_1") db_value = database.inputs.vectord3_1 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:vectord3_arr_0")) attribute = test_node.get_attribute("inputs:vectord3_arr_0") db_value = database.inputs.vectord3_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:vectord3_arr_1")) attribute = test_node.get_attribute("inputs:vectord3_arr_1") db_value = database.inputs.vectord3_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:vectorf3_0")) attribute = test_node.get_attribute("inputs:vectorf3_0") db_value = database.inputs.vectorf3_0 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:vectorf3_1")) attribute = test_node.get_attribute("inputs:vectorf3_1") db_value = database.inputs.vectorf3_1 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:vectorf3_arr_0")) attribute = test_node.get_attribute("inputs:vectorf3_arr_0") db_value = database.inputs.vectorf3_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:vectorf3_arr_1")) attribute = test_node.get_attribute("inputs:vectorf3_arr_1") db_value = database.inputs.vectorf3_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:vectorh3_0")) attribute = test_node.get_attribute("inputs:vectorh3_0") db_value = database.inputs.vectorh3_0 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:vectorh3_1")) attribute = test_node.get_attribute("inputs:vectorh3_1") db_value = database.inputs.vectorh3_1 expected_value = [0.0, 0.0, 0.0] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:vectorh3_arr_0")) attribute = test_node.get_attribute("inputs:vectorh3_arr_0") db_value = database.inputs.vectorh3_arr_0 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("inputs:vectorh3_arr_1")) attribute = test_node.get_attribute("inputs:vectorh3_arr_1") db_value = database.inputs.vectorh3_arr_1 expected_value = [] ogts.verify_values(expected_value, db_value, _attr_error(attribute, False)) self.assertTrue(test_node.get_attribute_exists("outputs:bool_0")) attribute = test_node.get_attribute("outputs:bool_0") db_value = database.outputs.bool_0 self.assertTrue(test_node.get_attribute_exists("outputs:bool_arr_0")) attribute = test_node.get_attribute("outputs:bool_arr_0") db_value = database.outputs.bool_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:colord3_0")) attribute = test_node.get_attribute("outputs:colord3_0") db_value = database.outputs.colord3_0 self.assertTrue(test_node.get_attribute_exists("outputs:colord3_arr_0")) attribute = test_node.get_attribute("outputs:colord3_arr_0") db_value = database.outputs.colord3_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:colord4_0")) attribute = test_node.get_attribute("outputs:colord4_0") db_value = database.outputs.colord4_0 self.assertTrue(test_node.get_attribute_exists("outputs:colord4_arr_0")) attribute = test_node.get_attribute("outputs:colord4_arr_0") db_value = database.outputs.colord4_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:colorf3_0")) attribute = test_node.get_attribute("outputs:colorf3_0") db_value = database.outputs.colorf3_0 self.assertTrue(test_node.get_attribute_exists("outputs:colorf3_arr_0")) attribute = test_node.get_attribute("outputs:colorf3_arr_0") db_value = database.outputs.colorf3_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:colorf4_0")) attribute = test_node.get_attribute("outputs:colorf4_0") db_value = database.outputs.colorf4_0 self.assertTrue(test_node.get_attribute_exists("outputs:colorf4_arr_0")) attribute = test_node.get_attribute("outputs:colorf4_arr_0") db_value = database.outputs.colorf4_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:colorh3_0")) attribute = test_node.get_attribute("outputs:colorh3_0") db_value = database.outputs.colorh3_0 self.assertTrue(test_node.get_attribute_exists("outputs:colorh3_arr_0")) attribute = test_node.get_attribute("outputs:colorh3_arr_0") db_value = database.outputs.colorh3_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:colorh4_0")) attribute = test_node.get_attribute("outputs:colorh4_0") db_value = database.outputs.colorh4_0 self.assertTrue(test_node.get_attribute_exists("outputs:colorh4_arr_0")) attribute = test_node.get_attribute("outputs:colorh4_arr_0") db_value = database.outputs.colorh4_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:double2_0")) attribute = test_node.get_attribute("outputs:double2_0") db_value = database.outputs.double2_0 self.assertTrue(test_node.get_attribute_exists("outputs:double2_arr_0")) attribute = test_node.get_attribute("outputs:double2_arr_0") db_value = database.outputs.double2_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:double3_0")) attribute = test_node.get_attribute("outputs:double3_0") db_value = database.outputs.double3_0 self.assertTrue(test_node.get_attribute_exists("outputs:double3_arr_0")) attribute = test_node.get_attribute("outputs:double3_arr_0") db_value = database.outputs.double3_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:double4_0")) attribute = test_node.get_attribute("outputs:double4_0") db_value = database.outputs.double4_0 self.assertTrue(test_node.get_attribute_exists("outputs:double4_arr_0")) attribute = test_node.get_attribute("outputs:double4_arr_0") db_value = database.outputs.double4_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:double_0")) attribute = test_node.get_attribute("outputs:double_0") db_value = database.outputs.double_0 self.assertTrue(test_node.get_attribute_exists("outputs:double_arr_0")) attribute = test_node.get_attribute("outputs:double_arr_0") db_value = database.outputs.double_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:float2_0")) attribute = test_node.get_attribute("outputs:float2_0") db_value = database.outputs.float2_0 self.assertTrue(test_node.get_attribute_exists("outputs:float2_arr_0")) attribute = test_node.get_attribute("outputs:float2_arr_0") db_value = database.outputs.float2_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:float3_0")) attribute = test_node.get_attribute("outputs:float3_0") db_value = database.outputs.float3_0 self.assertTrue(test_node.get_attribute_exists("outputs:float3_arr_0")) attribute = test_node.get_attribute("outputs:float3_arr_0") db_value = database.outputs.float3_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:float4_0")) attribute = test_node.get_attribute("outputs:float4_0") db_value = database.outputs.float4_0 self.assertTrue(test_node.get_attribute_exists("outputs:float4_arr_0")) attribute = test_node.get_attribute("outputs:float4_arr_0") db_value = database.outputs.float4_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:float_0")) attribute = test_node.get_attribute("outputs:float_0") db_value = database.outputs.float_0 self.assertTrue(test_node.get_attribute_exists("outputs:float_arr_0")) attribute = test_node.get_attribute("outputs:float_arr_0") db_value = database.outputs.float_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:frame4_0")) attribute = test_node.get_attribute("outputs:frame4_0") db_value = database.outputs.frame4_0 self.assertTrue(test_node.get_attribute_exists("outputs:frame4_arr_0")) attribute = test_node.get_attribute("outputs:frame4_arr_0") db_value = database.outputs.frame4_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:half2_0")) attribute = test_node.get_attribute("outputs:half2_0") db_value = database.outputs.half2_0 self.assertTrue(test_node.get_attribute_exists("outputs:half2_arr_0")) attribute = test_node.get_attribute("outputs:half2_arr_0") db_value = database.outputs.half2_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:half3_0")) attribute = test_node.get_attribute("outputs:half3_0") db_value = database.outputs.half3_0 self.assertTrue(test_node.get_attribute_exists("outputs:half3_arr_0")) attribute = test_node.get_attribute("outputs:half3_arr_0") db_value = database.outputs.half3_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:half4_0")) attribute = test_node.get_attribute("outputs:half4_0") db_value = database.outputs.half4_0 self.assertTrue(test_node.get_attribute_exists("outputs:half4_arr_0")) attribute = test_node.get_attribute("outputs:half4_arr_0") db_value = database.outputs.half4_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:half_0")) attribute = test_node.get_attribute("outputs:half_0") db_value = database.outputs.half_0 self.assertTrue(test_node.get_attribute_exists("outputs:half_arr_0")) attribute = test_node.get_attribute("outputs:half_arr_0") db_value = database.outputs.half_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:int2_0")) attribute = test_node.get_attribute("outputs:int2_0") db_value = database.outputs.int2_0 self.assertTrue(test_node.get_attribute_exists("outputs:int2_arr_0")) attribute = test_node.get_attribute("outputs:int2_arr_0") db_value = database.outputs.int2_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:int3_0")) attribute = test_node.get_attribute("outputs:int3_0") db_value = database.outputs.int3_0 self.assertTrue(test_node.get_attribute_exists("outputs:int3_arr_0")) attribute = test_node.get_attribute("outputs:int3_arr_0") db_value = database.outputs.int3_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:int4_0")) attribute = test_node.get_attribute("outputs:int4_0") db_value = database.outputs.int4_0 self.assertTrue(test_node.get_attribute_exists("outputs:int4_arr_0")) attribute = test_node.get_attribute("outputs:int4_arr_0") db_value = database.outputs.int4_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:int64_0")) attribute = test_node.get_attribute("outputs:int64_0") db_value = database.outputs.int64_0 self.assertTrue(test_node.get_attribute_exists("outputs:int64_arr_0")) attribute = test_node.get_attribute("outputs:int64_arr_0") db_value = database.outputs.int64_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:int_0")) attribute = test_node.get_attribute("outputs:int_0") db_value = database.outputs.int_0 self.assertTrue(test_node.get_attribute_exists("outputs:int_arr_0")) attribute = test_node.get_attribute("outputs:int_arr_0") db_value = database.outputs.int_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:matrixd2_0")) attribute = test_node.get_attribute("outputs:matrixd2_0") db_value = database.outputs.matrixd2_0 self.assertTrue(test_node.get_attribute_exists("outputs:matrixd2_arr_0")) attribute = test_node.get_attribute("outputs:matrixd2_arr_0") db_value = database.outputs.matrixd2_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:matrixd3_0")) attribute = test_node.get_attribute("outputs:matrixd3_0") db_value = database.outputs.matrixd3_0 self.assertTrue(test_node.get_attribute_exists("outputs:matrixd3_arr_0")) attribute = test_node.get_attribute("outputs:matrixd3_arr_0") db_value = database.outputs.matrixd3_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:matrixd4_0")) attribute = test_node.get_attribute("outputs:matrixd4_0") db_value = database.outputs.matrixd4_0 self.assertTrue(test_node.get_attribute_exists("outputs:matrixd4_arr_0")) attribute = test_node.get_attribute("outputs:matrixd4_arr_0") db_value = database.outputs.matrixd4_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:normald3_0")) attribute = test_node.get_attribute("outputs:normald3_0") db_value = database.outputs.normald3_0 self.assertTrue(test_node.get_attribute_exists("outputs:normald3_arr_0")) attribute = test_node.get_attribute("outputs:normald3_arr_0") db_value = database.outputs.normald3_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:normalf3_0")) attribute = test_node.get_attribute("outputs:normalf3_0") db_value = database.outputs.normalf3_0 self.assertTrue(test_node.get_attribute_exists("outputs:normalf3_arr_0")) attribute = test_node.get_attribute("outputs:normalf3_arr_0") db_value = database.outputs.normalf3_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:normalh3_0")) attribute = test_node.get_attribute("outputs:normalh3_0") db_value = database.outputs.normalh3_0 self.assertTrue(test_node.get_attribute_exists("outputs:normalh3_arr_0")) attribute = test_node.get_attribute("outputs:normalh3_arr_0") db_value = database.outputs.normalh3_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:pointd3_0")) attribute = test_node.get_attribute("outputs:pointd3_0") db_value = database.outputs.pointd3_0 self.assertTrue(test_node.get_attribute_exists("outputs:pointd3_arr_0")) attribute = test_node.get_attribute("outputs:pointd3_arr_0") db_value = database.outputs.pointd3_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:pointf3_0")) attribute = test_node.get_attribute("outputs:pointf3_0") db_value = database.outputs.pointf3_0 self.assertTrue(test_node.get_attribute_exists("outputs:pointf3_arr_0")) attribute = test_node.get_attribute("outputs:pointf3_arr_0") db_value = database.outputs.pointf3_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:pointh3_0")) attribute = test_node.get_attribute("outputs:pointh3_0") db_value = database.outputs.pointh3_0 self.assertTrue(test_node.get_attribute_exists("outputs:pointh3_arr_0")) attribute = test_node.get_attribute("outputs:pointh3_arr_0") db_value = database.outputs.pointh3_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:quatd4_0")) attribute = test_node.get_attribute("outputs:quatd4_0") db_value = database.outputs.quatd4_0 self.assertTrue(test_node.get_attribute_exists("outputs:quatd4_arr_0")) attribute = test_node.get_attribute("outputs:quatd4_arr_0") db_value = database.outputs.quatd4_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:quatf4_0")) attribute = test_node.get_attribute("outputs:quatf4_0") db_value = database.outputs.quatf4_0 self.assertTrue(test_node.get_attribute_exists("outputs:quatf4_arr_0")) attribute = test_node.get_attribute("outputs:quatf4_arr_0") db_value = database.outputs.quatf4_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:quath4_0")) attribute = test_node.get_attribute("outputs:quath4_0") db_value = database.outputs.quath4_0 self.assertTrue(test_node.get_attribute_exists("outputs:quath4_arr_0")) attribute = test_node.get_attribute("outputs:quath4_arr_0") db_value = database.outputs.quath4_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:texcoordd2_0")) attribute = test_node.get_attribute("outputs:texcoordd2_0") db_value = database.outputs.texcoordd2_0 self.assertTrue(test_node.get_attribute_exists("outputs:texcoordd2_arr_0")) attribute = test_node.get_attribute("outputs:texcoordd2_arr_0") db_value = database.outputs.texcoordd2_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:texcoordd3_0")) attribute = test_node.get_attribute("outputs:texcoordd3_0") db_value = database.outputs.texcoordd3_0 self.assertTrue(test_node.get_attribute_exists("outputs:texcoordd3_arr_0")) attribute = test_node.get_attribute("outputs:texcoordd3_arr_0") db_value = database.outputs.texcoordd3_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:texcoordf2_0")) attribute = test_node.get_attribute("outputs:texcoordf2_0") db_value = database.outputs.texcoordf2_0 self.assertTrue(test_node.get_attribute_exists("outputs:texcoordf2_arr_0")) attribute = test_node.get_attribute("outputs:texcoordf2_arr_0") db_value = database.outputs.texcoordf2_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:texcoordf3_0")) attribute = test_node.get_attribute("outputs:texcoordf3_0") db_value = database.outputs.texcoordf3_0 self.assertTrue(test_node.get_attribute_exists("outputs:texcoordf3_arr_0")) attribute = test_node.get_attribute("outputs:texcoordf3_arr_0") db_value = database.outputs.texcoordf3_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:texcoordh2_0")) attribute = test_node.get_attribute("outputs:texcoordh2_0") db_value = database.outputs.texcoordh2_0 self.assertTrue(test_node.get_attribute_exists("outputs:texcoordh2_arr_0")) attribute = test_node.get_attribute("outputs:texcoordh2_arr_0") db_value = database.outputs.texcoordh2_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:texcoordh3_0")) attribute = test_node.get_attribute("outputs:texcoordh3_0") db_value = database.outputs.texcoordh3_0 self.assertTrue(test_node.get_attribute_exists("outputs:texcoordh3_arr_0")) attribute = test_node.get_attribute("outputs:texcoordh3_arr_0") db_value = database.outputs.texcoordh3_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:timecode_0")) attribute = test_node.get_attribute("outputs:timecode_0") db_value = database.outputs.timecode_0 self.assertTrue(test_node.get_attribute_exists("outputs:timecode_arr_0")) attribute = test_node.get_attribute("outputs:timecode_arr_0") db_value = database.outputs.timecode_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:token_0")) attribute = test_node.get_attribute("outputs:token_0") db_value = database.outputs.token_0 self.assertTrue(test_node.get_attribute_exists("outputs:token_arr_0")) attribute = test_node.get_attribute("outputs:token_arr_0") db_value = database.outputs.token_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:transform4_0")) attribute = test_node.get_attribute("outputs:transform4_0") db_value = database.outputs.transform4_0 self.assertTrue(test_node.get_attribute_exists("outputs:transform4_arr_0")) attribute = test_node.get_attribute("outputs:transform4_arr_0") db_value = database.outputs.transform4_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:uchar_0")) attribute = test_node.get_attribute("outputs:uchar_0") db_value = database.outputs.uchar_0 self.assertTrue(test_node.get_attribute_exists("outputs:uchar_arr_0")) attribute = test_node.get_attribute("outputs:uchar_arr_0") db_value = database.outputs.uchar_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:uint64_0")) attribute = test_node.get_attribute("outputs:uint64_0") db_value = database.outputs.uint64_0 self.assertTrue(test_node.get_attribute_exists("outputs:uint64_arr_0")) attribute = test_node.get_attribute("outputs:uint64_arr_0") db_value = database.outputs.uint64_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:uint_0")) attribute = test_node.get_attribute("outputs:uint_0") db_value = database.outputs.uint_0 self.assertTrue(test_node.get_attribute_exists("outputs:uint_arr_0")) attribute = test_node.get_attribute("outputs:uint_arr_0") db_value = database.outputs.uint_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:vectord3_0")) attribute = test_node.get_attribute("outputs:vectord3_0") db_value = database.outputs.vectord3_0 self.assertTrue(test_node.get_attribute_exists("outputs:vectord3_arr_0")) attribute = test_node.get_attribute("outputs:vectord3_arr_0") db_value = database.outputs.vectord3_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:vectorf3_0")) attribute = test_node.get_attribute("outputs:vectorf3_0") db_value = database.outputs.vectorf3_0 self.assertTrue(test_node.get_attribute_exists("outputs:vectorf3_arr_0")) attribute = test_node.get_attribute("outputs:vectorf3_arr_0") db_value = database.outputs.vectorf3_arr_0 self.assertTrue(test_node.get_attribute_exists("outputs:vectorh3_0")) attribute = test_node.get_attribute("outputs:vectorh3_0") db_value = database.outputs.vectorh3_0 self.assertTrue(test_node.get_attribute_exists("outputs:vectorh3_arr_0")) attribute = test_node.get_attribute("outputs:vectorh3_arr_0") db_value = database.outputs.vectorh3_arr_0
86,139
Python
49.970414
140
0.666191
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/_impl/extension.py
""" Support required by the Carbonite extension loader """ import omni.ext class _PublicExtension(omni.ext.IExt): """Object that tracks the lifetime of the Python part of the extension loading""" def on_startup(self): """Set up initial conditions for the Python part of the extension""" def on_shutdown(self): """Shutting down this part of the extension prepares it for hot reload"""
416
Python
26.799998
85
0.701923
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/tests/test_api.py
"""Testing the stability of the API in this module""" import omni.graph.core.tests as ogts import omni.graph.examples.python as ogep from omni.graph.tools.tests.internal_utils import _check_module_api_consistency, _check_public_api_contents # ====================================================================== class _TestOmniGraphExamplesPythonApi(ogts.OmniGraphTestCase): _UNPUBLISHED = ["bindings", "ogn", "tests"] async def test_api(self): _check_module_api_consistency(ogep, self._UNPUBLISHED) # noqa: PLW0212 _check_module_api_consistency(ogep.tests, is_test_module=True) # noqa: PLW0212 async def test_api_features(self): """Test that the known public API features continue to exist""" _check_public_api_contents(ogep, [], self._UNPUBLISHED, only_expected_allowed=True) # noqa: PLW0212 _check_public_api_contents(ogep.tests, [], [], only_expected_allowed=True) # noqa: PLW0212
947
Python
48.894734
108
0.661035
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/tests/test_omnigraph_python_examples.py
import math import os import omni.graph.core as og import omni.graph.core.tests as ogts import omni.kit.test import omni.timeline import omni.usd from pxr import Gf, Sdf, UsdGeom def example_deformer1(input_point, width, height, freq): """Implement simple deformation on the input point with the given wavelength, wave height, and frequency""" tx = freq * (input_point[0] - width) / width ty = 1.5 * freq * (input_point[1] - width) / width tz = height * (math.sin(tx) + math.cos(ty)) return Gf.Vec3f(input_point[0], input_point[1], input_point[2] + tz) class TestOmniGraphPythonExamples(ogts.OmniGraphTestCase): # ---------------------------------------------------------------------- async def verify_example_deformer(self): """Compare the actual deformation against the expected values using example_deformer1""" stage = omni.usd.get_context().get_stage() input_grid = stage.GetPrimAtPath("/defaultPrim/inputGrid") self.assertEqual(input_grid.GetTypeName(), "Mesh") input_points_attr = input_grid.GetAttribute("points") self.assertIsNotNone(input_points_attr) output_grid = stage.GetPrimAtPath("/defaultPrim/outputGrid") self.assertEqual(output_grid.GetTypeName(), "Mesh") output_points_attr = output_grid.GetAttribute("points") self.assertIsNotNone(output_points_attr) await omni.kit.app.get_app().next_update_async() await og.Controller.evaluate() multiplier_attr = og.Controller.attribute("inputs:multiplier", "/defaultPrim/DeformerGraph/testDeformer") multiplier = og.Controller.get(multiplier_attr) # TODO: Should really be using hardcoded values from the file to ensure correct operation # multiplier = 3.0 width = 310.0 height = multiplier * 10.0 freq = 10.0 # check that the deformer applies the correct deformation input_points = input_points_attr.Get() output_points = output_points_attr.Get() actual_points = [] for input_point, output_point in zip(input_points, output_points): point = example_deformer1(input_point, width, height, freq) self.assertEqual(point[0], output_point[0]) self.assertEqual(point[1], output_point[1]) # verify that the z-coordinates computed by the test and the deformer match to three decimal places actual_points.append(point) self.assertAlmostEqual(point[2], output_point[2], 3) # need to wait for next update to propagate the attribute change from USD og.Controller.set(multiplier_attr, 0.0) await omni.kit.app.get_app().next_update_async() # check that the deformer with a zero multiplier leaves the grid undeformed input_points = input_points_attr.Get() output_points = output_points_attr.Get() for input_point, output_point in zip(input_points, output_points): self.assertEqual(input_point, output_point) # ---------------------------------------------------------------------- async def test_example_deformer_python(self): """Tests the omnigraph.examples.deformerPy node""" (result, error) = await og.load_example_file("ExampleGridDeformerPython.usda") self.assertTrue(result, error) await omni.kit.app.get_app().next_update_async() await self.verify_example_deformer() # ---------------------------------------------------------------------- async def run_python_node_creation_by_command(self, node_backed_by_usd=True): """ This tests the creation of python nodes through the node definition mechanism We have a python node type that defines the inputs and outputs of a python node type. Here, without pre-declaring these attributes in USD, we will create the node using its node type definition only. The required attributes should automatically be created for the node. We then wire it up to make sure it works. """ graph = og.Controller.create_graph("/defaultPrim/TestGraph") new_node_path = "/defaultPrim/TestGraph/new_node" omni.kit.commands.execute( "CreateNode", graph=graph, node_path=new_node_path, node_type="omni.graph.examples.python.VersionedDeformerPy", create_usd=node_backed_by_usd, ) node = graph.get_node(new_node_path) self.assertEqual(node.get_prim_path(), new_node_path) # ---------------------------------------------------------------------- async def test_python_node_creation_by_command_usd(self): """Test that USD commands creating Python nodes also create OmniGraph nodes""" await self.run_python_node_creation_by_command(node_backed_by_usd=True) # ---------------------------------------------------------------------- async def test_python_node_creation_by_command_no_usd(self): """Test that USD commands creating Python nodes also create OmniGraph nodes""" await self.run_python_node_creation_by_command(node_backed_by_usd=False) # ---------------------------------------------------------------------- async def test_update_node_version(self): usd_context = omni.usd.get_context() stage = usd_context.get_stage() controller = og.Controller() (input_grid, output_grid) = ogts.create_input_and_output_grid_meshes(stage) input_points_attr = input_grid.GetPointsAttr() output_points_attr = output_grid.GetPointsAttr() keys = og.Controller.Keys controller = og.Controller() (push_graph, _, _, _) = controller.edit( "/defaultPrim/pushGraph", { keys.CREATE_NODES: [ ("ReadPoints", "omni.graph.nodes.ReadPrimAttribute"), ("WritePoints", "omni.graph.nodes.WritePrimAttribute"), ], keys.SET_VALUES: [ ("ReadPoints.inputs:name", input_points_attr.GetName()), ("ReadPoints.inputs:primPath", "/defaultPrim/inputGrid"), ("ReadPoints.inputs:usePath", True), ("WritePoints.inputs:name", output_points_attr.GetName()), ("WritePoints.inputs:primPath", "/defaultPrim/outputGrid"), ("WritePoints.inputs:usePath", True), ], }, ) test_deformer = stage.DefinePrim("/defaultPrim/pushGraph/testVersionedDeformer", "OmniGraphNode") test_deformer.GetAttribute("node:type").Set("omni.graph.examples.python.VersionedDeformerPy") test_deformer.GetAttribute("node:typeVersion").Set(0) deformer_input_points = test_deformer.CreateAttribute("inputs:points", Sdf.ValueTypeNames.Point3fArray) deformer_input_points.Set([(0, 0, 0)] * 1024) deformer_output_points = test_deformer.CreateAttribute("outputs:points", Sdf.ValueTypeNames.Point3fArray) deformer_output_points.Set([(0, 0, 0)] * 1024) multiplier_attr = test_deformer.CreateAttribute("inputs:multiplier", Sdf.ValueTypeNames.Float) multiplier_attr.Set(3) await controller.evaluate() controller.edit( push_graph, { keys.CONNECT: [ ("ReadPoints.outputs:value", deformer_input_points.GetPath().pathString), (deformer_output_points.GetPath().pathString, "WritePoints.inputs:value"), ] }, ) # Wait for USD notice handler to construct the underlying compute graph await controller.evaluate() # This node has 2 attributes declared as part of its node definition. We didn't create these attributes # above, but the code should have automatically filled them in version_deformer_node = push_graph.get_node("/defaultPrim/pushGraph/testVersionedDeformer") input_attr = version_deformer_node.get_attribute("test_input") output_attr = version_deformer_node.get_attribute("test_output") self.assertTrue(input_attr is not None and input_attr.is_valid()) self.assertTrue(output_attr is not None and output_attr.is_valid()) self.assertEqual(input_attr.get_name(), "test_input") self.assertEqual(input_attr.get_type_name(), "int") self.assertEqual(output_attr.get_name(), "test_output") self.assertEqual(output_attr.get_type_name(), "float") # We added an union type input to this node as well, so test that is here: union_attr = version_deformer_node.get_attribute("test_union_input") self.assertTrue(union_attr is not None and union_attr.is_valid()) self.assertEqual(union_attr.get_name(), "test_union_input") self.assertEqual(union_attr.get_type_name(), "token") self.assertEqual(union_attr.get_extended_type(), og.ExtendedAttributeType.EXTENDED_ATTR_TYPE_UNION) self.assertEqual(union_attr.get_resolved_type().base_type, og.BaseDataType.UNKNOWN) union_attr.set_resolved_type(og.Type(og.BaseDataType.FLOAT)) self.assertEqual(union_attr.get_resolved_type(), og.Type(og.BaseDataType.FLOAT)) union_attr.set(32) self.assertEqual(union_attr.get(), 32) # Node version update happens as the nodes are constructed and checked against the node type multiplier_attr = test_deformer.GetAttribute("inputs:multiplier") self.assertFalse(multiplier_attr.IsValid()) wavelength_attr = test_deformer.GetAttribute("inputs:wavelength") self.assertIsNotNone(wavelength_attr) self.assertEqual(wavelength_attr.GetTypeName(), Sdf.ValueTypeNames.Float) # attrib value should be initialized to 50 og_attr = controller.node("/defaultPrim/pushGraph/testVersionedDeformer").get_attribute("inputs:wavelength") self.assertEqual(og_attr.get(), 50.0) # ---------------------------------------------------------------------- async def test_example_tutorial1_finished(self): """Tests the deforming_text_tutorial_finished.usda file""" ext_dir = os.path.dirname(__file__) + ("/.." * 5) file_path = os.path.join(ext_dir, "data", "deforming_text_tutorial_finished.usda") (result, error) = await ogts.load_test_file(file_path) self.assertTrue(result, error) await omni.kit.app.get_app().next_update_async() await og.Controller.evaluate() # Verify the test graph is functional. We take a look at the location of the sphere and the 'G' mesh. When we # move the sphere it should also move the 'G'. If the 'G' is not moved from it's orginal location we know # something is wrong. stage = omni.usd.get_context().get_stage() sphere = UsdGeom.Xformable(stage.GetPrimAtPath("/World/Sphere")) text_g_mesh = UsdGeom.Xformable(stage.GetPrimAtPath("/World/Text_G")) text_g_x0 = text_g_mesh.GetLocalTransformation()[3] # Move the sphere sphere.ClearXformOpOrder() sphere_translate_op = sphere.AddTranslateOp() sphere_translate_op.Set(Gf.Vec3d(0, 0, 0)) # Check the 'G' position has changed await omni.kit.app.get_app().next_update_async() text_g_x1 = text_g_mesh.GetLocalTransformation()[3] self.assertNotEqual(text_g_x0, text_g_x1) # ---------------------------------------------------------------------- async def test_singleton(self): """ Basic idea of test: we define a node that's been tagged as singleton. We then try to add another node of the same type. It should fail and not let us. """ (graph, (singleton_node,), _, _) = og.Controller.edit( "/TestGraph", {og.Controller.Keys.CREATE_NODES: ("testSingleton", "omni.graph.examples.python.TestSingleton")}, ) singleton_node = graph.get_node("/TestGraph/testSingleton") self.assertTrue(singleton_node.is_valid()) with ogts.ExpectedError(): (_, (other_node,), _, _) = og.Controller.edit( graph, {og.Controller.Keys.CREATE_NODES: ("testSingleton2", "omni.graph.examples.python.TestSingleton")} ) self.assertFalse(other_node.is_valid()) node = graph.get_node("/TestGraph/testSingleton") self.assertTrue(node.is_valid()) node = graph.get_node("/TestGraph/testSingleton2") self.assertFalse(node.is_valid()) # ---------------------------------------------------------------------- async def test_set_compute_incomplete(self): """ Test usage of OgnCountTo which leverages set_compute_incomplete API. """ controller = og.Controller() keys = og.Controller.Keys (_, nodes, _, _,) = controller.edit( {"graph_path": "/World/TestGraph", "evaluator_name": "dirty_push"}, { keys.CREATE_NODES: [ ("CountTo", "omni.graph.examples.python.CountTo"), ], keys.SET_VALUES: [ ("CountTo.inputs:increment", 1), ], }, ) count_out = controller.attribute("outputs:count", nodes[0]) self.assertEqual(og.Controller.get(count_out), 0.0) await controller.evaluate() self.assertEqual(og.Controller.get(count_out), 1.0) await controller.evaluate() self.assertEqual(og.Controller.get(count_out), 2.0) await controller.evaluate() self.assertEqual(og.Controller.get(count_out), 3.0) await controller.evaluate() self.assertEqual(og.Controller.get(count_out), 3.0)
13,779
Python
48.568345
120
0.609768
omniverse-code/kit/exts/omni.graph.examples.python/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.2] - 2022-08-31 ### Fixed - Refactored out use of a deprecated class ## [1.3.1] - 2022-08-09 ### Fixed - Applied formatting to all of the Python files ## [1.3.0] - 2022-07-07 ### Added - Test for public API consistency ## [1.2.0] - 2022-06-21 ### Changed - Made the imports and docstring more explicit in the top level __init__.py - Deliberately emptied out the _impl/__init__.py since it should not be imported - Changed the name of the extension class to emphasize that it is not part of an API ## [1.1.0] - 2022-04-29 ### Removed - Obsolete GPU Tests ### Changed - Made tests derive from OmniGraphTestCase ## [1.0.2] - 2022-03-14 ### Changed - Added categories to node OGN ## [1.0.1] - 2022-01-13 ### Changed - Fixed the outdated OmniGraph tutorial - Updated the USDA files, UI screenshots, and tutorial contents ## [1.0.0] - 2021-03-01 ### Initial Version - Started changelog with initial released version of the OmniGraph core
1,217
Markdown
25.47826
87
0.703369
omniverse-code/kit/exts/omni.graph.examples.python/docs/README.md
# OmniGraph Python Examples [omni.graph.examples.python] This extension contains example implementations for OmniGraph nodes written in Python.
145
Markdown
35.499991
86
0.834483
omniverse-code/kit/exts/omni.graph.examples.python/docs/index.rst
.. _ogn_omni_graph_examples_python: OmniGraph Python Example Nodes ############################## .. tabularcolumns:: |L|R| .. csv-table:: :width: 100% **Extension**: omni.graph.examples.python,**Documentation Generated**: |today| .. toctree:: :maxdepth: 1 CHANGELOG This extension includes a miscellaneous collection of examples that exercise some of the functionality of the OmniGraph nodes written in Python. Ulike the set of nodes implementing common features found in :ref:`ogn_omni_graph_nodes` the nodes here do not serve a common purpose, they are just used to illustrate the use of certain features of the OmniGraph. For examples of nodes implemented in C++ see the extension :ref:`ogn_omni_graph_examples_cpp`. For more comprehensive examples targeted at explaining the use of OmniGraph node features in detail see :ref:`ogn_user_guide`.
875
reStructuredText
29.206896
105
0.730286
omniverse-code/kit/exts/omni.graph.examples.python/docs/Overview.md
# OmniGraph Python Example Nodes ```{csv-table} **Extension**: omni.graph.examples.python,**Documentation Generated**: {sub-ref}`today` ``` This extension includes a miscellaneous collection of examples that exercise some of the functionality of the OmniGraph nodes written in Python. Ulike the set of nodes implementing common features found in {ref}`ogn_omni_graph_nodes` the nodes here do not serve a common purpose, they are just used to illustrate the use of certain features of the OmniGraph. For examples of nodes implemented in C++ see the extension {ref}`ogn_omni_graph_examples_cpp`. For more comprehensive examples targeted at explaining the use of OmniGraph node features in detail see {ref}`ogn_user_guide`.
729
Markdown
44.624997
105
0.781893
omniverse-code/kit/exts/omni.kit.widget.options_menu/omni/kit/widget/options_menu/options_model.py
from typing import List import omni.ui as ui from .option_item import OptionItem class OptionsModel(ui.AbstractItemModel): """ Model for options items. Args: name (str): Model name to display in menu header. items (List[OptionItem]): Items to show in menu. """ def __init__(self, name: str, items: List[OptionItem]): self.name = name self._items = items self.__subs = {} for item in self._items: if item.name: self.__subs[item] = item.model.subscribe_value_changed_fn(lambda m, i=item: self.__on_value_changed(i, m)) super().__init__() def destroy(self): self.__subs.clear() @property def dirty(self) -> bool: """ Flag if any item not in default value. """ for item in self._items: if item.dirty: return True return False def rebuild_items(self, items: List[OptionItem]) -> None: """ Rebuild option items. Args: items (List[OptionItem]): Items to show in menu. """ self.__subs.clear() self._items = items for item in self._items: if item.name: self.__subs[item] = item.model.subscribe_value_changed_fn(lambda m, i=item: self.__on_value_changed(i, m)) self._item_changed(None) def reset(self) -> None: """ Reset all items to default value. """ for item in self._items: item.reset() def get_item_children(self) -> List[OptionItem]: """ Get items in this model. """ return self._items def __on_value_changed(self, item: OptionItem, model: ui.SimpleBoolModel): self._item_changed(item)
1,802
Python
25.910447
122
0.54384
omniverse-code/kit/exts/omni.kit.widget.options_menu/omni/kit/widget/options_menu/option_menu_item.py
import omni.ui as ui from .option_item import OptionItem class OptionMenuItemDelegate(ui.MenuDelegate): """ Delegate for general option menu item. A general option item includes a selected icon and item text. Args: option_item (OptionItem): Option item to show as menu item. Keyword Args: width (ui.Length): Menu item width. Default ui.Fraction(1). """ def __init__(self, option_item: OptionItem, width: ui.Length = ui.Fraction(1)): self._option_item = option_item self._width = width super().__init__(propagate=True) def destroy(self): self.__sub = None def build_item(self, item: ui.MenuItem): model = self._option_item.model self.__sub = model.subscribe_value_changed_fn(self._on_value_changed) self._container = ui.HStack(height=24, width=self._width, content_clipping=False, checked=model.as_bool) with self._container: ui.ImageWithProvider(width = 24, style_type_name_override="MenuItem.Icon") ui.Label( item.text, style_type_name_override="MenuItem.Label", ) ui.Spacer(width=16) self._container.set_mouse_pressed_fn(lambda x, y, b, a, m=model: m.set_value(not m.as_bool)) self._container.set_mouse_hovered_fn(self._on_mouse_hovered) def _on_value_changed(self, model: ui.SimpleBoolModel) -> None: self._container.checked = model.as_bool def _on_mouse_hovered(self, hovered: bool) -> None: # Here to set selected instead of hovered status for icon. # Because there is margin in icon, there will be some blank at top/bottom as a result icon does not become hovered if mouse on these area. self._container.selected = hovered class OptionMenuItem(ui.MenuItem): """ Represent a menu item for a single option. Args: option_item (OptionItem): Option item to show as menu item. Keyword Args: hide_on_click (bool): Hide menu if item clicked. Default False. width (ui.Length): Menu item width. Default ui.Fraction(1). """ def __init__(self, option_item: OptionItem, hide_on_click: bool = False, width: ui.Length = ui.Fraction(1)): self._delegate = OptionMenuItemDelegate(option_item, width=width) super().__init__(option_item.text, delegate=self._delegate, hide_on_click=hide_on_click, checkable=True) def destroy(self): self._delegate.destroy()
2,502
Python
36.924242
146
0.642286
omniverse-code/kit/exts/omni.kit.widget.options_menu/omni/kit/widget/options_menu/style.py
from pathlib import Path import omni.ui as ui from omni.ui import color as cl CURRENT_PATH = Path(__file__).parent.absolute() ICON_PATH = CURRENT_PATH.parent.parent.parent.parent.joinpath(f"data/icons") OPTIONS_MENU_STYLE = { "Title.Background": {"background_color": 0xFF23211F, "corner_flag": ui.CornerFlag.TOP, "margin": 0}, "Title.Header": {"margin_width": 3, "margin_height": 0}, "Title.Label": {"background_color": 0x0, "color": cl.shade(cl('#A1A1A1')), "margin_width": 5}, "ResetButton": {"background_color": 0}, "ResetButton:hovered": {"background_color": cl.shade(cl('323434'))}, "ResetButton.Label": {"color": cl.shade(cl('#34C7FF'))}, "ResetButton.Label:disabled": {"color": cl.shade(cl('#6E6E6E'))}, "ResetButton.Label:hovered": {"color": cl.shade(cl('#1A91C5'))}, "MenuItem.Icon": {"image_url": f"{ICON_PATH}/check_solid.svg", "color": 0, "margin": 7}, "MenuItem.Icon:checked": {"color": cl.shade(cl('#34C7FF'))}, "MenuItem.Icon:selected": {"color": cl.shade(cl('#1F2123'))}, "MenuItem.Label::title": {"color": cl.shade(cl('#A1A1A1')), "margin_width": 5}, "MenuItem.Separator": {"color": cl.shade(cl('#626363')), "border_width": 1.5}, }
1,205
Python
47.239998
104
0.640664
omniverse-code/kit/exts/omni.kit.widget.options_menu/omni/kit/widget/options_menu/option_separator.py
import omni.ui as ui class SeparatorDelegate(ui.MenuDelegate): """Menu delegate for separator""" def build_item(self, _): with ui.HStack(): ui.Spacer(width=24) ui.Line(height=10, style_type_name_override="MenuItem.Separator") ui.Spacer(width=8) class OptionSeparator(ui.MenuItem): """A simple separator""" def __init__(self): super().__init__("##OPTION_SEPARATOR", delegate=SeparatorDelegate(), enabled=False)
482
Python
27.411763
91
0.628631
omniverse-code/kit/exts/omni.kit.widget.options_menu/omni/kit/widget/options_menu/__init__.py
from .options_menu import OptionsMenu from .options_model import OptionsModel from .option_item import OptionItem, OptionSeparator
132
Python
25.599995
52
0.840909
omniverse-code/kit/exts/omni.kit.widget.options_menu/omni/kit/widget/options_menu/option_item.py
from typing import Optional, Callable import omni.ui as ui class OptionItem(ui.AbstractItem): """ Represent an item for OptionsMenu. Args: name (str): Item name. Keyword args: text (str): Item text to show in menu item. Default None means using name. default (bool): Default item value. Default False. on_value_changed_fn (Callable[[bool], None]): Callback when item value changed. """ def __init__(self, name: Optional[str], text: Optional[str] = None, default: bool = False, on_value_changed_fn: Callable[[bool], None] = None): self.name = name self.text = text or name self.default = default self.model = ui.SimpleBoolModel(default) if on_value_changed_fn: self.__on_value_changed_fn = on_value_changed_fn def __on_value_changed(model: ui.SimpleBoolModel): self.__on_value_changed_fn(model.as_bool) self.__sub = self.model.subscribe_value_changed_fn(__on_value_changed) super().__init__() def destroy(self): self.__sub = None @property def value(self) -> bool: """ Item current value. """ return self.model.as_bool @value.setter def value(self, new_value: bool) -> None: self.model.set_value(new_value) @property def dirty(self) -> bool: """ Flag of item value changed. """ return self.model.as_bool != self.default def reset(self) -> None: """ Reset item value to default. """ self.model.set_value(self.default) class OptionSeparator(OptionItem): """ A simple option item represents a separator in menu item. """ def __init__(self): super().__init__(None)
1,814
Python
26.5
147
0.579383
omniverse-code/kit/exts/omni.kit.widget.options_menu/omni/kit/widget/options_menu/options_menu.py
from typing import Optional import omni.ui as ui from .option_item import OptionItem from .option_menu_item import OptionMenuItem from .options_model import OptionsModel from .option_separator import OptionSeparator from .style import OPTIONS_MENU_STYLE class OptionsMenuDelegate(ui.MenuDelegate): """ Delegate for options menu. It has a header to show label and reset button Args: model (OptionsModel): Model for options to show in this menu. """ def __init__(self, model: OptionsModel, **kwargs): self._model = model self._reset_all: Optional[ui.Button] = None self.__sub = self._model.subscribe_item_changed_fn(self.__on_item_changed) super().__init__(**kwargs) def destroy(self) -> None: self.__sub = None def build_title(self, item: ui.Menu) -> None: with ui.ZStack(content_clipping=True, height=24): ui.Rectangle(style_type_name_override="Title.Background") with ui.HStack(style_type_name_override="Title.Header"): if item.text: ui.Label(self._model.name, width=0, style_type_name_override="Title.Label") # Extra spacer here to make sure menu window has min width ui.Spacer(width=45) ui.Spacer() self._reset_all = ui.Button( "Reset All", width=0, height=24, enabled=self._model.dirty, style_type_name_override="ResetButton", clicked_fn=self._model.reset, identifier="reset_all", ) def __on_item_changed(self, model: OptionsModel, item: OptionItem) -> None: if self._reset_all: self._reset_all.enabled = self._model.dirty class OptionsMenu(ui.Menu): """ Represent a menu to show options. A options menu includes a header and a list of menu items for options. Args: model (OptionsModel): Model of option items to show in this menu. hide_on_click (bool): Hide menu when item clicked. Default False. width (ui.Length): Width of menu item. Default ui.Fraction(1). style (dict): Additional style. Default empty. """ def __init__(self, model: OptionsModel, hide_on_click: bool = False, width: ui.Length = ui.Fraction(1), style: dict = {}): self._model = model self._hide_on_click = hide_on_click self._width = width menu_style = OPTIONS_MENU_STYLE.copy() menu_style.update(style) self._delegate = OptionsMenuDelegate(self._model) super().__init__(self._model.name, delegate=self._delegate, menu_compatibility=False, on_build_fn=self._build_menu_items, style=menu_style) self.__sub = self._model.subscribe_item_changed_fn(self.__on_model_changed) def destroy(self): self.__sub = None self._delegate.destroy() def show_by_widget(self, widget: ui.Widget) -> None: """ Show menu around widget (bottom left). Args: widget (ui.Widget): Widget to align for this menu. """ if widget: x = widget.screen_position_x y = widget.screen_position_y + widget.computed_height self.show_at(x, y) else: self.show() def _build_menu_items(self): for item in self._model.get_item_children(): if item.text is None: # Separator OptionSeparator() else: OptionMenuItem(item, hide_on_click=self._hide_on_click, width=self._width) def __on_model_changed(self, model: OptionsModel, item: Optional[OptionItem]) -> None: if item is None: self.invalidate()
3,803
Python
34.886792
147
0.591112
omniverse-code/kit/exts/omni.kit.widget.options_menu/omni/kit/widget/options_menu/tests/__init__.py
from .test_ui import *
23
Python
10.999995
22
0.695652
omniverse-code/kit/exts/omni.kit.widget.options_menu/omni/kit/widget/options_menu/tests/test_ui.py
from pathlib import Path import omni.kit.ui_test as ui_test from omni.ui.tests.test_base import OmniUiTest from ..options_menu import OptionsMenu from ..options_model import OptionsModel from ..option_item import OptionItem, OptionSeparator CURRENT_PATH = Path(__file__).parent.absolute() TEST_DATA_PATH = CURRENT_PATH.parent.parent.parent.parent.parent.joinpath("data/tests") class TestOptions(OmniUiTest): # Before running each test async def setUp(self): self._model = OptionsModel( "Filter", [ OptionItem("audio", text="Audio"), OptionItem("materials", text="Materials"), OptionItem("scripts", text="Scripts"), OptionItem("textures", text="Textures"), OptionItem("usd", text="USD"), ] ) self._golden_img_dir = TEST_DATA_PATH.absolute().joinpath("golden") await super().setUp() # After running each test async def tearDown(self): await super().tearDown() async def finalize_test(self, golden_img_name: str): await self.wait_n_updates() await super().finalize_test(golden_img_dir=self._golden_img_dir, golden_img_name=golden_img_name) await self.wait_n_updates() async def test_ui_layout(self): """Test ui, reset and API to get/set value""" items = self._model.get_item_children() self._changed_names = [] def _on_item_changed(_, item: OptionItem): self._changed_names.append(item.name) self._sub = self._model.subscribe_item_changed_fn(_on_item_changed) menu = OptionsMenu(self._model) menu.show_at(0, 0) try: # Initial UI await ui_test.emulate_mouse_move(ui_test.Vec2(0, 0)) await ui_test.human_delay() await self.finalize_test("options_menu.png") # Change first and last item via mouse click await ui_test.human_delay() await ui_test.emulate_mouse_move_and_click(ui_test.Vec2(50, 45)) await ui_test.human_delay() await ui_test.emulate_mouse_move_and_click(ui_test.Vec2(50, 145)) await ui_test.human_delay() self.assertEqual(len(self._changed_names), 2) self.assertEqual(self._changed_names[0], items[0].name) self.assertEqual(self._changed_names[1], items[-1].name) await self.finalize_test("options_menu_click.png") # Change value via item property items[2].value = not items[2].value items[3].value = not items[3].value await self.finalize_test("options_menu_value_changed.png") # Reset all await ui_test.emulate_mouse_move_and_click(ui_test.Vec2(120, 20)) await self.finalize_test("options_menu.png") finally: menu.destroy() async def test_ui_rebuild_items(self): """Test ui, reset and API to get/set value""" items = self._model.get_item_children() menu = OptionsMenu(self._model) menu.show_at(0, 0) try: # Initial UI await ui_test.emulate_mouse_move(ui_test.Vec2(0, 0)) await ui_test.human_delay() await self.finalize_test("options_menu.png") self._model.rebuild_items( [ OptionItem("Test"), OptionSeparator(), OptionItem("More"), ] ) await ui_test.human_delay() await self.finalize_test("options_menu_rebuild.png") self._model.rebuild_items(items) await ui_test.human_delay() await self.finalize_test("options_menu.png") finally: menu.destroy()
3,827
Python
33.486486
105
0.577215
omniverse-code/kit/exts/omni.kit.welcome.about/omni/kit/welcome/about/style.py
from pathlib import Path import omni.ui as ui from omni.ui import color as cl from omni.ui import constant as fl CURRENT_PATH = Path(__file__).parent ICON_PATH = CURRENT_PATH.parent.parent.parent.parent.joinpath("icons") ABOUT_PAGE_STYLE = { "Info": { "background_color": cl("#1F2123") }, "Title.Label": { "font_size": fl.welcome_title_font_size }, "Version.Label": { "font_size": 18, "margin_width": 5 }, "Plugin.Title": { "font_size": 16, "margin_width": 5 }, "Plugin.Label": { "font_size": 16, "margin_width": 5 }, "Plugin.Frame": { "background_color": 0xFF454545, "margin_width": 2, "margin_height": 3, "margin": 5 } }
650
Python
35.166665
106
0.646154
omniverse-code/kit/exts/omni.kit.welcome.about/omni/kit/welcome/about/extension.py
from typing import List import carb.settings import carb.tokens import omni.client import omni.ext import omni.ui as ui from omni.kit.welcome.window import register_page from omni.ui import constant as fl from .style import ABOUT_PAGE_STYLE _extension_instance = None class AboutPageExtension(omni.ext.IExt): def on_startup(self, ext_id): self.__ext_name = omni.ext.get_extension_name(ext_id) register_page(self.__ext_name, self.build_ui) def on_shutdown(self): global _extension_instance _extension_instance = None self._about_widget = None def build_ui(self) -> None: with ui.ZStack(style=ABOUT_PAGE_STYLE): # Background ui.Rectangle(style_type_name_override="Content") with ui.VStack(): with ui.VStack(height=fl._find("welcome_page_title_height")): ui.Spacer() ui.Label("ABOUT", height=0, alignment=ui.Alignment.CENTER, style_type_name_override="Title.Label") ui.Spacer() with ui.HStack(): ui.Spacer(width=fl._find("welcome_content_padding_x")) with ui.VStack(): with ui.ZStack(): ui.Rectangle(style_type_name_override="Info") self.__build_content() ui.Spacer(width=fl._find("welcome_content_padding_x")) ui.Spacer(height=fl._find("welcome_content_padding_y")) def __build_content(self): import omni.kit.app manager = omni.kit.app.get_app().get_extension_manager() manager.set_extension_enabled_immediate("omni.kit.window.about", True) from omni.kit.window.about import AboutWidget with ui.Frame(): self._about_widget = AboutWidget()
1,849
Python
32.636363
118
0.593294
omniverse-code/kit/exts/omni.kit.welcome.about/omni/kit/welcome/about/tests/test_page.py
import asyncio from pathlib import Path import omni.kit.app from omni.ui.tests.test_base import OmniUiTest from ..extension import AboutPageExtension CURRENT_PATH = Path(__file__).parent TEST_DATA_PATH = CURRENT_PATH.parent.parent.parent.parent.parent.joinpath("data").joinpath("tests") class TestPage(OmniUiTest): # Before running each test async def setUp(self): await super().setUp() self._golden_img_dir = TEST_DATA_PATH.absolute().joinpath("golden_img").absolute() # After running each test async def tearDown(self): await super().tearDown() async def test_page(self): window = await self.create_test_window(width=800, height=500) with window.frame: ext = AboutPageExtension() ext.on_startup("omni.kit.welcome.extensions-1.1.0") ext.build_ui() ext._about_widget.app_info = "#App Name# #App Version#" ext._about_widget.versions = ["About test version #1", "About test version #2", "About test version #3"] class FakePluginImpl(): def __init__(self, name): self.name = name class FakePlugin(): def __init__(self, name): self.libPath = "Lib Path " + name self.impl = FakePluginImpl("Impl " + name) self.interfaces = "Interface " + name ext._about_widget.plugins = [FakePlugin("Test 1"), FakePlugin("Test 2"), FakePlugin("Test 3"), FakePlugin("Test 4")] await omni.kit.app.get_app().next_update_async() # Wait for image loaded await asyncio.sleep(5) await self.finalize_test(golden_img_dir=self._golden_img_dir, golden_img_name="page.png")
1,765
Python
35.040816
128
0.603399
omniverse-code/kit/exts/omni.kit.viewport.manipulator.transform/omni/kit/viewport/manipulator/transform/fakeGf.py
import math from usdrt import Gf def GfRotation(axis0, angle): axis = Gf.Vec3d(axis0[0], axis0[1], axis0[2]).GetNormalized() quat = Gf.Quatd() s = math.sin(math.radians (angle*0.5 ) ) qx = axis[0] * s qy = axis[1] * s qz = axis[2] * s qw = math.cos( math.radians (angle/2) ) i = Gf.Vec3d(qx, qy, qz) quat.SetReal(qw) quat.SetImaginary(i) return quat
397
Python
21.11111
65
0.586902
omniverse-code/kit/exts/omni.kit.viewport.manipulator.transform/omni/kit/viewport/manipulator/transform/__init__.py
from .extension import * from .model import *
46
Python
14.666662
24
0.73913
omniverse-code/kit/exts/omni.kit.viewport.manipulator.transform/omni/kit/viewport/manipulator/transform/utils.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and related documentation without an express # license agreement from NVIDIA CORPORATION is strictly prohibited. # import carb import carb.profiler import carb.settings @carb.profiler.profile def flatten(transform): """Convert array[4][4] to array[16]""" # flatten the matrix by hand # USING LIST COMPREHENSION IS VERY SLOW (e.g. return [item for sublist in transform for item in sublist]), which takes around 10ms. m0, m1, m2, m3 = transform[0], transform[1], transform[2], transform[3] return [ m0[0], m0[1], m0[2], m0[3], m1[0], m1[1], m1[2], m1[3], m2[0], m2[1], m2[2], m2[3], m3[0], m3[1], m3[2], m3[3], ]
1,078
Python
27.394736
135
0.628942
omniverse-code/kit/exts/omni.kit.viewport.manipulator.transform/omni/kit/viewport/manipulator/transform/model.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and related documentation without an express # license agreement from NVIDIA CORPORATION is strictly prohibited. # from __future__ import annotations # import asyncio # import math # import traceback from enum import Enum, Flag, IntEnum, auto # from typing import Dict, List, Sequence, Set, Tuple, Union # import concurrent.futures import carb import carb.dictionary import carb.events import carb.profiler import carb.settings # import omni.kit.app from omni.kit.async_engine import run_coroutine import omni.kit.undo import omni.timeline # from omni.kit.manipulator.tool.snap import settings_constants as snap_c from omni.kit.manipulator.transform import AbstractTransformManipulatorModel, Operation # from omni.kit.manipulator.transform.settings_constants import c # from omni.kit.manipulator.transform.settings_listener import OpSettingsListener, SnapSettingsListener # from omni.ui import scene as sc # from pxr import Gf, Sdf, Tf, Usd, UsdGeom, UsdUtils # from .utils import * # from .settings_constants import Constants as prim_c class ManipulationMode(IntEnum): PIVOT = 0 # transform around manipulator pivot UNIFORM = 1 # set same world transform from manipulator to all prims equally INDIVIDUAL = 2 # 2: (TODO) transform around each prim's own pivot respectively class Viewport1WindowState: def __init__(self): self._focused_windows = None focused_windows = [] try: # For some reason is_focused may return False, when a Window is definitely in fact is the focused window! # And there's no good solution to this when multiple Viewport-1 instances are open; so we just have to # operate on all Viewports for a given usd_context. import omni.kit.viewport_legacy as vp vpi = vp.acquire_viewport_interface() for instance in vpi.get_instance_list(): window = vpi.get_viewport_window(instance) if not window: continue focused_windows.append(window) if focused_windows: self._focused_windows = focused_windows for window in self._focused_windows: # Disable the selection_rect, but enable_picking for snapping window.disable_selection_rect(True) # Schedule a picking request so if snap needs it later, it may arrive by the on_change event window.request_picking() except Exception: pass def get_picked_world_pos(self): if self._focused_windows: # Try to reduce to the focused window now after, we've had some mouse-move input focused_windows = [window for window in self._focused_windows if window.is_focused()] if focused_windows: self._focused_windows = focused_windows for window in self._focused_windows: window.disable_selection_rect(True) # request picking FOR NEXT FRAME window.request_picking() # get PREVIOUSLY picked pos, it may be None the first frame but that's fine return window.get_picked_world_pos() return None def __del__(self): self.destroy() def destroy(self): self._focused_windows = None def get_usd_context_name(self): if self._focused_windows: return self._focused_windows[0].get_usd_context_name() else: return "" class DataAccessorRegistry(): def __init__(self): ... def getDataAccessor(self): self.dataAccessor = DataAccessor() return self.dataAccessor class DataAccessor(): def __init__(self): ... def get_local_to_world_transform(self, obj): ... def get_parent_to_world_transform(self, obj): ... def clear_xform_cache(self): ... class ViewportTransformModel(AbstractTransformManipulatorModel): def __init__(self, usd_context_name: str = "", viewport_api=None): super().__init__()
4,385
Python
38.160714
117
0.662942
omniverse-code/kit/exts/omni.kit.viewport.manipulator.transform/omni/kit/viewport/manipulator/transform/gestures.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and related documentation without an express # license agreement from NVIDIA CORPORATION is strictly prohibited. # from __future__ import annotations import asyncio import math import traceback from enum import Enum, Flag, IntEnum, auto from typing import Dict, List, Sequence, Set, Tuple, Union import concurrent.futures import carb import carb.dictionary import carb.events import carb.profiler import carb.settings import omni.kit.app from omni.kit.async_engine import run_coroutine import omni.kit.commands import omni.kit.undo import omni.timeline from omni.kit.manipulator.tool.snap import SnapProviderManager # from omni.kit.manipulator.tool.snap import settings_constants as snap_c from omni.kit.manipulator.transform.gestures import ( RotateChangedGesture, RotateDragGesturePayload, ScaleChangedGesture, ScaleDragGesturePayload, TransformDragGesturePayload, TranslateChangedGesture, TranslateDragGesturePayload, ) from omni.kit.manipulator.transform import Operation from omni.kit.manipulator.transform.settings_constants import c from omni.ui import scene as sc from .model import ViewportTransformModel, ManipulationMode, Viewport1WindowState from .utils import flatten from .fakeGf import GfRotation # from usdrt import Sdf, Usd, UsdGeom from usdrt import Gf class ViewportTransformChangedGestureBase: def __init__(self, usd_context_name: str = "", viewport_api=None): self._settings = carb.settings.get_settings() self._usd_context_name = usd_context_name self._usd_context = omni.usd.get_context(self._usd_context_name) self._viewport_api = viewport_api # VP2 self._vp1_window_state = None self._stage_id = None def on_began(self, payload_type=TransformDragGesturePayload): self._viewport_on_began() if not self.gesture_payload or not self.sender or not isinstance(self.gesture_payload, payload_type): return model = self.sender.model if not model: return item = self.gesture_payload.changing_item self._current_editing_op = item.operation # NOTE! self._begin_xform has no scale. To get the full matrix, do self._begin_scale_mtx * self._begin_xform self._begin_xform = Gf.Matrix4d(*model.get_as_floats(model.get_item("no_scale_transform_manipulator"))) manip_scale = Gf.Vec3d(*model.get_as_floats(model.get_item("scale_manipulator"))) self._begin_scale_mtx = Gf.Matrix4d(1.0) self._begin_scale_mtx.SetScale(manip_scale) model.set_floats(model.get_item("viewport_fps"), [0.0]) model.on_began(self.gesture_payload) def on_changed(self, payload_type=TransformDragGesturePayload): if not self.gesture_payload or not self.sender or not isinstance(self.gesture_payload, payload_type): return model = self.sender.model if not model: return if self._viewport_api: fps = self._viewport_api.frame_info.get("fps") model.set_floats(model.get_item("viewport_fps"), [fps]) model.on_changed(self.gesture_payload) def on_ended(self, payload_type=TransformDragGesturePayload): self._viewport_on_ended() if not self.gesture_payload or not self.sender or not isinstance(self.gesture_payload, payload_type): return model = self.sender.model if not model: return item = self.gesture_payload.changing_item if item.operation != self._current_editing_op: return model.set_floats(model.get_item("viewport_fps"), [0.0]) model.on_ended(self.gesture_payload) self._current_editing_op = None def on_canceled(self, payload_type=TransformDragGesturePayload): self._viewport_on_ended() if not self.gesture_payload or not self.sender or not isinstance(self.gesture_payload, payload_type): return model = self.sender.model if not model: return item = self.gesture_payload.changing_item if item.operation != self._current_editing_op: return model.on_canceled(self.gesture_payload) self._current_editing_op = None def _publish_delta(self, operation: Operation, delta: List[float]): if operation == Operation.TRANSLATE: self._settings.set_float_array(TRANSFORM_GIZMO_TRANSLATE_DELTA_XYZ, delta) elif operation == Operation.ROTATE: self._settings.set_float_array(TRANSFORM_GIZMO_ROTATE_DELTA_XYZW, delta) elif operation == Operation.SCALE: self._settings.set_float_array(TRANSFORM_GIZMO_SCALE_DELTA_XYZ, delta) def __set_viewport_manipulating(self, value: int): # Signal that user-manipulation has started for this stage if self._stage_id is None: # self._stage_id = UsdUtils.StageCache.Get().GetId(self._usd_context.get_stage()).ToLongInt() self._stage_id = self._usd_context.get_stage_id() key = f"/app/viewport/{self._stage_id}/manipulating" cur_value = self._settings.get(key) or 0 self._settings.set(key, cur_value + value) def _viewport_on_began(self): self._viewport_on_ended() if self._viewport_api is None: self._vp1_window_state = Viewport1WindowState() self.__set_viewport_manipulating(1) def _viewport_on_ended(self): if self._vp1_window_state: self._vp1_window_state.destroy() self._vp1_window_state = None if self._stage_id: self.__set_viewport_manipulating(-1) self._stage_id = None class ViewportTranslateChangedGesture(TranslateChangedGesture, ViewportTransformChangedGestureBase): def __init__(self, snap_manager: SnapProviderManager, **kwargs): ViewportTransformChangedGestureBase.__init__(self, **kwargs) TranslateChangedGesture.__init__(self) self._accumulated_translate = Gf.Vec3d(0) self._snap_manager = snap_manager def on_began(self): ViewportTransformChangedGestureBase.on_began(self, TranslateDragGesturePayload) self._accumulated_translate = Gf.Vec3d(0) model = self._get_model(TranslateDragGesturePayload) if model and self._can_snap(model): # TODO No need for gesture=self when VP1 has viewport_api self._snap_manager.on_began(model.consolidated_xformable_prim_data_curr.keys(), gesture=self) if model: model.set_floats(model.get_item("translate_delta"), [0, 0, 0]) def on_ended(self): ViewportTransformChangedGestureBase.on_ended(self, TranslateDragGesturePayload) model = self._get_model(TranslateDragGesturePayload) if model and self._can_snap(model): self._snap_manager.on_ended() def on_canceled(self): ViewportTransformChangedGestureBase.on_canceled(self, TranslateDragGesturePayload) model = self._get_model(TranslateDragGesturePayload) if model and self._can_snap(model): self._snap_manager.on_ended() @carb.profiler.profile def on_changed(self): ViewportTransformChangedGestureBase.on_changed(self, TranslateDragGesturePayload) model = self._get_model(TranslateDragGesturePayload) if not model: return manip_xform = Gf.Matrix4d(*model.get_as_floats(model.get_item("no_scale_transform_manipulator"))) new_manip_xform = Gf.Matrix4d(manip_xform) rotation_mtx = manip_xform.ExtractRotationMatrix() rotation_mtx.Orthonormalize() translate_delta = self.gesture_payload.moved_delta translate = self.gesture_payload.moved axis = self.gesture_payload.axis # slow Gf.Vec3d(*translate_delta) translate_delta = Gf.Vec3d(translate_delta[0], translate_delta[1], translate_delta[2]) if model.op_settings_listener.translation_mode == c.TRANSFORM_MODE_LOCAL: translate_delta = translate_delta * rotation_mtx self._accumulated_translate += translate_delta def apply_position(snap_world_pos=None, snap_world_orient=None, keep_spacing: bool = True): nonlocal new_manip_xform if self.state != sc.GestureState.CHANGED: return # only set translate if no snap or only snap to position item_name = "translate" if snap_world_pos and ( math.isfinite(snap_world_pos[0]) and math.isfinite(snap_world_pos[1]) and math.isfinite(snap_world_pos[2]) ): if snap_world_orient is None: new_manip_xform.SetTranslateOnly(Gf.Vec3d(snap_world_pos[0], snap_world_pos[1], snap_world_pos[2])) new_manip_xform = self._begin_scale_mtx * new_manip_xform else: new_manip_xform.SetTranslateOnly(Gf.Vec3d(snap_world_pos[0], snap_world_pos[1], snap_world_pos[2])) new_manip_xform.SetRotateOnly(snap_world_orient) # set transform if snap both position and orientation item_name = "no_scale_transform_manipulator" else: new_manip_xform.SetTranslateOnly(self._begin_xform.ExtractTranslation() + self._accumulated_translate) new_manip_xform = self._begin_scale_mtx * new_manip_xform model.set_floats(model.get_item("translate_delta"), translate_delta) if model.custom_manipulator_enabled: self._publish_delta(Operation.TRANSLATE, translate_delta) if keep_spacing is False: mode_item = model.get_item("manipulator_mode") prev_mode = model.get_as_ints(mode_item) model.set_ints(mode_item, [int(ManipulationMode.UNIFORM)]) model.set_floats(model.get_item(item_name), flatten(new_manip_xform)) if keep_spacing is False: model.set_ints(mode_item, prev_mode) # only do snap to surface if drag the center point if ( model.snap_settings_listener.snap_enabled and model.snap_settings_listener.snap_provider and axis == [1, 1, 1] ): ndc_location = None if self._viewport_api: # No mouse location is available, have to convert back to NDC space ndc_location = self.sender.transform_space( sc.Space.WORLD, sc.Space.NDC, self.gesture_payload.ray_closest_point ) if self._snap_manager.get_snap_pos( new_manip_xform, ndc_location, self.sender.scene_view, lambda **kwargs: apply_position( kwargs.get("position", None), kwargs.get("orient", None), kwargs.get("keep_spacing", True) ), ): return apply_position() def _get_model(self, payload_type) -> ViewportTransformModel: if not self.gesture_payload or not self.sender or not isinstance(self.gesture_payload, payload_type): return None return self.sender.model def _can_snap(self, model: ViewportTransformModel): axis = self.gesture_payload.axis if ( model.snap_settings_listener.snap_enabled and model.snap_settings_listener.snap_provider and axis == [1, 1, 1] ): return True return False class ViewportRotateChangedGesture(RotateChangedGesture, ViewportTransformChangedGestureBase): def __init__(self, **kwargs): ViewportTransformChangedGestureBase.__init__(self, **kwargs) RotateChangedGesture.__init__(self) def on_began(self): ViewportTransformChangedGestureBase.on_began(self, RotateDragGesturePayload) model = self.sender.model if model: model.set_floats(model.get_item("rotate_delta"), [0, 0, 0, 0]) def on_ended(self): ViewportTransformChangedGestureBase.on_ended(self, RotateDragGesturePayload) def on_canceled(self): ViewportTransformChangedGestureBase.on_canceled(self, RotateDragGesturePayload) @carb.profiler.profile def on_changed(self): ViewportTransformChangedGestureBase.on_changed(self, RotateDragGesturePayload) if ( not self.gesture_payload or not self.sender or not isinstance(self.gesture_payload, RotateDragGesturePayload) ): return model = self.sender.model if not model: return axis = self.gesture_payload.axis angle = self.gesture_payload.angle angle_delta = self.gesture_payload.angle_delta screen_space = self.gesture_payload.screen_space free_rotation = self.gesture_payload.free_rotation axis = Gf.Vec3d(*axis[:3]) rotate = GfRotation(axis, angle) delta_axis = Gf.Vec4d(*axis, 0.0) rot_matrix = Gf.Matrix4d(1) rot_matrix.SetRotate(rotate) if free_rotation: rotate = GfRotation(axis, angle_delta) rot_matrix = Gf.Matrix4d(1) rot_matrix.SetRotate(rotate) xform = Gf.Matrix4d(*model.get_as_floats(model.get_item("no_scale_transform_manipulator"))) full_xform = self._begin_scale_mtx * xform translate = full_xform.ExtractTranslation() no_translate_mtx = Gf.Matrix4d(full_xform) no_translate_mtx.SetTranslateOnly(Gf.Vec3d(0)) no_translate_mtx = no_translate_mtx * rot_matrix new_transform_matrix = no_translate_mtx.SetTranslateOnly(translate) delta_axis = no_translate_mtx * delta_axis elif model.op_settings_listener.rotation_mode == c.TRANSFORM_MODE_GLOBAL or screen_space: begin_full_xform = self._begin_scale_mtx * self._begin_xform translate = begin_full_xform.ExtractTranslation() no_translate_mtx = Gf.Matrix4d(begin_full_xform) no_translate_mtx.SetTranslateOnly(Gf.Vec3d(0)) no_translate_mtx = no_translate_mtx * rot_matrix new_transform_matrix = no_translate_mtx.SetTranslateOnly(translate) delta_axis = no_translate_mtx * delta_axis else: self._begin_xform = Gf.Matrix4d(*model.get_as_floats(model.get_item("no_scale_transform_manipulator"))) new_transform_matrix = self._begin_scale_mtx * rot_matrix * self._begin_xform delta_axis.Normalize() delta_rotate = GfRotation(delta_axis[:3], angle_delta) quat = delta_rotate #.GetQuaternion() real = quat.GetReal() imaginary = quat.GetImaginary() rd = [imaginary[0], imaginary[1], imaginary[2], real] model.set_floats(model.get_item("rotate_delta"), rd) if model.custom_manipulator_enabled: self._publish_delta(Operation.ROTATE, rd) model.set_floats(model.get_item("rotate"), flatten(new_transform_matrix)) class ViewportScaleChangedGesture(ScaleChangedGesture, ViewportTransformChangedGestureBase): def __init__(self, **kwargs): ViewportTransformChangedGestureBase.__init__(self, **kwargs) ScaleChangedGesture.__init__(self) def on_began(self): ViewportTransformChangedGestureBase.on_began(self, ScaleDragGesturePayload) model = self.sender.model if model: model.set_floats(model.get_item("scale_delta"), [0, 0, 0]) def on_ended(self): ViewportTransformChangedGestureBase.on_ended(self, ScaleDragGesturePayload) def on_canceled(self): ViewportTransformChangedGestureBase.on_canceled(self, ScaleDragGesturePayload) @carb.profiler.profile def on_changed(self): ViewportTransformChangedGestureBase.on_changed(self, ScaleDragGesturePayload) if not self.gesture_payload or not self.sender or not isinstance(self.gesture_payload, ScaleDragGesturePayload): return model = self.sender.model if not model: return axis = self.gesture_payload.axis scale = self.gesture_payload.scale axis = Gf.Vec3d(*axis[:3]) scale_delta = scale * axis scale_vec = Gf.Vec3d() for i in range(3): scale_vec[i] = scale_delta[i] if scale_delta[i] else 1 scale_matrix = Gf.Matrix4d(1.0) scale_matrix.SetScale(scale_vec) scale_matrix *= self._begin_scale_mtx new_transform_matrix = scale_matrix * self._begin_xform s = Gf.Vec3d(*model.get_as_floats(model.get_item("scale_manipulator"))) sd = [s_n / s_o for s_n, s_o in zip([scale_matrix[0][0], scale_matrix[1][1], scale_matrix[2][2]], s)] model.set_floats(model.get_item("scale_delta"), sd) if model.custom_manipulator_enabled: self._publish_delta(Operation.SCALE, sd) model.set_floats(model.get_item("scale"), flatten(new_transform_matrix))
17,358
Python
37.747768
120
0.649038
omniverse-code/kit/exts/omni.kit.viewport.manipulator.transform/omni/kit/viewport/manipulator/transform/tests/test_manipulator_transform.py
## Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. ## ## NVIDIA CORPORATION and its licensors retain all intellectual property ## and proprietary rights in and to this software, related documentation ## and any modifications thereto. Any use, reproduction, disclosure or ## distribution of this software and related documentation without an express ## license agreement from NVIDIA CORPORATION is strictly prohibited. ## from omni.ui.tests.test_base import OmniUiTest class TestViewportTransform(OmniUiTest): # Before running each test async def setUp(self): pass # After running each test async def tearDown(self): pass
670
Python
34.315788
77
0.756716
omniverse-code/kit/exts/omni.kit.window.content_browser_registry/config/extension.toml
[package] # Semantic Versioning is used: https://semver.org/ version = "0.0.1" # Lists people or organizations that are considered the "authors" of the package. authors = ["NVIDIA"] # The title and description fields are primarly for displaying extension info in UI title = "content Browser Registry" description="Registry for all customizations that are added to the Content Browser" # URL of the extension source repository. repository = "" # Keywords for the extension keywords = ["kit", "ui"] # Location of change log file in target (final) folder of extension, relative to the root. # More info on writing changelog: https://keepachangelog.com/en/1.0.0/ changelog="docs/CHANGELOG.md" # Path (relative to the root) or content of readme markdown file for UI. readme = "docs/README.md" # Icon is shown in Extensions window, it is recommended to be square, of size 256x256. icon = "data/icon.png" category = "core" [dependencies] "omni.kit.window.filepicker" = {} # Main python module this extension provides, it will be publicly available as "import omni.kit.viewport.registry". [[python.module]] name = "omni.kit.window.content_browser_registry" [settings] # exts."omni.kit.window.content_browser_registry".xxx = "" [documentation] pages = [ "docs/CHANGELOG.md", ] [[test]] args = [ "--/app/window/dpiScaleOverride=1.0", "--/app/window/scaleToMonitor=false", "--no-window" ]
1,408
TOML
26.62745
115
0.727983
omniverse-code/kit/exts/omni.kit.window.content_browser_registry/omni/kit/window/content_browser_registry/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 typing import Callable from collections import OrderedDict from omni.kit.window.filepicker import SearchDelegate g_singleton = None # Any class derived from `omni.ext.IExt` in top level module (defined in `python.modules` of `extension.toml`) will be # instantiated when extension gets enabled and `on_startup(ext_id)` will be called. Later when extension gets disabled # on_shutdown() is called. class ContentBrowserRegistryExtension(omni.ext.IExt): """ This registry extension keeps track of the functioanl customizations that are applied to the Content Browser - so that they can be re-applied should the browser be re-started. """ def __init__(self): super().__init__() self._custom_menus = OrderedDict() self._selection_handlers = set() self._search_delegate = None def on_startup(self, ext_id): # Save away this instance as singleton global g_singleton g_singleton = self def on_shutdown(self): self._custom_menus.clear() self._selection_handlers.clear() self._search_delegate = None global g_singleton g_singleton = None def register_custom_menu(self, context: str, name: str, glyph: str, click_fn: Callable, show_fn: Callable, index: int = -1): id = f"{context}::{name}" self._custom_menus[id] = { 'name': name, 'glyph': glyph, 'click_fn': click_fn, 'show_fn': show_fn, 'index': index, } def deregister_custom_menu(self, context: str, name: str): id = f"{context}::{name}" if id in self._custom_menus: del self._custom_menus[id] def register_selection_handler(self, handler: Callable): self._selection_handlers.add(handler) def deregister_selection_handler(self, handler: Callable): if handler in self._selection_handlers: self._selection_handlers.remove(handler) def register_search_delegate(self, search_delegate: SearchDelegate): self._search_delegate = search_delegate def deregister_search_delegate(self, search_delegate: SearchDelegate): if self._search_delegate == search_delegate: self._search_delegate = None def get_instance(): return g_singleton
2,775
Python
34.13924
128
0.675676
omniverse-code/kit/exts/omni.kit.window.content_browser_registry/omni/kit/window/content_browser_registry/__init__.py
# Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and related documentation without an express # license agreement from NVIDIA CORPORATION is strictly prohibited. # from typing import Callable, Union, Set from collections import OrderedDict from omni.kit.window.filepicker import SearchDelegate from .extension import ContentBrowserRegistryExtension, get_instance def custom_menus() -> OrderedDict: registry = get_instance() if registry: return registry._custom_menus return OrderedDict() def selection_handlers() -> Set: registry = get_instance() if registry: return registry._selection_handlers return set() def search_delegate() -> SearchDelegate: registry = get_instance() if registry: return registry._search_delegate return None def register_context_menu(name: str, glyph: str, click_fn: Callable, show_fn: Callable, index: int = -1): registry = get_instance() if registry: registry.register_custom_menu("context", name, glyph, click_fn, show_fn, index=index) def deregister_context_menu(name: str): registry = get_instance() if registry: registry.deregister_custom_menu("context", name) def register_listview_menu(name: str, glyph: str, click_fn: Callable, show_fn: Callable, index: int = -1): registry = get_instance() if registry: registry.register_custom_menu("listview", name, glyph, click_fn, show_fn, index=index) def deregister_listview_menu(name: str): registry = get_instance() if registry: registry.deregister_custom_menu("listview", name) def register_import_menu(name: str, glyph: str, click_fn: Callable, show_fn: Callable): registry = get_instance() if registry: registry.register_custom_menu("import", name, glyph, click_fn, show_fn) def deregister_import_menu(name: str): registry = get_instance() if registry: registry.deregister_custom_menu("import", name) def register_file_open_handler(name: str, open_fn: Callable, file_type: Union[int, Callable]): registry = get_instance() if registry: registry.register_custom_menu("file_open", name, None, open_fn, file_type) def deregister_file_open_handler(name: str): registry = get_instance() if registry: registry.deregister_custom_menu("file_open", name) def register_selection_handler(handler: Callable): registry = get_instance() if registry: registry.register_selection_handler(handler) def deregister_selection_handler(handler: Callable): registry = get_instance() if registry: registry.deregister_selection_handler(handler) def register_search_delegate(search_delegate: SearchDelegate): registry = get_instance() if registry: registry.register_search_delegate(search_delegate) def deregister_search_delegate(search_delegate: SearchDelegate): registry = get_instance() if registry: registry.deregister_search_delegate(search_delegate)
3,246
Python
34.293478
106
0.718731
omniverse-code/kit/exts/omni.kit.window.content_browser_registry/omni/kit/window/content_browser_registry/tests/test_registry.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 import inspect import omni.kit.window.content_browser_registry as registry from unittest.mock import Mock from omni.kit.test.async_unittest import AsyncTestCase class TestRegistry(AsyncTestCase): """Testing Content Browser Registry""" async def setUp(self): pass async def tearDown(self): pass async def test_custom_menus(self): """Test registering and de-registering custom menus""" test_menus = [ { "register_fn": registry.register_context_menu, "deregister_fn": registry.deregister_context_menu, "context": "context", "name": "my context menu", "glyph": "my glyph", "click_fn": Mock(), "show_fn": Mock(), }, { "register_fn": registry.register_listview_menu, "deregister_fn": registry.deregister_listview_menu, "context": "listview", "name": "my listview menu", "glyph": "my glyph", "click_fn": Mock(), "show_fn": Mock(), }, { "register_fn": registry.register_import_menu, "deregister_fn": registry.deregister_import_menu, "context": "import", "name": "my import menu", "glyph": None, "click_fn": Mock(), "show_fn": Mock(), }, { "register_fn": registry.register_file_open_handler, "deregister_fn": registry.deregister_file_open_handler, "context": "file_open", "name": "my file_open handler", "glyph": None, "click_fn": Mock(), "show_fn": Mock(), } ] # Register menus for test_menu in test_menus: register_fn = test_menu["register_fn"] if 'glyph' in inspect.getfullargspec(register_fn).args: register_fn(test_menu["name"], test_menu["glyph"], test_menu["click_fn"], test_menu["show_fn"]) else: register_fn(test_menu["name"], test_menu["click_fn"], test_menu["show_fn"]) # Confirm menus stored to registry for test_menu in test_menus: self.assertTrue(f'{test_menu["context"]}::{test_menu["name"]}' in registry.custom_menus()) # De-register all menus for test_menu in test_menus: test_menu["deregister_fn"](test_menu["name"]) # Confirm all menus removed from registry self.assertEqual(len(registry.custom_menus()), 0) async def test_selection_handlers(self): """Test registering selection handlers""" test_handler_1 = Mock() test_handler_2 = Mock() test_handlers = [test_handler_1, test_handler_2, test_handler_1] self.assertEqual(len(registry.selection_handlers()), 0) for test_handler in test_handlers: registry.register_selection_handler(test_handler) # Confirm each unique handler is stored only once in registry self.assertEqual(len(registry.selection_handlers()), 2) async def test_search_delegate(self): """Test registering search delegate""" test_search_delegate = Mock() self.assertEqual(registry.search_delegate(), None) registry.register_search_delegate(test_search_delegate) # Confirm search delegate stored in registry self.assertEqual(registry.search_delegate(), test_search_delegate)
4,061
Python
38.057692
111
0.581138
omniverse-code/kit/exts/omni.kit.window.content_browser_registry/docs/CHANGELOG.md
# Changelog The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [0.0.1] - 2022-10-11 ### Updated - Initial version.
148
Markdown
23.833329
80
0.675676
omniverse-code/kit/exts/omni.kit.window.content_browser_registry/docs/README.md
# Content Browser registry extension [omni.kit.window.content_browser_registry] This helper registry maintains a list of customizations that are added to the content browser.
175
Markdown
57.666647
94
0.828571
omniverse-code/kit/exts/omni.kit.window.about/config/extension.toml
[package] # Semantic Versioning is used: https://semver.org/ version = "1.0.3" # Lists people or organizations that are considered the "authors" of the package. authors = ["NVIDIA"] # The title and description fields are primarily for displaying extension info in UI title = "Kit About Window" description="Show application/build information." # URL of the extension source repository. repository = "" # Preview image. Folder named "data" automatically goes in git lfs (see .gitattributes file). preview_image = "data/preview.png" # One of categories for UI. category = "Internal" # Keywords for the extension keywords = ["kit"] # https://keepachangelog.com/en/1.0.0/ changelog="docs/CHANGELOG.md" [dependencies] "omni.ui" = {} "omni.usd" = {} "omni.client" = {} "omni.kit.menu.utils" = {} "omni.kit.clipboard" = {} [[python.module]] name = "omni.kit.window.about" [[test]] args = [ "--/renderer/enabled=pxr", "--/renderer/active=pxr", "--/renderer/multiGpu/enabled=false", "--/renderer/multiGpu/autoEnable=false", # Disable mGPU with PXR due to OM-51026, OM-53611 "--/renderer/multiGpu/maxGpuCount=1", "--/app/asyncRendering=false", "--/app/window/dpiScaleOverride=1.0", "--/app/window/scaleToMonitor=false", # "--no-window", # Test crashes with this turned on, for some reason "--/testconfig/isTest=true" ] dependencies = [ "omni.hydra.pxr", "omni.kit.renderer.capture", "omni.kit.ui_test", "omni.kit.test_suite.helpers", ] stdoutFailPatterns.include = [] stdoutFailPatterns.exclude = []
1,559
TOML
25
94
0.686979
omniverse-code/kit/exts/omni.kit.window.about/omni/kit/window/about/about.py
import carb import carb.settings import omni.client import omni.kit.app import omni.kit.ui import omni.ext import omni.kit.menu.utils from omni.kit.menu.utils import MenuItemDescription from pathlib import Path from omni import ui from .about_actions import register_actions, deregister_actions from .about_window import AboutWindow WINDOW_NAME = "About" MENU_NAME = "Help" _extension_instance = None class AboutExtension(omni.ext.IExt): def on_startup(self, ext_id): self._ext_name = omni.ext.get_extension_name(ext_id) self._window = AboutWindow() self._window.set_visibility_changed_fn(self._on_visibility_changed) self._menu_entry = MenuItemDescription( name=WINDOW_NAME, ticked_fn=self._is_visible, onclick_action=(self._ext_name, "toggle_window"), ) omni.kit.menu.utils.add_menu_items([self._menu_entry], name=MENU_NAME) ui.Workspace.set_show_window_fn( "About", lambda value: self._toggle_window(), ) manager = omni.kit.app.get_app().get_extension_manager() extension_path = manager.get_extension_path(ext_id) global _extension_instance _extension_instance = self register_actions(self._ext_name, lambda: _extension_instance) def on_shutdown(self): global _extension_instance _extension_instance = None self._window.destroy() self._window = None omni.kit.menu.utils.remove_menu_items([self._menu_entry], name=MENU_NAME) self._menu_entry = None deregister_actions(self._ext_name) def _is_visible(self) -> bool: return False if self._window is None else self._window.visible def _on_visibility_changed(self, visible): self._menu_entry.ticked = visible omni.kit.menu.utils.refresh_menu_items(MENU_NAME) def toggle_window(self): self._window.visible = not self._window.visible def show(self, visible: bool): self._window.visible = visible def menu_show_about(self, plugins): version_infos = [ f"Omniverse Kit {self.kit_version}", f"App Name: {self.app_name}", f"App Version: {self.app_version}", f"Client Library Version: {self.client_library_version}", f"USD Resolver Version: {self.usd_resolver_version}", f"USD Version: {self.usd_version}", f"MDL SDK Version: {self.mdlsdk_version}", ] @staticmethod def _resize_window(window: ui.Window, scrolling_frame: ui.ScrollingFrame): scrolling_frame.width = ui.Pixel(window.width - 10) scrolling_frame.height = ui.Pixel(window.height - 305) def get_instance(): return _extension_instance
2,772
Python
29.811111
81
0.644661
omniverse-code/kit/exts/omni.kit.window.about/omni/kit/window/about/style.py
from pathlib import Path from omni import ui from omni.ui import color as cl CURRENT_PATH = Path(__file__).parent ICON_PATH = CURRENT_PATH.parent.parent.parent.parent.joinpath("data") ABOUT_STYLE = { "Window": {"background_color": cl("#1F2123")}, "Line": {"color": 0xFF353332, "border_width": 1.5}, "ScrollingFrame": {"background_color": cl.transparent, "margin_width": 1, "margin_height": 2}, "About.Background": {"image_url": f"{ICON_PATH}/about_backgroud.png"}, "About.Background.Fill": {"background_color": cl("#131415")}, "About.Logo": {"image_url": f"{ICON_PATH}/about_logo.png", "padding": 0, "margin": 0}, "Logo.Frame": {"background_color": cl("#202424"), "padding": 0, "margin": 0}, "Logo.Separator": {"color": cl("#7BB01E"), "border_width": 1.5}, "Text.App": {"font_size": 18, "margin_width": 10, "margin_height": 2}, "Text.Plugin": {"font_size": 14, "margin_width": 10, "margin_height": 2}, "Text.Version": {"font_size": 18, "margin_width": 10, "margin_height": 2}, "Text.Title": {"font_size": 16, "margin_width": 10}, }
1,083
Python
46.130433
98
0.626039
omniverse-code/kit/exts/omni.kit.window.about/omni/kit/window/about/about_window.py
import omni.ui as ui import omni.kit.clipboard from .about_widget import AboutWidget from .style import ABOUT_STYLE class AboutWindow(ui.Window): def __init__(self): super().__init__( "About", width=800, height=540, flags=ui.WINDOW_FLAGS_NO_SCROLLBAR | ui.WINDOW_FLAGS_NO_DOCKING, visible=False ) self.frame.set_build_fn(self._build_ui) self.frame.set_style(ABOUT_STYLE) def destroy(self): self.visible = False super().destroy() def _build_ui(self): with self.frame: with ui.ZStack(): with ui.VStack(): self._widget = AboutWidget() ui.Line(height=0) ui.Spacer(height=4) with ui.HStack(height=26): ui.Spacer() ui.Button("Close", width=80, clicked_fn=self._hide, style={"padding": 0, "margin": 0}) ui.Button( "###copy_to_clipboard", style={"background_color": 0x00000000}, mouse_pressed_fn=lambda x, y, b, a: self.__copy_to_clipboard(b), identifier="copy_to_clipboard", ) def _hide(self): self.visible = False def __copy_to_clipboard(self, button): if button != 1: return omni.kit.clipboard.copy("\n".join(self._widget.versions))
1,474
Python
30.382978
110
0.504071
omniverse-code/kit/exts/omni.kit.window.about/omni/kit/window/about/__init__.py
from .about import * from .about_widget import AboutWidget
59
Python
18.999994
37
0.79661
omniverse-code/kit/exts/omni.kit.window.about/omni/kit/window/about/about_widget.py
from typing import List import carb import carb.settings import omni.kit.app import omni.ui as ui from .style import ABOUT_STYLE class AboutWidget: def __init__(self): app = omni.kit.app.get_app() self._app_info = f"{app.get_app_name()} {app.get_app_version()}" self._versions = self.__get_versions() plugins = [p for p in carb.get_framework().get_plugins() if p.impl.name] self._plugins = sorted(plugins, key=lambda x: x.impl.name) custom_image = carb.settings.get_settings().get("/app/window/imagePath") if custom_image: ABOUT_STYLE['About.Logo']['image_url'] = carb.tokens.get_tokens_interface().resolve(custom_image) self._frame = ui.Frame(build_fn=self._build_ui, style=ABOUT_STYLE) @property def app_info(self) -> List[str]: return self._app_info @app_info.setter def app_info(self, value: str) -> None: self._app_info = value with self._frame: self._frame.call_build_fn() @property def versions(self) -> List[str]: return [self._app_info] + self._versions @versions.setter def versions(self, values: List[str]) -> None: self._versions = values with self._frame: self._frame.call_build_fn() @property def plugins(self) -> list: return self._plugins @plugins.setter def plugins(self, values: list) -> None: self._plugins = values with self._frame: self._frame.call_build_fn() def _build_ui(self): with ui.VStack(spacing=5): with ui.ZStack(height=0): with ui.ZStack(): ui.Rectangle(style_type_name_override="About.Background.Fill") ui.Image( style_type_name_override="About.Background", alignment=ui.Alignment.RIGHT_TOP, ) with ui.VStack(): ui.Spacer(height=10) self.__build_app_info() ui.Spacer(height=10) for version_info in self._versions: ui.Label(version_info, height=0, style_type_name_override="Text.Version") ui.Spacer(height=10) ui.Spacer(height=0) ui.Label("Loaded plugins", height=0, style_type_name_override="Text.Title") ui.Line(height=0) with ui.ScrollingFrame( horizontal_scrollbar_policy=ui.ScrollBarPolicy.SCROLLBAR_ALWAYS_OFF, vertical_scrollbar_policy=ui.ScrollBarPolicy.SCROLLBAR_ALWAYS_ON, ): with ui.VStack(height=0, spacing=1): for p in self._plugins: ui.Label(f"{p.impl.name} {p.interfaces}", tooltip=p.libPath, style_type_name_override="Text.Plugin") def __build_app_info(self): with ui.HStack(height=0): ui.Spacer(width=10) with ui.ZStack(width=0, height=0): ui.Rectangle(style_type_name_override="Logo.Frame") with ui.HStack(height=0): with ui.VStack(): ui.Spacer(height=5) ui.Image(width=80, height=80, alignment=ui.Alignment.CENTER, style_type_name_override="About.Logo") ui.Spacer(height=5) with ui.VStack(width=0): ui.Spacer(height=10) ui.Line(alignment=ui.Alignment.LEFT, style_type_name_override="Logo.Separator") ui.Spacer(height=18) with ui.VStack(width=0, height=80): ui.Spacer() ui.Label("OMNIVERSE", style_type_name_override="Text.App") ui.Label(self._app_info, style_type_name_override="Text.App") ui.Spacer() ui.Spacer() def __get_versions(self) -> List[str]: settings = carb.settings.get_settings() is_running_test = settings.get("/testconfig/isTest") # omni_usd_resolver isn't loaded until Ar.GetResolver is called. # In the ext test, nothing does that, so we need to do it # since the library isn't located in a PATH search entry. # Unforunately the ext is loaded before the test module runs, # so we can't do it there. try: if is_running_test: from pxr import Ar Ar.GetResolver() import omni.usd_resolver usd_resolver_version = omni.usd_resolver.get_version() except ImportError: usd_resolver_version = None try: import omni.usd_libs usd_version = omni.usd_libs.get_version() except ImportError: usd_version = None try: # OM-61509: Add MDL SDK and USD version in about window import omni.mdl.neuraylib from omni.mdl import pymdlsdk # get mdl sdk version neuraylib = omni.mdl.neuraylib.get_neuraylib() ineuray = neuraylib.getNeurayAPI() neuray = pymdlsdk.attach_ineuray(ineuray) # strip off the date and platform info and only keep the version and build info version = neuray.get_version().split(",")[:2] mdlsdk_version = ",".join(version) except ImportError: mdlsdk_version = None app = omni.kit.app.get_app() version_infos = [ f"Omniverse Kit {app.get_kit_version()}", f"Client Library Version: {omni.client.get_version()}", f"USD Resolver Version: {usd_resolver_version}", f"USD Version: {usd_version}", f"MDL SDK Version: {mdlsdk_version}", ] return version_infos
5,850
Python
36.993506
124
0.549915
omniverse-code/kit/exts/omni.kit.window.about/omni/kit/window/about/about_actions.py
import carb import omni.kit.actions.core def register_actions(extension_id, get_self_fn): action_registry = omni.kit.actions.core.get_action_registry() actions_tag = "About Actions" omni.kit.actions.core.get_action_registry().register_action( extension_id, "toggle_window", get_self_fn().toggle_window, display_name="Help->Toggle About Window", description="Toggle About", tag=actions_tag, ) omni.kit.actions.core.get_action_registry().register_action( extension_id, "show_window", lambda v=True: get_self_fn().show(v), display_name="Help->Show About Window", description="Show About", tag=actions_tag, ) omni.kit.actions.core.get_action_registry().register_action( extension_id, "hide_window", lambda v=False: get_self_fn().show(v), display_name="Help->Hide About Window", description="Hide About", tag=actions_tag, ) def deregister_actions(extension_id): action_registry = omni.kit.actions.core.get_action_registry() action_registry.deregister_all_actions_for_extension(extension_id)
1,176
Python
29.179486
70
0.643707
omniverse-code/kit/exts/omni.kit.window.about/omni/kit/window/about/tests/test_window_about.py
## Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. ## ## NVIDIA CORPORATION and its licensors retain all intellectual property ## and proprietary rights in and to this software, related documentation ## and any modifications thereto. Any use, reproduction, disclosure or ## distribution of this software and related documentation without an express ## license agreement from NVIDIA CORPORATION is strictly prohibited. ## from pathlib import Path import omni.kit.app import omni.kit.test import omni.ui as ui from omni.ui.tests.test_base import OmniUiTest CURRENT_PATH = Path(__file__).parent TEST_DATA_PATH = CURRENT_PATH.parent.parent.parent.parent.parent.joinpath("data").joinpath("tests") class TestAboutWindow(OmniUiTest): # Before running each test async def setUp(self): await super().setUp() self._golden_img_dir = TEST_DATA_PATH.absolute().joinpath("golden_img").absolute() # After running each test async def tearDown(self): await super().tearDown() async def test_about_ui(self): class FakePluginImpl(): def __init__(self, name): self.name = name class FakePlugin(): def __init__(self, name): self.libPath = "Lib Path " + name self.impl = FakePluginImpl("Impl " + name) self.interfaces = "Interface " + name about = omni.kit.window.about.get_instance() about.show(True) await omni.kit.app.get_app().next_update_async() await omni.kit.app.get_app().next_update_async() about._window._widget.app_info = "#App Name# #App Version#" about._window._widget.versions = [ "Omniverse Kit #Version#", "Client Library Version: #Client Library Version#", "USD Resolver Version: #USD Resolver Version#", "USD Version: #USD Version#", "MDL SDK Version: #MDL SDK Version#", ] about._window._widget.plugins = [FakePlugin("Test 1"), FakePlugin("Test 2"), FakePlugin("Test 3"), FakePlugin("Test 4")] for _ in range(10): await omni.kit.app.get_app().next_update_async() await self.docked_test_window( window=about._window, width=800, height=510) await self.finalize_test(golden_img_dir=self._golden_img_dir, golden_img_name="test_about_ui.png")
2,403
Python
37.774193
128
0.63712
omniverse-code/kit/exts/omni.kit.window.about/omni/kit/window/about/tests/__init__.py
from .test_window_about import * from .test_clipboard import *
63
Python
20.333327
32
0.761905
omniverse-code/kit/exts/omni.kit.window.about/omni/kit/window/about/tests/test_clipboard.py
## Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. ## ## NVIDIA CORPORATION and its licensors retain all intellectual property ## and proprietary rights in and to this software, related documentation ## and any modifications thereto. Any use, reproduction, disclosure or ## distribution of this software and related documentation without an express ## license agreement from NVIDIA CORPORATION is strictly prohibited. ## import pathlib import sys import unittest import omni.kit.app import omni.kit.test import omni.ui as ui from omni.kit import ui_test from omni.ui.tests.test_base import OmniUiTest class TestAboutWindowClipboard(OmniUiTest): # Before running each test async def setUp(self): await super().setUp() # After running each test async def tearDown(self): await super().tearDown() # @unittest.skipIf(sys.platform.startswith("linux"), "Pyperclip fails on some TeamCity agents") async def test_about_clipboard(self): class FakePluginImpl(): def __init__(self, name): self.name = name class FakePlugin(): def __init__(self, name): self.libPath = "Lib Path " + name self.impl = FakePluginImpl("Impl " + name) self.interfaces = "Interface " + name omni.kit.clipboard.copy("") about = omni.kit.window.about.get_instance() about.kit_version = "#Version#" about.nucleus_version = "#Nucleus Version#" about.client_library_version = "#Client Library Version#" about.app_name = "#App Name#" about.app_version = "#App Version#" about.usd_resolver_version = "#USD Resolver Version#" about.usd_version = "#USD Version#" about.mdlsdk_version = "#MDL SDK Version#" about_window = about.menu_show_about([FakePlugin("Test 1"), FakePlugin("Test 2"), FakePlugin("Test 3"), FakePlugin("Test 4")]) await ui_test.find("About//Frame/**/Button[*].identifier=='copy_to_clipboard'").click(right_click=True) await ui_test.human_delay() clipboard = omni.kit.clipboard.paste() self.assertEqual(clipboard, "#App Name# #App Version#\nOmniverse Kit #Version#\nClient Library Version: #Client Library Version#\nUSD Resolver Version: #USD Resolver Version#\nUSD Version: #USD Version#\nMDL SDK Version: #MDL SDK Version#")
2,390
Python
39.525423
248
0.669038
omniverse-code/kit/exts/omni.kit.window.about/docs/CHANGELOG.md
# Changelog The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [1.0.3] - 2022-11-17 ### Updated - Swap out pyperclip with linux-friendly copy & paste ## [1.0.2] - 2022-09-13 ### Updated - Fix window/menu visibility issues ## [1.0.1] - 2021-08-18 ### Updated - Updated menu to match other menu styling ## [1.0.0] - 2021-02-26 ### Updated - Added test ## [0.2.1] - 2020-12-08 ### Updated - Added "App Version" - Added right mouse button copy to clipboard ## [0.2.0] - 2020-12-04 ### Updated - Updated to new UI and added resizing ## [0.1.0] - 2020-10-29 - Ported old version to extensions 2.0
632
Markdown
18.781249
80
0.651899
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnGpuInteropRenderProductEntry.rst
.. _omni_graph_nodes_GpuInteropRenderProductEntry_1: .. _omni_graph_nodes_GpuInteropRenderProductEntry: .. ================================================================================ .. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT. .. ================================================================================ :orphan: .. meta:: :title: Gpu Interop Render Product Entry :keywords: lang-en omnigraph node internal threadsafe nodes gpu-interop-render-product-entry Gpu Interop Render Product Entry ================================ .. <description> Entry node for post-processing hydra render results for a single view .. </description> Installation ------------ To use this node enable :ref:`omni.graph.nodes<ext_omni_graph_nodes>` in the Extension Manager. Outputs ------- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "outputs:exec", "``execution``", "Trigger for scheduling dependencies", "None" "gpuFoundations (*outputs:gpu*)", "``uint64``", "Pointer to shared context containing gpu foundations", "None" "hydraTime (*outputs:hydraTime*)", "``double``", "Hydra time in stage", "None" "renderProduct (*outputs:rp*)", "``uint64``", "Pointer to render product for this view", "None" "simTime (*outputs:simTime*)", "``double``", "Simulation time", "None" Metadata -------- .. csv-table:: :header: "Name", "Value" :widths: 30,70 "Unique ID", "omni.graph.nodes.GpuInteropRenderProductEntry" "Version", "1" "Extension", "omni.graph.nodes" "Has State?", "False" "Implementation Language", "C++" "Default Memory Type", "cpu" "Generated Code Exclusions", "None" "hidden", "true" "Categories", "internal" "Generated Class Name", "OgnGpuInteropRenderProductEntryDatabase" "Python Module", "omni.graph.nodes"
1,865
reStructuredText
28.619047
114
0.596783
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnExtractAttr.rst
.. _omni_graph_nodes_ExtractAttribute_1: .. _omni_graph_nodes_ExtractAttribute: .. ================================================================================ .. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT. .. ================================================================================ :orphan: .. meta:: :title: Extract Attribute :keywords: lang-en omnigraph node bundle threadsafe nodes extract-attribute Extract Attribute ================= .. <description> Copies a single attribute from an input bundle to an output attribute directly on the node if it exists in the input bundle and matches the type of the output attribute .. </description> Installation ------------ To use this node enable :ref:`omni.graph.nodes<ext_omni_graph_nodes>` in the Extension Manager. Inputs ------ .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Attribute To Extract (*inputs:attrName*)", "``token``", "Name of the attribute to look for in the bundle", "points" "Bundle For Extraction (*inputs:data*)", "``bundle``", "Collection of attributes from which the named attribute is to be extracted", "None" Outputs ------- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Extracted Attribute (*outputs:output*)", "``any``", "The single attribute extracted from the input bundle", "None" Metadata -------- .. csv-table:: :header: "Name", "Value" :widths: 30,70 "Unique ID", "omni.graph.nodes.ExtractAttribute" "Version", "1" "Extension", "omni.graph.nodes" "Has State?", "False" "Implementation Language", "C++" "Default Memory Type", "cpu" "Generated Code Exclusions", "None" "uiName", "Extract Attribute" "Categories", "bundle" "Generated Class Name", "OgnExtractAttrDatabase" "Python Module", "omni.graph.nodes"
1,901
reStructuredText
26.565217
168
0.599684
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnRotateVector.rst
.. _omni_graph_nodes_RotateVector_1: .. _omni_graph_nodes_RotateVector: .. ================================================================================ .. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT. .. ================================================================================ :orphan: .. meta:: :title: Rotate Vector :keywords: lang-en omnigraph node math:operator threadsafe nodes rotate-vector Rotate Vector ============= .. <description> Rotates a 3d direction vector by a specified rotation. Accepts 3x3 matrices, 4x4 matrices, euler angles (XYZ), or quaternions For 4x4 matrices, the transformation information in the matrix is ignored and the vector is treated as a 4-component vector where the fourth component is zero. The result is then projected back to a 3-vector. Supports mixed array inputs, eg a single quaternion and an array of vectors. .. </description> Installation ------------ To use this node enable :ref:`omni.graph.nodes<ext_omni_graph_nodes>` in the Extension Manager. Inputs ------ .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Rotation (*inputs:rotation*)", "``['matrixd[3]', 'matrixd[3][]', 'matrixd[4]', 'matrixd[4][]', 'quatd[4]', 'quatd[4][]', 'quatf[4]', 'quatf[4][]', 'quath[4]', 'quath[4][]', 'vectord[3]', 'vectord[3][]', 'vectorf[3]', 'vectorf[3][]', 'vectorh[3]', 'vectorh[3][]']``", "The rotation to be applied", "None" "Vector (*inputs:vector*)", "``['vectord[3]', 'vectord[3][]', 'vectorf[3]', 'vectorf[3][]', 'vectorh[3]', 'vectorh[3][]']``", "The row vector(s) to be rotated", "None" Outputs ------- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Result (*outputs:result*)", "``['vectord[3]', 'vectord[3][]', 'vectorf[3]', 'vectorf[3][]', 'vectorh[3]', 'vectorh[3][]']``", "The transformed row vector(s)", "None" Metadata -------- .. csv-table:: :header: "Name", "Value" :widths: 30,70 "Unique ID", "omni.graph.nodes.RotateVector" "Version", "1" "Extension", "omni.graph.nodes" "Has State?", "False" "Implementation Language", "C++" "Default Memory Type", "cpu" "Generated Code Exclusions", "None" "uiName", "Rotate Vector" "Categories", "math:operator" "Generated Class Name", "OgnRotateVectorDatabase" "Python Module", "omni.graph.nodes"
2,396
reStructuredText
33.73913
413
0.586811
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnReadTime.rst
.. _omni_graph_nodes_ReadTime_1: .. _omni_graph_nodes_ReadTime: .. ================================================================================ .. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT. .. ================================================================================ :orphan: .. meta:: :title: Read Time :keywords: lang-en omnigraph node time threadsafe nodes read-time Read Time ========= .. <description> Holds the values related to the current global time and the timeline .. </description> Installation ------------ To use this node enable :ref:`omni.graph.nodes<ext_omni_graph_nodes>` in the Extension Manager. Outputs ------- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Absolute Simulation Time (Seconds) (*outputs:absoluteSimTime*)", "``double``", "The accumulated total of elapsed times between rendered frames", "None" "Delta (Seconds) (*outputs:deltaSeconds*)", "``double``", "The number of seconds elapsed since the last OmniGraph update", "None" "Animation Time (Frames) (*outputs:frame*)", "``double``", "The global animation time in frames, equivalent to (time * fps), during playback", "None" "Is Playing (*outputs:isPlaying*)", "``bool``", "True during global animation timeline playback", "None" "Animation Time (Seconds) (*outputs:time*)", "``double``", "The global animation time in seconds during playback", "None" "Time Since Start (Seconds) (*outputs:timeSinceStart*)", "``double``", "Elapsed time since the App started", "None" Metadata -------- .. csv-table:: :header: "Name", "Value" :widths: 30,70 "Unique ID", "omni.graph.nodes.ReadTime" "Version", "1" "Extension", "omni.graph.nodes" "Has State?", "False" "Implementation Language", "C++" "Default Memory Type", "cpu" "Generated Code Exclusions", "None" "uiName", "Read Time" "Categories", "time" "Generated Class Name", "OgnReadTimeDatabase" "Python Module", "omni.graph.nodes"
2,032
reStructuredText
30.765625
156
0.602362
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnArrayRemoveValue.rst
.. _omni_graph_nodes_ArrayRemoveValue_1: .. _omni_graph_nodes_ArrayRemoveValue: .. ================================================================================ .. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT. .. ================================================================================ :orphan: .. meta:: :title: Array Remove Value :keywords: lang-en omnigraph node math:array threadsafe nodes array-remove-value Array Remove Value ================== .. <description> Removes the first occurrence of the given value from an array. If removeAll is true, removes all occurrences .. </description> Installation ------------ To use this node enable :ref:`omni.graph.nodes<ext_omni_graph_nodes>` in the Extension Manager. Inputs ------ .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Array (*inputs:array*)", "``['bool[]', 'colord[3][]', 'colord[4][]', 'colorf[3][]', 'colorf[4][]', 'colorh[3][]', 'colorh[4][]', 'double[2][]', 'double[3][]', 'double[4][]', 'double[]', 'float[2][]', 'float[3][]', 'float[4][]', 'float[]', 'frame[4][]', 'half[2][]', 'half[3][]', 'half[4][]', 'half[]', 'int64[]', 'int[2][]', 'int[3][]', 'int[4][]', 'int[]', 'matrixd[3][]', 'matrixd[4][]', 'normald[3][]', 'normalf[3][]', 'normalh[3][]', 'pointd[3][]', 'pointf[3][]', 'pointh[3][]', 'quatd[4][]', 'quatf[4][]', 'quath[4][]', 'texcoordd[2][]', 'texcoordd[3][]', 'texcoordf[2][]', 'texcoordf[3][]', 'texcoordh[2][]', 'texcoordh[3][]', 'timecode[]', 'token[]', 'transform[4][]', 'uchar[]', 'uint64[]', 'uint[]', 'vectord[3][]', 'vectorf[3][]', 'vectorh[3][]']``", "The array to be modified", "None" "inputs:removeAll", "``bool``", "If true, removes all occurences of the value.", "False" "inputs:value", "``['bool', 'colord[3]', 'colord[4]', 'colorf[3]', 'colorf[4]', 'colorh[3]', 'colorh[4]', 'double', 'double[2]', 'double[3]', 'double[4]', 'float', 'float[2]', 'float[3]', 'float[4]', 'frame[4]', 'half', 'half[2]', 'half[3]', 'half[4]', 'int', 'int64', 'int[2]', 'int[3]', 'int[4]', 'matrixd[3]', 'matrixd[4]', 'normald[3]', 'normalf[3]', 'normalh[3]', 'pointd[3]', 'pointf[3]', 'pointh[3]', 'quatd[4]', 'quatf[4]', 'quath[4]', 'texcoordd[2]', 'texcoordd[3]', 'texcoordf[2]', 'texcoordf[3]', 'texcoordh[2]', 'texcoordh[3]', 'timecode', 'token', 'transform[4]', 'uchar', 'uint', 'uint64', 'vectord[3]', 'vectorf[3]', 'vectorh[3]']``", "The value to be removed", "None" Outputs ------- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Array (*outputs:array*)", "``['bool[]', 'colord[3][]', 'colord[4][]', 'colorf[3][]', 'colorf[4][]', 'colorh[3][]', 'colorh[4][]', 'double[2][]', 'double[3][]', 'double[4][]', 'double[]', 'float[2][]', 'float[3][]', 'float[4][]', 'float[]', 'frame[4][]', 'half[2][]', 'half[3][]', 'half[4][]', 'half[]', 'int64[]', 'int[2][]', 'int[3][]', 'int[4][]', 'int[]', 'matrixd[3][]', 'matrixd[4][]', 'normald[3][]', 'normalf[3][]', 'normalh[3][]', 'pointd[3][]', 'pointf[3][]', 'pointh[3][]', 'quatd[4][]', 'quatf[4][]', 'quath[4][]', 'texcoordd[2][]', 'texcoordd[3][]', 'texcoordf[2][]', 'texcoordf[3][]', 'texcoordh[2][]', 'texcoordh[3][]', 'timecode[]', 'token[]', 'transform[4][]', 'uchar[]', 'uint64[]', 'uint[]', 'vectord[3][]', 'vectorf[3][]', 'vectorh[3][]']``", "The modified array", "None" "outputs:found", "``bool``", "true if a value was removed, false otherwise", "None" Metadata -------- .. csv-table:: :header: "Name", "Value" :widths: 30,70 "Unique ID", "omni.graph.nodes.ArrayRemoveValue" "Version", "1" "Extension", "omni.graph.nodes" "Has State?", "False" "Implementation Language", "C++" "Default Memory Type", "cpu" "Generated Code Exclusions", "None" "uiName", "Array Remove Value" "Categories", "math:array" "Generated Class Name", "OgnArrayRemoveValueDatabase" "Python Module", "omni.graph.nodes"
3,940
reStructuredText
54.507041
800
0.530203
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnToRad.rst
.. _omni_graph_nodes_ToRad_1: .. _omni_graph_nodes_ToRad: .. ================================================================================ .. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT. .. ================================================================================ :orphan: .. meta:: :title: To Radians :keywords: lang-en omnigraph node math:conversion threadsafe nodes to-rad To Radians ========== .. <description> Convert degree input into radians .. </description> Installation ------------ To use this node enable :ref:`omni.graph.nodes<ext_omni_graph_nodes>` in the Extension Manager. Inputs ------ .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Degrees (*inputs:degrees*)", "``['double', 'double[]', 'float', 'float[]', 'half', 'half[]', 'timecode']``", "Angle value in degrees to be converted", "None" Outputs ------- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Radians (*outputs:radians*)", "``['double', 'double[]', 'float', 'float[]', 'half', 'half[]', 'timecode']``", "Angle value in radians", "None" Metadata -------- .. csv-table:: :header: "Name", "Value" :widths: 30,70 "Unique ID", "omni.graph.nodes.ToRad" "Version", "1" "Extension", "omni.graph.nodes" "Has State?", "False" "Implementation Language", "C++" "Default Memory Type", "cpu" "Generated Code Exclusions", "None" "uiName", "To Radians" "Categories", "math:conversion" "Generated Class Name", "OgnToRadDatabase" "Python Module", "omni.graph.nodes"
1,632
reStructuredText
23.014706
162
0.542892
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnRpResourceExampleDeformer.rst
.. _omni_graph_nodes_RpResourceExampleDeformer_1: .. _omni_graph_nodes_RpResourceExampleDeformer: .. ================================================================================ .. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT. .. ================================================================================ :orphan: .. meta:: :title: RpResource Example Deformer Node :keywords: lang-en omnigraph node nodes rp-resource-example-deformer RpResource Example Deformer Node ================================ .. <description> Allocate CUDA-interoperable RpResource .. </description> Installation ------------ To use this node enable :ref:`omni.graph.nodes<ext_omni_graph_nodes>` in the Extension Manager. Inputs ------ .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Deform Scale (*inputs:deformScale*)", "``float``", "Deformation control", "1.0" "Displacement Axis (*inputs:displacementAxis*)", "``int``", "dimension in which mesh is translated", "0" "Point Counts (*inputs:pointCountCollection*)", "``uint64[]``", "Pointer to point counts collection", "[]" "Position Scale (*inputs:positionScale*)", "``float``", "Deformation control", "1.0" "Prim Paths (*inputs:primPathCollection*)", "``token[]``", "Pointer to prim path collection", "[]" "Resource Pointer Collection (*inputs:resourcePointerCollection*)", "``uint64[]``", "Pointer to RpResource collection", "[]" "Run Deformer (*inputs:runDeformerKernel*)", "``bool``", "Whether cuda kernel will be executed", "True" "stream (*inputs:stream*)", "``uint64``", "Pointer to the CUDA Stream", "0" "Time Scale (*inputs:timeScale*)", "``float``", "Deformation control", "0.01" "Verbose (*inputs:verbose*)", "``bool``", "verbose printing", "False" Outputs ------- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Point Counts (*outputs:pointCountCollection*)", "``uint64[]``", "Point count for each prim being deformed", "None" "Prim Paths (*outputs:primPathCollection*)", "``token[]``", "Path for each prim being deformed", "None" "Reload (*outputs:reload*)", "``bool``", "Force RpResource reload", "False" "Resource Pointer Collection (*outputs:resourcePointerCollection*)", "``uint64[]``", "Pointers to RpResources (two resources per prim are assumed -- one for rest positions and one for deformed positions)", "None" "stream (*outputs:stream*)", "``uint64``", "Pointer to the CUDA Stream", "None" State ----- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "state:sequenceCounter", "``uint64``", "tick counter for animation", "0" Metadata -------- .. csv-table:: :header: "Name", "Value" :widths: 30,70 "Unique ID", "omni.graph.nodes.RpResourceExampleDeformer" "Version", "1" "Extension", "omni.graph.nodes" "Has State?", "True" "Implementation Language", "C++" "Default Memory Type", "cpu" "Generated Code Exclusions", "None" "uiName", "RpResource Example Deformer Node" "__tokens", "{""points"": ""points"", ""transform"": ""transform"", ""rpResource"": ""rpResource"", ""pointCount"": ""pointCount"", ""primPath"": ""primPath"", ""testToken"": ""testToken"", ""uintData"": ""uintData""}" "Generated Class Name", "OgnRpResourceExampleDeformerDatabase" "Python Module", "omni.graph.nodes"
3,443
reStructuredText
37.266666
222
0.610805
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnTimer.rst
.. _omni_graph_nodes_Timer_2: .. _omni_graph_nodes_Timer: .. ================================================================================ .. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT. .. ================================================================================ :orphan: .. meta:: :title: Timer :keywords: lang-en omnigraph node animation nodes timer Timer ===== .. <description> Timer Node is a node that lets you create animation curve(s), plays back and samples the value(s) along its time to output values. .. </description> Installation ------------ To use this node enable :ref:`omni.graph.nodes<ext_omni_graph_nodes>` in the Extension Manager. Inputs ------ .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Duration (*inputs:duration*)", "``double``", "Number of seconds to play interpolation", "1.0" "End Value (*inputs:endValue*)", "``double``", "Value value of the end of the duration", "1.0" "Play (*inputs:play*)", "``execution``", "Play the clip from current frame", "None" "Start Value (*inputs:startValue*)", "``double``", "Value value of the start of the duration", "0.0" Outputs ------- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Finished (*outputs:finished*)", "``execution``", "The Timer node has finished the playback", "None" "Updated (*outputs:updated*)", "``execution``", "The Timer node is ticked, and output value(s) resampled and updated", "None" "Value (*outputs:value*)", "``double``", "Value value of the Timer node between 0.0 and 1.0", "0.0" Metadata -------- .. csv-table:: :header: "Name", "Value" :widths: 30,70 "Unique ID", "omni.graph.nodes.Timer" "Version", "2" "Extension", "omni.graph.nodes" "Has State?", "False" "Implementation Language", "C++" "Default Memory Type", "cpu" "Generated Code Exclusions", "None" "uiName", "Timer" "Categories", "animation" "__categoryDescriptions", "animation,Nodes dealing with Animation" "Generated Class Name", "OgnTimerDatabase" "Python Module", "omni.graph.nodes"
2,175
reStructuredText
28.405405
130
0.584828
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnDistance3D.rst
.. _omni_graph_nodes_Distance3D_1: .. _omni_graph_nodes_Distance3D: .. ================================================================================ .. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT. .. ================================================================================ :orphan: .. meta:: :title: Distance3D :keywords: lang-en omnigraph node math:operator threadsafe nodes distance3-d Distance3D ========== .. <description> Computes the distance between two 3D points A and B. Which is the length of the vector with start and end points A and B If one input is an array and the other is a single point, the scaler will be broadcast to the size of the array .. </description> Installation ------------ To use this node enable :ref:`omni.graph.nodes<ext_omni_graph_nodes>` in the Extension Manager. Inputs ------ .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "A (*inputs:a*)", "``['pointd[3]', 'pointd[3][]', 'pointf[3]', 'pointf[3][]', 'pointh[3]', 'pointh[3][]']``", "Vector A", "None" "B (*inputs:b*)", "``['pointd[3]', 'pointd[3][]', 'pointf[3]', 'pointf[3][]', 'pointh[3]', 'pointh[3][]']``", "Vector B", "None" Outputs ------- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "outputs:distance", "``['double', 'double[]', 'float', 'float[]', 'half', 'half[]']``", "The distance between the input vectors", "None" Metadata -------- .. csv-table:: :header: "Name", "Value" :widths: 30,70 "Unique ID", "omni.graph.nodes.Distance3D" "Version", "1" "Extension", "omni.graph.nodes" "Has State?", "False" "Implementation Language", "C++" "Default Memory Type", "cpu" "Generated Code Exclusions", "None" "uiName", "Distance3D" "Categories", "math:operator" "Generated Class Name", "OgnDistance3DDatabase" "Python Module", "omni.graph.nodes"
1,950
reStructuredText
27.275362
234
0.559487
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnGetLocationAtDistanceOnCurve.rst
.. _omni_graph_nodes_GetLocationAtDistanceOnCurve_1: .. _omni_graph_nodes_GetLocationAtDistanceOnCurve: .. ================================================================================ .. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT. .. ================================================================================ :orphan: .. meta:: :title: Get Locations At Distances On Curve :keywords: lang-en omnigraph node internal threadsafe nodes get-location-at-distance-on-curve Get Locations At Distances On Curve =================================== .. <description> DEPRECATED: Use GetLocationAtDistanceOnCurve2 .. </description> Installation ------------ To use this node enable :ref:`omni.graph.nodes<ext_omni_graph_nodes>` in the Extension Manager. Inputs ------ .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Curve (*inputs:curve*)", "``pointd[3][]``", "The curve to be examined", "[]" "Distances (*inputs:distance*)", "``double[]``", "The distances along the curve, wrapped to the range 0-1.0", "[]" "Forward (*inputs:forwardAxis*)", "``token``", "The direction vector from which the returned rotation is relative, one of X, Y, Z", "X" "Up (*inputs:upAxis*)", "``token``", "The world Up vector, the curve should be in a plane perpendicular with this - one of X, Y, Z", "Y" Outputs ------- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Locations on curve at the given distances in world space (*outputs:location*)", "``pointd[3][]``", "Locations", "None" "World space orientations of the curve at the given distances, may not be smooth for some curves (*outputs:orientation*)", "``quatf[4][]``", "Orientations", "None" "World space rotations of the curve at the given distances, may not be smooth for some curves (*outputs:rotateXYZ*)", "``vectord[3][]``", "Rotations", "None" Metadata -------- .. csv-table:: :header: "Name", "Value" :widths: 30,70 "Unique ID", "omni.graph.nodes.GetLocationAtDistanceOnCurve" "Version", "1" "Extension", "omni.graph.nodes" "Has State?", "False" "Implementation Language", "C++" "Default Memory Type", "cpu" "Generated Code Exclusions", "None" "hidden", "true" "uiName", "Get Locations At Distances On Curve" "__tokens", "[""x"", ""y"", ""z"", ""X"", ""Y"", ""Z""]" "Categories", "internal" "Generated Class Name", "OgnGetLocationAtDistanceOnCurveDatabase" "Python Module", "omni.graph.nodes"
2,556
reStructuredText
33.093333
167
0.595853
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnSourceIndices.rst
.. _omni_graph_nodes_SourceIndices_1: .. _omni_graph_nodes_SourceIndices: .. ================================================================================ .. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT. .. ================================================================================ :orphan: .. meta:: :title: Extract Source Index Array :keywords: lang-en omnigraph node math:operator threadsafe nodes source-indices Extract Source Index Array ========================== .. <description> Takes an input array of index values in 'sourceStartsInTarget' encoded as the list of index values at which the output array value will be incremented, starting at the second entry, and with the last entry into the array being the desired sized of the output array 'sourceIndices'. For example the input [1,2,3,5,6,6] would generate an output array of size 5 (last index) consisting of the values [0,0,2,3,3,3]: - the first two 0s to fill the output array up to index input[1]=2 - the first two 0s to fill the output array up to index input[1]=2 - the 2 to fill the output array up to index input[2]=3 - the three 3s to fill the output array up to index input[3]=6 .. </description> Installation ------------ To use this node enable :ref:`omni.graph.nodes<ext_omni_graph_nodes>` in the Extension Manager. Inputs ------ .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "inputs:sourceStartsInTarget", "``int[]``", "List of index values encoding the increments for the output array values", "[]" Outputs ------- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "outputs:sourceIndices", "``int[]``", "Decoded list of index values as described by the node algorithm", "[]" Metadata -------- .. csv-table:: :header: "Name", "Value" :widths: 30,70 "Unique ID", "omni.graph.nodes.SourceIndices" "Version", "1" "Extension", "omni.graph.nodes" "Has State?", "False" "Implementation Language", "C++" "Default Memory Type", "cpu" "Generated Code Exclusions", "None" "uiName", "Extract Source Index Array" "Categories", "math:operator" "Generated Class Name", "OgnSourceIndicesDatabase" "Python Module", "omni.graph.nodes"
2,319
reStructuredText
31.222222
415
0.616645
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnReadKeyboardState.rst
.. _omni_graph_nodes_ReadKeyboardState_1: .. _omni_graph_nodes_ReadKeyboardState: .. ================================================================================ .. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT. .. ================================================================================ :orphan: .. meta:: :title: Read Keyboard State :keywords: lang-en omnigraph node input:keyboard threadsafe nodes read-keyboard-state Read Keyboard State =================== .. <description> Reads the current state of the keyboard .. </description> Installation ------------ To use this node enable :ref:`omni.graph.nodes<ext_omni_graph_nodes>` in the Extension Manager. Inputs ------ .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Key (*inputs:key*)", "``token``", "The key to check the state of", "A" "", "*displayGroup*", "parameters", "" "", "*allowedTokens*", "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,Apostrophe,Backslash,Backspace,CapsLock,Comma,Del,Down,End,Enter,Equal,Escape,F1,F10,F11,F12,F2,F3,F4,F5,F6,F7,F8,F9,GraveAccent,Home,Insert,Key0,Key1,Key2,Key3,Key4,Key5,Key6,Key7,Key8,Key9,Left,LeftAlt,LeftBracket,LeftControl,LeftShift,LeftSuper,Menu,Minus,NumLock,Numpad0,Numpad1,Numpad2,Numpad3,Numpad4,Numpad5,Numpad6,Numpad7,Numpad8,Numpad9,NumpadAdd,NumpadDel,NumpadDivide,NumpadEnter,NumpadEqual,NumpadMultiply,NumpadSubtract,PageDown,PageUp,Pause,Period,PrintScreen,Right,RightAlt,RightBracket,RightControl,RightShift,RightSuper,ScrollLock,Semicolon,Slash,Space,Tab,Up", "" Outputs ------- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Alt (*outputs:altOut*)", "``bool``", "True if Alt is held", "None" "Ctrl (*outputs:ctrlOut*)", "``bool``", "True if Ctrl is held", "None" "outputs:isPressed", "``bool``", "True if the key is currently pressed, false otherwise", "None" "Shift (*outputs:shiftOut*)", "``bool``", "True if Shift is held", "None" Metadata -------- .. csv-table:: :header: "Name", "Value" :widths: 30,70 "Unique ID", "omni.graph.nodes.ReadKeyboardState" "Version", "1" "Extension", "omni.graph.nodes" "Has State?", "False" "Implementation Language", "C++" "Default Memory Type", "cpu" "Generated Code Exclusions", "None" "uiName", "Read Keyboard State" "Categories", "input:keyboard" "Generated Class Name", "OgnReadKeyboardStateDatabase" "Python Module", "omni.graph.nodes"
2,530
reStructuredText
33.671232
662
0.628854
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnTranslateToTarget.rst
.. _omni_graph_nodes_TranslateToTarget_2: .. _omni_graph_nodes_TranslateToTarget: .. ================================================================================ .. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT. .. ================================================================================ :orphan: .. meta:: :title: Translate To Target :keywords: lang-en omnigraph node sceneGraph threadsafe WriteOnly nodes translate-to-target Translate To Target =================== .. <description> This node smoothly translates a prim object to a target prim object given a speed and easing factor. At the end of the maneuver, the source prim will have the same translation as the target prim .. </description> Installation ------------ To use this node enable :ref:`omni.graph.nodes<ext_omni_graph_nodes>` in the Extension Manager. Inputs ------ .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Execute In (*inputs:execIn*)", "``execution``", "The input execution", "None" "inputs:exponent", "``float``", "The blend exponent, which is the degree of the ease curve (1 = linear, 2 = quadratic, 3 = cubic, etc). ", "2.0" "inputs:sourcePrim", "``target``", "The source prim to be transformed", "None" "inputs:sourcePrimPath", "``path``", "The source prim to be transformed, used when 'useSourcePath' is true", "None" "inputs:speed", "``double``", "The peak speed of approach (Units / Second)", "1.0" "Stop (*inputs:stop*)", "``execution``", "Stops the maneuver", "None" "inputs:targetPrim", "``bundle``", "The destination prim. The target's translation will be matched by the sourcePrim", "None" "inputs:targetPrimPath", "``path``", "The destination prim. The target's translation will be matched by the sourcePrim, used when 'useTargetPath' is true", "None" "inputs:useSourcePath", "``bool``", "When true, the 'sourcePrimPath' attribute is used, otherwise it will read the connection at the 'sourcePrim' attribute", "False" "inputs:useTargetPath", "``bool``", "When true, the 'targetPrimPath' attribute is used, otherwise it will read the connection at the 'targetPrim' attribute", "False" Outputs ------- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Finished (*outputs:finished*)", "``execution``", "The output execution, sent one the maneuver is completed", "None" Metadata -------- .. csv-table:: :header: "Name", "Value" :widths: 30,70 "Unique ID", "omni.graph.nodes.TranslateToTarget" "Version", "2" "Extension", "omni.graph.nodes" "Has State?", "False" "Implementation Language", "C++" "Default Memory Type", "cpu" "Generated Code Exclusions", "None" "uiName", "Translate To Target" "Categories", "sceneGraph" "Generated Class Name", "OgnTranslateToTargetDatabase" "Python Module", "omni.graph.nodes"
2,935
reStructuredText
37.12987
195
0.62862
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnToString.rst
.. _omni_graph_nodes_ToString_1: .. _omni_graph_nodes_ToString: .. ================================================================================ .. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT. .. ================================================================================ :orphan: .. meta:: :title: To String :keywords: lang-en omnigraph node function threadsafe nodes to-string To String ========= .. <description> Converts the given input to a string equivalent. .. </description> Installation ------------ To use this node enable :ref:`omni.graph.nodes<ext_omni_graph_nodes>` in the Extension Manager. Inputs ------ .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "value (*inputs:value*)", "``any``", "The value to be converted to a string. Numeric values are converted using C++'s std::ostringstream << operator. This can result in the values being converted to exponential form. E.g: 1.234e+06 Arrays of numeric values are converted to Python list syntax. E.g: [1.5, -0.03] A uchar value is converted to a single, unquoted character. An array of uchar values is converted to an unquoted string. Avoid zero values (i.e. null chars) in the array as the behavior is undefined and may vary over time. A single token is converted to its unquoted string equivalent. An array of tokens is converted to Python list syntax with each token enclosed in double quotes. E.g. [""first"", ""second""]", "None" Outputs ------- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "String (*outputs:converted*)", "``string``", "Output string", "None" Metadata -------- .. csv-table:: :header: "Name", "Value" :widths: 30,70 "Unique ID", "omni.graph.nodes.ToString" "Version", "1" "Extension", "omni.graph.nodes" "Has State?", "False" "Implementation Language", "C++" "Default Memory Type", "cpu" "Generated Code Exclusions", "None" "uiName", "To String" "Categories", "function" "Generated Class Name", "OgnToStringDatabase" "Python Module", "omni.graph.nodes"
2,145
reStructuredText
30.558823
737
0.613054
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnTimelineSet.rst
.. _omni_graph_nodes_SetTimeline_1: .. _omni_graph_nodes_SetTimeline: .. ================================================================================ .. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT. .. ================================================================================ :orphan: .. meta:: :title: Set main timeline :keywords: lang-en omnigraph node time compute-on-request nodes set-timeline Set main timeline ================= .. <description> Set properties of the main timeline .. </description> Installation ------------ To use this node enable :ref:`omni.graph.nodes<ext_omni_graph_nodes>` in the Extension Manager. Inputs ------ .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Execute In (*inputs:execIn*)", "``execution``", "The input that triggers the execution of this node.", "None" "Property Name (*inputs:propName*)", "``token``", "The name of the property to set.", "Frame" "", "*displayGroup*", "parameters", "" "", "*literalOnly*", "1", "" "", "*allowedTokens*", "Frame,Time,StartFrame,StartTime,EndFrame,EndTime,FramesPerSecond", "" "Property Value (*inputs:propValue*)", "``double``", "The value of the property to set.", "0.0" Outputs ------- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Clamp to range (*outputs:clamped*)", "``bool``", "Was the input frame or time clamped to the playback range?", "None" "Execute Out (*outputs:execOut*)", "``execution``", "The output that is triggered when this node executed.", "None" Metadata -------- .. csv-table:: :header: "Name", "Value" :widths: 30,70 "Unique ID", "omni.graph.nodes.SetTimeline" "Version", "1" "Extension", "omni.graph.nodes" "Has State?", "False" "Implementation Language", "C++" "Default Memory Type", "cpu" "Generated Code Exclusions", "None" "uiName", "Set main timeline" "Categories", "time" "Generated Class Name", "OgnTimelineSetDatabase" "Python Module", "omni.graph.nodes"
2,097
reStructuredText
27.351351
122
0.577492
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnReadPrimsV2.rst
.. _omni_graph_nodes_ReadPrimsV2_1: .. _omni_graph_nodes_ReadPrimsV2: .. ================================================================================ .. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT. .. ================================================================================ :orphan: .. meta:: :title: Read Prims :keywords: lang-en omnigraph node sceneGraph,bundle ReadOnly nodes read-prims-v2 Read Prims ========== .. <description> Reads primitives and outputs multiple primitive in a bundle. .. </description> Installation ------------ To use this node enable :ref:`omni.graph.nodes<ext_omni_graph_nodes>` in the Extension Manager. Inputs ------ .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "inputs:_debugStamp", "``int``", "For internal testing only, and subject to change. Please do not depend on this attribute! When not zero, this _debugStamp attribute will be copied to root and child bundles that change When a full update is performed, the negative _debugStamp is written. When only derived attributes (like bounding boxes and world matrices) are updated, _debugStamp + 1000000 is written", "0" "", "*literalOnly*", "1", "" "", "*hidden*", "true", "" "Apply Skel Binding (*inputs:applySkelBinding*)", "``bool``", "If an input USD prim is skinnable and has the SkelBindingAPI schema applied, read skeletal data and apply SkelBinding to deform the prim. The output bundle will have additional child bundles created to hold data for the skeleton and skel animation prims if present. After evaluation, deformed points and normals will be written to the `points` and `normals` attributes, while non-deformed points and normals will be copied to the `points:default` and `normals:default` attributes.", "False" "Attribute Name Pattern (*inputs:attrNamesToImport*)", "``string``", "A list of wildcard patterns used to match the attribute names that are to be imported Supported syntax of wildcard pattern: '*' - match an arbitrary number of any characters '?' - match any single character '^' - (caret) is used to define a pattern that is to be excluded Example of wildcard patterns, input: ['points', 'faceVertexCount', 'faceVertexIndices', 'size'] '*' - match any '* ^points' - match any, but exclude 'points' '* ^face*' - match any, but exclude 'faceVertexCount' and 'faceVertexIndices'", "*" "Compute Bounding Box (*inputs:computeBoundingBox*)", "``bool``", "For each primitive compute local bounding box and store them as 'bboxMinCorner', 'bboxMaxCorner' and 'bboxTransform' attributes.", "False" "Bundle change tracking (*inputs:enableBundleChangeTracking*)", "``bool``", "Enable change tracking for output bundle, its children and attributes. The change tracking system for bundles has some overhead, but enables users to inspect the changes that occurred in a bundle. Through inspecting the type of changes user can mitigate excessive computations.", "False" "USD change tracking (*inputs:enableChangeTracking*)", "``bool``", "Should the output bundles only be updated when the associated USD prims change? This uses a USD notice handler, and has a small overhead, so if you know that the imported USD prims will change frequently, you might want to disable this.", "True" "Prim Path Pattern (*inputs:pathPattern*)", "``string``", "A list of wildcard patterns used to match the prim paths that are to be imported Supported syntax of wildcard pattern: '*' - match an arbitrary number of any characters '?' - match any single character '^' - (caret) is used to define a pattern that is to be excluded Example of wildcard patterns, input: ['/Cube0', '/Cube1', '/Box'] '*' - match any '* ^/Box' - match any, but exclude '/Box' '* ^/Cube*' - match any, but exclude '/Cube0' and '/Cube1'", "" "Prims (*inputs:prims*)", "``target``", "The root prim(s) that pattern matching uses to search from. If 'pathPattern' input is empty, the directly connected prims will be read. Otherwise, all the subtree (including root) will be tested against pattern matcher inputs, and the matched prims will be read into the output bundle. If no prims are connected, and 'pathPattern' is none empty, absolute root ""/"" will be searched as root prim.", "None" "", "*allowMultiInputs*", "1", "" "Prim Type Pattern (*inputs:typePattern*)", "``string``", "A list of wildcard patterns used to match the prim types that are to be imported Supported syntax of wildcard pattern: '*' - match an arbitrary number of any characters '?' - match any single character '^' - (caret) is used to define a pattern that is to be excluded Example of wildcard patterns, input: ['Mesh', 'Cone', 'Cube'] '*' - match any '* ^Mesh' - match any, but exclude 'Mesh' '* ^Cone ^Cube' - match any, but exclude 'Cone' and 'Cube'", "*" "Time (*inputs:usdTimecode*)", "``timecode``", "The time at which to evaluate the transform of the USD prim. A value of ""NaN"" indicates that the default USD time stamp should be used", "NaN" Outputs ------- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "outputs:primsBundle", "``bundle``", "An output bundle containing multiple prims as children. Each child contains data attributes and two additional token attributes named sourcePrimPath and sourcePrimType which contains the path of the Prim being read", "None" State ----- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "state:applySkelBinding", "``bool``", "State from previous evaluation", "False" "state:attrNamesToImport", "``string``", "State from previous evaluation", "None" "state:computeBoundingBox", "``bool``", "State from previous evaluation", "False" "state:enableBundleChangeTracking", "``bool``", "State from previous evaluation", "False" "state:enableChangeTracking", "``bool``", "State from previous evaluation", "False" "state:pathPattern", "``string``", "State from previous evaluation", "None" "state:typePattern", "``string``", "State from previous evaluation", "None" "state:usdTimecode", "``timecode``", "State from previous evaluation", "-1" Metadata -------- .. csv-table:: :header: "Name", "Value" :widths: 30,70 "Unique ID", "omni.graph.nodes.ReadPrimsV2" "Version", "1" "Extension", "omni.graph.nodes" "Has State?", "True" "Implementation Language", "C++" "Default Memory Type", "cpu" "Generated Code Exclusions", "None" "uiName", "Read Prims" "Categories", "sceneGraph,bundle" "Generated Class Name", "OgnReadPrimsV2Database" "Python Module", "omni.graph.nodes"
6,754
reStructuredText
69.364583
613
0.677821
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnWriteVariable.rst
.. _omni_graph_core_WriteVariable_2: .. _omni_graph_core_WriteVariable: .. ================================================================================ .. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT. .. ================================================================================ :orphan: .. meta:: :title: Write Variable :keywords: lang-en omnigraph node internal WriteOnly core write-variable Write Variable ============== .. <description> Node that writes a value to a variable .. </description> Installation ------------ To use this node enable :ref:`omni.graph.nodes<ext_omni_graph_nodes>` in the Extension Manager. Inputs ------ .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "inputs:execIn", "``execution``", "Input execution state", "None" "inputs:graph", "``target``", "Ignored. Do not use", "None" "", "*hidden*", "true", "" "inputs:targetPath", "``token``", "Ignored. Do not use.", "None" "", "*hidden*", "true", "" "inputs:value", "``any``", "The new value to be written", "None" "inputs:variableName", "``token``", "The name of the graph variable to use.", "" "", "*hidden*", "true", "" "", "*literalOnly*", "1", "" Outputs ------- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "outputs:execOut", "``execution``", "Output execution", "None" "outputs:value", "``any``", "The written variable value", "None" Metadata -------- .. csv-table:: :header: "Name", "Value" :widths: 30,70 "Unique ID", "omni.graph.core.WriteVariable" "Version", "2" "Extension", "omni.graph.nodes" "Has State?", "False" "Implementation Language", "C++" "Default Memory Type", "cpu" "Generated Code Exclusions", "None" "hidden", "true" "uiName", "Write Variable" "Categories", "internal" "Generated Class Name", "OgnWriteVariableDatabase" "Python Module", "omni.graph.nodes"
2,003
reStructuredText
24.692307
95
0.547179
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnSelectIf.rst
.. _omni_graph_nodes_SelectIf_1: .. _omni_graph_nodes_SelectIf: .. ================================================================================ .. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT. .. ================================================================================ :orphan: .. meta:: :title: Select If :keywords: lang-en omnigraph node flowControl threadsafe nodes select-if Select If ========= .. <description> Selects an output from the given inputs based on a boolean condition. If the condition is an array, and the inputs are arrays of equal length, and values will be selected from ifTrue, ifFalse depending on the bool at the same index. If one input is an array and the other is a scaler of the same base type, the scaler will be extended to the length of the other input. .. </description> Installation ------------ To use this node enable :ref:`omni.graph.nodes<ext_omni_graph_nodes>` in the Extension Manager. Inputs ------ .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "inputs:condition", "``['bool', 'bool[]']``", "The selection variable", "None" "If False (*inputs:ifFalse*)", "``any``", "Value if condition is False", "None" "If True (*inputs:ifTrue*)", "``any``", "Value if condition is True", "None" Outputs ------- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Result (*outputs:result*)", "``any``", "The selected value from ifTrue and ifFalse", "None" Metadata -------- .. csv-table:: :header: "Name", "Value" :widths: 30,70 "Unique ID", "omni.graph.nodes.SelectIf" "Version", "1" "Extension", "omni.graph.nodes" "Icon", "ogn/icons/omni.graph.nodes.SelectIf.svg" "Has State?", "False" "Implementation Language", "C++" "Default Memory Type", "cpu" "Generated Code Exclusions", "None" "uiName", "Select If" "Categories", "flowControl" "Generated Class Name", "OgnSelectIfDatabase" "Python Module", "omni.graph.nodes"
2,058
reStructuredText
28
368
0.593294
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnCopyAttr.rst
.. _omni_graph_nodes_CopyAttribute_1: .. _omni_graph_nodes_CopyAttribute: .. ================================================================================ .. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT. .. ================================================================================ :orphan: .. meta:: :title: Copy Attributes From Bundles :keywords: lang-en omnigraph node bundle nodes copy-attribute Copy Attributes From Bundles ============================ .. <description> Copies all attributes from one input bundle and specified attributes from a second input bundle to the output bundle. .. </description> Installation ------------ To use this node enable :ref:`omni.graph.nodes<ext_omni_graph_nodes>` in the Extension Manager. Inputs ------ .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Full Bundle To Copy (*inputs:fullData*)", "``bundle``", "Collection of attributes to fully copy to the output", "None" "Extracted Names For Partial Copy (*inputs:inputAttrNames*)", "``token``", "Comma or space separated text, listing the names of attributes to copy from partialData", "" "New Names For Partial Copy (*inputs:outputAttrNames*)", "``token``", "Comma or space separated text, listing the new names of attributes copied from partialData", "" "Partial Bundle To Copy (*inputs:partialData*)", "``bundle``", "Collection of attributes from which to select named attributes", "None" Outputs ------- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Bundle Of Copied Attributes (*outputs:data*)", "``bundle``", "Collection of attributes consisting of all attributes from input 'fullData' and selected inputs from input 'partialData'", "None" Metadata -------- .. csv-table:: :header: "Name", "Value" :widths: 30,70 "Unique ID", "omni.graph.nodes.CopyAttribute" "Version", "1" "Extension", "omni.graph.nodes" "Has State?", "False" "Implementation Language", "C++" "Default Memory Type", "cpu" "Generated Code Exclusions", "None" "uiName", "Copy Attributes From Bundles" "Categories", "bundle" "Generated Class Name", "OgnCopyAttrDatabase" "Python Module", "omni.graph.nodes"
2,288
reStructuredText
31.239436
196
0.618881
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnReadPrim.rst
.. _omni_graph_nodes_ReadPrim_9: .. _omni_graph_nodes_ReadPrim: .. ================================================================================ .. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT. .. ================================================================================ :orphan: .. meta:: :title: Read Prim :keywords: lang-en omnigraph node sceneGraph,bundle ReadOnly nodes read-prim Read Prim ========= .. <description> DEPRECATED - use ReadPrimAttributes! .. </description> Installation ------------ To use this node enable :ref:`omni.graph.nodes<ext_omni_graph_nodes>` in the Extension Manager. Inputs ------ .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Attributes To Import (*inputs:attrNamesToImport*)", "``token``", "A list of wildcard patterns used to match the attribute names that are to be imported Supported syntax of wildcard pattern: '*' - match an arbitrary number of any characters '?' - match any single character '^' - (caret) is used to define a pattern that is to be excluded Example of wildcard patterns, input: ['points', 'faceVertexCount', 'faceVertexIndices', 'size'] '*' - match any '* ^points' - match any, but exclude 'points' '* ^face*' - match any, but exclude 'faceVertexCount' and 'faceVertexIndices'", "*" "Compute Bounding Box (*inputs:computeBoundingBox*)", "``bool``", "For each primitive compute local bounding box and store them as 'bboxMinCorner', 'bboxMaxCorner' and 'bboxTransform' attributes.", "False" "inputs:prim", "``bundle``", "The prims to be read from when 'usePathPattern' is false", "None" "Time (*inputs:usdTimecode*)", "``timecode``", "The time at which to evaluate the transform of the USD prim. A value of ""NaN"" indicates that the default USD time stamp should be used", "NaN" Outputs ------- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "outputs:primBundle", "``bundle``", "A bundle of the target Prim attributes. In addition to the data attributes, there is a token attribute named sourcePrimPath which contains the path of the Prim being read", "None" State ----- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "state:attrNamesToImport", "``uint64``", "State from previous evaluation", "None" "state:computeBoundingBox", "``bool``", "State from previous evaluation", "False" "state:primPath", "``uint64``", "State from previous evaluation", "None" "state:primTypes", "``uint64``", "State from previous evaluation", "None" "state:usdTimecode", "``timecode``", "State from previous evaluation", "NaN" Metadata -------- .. csv-table:: :header: "Name", "Value" :widths: 30,70 "Unique ID", "omni.graph.nodes.ReadPrim" "Version", "9" "Extension", "omni.graph.nodes" "Has State?", "True" "Implementation Language", "C++" "Default Memory Type", "cpu" "Generated Code Exclusions", "None" "hidden", "true" "uiName", "Read Prim" "Categories", "sceneGraph,bundle" "Generated Class Name", "OgnReadPrimDatabase" "Python Module", "omni.graph.nodes"
3,215
reStructuredText
36.835294
610
0.625816
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnIsPrimActive.rst
.. _omni_graph_nodes_IsPrimActive_1: .. _omni_graph_nodes_IsPrimActive: .. ================================================================================ .. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT. .. ================================================================================ :orphan: .. meta:: :title: Is Prim Active :keywords: lang-en omnigraph node sceneGraph threadsafe ReadOnly nodes is-prim-active Is Prim Active ============== .. <description> Query if a Prim is active or not in the stage. .. </description> Installation ------------ To use this node enable :ref:`omni.graph.nodes<ext_omni_graph_nodes>` in the Extension Manager. Inputs ------ .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Prim Path (*inputs:prim*)", "``path``", "The prim path to be queried", "" "Prim (*inputs:primTarget*)", "``target``", "The prim to be queried", "None" Outputs ------- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "outputs:active", "``bool``", "Whether the prim is active or not", "None" Metadata -------- .. csv-table:: :header: "Name", "Value" :widths: 30,70 "Unique ID", "omni.graph.nodes.IsPrimActive" "Version", "1" "Extension", "omni.graph.nodes" "Has State?", "False" "Implementation Language", "C++" "Default Memory Type", "cpu" "Generated Code Exclusions", "None" "uiName", "Is Prim Active" "Categories", "sceneGraph" "Generated Class Name", "OgnIsPrimActiveDatabase" "Python Module", "omni.graph.nodes"
1,623
reStructuredText
22.536232
95
0.554529
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnWritePrims.rst
.. _omni_graph_nodes_WritePrims_1: .. _omni_graph_nodes_WritePrims: .. ================================================================================ .. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT. .. ================================================================================ :orphan: .. meta:: :title: Write Prims (Legacy) :keywords: lang-en omnigraph node sceneGraph,bundle WriteOnly nodes write-prims Write Prims (Legacy) ==================== .. <description> DEPRECATED - use WritePrimsV2! .. </description> Installation ------------ To use this node enable :ref:`omni.graph.nodes<ext_omni_graph_nodes>` in the Extension Manager. Inputs ------ .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Attribute Name Pattern (*inputs:attrNamesToExport*)", "``string``", "A list of wildcard patterns used to match primitive attributes by name. Supported syntax of wildcard pattern: `*` - match an arbitrary number of any characters `?` - match any single character `^` - (caret) is used to define a pattern that is to be excluded Example of wildcard patterns, input: ['xFormOp:translate', 'xformOp:scale','radius'] '*' - match any 'xformOp:*' - matches 'xFormOp:translate' and 'xformOp:scale' '* ^radius' - match any, but exclude 'radius' '* ^xformOp*' - match any, but exclude 'xFormOp:translate', 'xformOp:scale'", "*" "inputs:execIn", "``execution``", "The input execution (for action graphs only)", "None" "Prim Path Pattern (*inputs:pathPattern*)", "``string``", "A list of wildcard patterns used to match primitives by path. Supported syntax of wildcard pattern: `*` - match an arbitrary number of any characters `?` - match any single character `^` - (caret) is used to define a pattern that is to be excluded Example of wildcard patterns, input: ['/Cube0', '/Cube1', '/Box'] '*' - match any '* ^/Box' - match any, but exclude '/Box' '* ^/Cube*' - match any, but exclude '/Cube0' and '/Cube1'", "*" "Prims Bundle (*inputs:primsBundle*)", "``bundle``", "The bundle(s) of multiple prims to be written back. The sourcePrimPath attribute is used to find the destination prim.", "None" "", "*allowMultiInputs*", "1", "" "Prim Type Pattern (*inputs:typePattern*)", "``string``", "A list of wildcard patterns used to match primitives by type. Supported syntax of wildcard pattern: `*` - match an arbitrary number of any characters `?` - match any single character `^` - (caret) is used to define a pattern that is to be excluded Example of wildcard patterns, input: ['Mesh', 'Cone', 'Cube'] '*' - match any '* ^Mesh' - match any, but exclude 'Mesh' '* ^Cone ^Cube' - match any, but exclude 'Cone' and 'Cube'", "*" "Persist To USD (*inputs:usdWriteBack*)", "``bool``", "Whether or not the value should be written back to USD, or kept a Fabric only value", "False" Outputs ------- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "outputs:execOut", "``execution``", "The output execution port (for action graphs only)", "None" Metadata -------- .. csv-table:: :header: "Name", "Value" :widths: 30,70 "Unique ID", "omni.graph.nodes.WritePrims" "Version", "1" "Extension", "omni.graph.nodes" "Has State?", "False" "Implementation Language", "C++" "Default Memory Type", "cpu" "Generated Code Exclusions", "None" "hidden", "true" "uiName", "Write Prims (Legacy)" "Categories", "sceneGraph,bundle" "Generated Class Name", "OgnWritePrimsDatabase" "Python Module", "omni.graph.nodes"
3,679
reStructuredText
48.066666
652
0.616472
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnAppendPath.rst
.. _omni_graph_nodes_AppendPath_1: .. _omni_graph_nodes_AppendPath: .. ================================================================================ .. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT. .. ================================================================================ :orphan: .. meta:: :title: Append Path :keywords: lang-en omnigraph node sceneGraph threadsafe nodes append-path Append Path =========== .. <description> Generates a path token by appending the given relative path token to the given root or prim path token .. </description> Installation ------------ To use this node enable :ref:`omni.graph.nodes<ext_omni_graph_nodes>` in the Extension Manager. Inputs ------ .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "inputs:path", "``['token', 'token[]']``", "The path token(s) to be appended to. Must be a base or prim path (ex. /World)", "None" "inputs:suffix", "``token``", "The prim or prim-property path to append (ex. Cube or Cube.attr)", "" Outputs ------- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "outputs:path", "``['token', 'token[]']``", "The new path token(s) (ex. /World/Cube or /World/Cube.attr)", "None" State ----- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "state:path", "``token``", "Snapshot of previously seen path", "None" "state:suffix", "``token``", "Snapshot of previously seen suffix", "None" Metadata -------- .. csv-table:: :header: "Name", "Value" :widths: 30,70 "Unique ID", "omni.graph.nodes.AppendPath" "Version", "1" "Extension", "omni.graph.nodes" "Has State?", "True" "Implementation Language", "C++" "Default Memory Type", "cpu" "Generated Code Exclusions", "None" "tags", "paths" "uiName", "Append Path" "Categories", "sceneGraph" "Generated Class Name", "OgnAppendPathDatabase" "Python Module", "omni.graph.nodes"
2,049
reStructuredText
24.625
134
0.565642
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnWritePrim.rst
.. _omni_graph_nodes_WritePrim_3: .. _omni_graph_nodes_WritePrim: .. ================================================================================ .. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT. .. ================================================================================ :orphan: .. meta:: :title: Write Prim Attributes :keywords: lang-en omnigraph node sceneGraph WriteOnly nodes write-prim Write Prim Attributes ===================== .. <description> Exposes attributes for a single Prim on the USD stage as inputs to this node. When this node computes it writes any of these connected inputs to the target Prim. Any inputs which are not connected will not be written. .. </description> Installation ------------ To use this node enable :ref:`omni.graph.nodes<ext_omni_graph_nodes>` in the Extension Manager. Inputs ------ .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "inputs:execIn", "``execution``", "The input execution port", "None" "Prim (*inputs:prim*)", "``target``", "The prim to be written to", "None" "Persist To USD (*inputs:usdWriteBack*)", "``bool``", "Whether or not the value should be written back to USD, or kept a Fabric only value", "True" Outputs ------- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "outputs:execOut", "``execution``", "The output execution port", "None" Metadata -------- .. csv-table:: :header: "Name", "Value" :widths: 30,70 "Unique ID", "omni.graph.nodes.WritePrim" "Version", "3" "Extension", "omni.graph.nodes" "Has State?", "False" "Implementation Language", "C++" "Default Memory Type", "cpu" "Generated Code Exclusions", "None" "uiName", "Write Prim Attributes" "Categories", "sceneGraph" "Generated Class Name", "OgnWritePrimDatabase" "Python Module", "omni.graph.nodes"
1,937
reStructuredText
26.685714
217
0.588539
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnCurveFrame.rst
.. _omni_graph_nodes_CurveToFrame_1: .. _omni_graph_nodes_CurveToFrame: .. ================================================================================ .. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT. .. ================================================================================ :orphan: .. meta:: :title: Crate Curve From Frame :keywords: lang-en omnigraph node geometry:generator threadsafe nodes curve-to-frame Crate Curve From Frame ====================== .. <description> Create a frame object based on a curve description .. </description> Installation ------------ To use this node enable :ref:`omni.graph.nodes<ext_omni_graph_nodes>` in the Extension Manager. Inputs ------ .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Curve Points (*inputs:curvePoints*)", "``float[3][]``", "Points on the curve to be framed", "[]" "Curve Vertex Counts (*inputs:curveVertexCounts*)", "``int[]``", "Vertex counts for the curve points", "[]" "Curve Vertex Starts (*inputs:curveVertexStarts*)", "``int[]``", "Vertex starting points", "[]" Outputs ------- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Out Vectors (*outputs:out*)", "``float[3][]``", "Out vector directions on the curve frame", "None" "Tangents (*outputs:tangent*)", "``float[3][]``", "Tangents on the curve frame", "None" "Up Vectors (*outputs:up*)", "``float[3][]``", "Up vectors on the curve frame", "None" Metadata -------- .. csv-table:: :header: "Name", "Value" :widths: 30,70 "Unique ID", "omni.graph.nodes.CurveToFrame" "Version", "1" "Extension", "omni.graph.nodes" "Has State?", "False" "Implementation Language", "C++" "Default Memory Type", "cpu" "Generated Code Exclusions", "None" "uiName", "Crate Curve From Frame" "Categories", "geometry:generator" "Generated Class Name", "OgnCurveFrameDatabase" "Python Module", "omni.graph.nodes"
2,027
reStructuredText
27.166666
111
0.571288
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnRandomUnitVector.rst
.. _omni_graph_nodes_RandomUnitVector_1: .. _omni_graph_nodes_RandomUnitVector: .. ================================================================================ .. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT. .. ================================================================================ :orphan: .. meta:: :title: Random Unit Vector :keywords: lang-en omnigraph node math:operator threadsafe nodes random-unit-vector Random Unit Vector ================== .. <description> Generates a random vector with uniform distribution on the unit sphere. .. </description> Installation ------------ To use this node enable :ref:`omni.graph.nodes<ext_omni_graph_nodes>` in the Extension Manager. Inputs ------ .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "inputs:execIn", "``execution``", "The input execution port to output a new random value", "None" "Is noise function (*inputs:isNoise*)", "``bool``", "Turn this node into a noise generator function For a given seed, it will then always output the same number(s)", "False" "", "*hidden*", "true", "" "", "*literalOnly*", "1", "" "Seed (*inputs:seed*)", "``uint64``", "The seed of the random generator.", "None" "Use seed (*inputs:useSeed*)", "``bool``", "Use the custom seed instead of a random one", "False" Outputs ------- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "outputs:execOut", "``execution``", "The output execution port", "None" "Random Unit Vector (*outputs:random*)", "``vectorf[3]``", "The random unit vector that was generated", "None" State ----- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "state:gen", "``matrixd[3]``", "Random number generator internal state (abusing matrix3d because it is large enough)", "None" Metadata -------- .. csv-table:: :header: "Name", "Value" :widths: 30,70 "Unique ID", "omni.graph.nodes.RandomUnitVector" "Version", "1" "Extension", "omni.graph.nodes" "Has State?", "True" "Implementation Language", "C++" "Default Memory Type", "cpu" "Generated Code Exclusions", "None" "uiName", "Random Unit Vector" "Categories", "math:operator" "Generated Class Name", "OgnRandomUnitVectorDatabase" "Python Module", "omni.graph.nodes"
2,406
reStructuredText
28
177
0.588944
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnReadPrimAttribute.rst
.. _omni_graph_nodes_ReadPrimAttribute_3: .. _omni_graph_nodes_ReadPrimAttribute: .. ================================================================================ .. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT. .. ================================================================================ :orphan: .. meta:: :title: Read Prim Attribute :keywords: lang-en omnigraph node sceneGraph threadsafe ReadOnly nodes read-prim-attribute Read Prim Attribute =================== .. <description> Given a path to a prim on the current USD stage and the name of an attribute on that prim, gets the value of that attribute, at the global timeline value. .. </description> Installation ------------ To use this node enable :ref:`omni.graph.nodes<ext_omni_graph_nodes>` in the Extension Manager. Inputs ------ .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Attribute Name (*inputs:name*)", "``token``", "The name of the attribute to get on the specified prim", "" "inputs:prim", "``target``", "The prim to be read from when 'usePath' is false", "None" "inputs:primPath", "``token``", "The path of the prim to be modified when 'usePath' is true", "None" "Time (*inputs:usdTimecode*)", "``timecode``", "The time at which to evaluate the transform of the USD prim attribute. A value of ""NaN"" indicates that the default USD time stamp should be used", "NaN" "inputs:usePath", "``bool``", "When true, the 'primPath' attribute is used as the path to the prim being read, otherwise it will read the connection at the 'prim' attribute", "False" Outputs ------- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "outputs:value", "``any``", "The attribute value", "None" State ----- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "state:correctlySetup", "``bool``", "Wheter or not the instance is properly setup", "False" "state:importPath", "``uint64``", "Path at which data has been imported", "None" "state:srcAttrib", "``uint64``", "A TokenC to the source attribute", "None" "state:srcPath", "``uint64``", "A PathC to the source prim", "None" "state:srcPathAsToken", "``uint64``", "A TokenC to the source prim", "None" "state:time", "``double``", "The timecode at which we have imported the value", "None" Metadata -------- .. csv-table:: :header: "Name", "Value" :widths: 30,70 "Unique ID", "omni.graph.nodes.ReadPrimAttribute" "Version", "3" "Extension", "omni.graph.nodes" "Icon", "ogn/icons/omni.graph.nodes.ReadPrimAttribute.svg" "Has State?", "True" "Implementation Language", "C++" "Default Memory Type", "cpu" "Generated Code Exclusions", "usd" "uiName", "Read Prim Attribute" "Categories", "sceneGraph" "Generated Class Name", "OgnReadPrimAttributeDatabase" "Python Module", "omni.graph.nodes"
2,980
reStructuredText
33.264367
206
0.612416
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnGetAttrNames.rst
.. _omni_graph_nodes_GetAttributeNames_1: .. _omni_graph_nodes_GetAttributeNames: .. ================================================================================ .. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT. .. ================================================================================ :orphan: .. meta:: :title: Get Attribute Names From Bundle :keywords: lang-en omnigraph node bundle threadsafe nodes get-attribute-names Get Attribute Names From Bundle =============================== .. <description> Retrieves the names of all of the attributes contained in the input bundle, optionally sorted. .. </description> Installation ------------ To use this node enable :ref:`omni.graph.nodes<ext_omni_graph_nodes>` in the Extension Manager. Inputs ------ .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Bundle To Examine (*inputs:data*)", "``bundle``", "Collection of attributes from which to extract names", "None" "Sort Output (*inputs:sort*)", "``bool``", "If true, the names will be output in sorted order (default, for consistency). If false, the order is not be guaranteed to be consistent between systems or over time, so do not rely on the order downstream in this case.", "True" Outputs ------- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Attribute Names (*outputs:output*)", "``token[]``", "Names of all of the attributes contained in the input bundle", "None" Metadata -------- .. csv-table:: :header: "Name", "Value" :widths: 30,70 "Unique ID", "omni.graph.nodes.GetAttributeNames" "Version", "1" "Extension", "omni.graph.nodes" "Has State?", "False" "Implementation Language", "C++" "Default Memory Type", "cpu" "Generated Code Exclusions", "None" "uiName", "Get Attribute Names From Bundle" "Categories", "bundle" "Generated Class Name", "OgnGetAttrNamesDatabase" "Python Module", "omni.graph.nodes"
2,026
reStructuredText
28.376811
275
0.600691
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnCreateTubeTopology.rst
.. _omni_graph_nodes_CreateTubeTopology_1: .. _omni_graph_nodes_CreateTubeTopology: .. ================================================================================ .. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT. .. ================================================================================ :orphan: .. meta:: :title: Create Tube Topology :keywords: lang-en omnigraph node geometry:generator threadsafe nodes create-tube-topology Create Tube Topology ==================== .. <description> Creates the face vertex counts and indices describing a tube topology with the given number of rows and columns. .. </description> Installation ------------ To use this node enable :ref:`omni.graph.nodes<ext_omni_graph_nodes>` in the Extension Manager. Inputs ------ .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Column Array (*inputs:cols*)", "``int[]``", "Array of columns in the topology to be generated", "[]" "Row Array (*inputs:rows*)", "``int[]``", "Array of rows in the topology to be generated", "[]" Outputs ------- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Face Vertex Counts (*outputs:faceVertexCounts*)", "``int[]``", "Array of vertex counts for each face in the tube topology", "None" "Face Vertex Indices (*outputs:faceVertexIndices*)", "``int[]``", "Array of vertex indices for each face in the tube topology", "None" Metadata -------- .. csv-table:: :header: "Name", "Value" :widths: 30,70 "Unique ID", "omni.graph.nodes.CreateTubeTopology" "Version", "1" "Extension", "omni.graph.nodes" "Has State?", "False" "Implementation Language", "C++" "Default Memory Type", "cpu" "Generated Code Exclusions", "None" "uiName", "Create Tube Topology" "Categories", "geometry:generator" "Generated Class Name", "OgnCreateTubeTopologyDatabase" "Python Module", "omni.graph.nodes"
1,993
reStructuredText
27.485714
138
0.593578
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnLengthAlongCurve.rst
.. _omni_graph_nodes_LengthAlongCurve_1: .. _omni_graph_nodes_LengthAlongCurve: .. ================================================================================ .. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT. .. ================================================================================ :orphan: .. meta:: :title: Length Along Curve :keywords: lang-en omnigraph node geometry:analysis threadsafe nodes length-along-curve Length Along Curve ================== .. <description> Find the length along the curve of a set of points .. </description> Installation ------------ To use this node enable :ref:`omni.graph.nodes<ext_omni_graph_nodes>` in the Extension Manager. Inputs ------ .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Curve Points (*inputs:curvePoints*)", "``float[3][]``", "Points on the curve to be framed", "[]" "Curve Vertex Counts (*inputs:curveVertexCounts*)", "``int[]``", "Vertex counts for the curve points", "[]" "Curve Vertex Starts (*inputs:curveVertexStarts*)", "``int[]``", "Vertex starting points", "[]" "Normalize (*inputs:normalize*)", "``bool``", "If true then normalize the curve length to a 0, 1 range", "False" Outputs ------- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "outputs:length", "``float[]``", "List of lengths along the curve corresponding to the input points", "None" Metadata -------- .. csv-table:: :header: "Name", "Value" :widths: 30,70 "Unique ID", "omni.graph.nodes.LengthAlongCurve" "Version", "1" "Extension", "omni.graph.nodes" "Has State?", "False" "Implementation Language", "C++" "Default Memory Type", "cpu" "Generated Code Exclusions", "None" "uiName", "Length Along Curve" "Categories", "geometry:analysis" "Generated Class Name", "OgnLengthAlongCurveDatabase" "Python Module", "omni.graph.nodes"
1,974
reStructuredText
26.816901
116
0.582067
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnTransformVector.rst
.. _omni_graph_nodes_TransformVector_1: .. _omni_graph_nodes_TransformVector: .. ================================================================================ .. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT. .. ================================================================================ :orphan: .. meta:: :title: Transform Vector :keywords: lang-en omnigraph node math:operator threadsafe nodes transform-vector Transform Vector ================ .. <description> Applies a transformation matrix to a row vector, returning the result. returns vector * matrix If the vector is one dimension smaller than the matrix (eg a 4x4 matrix and a 3d vector), The last component of the vector will be treated as a 1. The result is then projected back to a 3-vector. Supports mixed array inputs, eg a single matrix and an array of vectors. .. </description> Installation ------------ To use this node enable :ref:`omni.graph.nodes<ext_omni_graph_nodes>` in the Extension Manager. Inputs ------ .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Matrix (*inputs:matrix*)", "``['matrixd[3]', 'matrixd[3][]', 'matrixd[4]', 'matrixd[4][]']``", "The transformation matrix to be applied", "None" "Vector (*inputs:vector*)", "``['vectord[3]', 'vectord[3][]', 'vectorf[3]', 'vectorf[3][]', 'vectorh[3]', 'vectorh[3][]']``", "The row vector(s) to be translated", "None" Outputs ------- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "Result (*outputs:result*)", "``['vectord[3]', 'vectord[3][]', 'vectorf[3]', 'vectorf[3][]', 'vectorh[3]', 'vectorh[3][]']``", "The transformed row vector(s)", "None" Metadata -------- .. csv-table:: :header: "Name", "Value" :widths: 30,70 "Unique ID", "omni.graph.nodes.TransformVector" "Version", "1" "Extension", "omni.graph.nodes" "Has State?", "False" "Implementation Language", "C++" "Default Memory Type", "cpu" "Generated Code Exclusions", "None" "uiName", "Transform Vector" "Categories", "math:operator" "Generated Class Name", "OgnTransformVectorDatabase" "Python Module", "omni.graph.nodes"
2,219
reStructuredText
31.173913
365
0.590807
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnReadVariable.rst
.. _omni_graph_core_ReadVariable_2: .. _omni_graph_core_ReadVariable: .. ================================================================================ .. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT. .. ================================================================================ :orphan: .. meta:: :title: Read Variable :keywords: lang-en omnigraph node internal threadsafe core read-variable Read Variable ============= .. <description> Node that reads a value from a variable .. </description> Installation ------------ To use this node enable :ref:`omni.graph.nodes<ext_omni_graph_nodes>` in the Extension Manager. Inputs ------ .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "inputs:graph", "``target``", "Ignored. Do not use", "None" "", "*hidden*", "true", "" "inputs:targetPath", "``token``", "Ignored. Do not use.", "None" "", "*hidden*", "true", "" "inputs:variableName", "``token``", "The name of the graph variable to use.", "" "", "*hidden*", "true", "" "", "*literalOnly*", "1", "" Outputs ------- .. csv-table:: :header: "Name", "Type", "Descripton", "Default" :widths: 20, 20, 50, 10 "outputs:value", "``any``", "The variable value that we returned.", "None" Metadata -------- .. csv-table:: :header: "Name", "Value" :widths: 30,70 "Unique ID", "omni.graph.core.ReadVariable" "Version", "2" "Extension", "omni.graph.nodes" "Has State?", "False" "Implementation Language", "C++" "Default Memory Type", "cpu" "Generated Code Exclusions", "None" "hidden", "true" "uiName", "Read Variable" "Categories", "internal" "Generated Class Name", "OgnReadVariableDatabase" "Python Module", "omni.graph.nodes"
1,800
reStructuredText
23.013333
95
0.539444