file_path
stringlengths 21
207
| content
stringlengths 5
1.02M
| size
int64 5
1.02M
| lang
stringclasses 9
values | avg_line_length
float64 1.33
100
| max_line_length
int64 4
993
| alphanum_fraction
float64 0.27
0.93
|
---|---|---|---|---|---|---|
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/ogn/tests/TestOgnCountTo.py | import os
import omni.kit.test
import omni.graph.core as og
import omni.graph.core.tests as ogts
from omni.graph.core.tests.omnigraph_test_utils import _TestGraphAndNode
from omni.graph.core.tests.omnigraph_test_utils import _test_clear_scene
from omni.graph.core.tests.omnigraph_test_utils import _test_setup_scene
from omni.graph.core.tests.omnigraph_test_utils import _test_verify_scene
class TestOgn(ogts.OmniGraphTestCase):
async def test_data_access(self):
from omni.graph.examples.python.ogn.OgnCountToDatabase import OgnCountToDatabase
test_file_name = "OgnCountToTemplate.usda"
usd_path = os.path.join(os.path.dirname(__file__), "usd", test_file_name)
if not os.path.exists(usd_path):
self.assertTrue(False, f"{usd_path} not found for loading test")
(result, error) = await ogts.load_test_file(usd_path)
self.assertTrue(result, f'{error} on {usd_path}')
test_node = og.Controller.node("/TestGraph/Template_omni_graph_examples_python_CountTo")
database = OgnCountToDatabase(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:countTo"))
attribute = test_node.get_attribute("inputs:countTo")
db_value = database.inputs.countTo
expected_value = 3
actual_value = og.Controller.get(attribute)
ogts.verify_values(expected_value, actual_value, _attr_error(attribute, True))
ogts.verify_values(expected_value, db_value, _attr_error(attribute, False))
self.assertTrue(test_node.get_attribute_exists("inputs:increment"))
attribute = test_node.get_attribute("inputs:increment")
db_value = database.inputs.increment
expected_value = 0.1
actual_value = og.Controller.get(attribute)
ogts.verify_values(expected_value, actual_value, _attr_error(attribute, True))
ogts.verify_values(expected_value, db_value, _attr_error(attribute, False))
self.assertTrue(test_node.get_attribute_exists("inputs:reset"))
attribute = test_node.get_attribute("inputs:reset")
db_value = database.inputs.reset
expected_value = False
actual_value = og.Controller.get(attribute)
ogts.verify_values(expected_value, actual_value, _attr_error(attribute, True))
ogts.verify_values(expected_value, db_value, _attr_error(attribute, False))
self.assertTrue(test_node.get_attribute_exists("inputs:trigger"))
attribute = test_node.get_attribute("inputs:trigger")
db_value = database.inputs.trigger
expected_value = [0.0, 0.0, 0.0]
actual_value = og.Controller.get(attribute)
ogts.verify_values(expected_value, actual_value, _attr_error(attribute, True))
ogts.verify_values(expected_value, db_value, _attr_error(attribute, False))
self.assertTrue(test_node.get_attribute_exists("outputs:count"))
attribute = test_node.get_attribute("outputs:count")
db_value = database.outputs.count
| 3,414 | Python | 49.970149 | 96 | 0.689807 |
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/ogn/tests/TestOgnDeformerGpu.py | import os
import omni.kit.test
import omni.graph.core as og
import omni.graph.core.tests as ogts
from omni.graph.core.tests.omnigraph_test_utils import _TestGraphAndNode
from omni.graph.core.tests.omnigraph_test_utils import _test_clear_scene
from omni.graph.core.tests.omnigraph_test_utils import _test_setup_scene
from omni.graph.core.tests.omnigraph_test_utils import _test_verify_scene
class TestOgn(ogts.OmniGraphTestCase):
async def test_data_access(self):
from omni.graph.examples.python.ogn.OgnDeformerGpuDatabase import OgnDeformerGpuDatabase
test_file_name = "OgnDeformerGpuTemplate.usda"
usd_path = os.path.join(os.path.dirname(__file__), "usd", test_file_name)
if not os.path.exists(usd_path):
self.assertTrue(False, f"{usd_path} not found for loading test")
(result, error) = await ogts.load_test_file(usd_path)
self.assertTrue(result, f'{error} on {usd_path}')
test_node = og.Controller.node("/TestGraph/Template_omni_graph_examples_python_DeformerPyGpu")
database = OgnDeformerGpuDatabase(test_node)
self.assertTrue(test_node.is_valid())
node_type_name = test_node.get_type_name()
self.assertEqual(og.GraphRegistry().get_node_type_version(node_type_name), 1)
def _attr_error(attribute: og.Attribute, usd_test: bool) -> str:
test_type = "USD Load" if usd_test else "Database Access"
return f"{node_type_name} {test_type} Test - {attribute.get_name()} value error"
self.assertTrue(test_node.get_attribute_exists("inputs:multiplier"))
attribute = test_node.get_attribute("inputs:multiplier")
expected_value = 1
actual_value = og.Controller.get(attribute)
ogts.verify_values(expected_value, actual_value, _attr_error(attribute, True))
self.assertTrue(test_node.get_attribute_exists("inputs:points"))
attribute = test_node.get_attribute("inputs:points")
expected_value = []
actual_value = og.Controller.get(attribute)
ogts.verify_values(expected_value, actual_value, _attr_error(attribute, True))
self.assertTrue(test_node.get_attribute_exists("outputs:points"))
attribute = test_node.get_attribute("outputs:points")
| 2,267 | Python | 48.304347 | 102 | 0.699162 |
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/ogn/tests/TestOgnClampDouble.py | import os
import omni.kit.test
import omni.graph.core as og
import omni.graph.core.tests as ogts
from omni.graph.core.tests.omnigraph_test_utils import _TestGraphAndNode
from omni.graph.core.tests.omnigraph_test_utils import _test_clear_scene
from omni.graph.core.tests.omnigraph_test_utils import _test_setup_scene
from omni.graph.core.tests.omnigraph_test_utils import _test_verify_scene
class TestOgn(ogts.OmniGraphTestCase):
TEST_DATA = [
{
'inputs': [
['inputs:num', -1.0, False],
['inputs:min', 2.0, False],
['inputs:max', 3.0, False],
],
'outputs': [
['outputs:out', 2.0, False],
],
},
{
'inputs': [
['inputs:num', 2.5, False],
['inputs:min', 2.0, False],
['inputs:max', 3.0, False],
],
'outputs': [
['outputs:out', 2.5, False],
],
},
{
'inputs': [
['inputs:num', 8.0, False],
['inputs:min', 2.0, False],
['inputs:max', 3.0, False],
],
'outputs': [
['outputs:out', 3.0, False],
],
},
]
async def test_generated(self):
test_info = _TestGraphAndNode()
controller = og.Controller()
for i, test_run in enumerate(self.TEST_DATA):
await _test_clear_scene(self, test_run)
test_info = await _test_setup_scene(self, controller, "/TestGraph", "TestNode_omni_graph_examples_python_ClampDouble", "omni.graph.examples.python.ClampDouble", test_run, test_info)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.examples.python.ClampDouble User test case #{i+1}")
async def test_vectorized_generated(self):
test_info = _TestGraphAndNode()
controller = og.Controller()
for i, test_run in enumerate(self.TEST_DATA):
await _test_clear_scene(self, test_run)
test_info = await _test_setup_scene(self, controller, "/TestGraph", "TestNode_omni_graph_examples_python_ClampDouble","omni.graph.examples.python.ClampDouble", test_run, test_info, 16)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.examples.python.ClampDouble User test case #{i+1}", 16)
async def test_data_access(self):
from omni.graph.examples.python.ogn.OgnClampDoubleDatabase import OgnClampDoubleDatabase
test_file_name = "OgnClampDoubleTemplate.usda"
usd_path = os.path.join(os.path.dirname(__file__), "usd", test_file_name)
if not os.path.exists(usd_path):
self.assertTrue(False, f"{usd_path} not found for loading test")
(result, error) = await ogts.load_test_file(usd_path)
self.assertTrue(result, f'{error} on {usd_path}')
test_node = og.Controller.node("/TestGraph/Template_omni_graph_examples_python_ClampDouble")
database = OgnClampDoubleDatabase(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:max"))
attribute = test_node.get_attribute("inputs:max")
db_value = database.inputs.max
expected_value = 0
actual_value = og.Controller.get(attribute)
ogts.verify_values(expected_value, actual_value, _attr_error(attribute, True))
ogts.verify_values(expected_value, db_value, _attr_error(attribute, False))
self.assertTrue(test_node.get_attribute_exists("inputs:min"))
attribute = test_node.get_attribute("inputs:min")
db_value = database.inputs.min
expected_value = 0
actual_value = og.Controller.get(attribute)
ogts.verify_values(expected_value, actual_value, _attr_error(attribute, True))
ogts.verify_values(expected_value, db_value, _attr_error(attribute, False))
self.assertTrue(test_node.get_attribute_exists("inputs:num"))
attribute = test_node.get_attribute("inputs:num")
db_value = database.inputs.num
expected_value = 0
actual_value = og.Controller.get(attribute)
ogts.verify_values(expected_value, actual_value, _attr_error(attribute, True))
ogts.verify_values(expected_value, db_value, _attr_error(attribute, False))
self.assertTrue(test_node.get_attribute_exists("outputs:out"))
attribute = test_node.get_attribute("outputs:out")
db_value = database.outputs.out
| 5,025 | Python | 44.690909 | 196 | 0.616119 |
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/ogn/tests/TestOgnBouncingCubesCpu.py | import os
import omni.kit.test
import omni.graph.core as og
import omni.graph.core.tests as ogts
from omni.graph.core.tests.omnigraph_test_utils import _TestGraphAndNode
from omni.graph.core.tests.omnigraph_test_utils import _test_clear_scene
from omni.graph.core.tests.omnigraph_test_utils import _test_setup_scene
from omni.graph.core.tests.omnigraph_test_utils import _test_verify_scene
class TestOgn(ogts.OmniGraphTestCase):
async def test_data_access(self):
from omni.graph.examples.python.ogn.OgnBouncingCubesCpuDatabase import OgnBouncingCubesCpuDatabase
test_file_name = "OgnBouncingCubesCpuTemplate.usda"
usd_path = os.path.join(os.path.dirname(__file__), "usd", test_file_name)
if not os.path.exists(usd_path):
self.assertTrue(False, f"{usd_path} not found for loading test")
(result, error) = await ogts.load_test_file(usd_path)
self.assertTrue(result, f'{error} on {usd_path}')
test_node = og.Controller.node("/TestGraph/Template_omni_graph_examples_python_BouncingCubes")
database = OgnBouncingCubesCpuDatabase(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("state:translations"))
attribute = test_node.get_attribute("state:translations")
db_value = database.state.translations
self.assertTrue(test_node.get_attribute_exists("state:velocities"))
attribute = test_node.get_attribute("state:velocities")
db_value = database.state.velocities
| 1,917 | Python | 48.179486 | 106 | 0.70892 |
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/ogn/tests/TestOgnVersionedDeformerPy.py | import os
import omni.kit.test
import omni.graph.core as og
import omni.graph.core.tests as ogts
from omni.graph.core.tests.omnigraph_test_utils import _TestGraphAndNode
from omni.graph.core.tests.omnigraph_test_utils import _test_clear_scene
from omni.graph.core.tests.omnigraph_test_utils import _test_setup_scene
from omni.graph.core.tests.omnigraph_test_utils import _test_verify_scene
class TestOgn(ogts.OmniGraphTestCase):
TEST_DATA = [
{
'inputs': [
['inputs:points', [[1.0, 2.0, 3.0], [3.0, 4.0, 5.0]], False],
['inputs:wavelength', 3.0, False],
],
'outputs': [
['outputs:points', [[1.0, 2.0, -1.5244665], [3.0, 4.0, 19.18311]], False],
],
},
]
async def test_generated(self):
test_info = _TestGraphAndNode()
controller = og.Controller()
for i, test_run in enumerate(self.TEST_DATA):
await _test_clear_scene(self, test_run)
test_info = await _test_setup_scene(self, controller, "/TestGraph", "TestNode_omni_graph_examples_python_VersionedDeformerPy", "omni.graph.examples.python.VersionedDeformerPy", test_run, test_info)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.examples.python.VersionedDeformerPy User test case #{i+1}")
async def test_vectorized_generated(self):
test_info = _TestGraphAndNode()
controller = og.Controller()
for i, test_run in enumerate(self.TEST_DATA):
await _test_clear_scene(self, test_run)
test_info = await _test_setup_scene(self, controller, "/TestGraph", "TestNode_omni_graph_examples_python_VersionedDeformerPy","omni.graph.examples.python.VersionedDeformerPy", test_run, test_info, 16)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.examples.python.VersionedDeformerPy User test case #{i+1}", 16)
async def test_data_access(self):
from omni.graph.examples.python.ogn.OgnVersionedDeformerPyDatabase import OgnVersionedDeformerPyDatabase
test_file_name = "OgnVersionedDeformerPyTemplate.usda"
usd_path = os.path.join(os.path.dirname(__file__), "usd", test_file_name)
if not os.path.exists(usd_path):
self.assertTrue(False, f"{usd_path} not found for loading test")
(result, error) = await ogts.load_test_file(usd_path)
self.assertTrue(result, f'{error} on {usd_path}')
test_node = og.Controller.node("/TestGraph/Template_omni_graph_examples_python_VersionedDeformerPy")
database = OgnVersionedDeformerPyDatabase(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), 2)
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:points"))
attribute = test_node.get_attribute("inputs:points")
db_value = database.inputs.points
expected_value = []
actual_value = og.Controller.get(attribute)
ogts.verify_values(expected_value, actual_value, _attr_error(attribute, True))
ogts.verify_values(expected_value, db_value, _attr_error(attribute, False))
self.assertTrue(test_node.get_attribute_exists("inputs:wavelength"))
attribute = test_node.get_attribute("inputs:wavelength")
db_value = database.inputs.wavelength
expected_value = 50.0
actual_value = og.Controller.get(attribute)
ogts.verify_values(expected_value, actual_value, _attr_error(attribute, True))
ogts.verify_values(expected_value, db_value, _attr_error(attribute, False))
self.assertTrue(test_node.get_attribute_exists("outputs:points"))
attribute = test_node.get_attribute("outputs:points")
db_value = database.outputs.points
| 4,226 | Python | 51.185185 | 212 | 0.666115 |
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/ogn/tests/TestOgnTestSingleton.py | import os
import omni.kit.test
import omni.graph.core as og
import omni.graph.core.tests as ogts
from omni.graph.core.tests.omnigraph_test_utils import _TestGraphAndNode
from omni.graph.core.tests.omnigraph_test_utils import _test_clear_scene
from omni.graph.core.tests.omnigraph_test_utils import _test_setup_scene
from omni.graph.core.tests.omnigraph_test_utils import _test_verify_scene
class TestOgn(ogts.OmniGraphTestCase):
async def test_data_access(self):
from omni.graph.examples.python.ogn.OgnTestSingletonDatabase import OgnTestSingletonDatabase
test_file_name = "OgnTestSingletonTemplate.usda"
usd_path = os.path.join(os.path.dirname(__file__), "usd", test_file_name)
if not os.path.exists(usd_path):
self.assertTrue(False, f"{usd_path} not found for loading test")
(result, error) = await ogts.load_test_file(usd_path)
self.assertTrue(result, f'{error} on {usd_path}')
test_node = og.Controller.node("/TestGraph/Template_omni_graph_examples_python_TestSingleton")
database = OgnTestSingletonDatabase(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("outputs:out"))
attribute = test_node.get_attribute("outputs:out")
db_value = database.outputs.out
| 1,698 | Python | 47.542856 | 102 | 0.704947 |
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/ogn/tests/TestOgnPositionToColor.py | import os
import omni.kit.test
import omni.graph.core as og
import omni.graph.core.tests as ogts
from omni.graph.core.tests.omnigraph_test_utils import _TestGraphAndNode
from omni.graph.core.tests.omnigraph_test_utils import _test_clear_scene
from omni.graph.core.tests.omnigraph_test_utils import _test_setup_scene
from omni.graph.core.tests.omnigraph_test_utils import _test_verify_scene
class TestOgn(ogts.OmniGraphTestCase):
TEST_DATA = [
{
'inputs': [
['inputs:position', [1.0, 2.0, 3.0], False],
['inputs:scale', 4.0, False],
['inputs:color_offset', [0.3, 0.2, 0.1], False],
],
'outputs': [
['outputs:color', [[0.0, 1.0, 0.1]], False],
],
},
]
async def test_generated(self):
test_info = _TestGraphAndNode()
controller = og.Controller()
for i, test_run in enumerate(self.TEST_DATA):
await _test_clear_scene(self, test_run)
test_info = await _test_setup_scene(self, controller, "/TestGraph", "TestNode_omni_graph_examples_python_PositionToColor", "omni.graph.examples.python.PositionToColor", test_run, test_info)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.examples.python.PositionToColor User test case #{i+1}")
async def test_vectorized_generated(self):
test_info = _TestGraphAndNode()
controller = og.Controller()
for i, test_run in enumerate(self.TEST_DATA):
await _test_clear_scene(self, test_run)
test_info = await _test_setup_scene(self, controller, "/TestGraph", "TestNode_omni_graph_examples_python_PositionToColor","omni.graph.examples.python.PositionToColor", test_run, test_info, 16)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.examples.python.PositionToColor User test case #{i+1}", 16)
async def test_data_access(self):
from omni.graph.examples.python.ogn.OgnPositionToColorDatabase import OgnPositionToColorDatabase
test_file_name = "OgnPositionToColorTemplate.usda"
usd_path = os.path.join(os.path.dirname(__file__), "usd", test_file_name)
if not os.path.exists(usd_path):
self.assertTrue(False, f"{usd_path} not found for loading test")
(result, error) = await ogts.load_test_file(usd_path)
self.assertTrue(result, f'{error} on {usd_path}')
test_node = og.Controller.node("/TestGraph/Template_omni_graph_examples_python_PositionToColor")
database = OgnPositionToColorDatabase(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:color_offset"))
attribute = test_node.get_attribute("inputs:color_offset")
db_value = database.inputs.color_offset
expected_value = [0.0, 0.0, 0.0]
actual_value = og.Controller.get(attribute)
ogts.verify_values(expected_value, actual_value, _attr_error(attribute, True))
ogts.verify_values(expected_value, db_value, _attr_error(attribute, False))
self.assertTrue(test_node.get_attribute_exists("inputs:position"))
attribute = test_node.get_attribute("inputs:position")
db_value = database.inputs.position
expected_value = [0.0, 0.0, 0.0]
actual_value = og.Controller.get(attribute)
ogts.verify_values(expected_value, actual_value, _attr_error(attribute, True))
ogts.verify_values(expected_value, db_value, _attr_error(attribute, False))
self.assertTrue(test_node.get_attribute_exists("inputs:scale"))
attribute = test_node.get_attribute("inputs:scale")
db_value = database.inputs.scale
expected_value = 1.0
actual_value = og.Controller.get(attribute)
ogts.verify_values(expected_value, actual_value, _attr_error(attribute, True))
ogts.verify_values(expected_value, db_value, _attr_error(attribute, False))
self.assertTrue(test_node.get_attribute_exists("outputs:color"))
attribute = test_node.get_attribute("outputs:color")
db_value = database.outputs.color
| 4,654 | Python | 50.722222 | 204 | 0.660722 |
omniverse-code/kit/exts/omni.graph.examples.python/omni/graph/examples/python/ogn/tests/TestOgnDecomposeDouble3.py | import os
import omni.kit.test
import omni.graph.core as og
import omni.graph.core.tests as ogts
from omni.graph.core.tests.omnigraph_test_utils import _TestGraphAndNode
from omni.graph.core.tests.omnigraph_test_utils import _test_clear_scene
from omni.graph.core.tests.omnigraph_test_utils import _test_setup_scene
from omni.graph.core.tests.omnigraph_test_utils import _test_verify_scene
class TestOgn(ogts.OmniGraphTestCase):
TEST_DATA = [
{
'inputs': [
['inputs:double3', [1.0, 2.0, 3.0], False],
],
'outputs': [
['outputs:x', 1.0, False],
['outputs:y', 2.0, False],
['outputs:z', 3.0, False],
],
},
]
async def test_generated(self):
test_info = _TestGraphAndNode()
controller = og.Controller()
for i, test_run in enumerate(self.TEST_DATA):
await _test_clear_scene(self, test_run)
test_info = await _test_setup_scene(self, controller, "/TestGraph", "TestNode_omni_graph_examples_python_DecomposeDouble3", "omni.graph.examples.python.DecomposeDouble3", test_run, test_info)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.examples.python.DecomposeDouble3 User test case #{i+1}")
async def test_vectorized_generated(self):
test_info = _TestGraphAndNode()
controller = og.Controller()
for i, test_run in enumerate(self.TEST_DATA):
await _test_clear_scene(self, test_run)
test_info = await _test_setup_scene(self, controller, "/TestGraph", "TestNode_omni_graph_examples_python_DecomposeDouble3","omni.graph.examples.python.DecomposeDouble3", test_run, test_info, 16)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.examples.python.DecomposeDouble3 User test case #{i+1}", 16)
async def test_data_access(self):
from omni.graph.examples.python.ogn.OgnDecomposeDouble3Database import OgnDecomposeDouble3Database
test_file_name = "OgnDecomposeDouble3Template.usda"
usd_path = os.path.join(os.path.dirname(__file__), "usd", test_file_name)
if not os.path.exists(usd_path):
self.assertTrue(False, f"{usd_path} not found for loading test")
(result, error) = await ogts.load_test_file(usd_path)
self.assertTrue(result, f'{error} on {usd_path}')
test_node = og.Controller.node("/TestGraph/Template_omni_graph_examples_python_DecomposeDouble3")
database = OgnDecomposeDouble3Database(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:double3"))
attribute = test_node.get_attribute("inputs:double3")
db_value = database.inputs.double3
expected_value = [0, 0, 0]
actual_value = og.Controller.get(attribute)
ogts.verify_values(expected_value, actual_value, _attr_error(attribute, True))
ogts.verify_values(expected_value, db_value, _attr_error(attribute, False))
self.assertTrue(test_node.get_attribute_exists("outputs:x"))
attribute = test_node.get_attribute("outputs:x")
db_value = database.outputs.x
self.assertTrue(test_node.get_attribute_exists("outputs:y"))
attribute = test_node.get_attribute("outputs:y")
db_value = database.outputs.y
self.assertTrue(test_node.get_attribute_exists("outputs:z"))
attribute = test_node.get_attribute("outputs:z")
db_value = database.outputs.z
| 4,045 | Python | 48.341463 | 206 | 0.657849 |
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/__init__.py | """There is no public API to this module."""
__all__ = []
scan_for_test_modules = True
"""The presence of this object causes the test runner to automatically scan the directory for unit test cases"""
| 201 | Python | 32.666661 | 112 | 0.716418 |
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.widget.options_menu/docs/index.rst | omni.kit.widget.options_menu
#############################
.. toctree::
:maxdepth: 1
CHANGELOG
| 105 | reStructuredText | 9.599999 | 29 | 0.466667 |
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/__init__.py | from .extension import *
| 25 | Python | 11.999994 | 24 | 0.76 |
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.welcome.about/omni/kit/welcome/about/tests/__init__.py | from .test_page import * | 24 | Python | 23.999976 | 24 | 0.75 |
omniverse-code/kit/exts/omni.kit.welcome.about/docs/index.rst | omni.kit.welcome.about
###########################
.. toctree::
:maxdepth: 1
CHANGELOG
| 95 | reStructuredText | 10.999999 | 27 | 0.463158 |
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/extension.py | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
import omni.ext
# from .style import get_default_style
class ViewportTransformManipulatorExt(omni.ext.IExt):
def on_startup(self, ext_id):
print('ViewportTransformManipulatorExt on_startup')
def on_shutdown(self):
print('ViewportTransformManipulatorExt on_shutdown') | 722 | Python | 37.05263 | 76 | 0.782548 |
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/__init__.py | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
from .test_manipulator_transform import TestViewportTransform
| 491 | Python | 43.727269 | 76 | 0.816701 |
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.viewport.manipulator.transform/docs/index.rst | omni.kit.viewport.manipulator.transform
################################
Example of Python only extension
.. toctree::
:maxdepth: 1
README
CHANGELOG
.. automodule:: omni.kit.viewport.manipulator.transform
:platform: Windows-x86_64, Linux-x86_64
:members:
:undoc-members:
:show-inheritance:
:imported-members:
:exclude-members: contextmanager
| 381 | reStructuredText | 17.190475 | 55 | 0.645669 |
omniverse-code/kit/exts/omni.kit.window.content_browser_registry/PACKAGE-LICENSES/omni.kit.window.content_browser_registry-LICENSE.md | Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
NVIDIA CORPORATION and its licensors retain all intellectual property
and proprietary rights in and to this software, related documentation
and any modifications thereto. Any use, reproduction, disclosure or
distribution of this software and related documentation without an express
license agreement from NVIDIA CORPORATION is strictly prohibited. | 412 | Markdown | 57.999992 | 74 | 0.839806 |
omniverse-code/kit/exts/omni.kit.window.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/omni/kit/window/content_browser_registry/tests/__init__.py | ## Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.
##
## NVIDIA CORPORATION and its licensors retain all intellectual property
## and proprietary rights in and to this software, related documentation
## and any modifications thereto. Any use, reproduction, disclosure or
## distribution of this software and related documentation without an express
## license agreement from NVIDIA CORPORATION is strictly prohibited.
##
from .test_registry import *
| 470 | Python | 46.099995 | 77 | 0.791489 |
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.content_browser_registry/docs/index.rst | omni.kit.window.content_browser_registry
########################################
.. toctree::
:maxdepth: 1
CHANGELOG
| 126 | reStructuredText | 14.874998 | 40 | 0.47619 |
omniverse-code/kit/exts/omni.kit.window.about/PACKAGE-LICENSES/omni.kit.window.about-LICENSE.md | Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
NVIDIA CORPORATION and its licensors retain all intellectual property
and proprietary rights in and to this software, related documentation
and any modifications thereto. Any use, reproduction, disclosure or
distribution of this software and related documentation without an express
license agreement from NVIDIA CORPORATION is strictly prohibited. | 412 | Markdown | 57.999992 | 74 | 0.839806 |
omniverse-code/kit/exts/omni.kit.window.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.kit.window.about/docs/index.rst | omni.kit.window.about
###########################
.. toctree::
:maxdepth: 1
CHANGELOG
| 96 | reStructuredText | 8.699999 | 27 | 0.447917 |
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/OgnBreakVector4.rst | .. _omni_graph_nodes_BreakVector4_1:
.. _omni_graph_nodes_BreakVector4:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Break 4-Vector
:keywords: lang-en omnigraph node math:conversion threadsafe nodes break-vector4
Break 4-Vector
==============
.. <description>
Split vector into 4 component 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
"Vector (*inputs:tuple*)", "``['double[4]', 'float[4]', 'half[4]', 'int[4]']``", "4-vector to be broken", "None"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"W (*outputs:w*)", "``['double', 'float', 'half', 'int']``", "The fourth component of the vector", "None"
"X (*outputs:x*)", "``['double', 'float', 'half', 'int']``", "The first component of the vector", "None"
"Y (*outputs:y*)", "``['double', 'float', 'half', 'int']``", "The second component of the vector", "None"
"Z (*outputs:z*)", "``['double', 'float', 'half', 'int']``", "The third component of the vector", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.nodes.BreakVector4"
"Version", "1"
"Extension", "omni.graph.nodes"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"tags", "decompose,separate,isolate"
"uiName", "Break 4-Vector"
"Categories", "math:conversion"
"Generated Class Name", "OgnBreakVector4Database"
"Python Module", "omni.graph.nodes"
| 1,972 | reStructuredText | 26.402777 | 116 | 0.548682 |
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/OgnToToken.rst | .. _omni_graph_nodes_ToToken_1:
.. _omni_graph_nodes_ToToken:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: To Token
:keywords: lang-en omnigraph node function threadsafe nodes to-token
To Token
========
.. <description>
Converts the given input to a string equivalent and provides the Token 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
"value (*inputs:value*)", "``any``", "The value to be converted to a token", "None"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"Token (*outputs:converted*)", "``token``", "Stringified output as a Token", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.nodes.ToToken"
"Version", "1"
"Extension", "omni.graph.nodes"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "To Token"
"Categories", "function"
"Generated Class Name", "OgnToTokenDatabase"
"Python Module", "omni.graph.nodes"
| 1,528 | reStructuredText | 21.485294 | 95 | 0.552356 |
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/OgnConstantColor3f.rst | .. _omni_graph_nodes_ConstantColor3f_1:
.. _omni_graph_nodes_ConstantColor3f:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Constant Color3F
:keywords: lang-en omnigraph node constants nodes constant-color3f
Constant Color3F
================
.. <description>
Holds a 3-component color constant, which is energy-linear RGB
.. </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*)", "``colorf[3]``", "The constant value", "[0.0, 0.0, 0.0]"
"", "*outputOnly*", "1", ""
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.nodes.ConstantColor3f"
"Version", "1"
"Extension", "omni.graph.nodes"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"Categories", "constants"
"Generated Class Name", "OgnConstantColor3fDatabase"
"Python Module", "omni.graph.nodes"
| 1,372 | reStructuredText | 22.271186 | 95 | 0.550292 |
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/OgnConstantUChar.rst | .. _omni_graph_nodes_ConstantUChar_1:
.. _omni_graph_nodes_ConstantUChar:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Constant UChar
:keywords: lang-en omnigraph node constants nodes constant-u-char
Constant UChar
==============
.. <description>
Holds an 8-bit unsigned character 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
"Value (*inputs:value*)", "``uchar``", "The constant value", "0"
"", "*outputOnly*", "1", ""
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.nodes.ConstantUChar"
"Version", "1"
"Extension", "omni.graph.nodes"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Constant UChar"
"Categories", "constants"
"Generated Class Name", "OgnConstantUCharDatabase"
"Python Module", "omni.graph.nodes"
| 1,347 | reStructuredText | 21.466666 | 95 | 0.545657 |
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/OgnConstantInt4.rst | .. _omni_graph_nodes_ConstantInt4_1:
.. _omni_graph_nodes_ConstantInt4:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Constant Int4
:keywords: lang-en omnigraph node constants nodes constant-int4
Constant Int4
=============
.. <description>
Holds a 4-component int constant.
.. </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*)", "``int[4]``", "The constant value", "[0, 0, 0, 0]"
"", "*outputOnly*", "1", ""
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.nodes.ConstantInt4"
"Version", "1"
"Extension", "omni.graph.nodes"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"Categories", "constants"
"Generated Class Name", "OgnConstantInt4Database"
"Python Module", "omni.graph.nodes"
| 1,313 | reStructuredText | 21.271186 | 95 | 0.536938 |
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/OgnGetLocationAtDistanceOnCurve2.rst | .. _omni_graph_nodes_GetLocationAtDistanceOnCurve2_1:
.. _omni_graph_nodes_GetLocationAtDistanceOnCurve2:
.. ================================================================================
.. 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-curve2
Get Locations At Distances On Curve
===================================
.. <description>
Given a set of curve points and a normalized distance between 0-1.0, return the location on a closed curve. 0 is the first point on the curve, 1.0 is also the first point because the is an implicit segment connecting the first and last points. Values outside the range 0-1.0 will be wrapped to that range, for example -0.4 is equivalent to 0.6 and 1.3 is equivalent to 0.3 This is a simplistic curve-following node, intended for curves in a plane, for prototyping purposes.
.. </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", "[]"
"Distance (*inputs:distance*)", "``double``", "The distance along the curve, wrapped to the range 0-1.0", "0.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
"Location on curve at the given distance in world space (*outputs:location*)", "``pointd[3]``", "Location", "None"
"World space orientation of the curve at the given distance, may not be smooth for some curves (*outputs:orientation*)", "``quatf[4]``", "Orientation", "None"
"World space rotation of the curve at the given distance, 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.GetLocationAtDistanceOnCurve2"
"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", "OgnGetLocationAtDistanceOnCurve2Database"
"Python Module", "omni.graph.nodes"
| 2,973 | reStructuredText | 38.653333 | 474 | 0.621931 |
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/OgnHasVariantSet.rst | .. _omni_graph_nodes_HasVariantSet_2:
.. _omni_graph_nodes_HasVariantSet:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Has Variant Set
:keywords: lang-en omnigraph node graph:action,sceneGraph,variants ReadOnly nodes has-variant-set
Has Variant Set
===============
.. <description>
Query the existence of a variantSet on a 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
"inputs:prim", "``target``", "The prim with the variantSet", "None"
"inputs:variantSetName", "``token``", "The variantSet name", ""
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"outputs:exists", "``bool``", "Variant exists", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.nodes.HasVariantSet"
"Version", "2"
"Extension", "omni.graph.nodes"
"Icon", "ogn/icons/omni.graph.nodes.HasVariantSet.svg"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Has Variant Set"
"Categories", "graph:action,sceneGraph,variants"
"Generated Class Name", "OgnHasVariantSetDatabase"
"Python Module", "omni.graph.nodes"
| 1,684 | reStructuredText | 23.071428 | 101 | 0.570071 |
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/OgnClearVariantSelection.rst | .. _omni_graph_nodes_ClearVariantSelection_2:
.. _omni_graph_nodes_ClearVariantSelection:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Clear Variant Selection
:keywords: lang-en omnigraph node graph:action,sceneGraph,variants WriteOnly nodes clear-variant-selection
Clear Variant Selection
=======================
.. <description>
This node will clear the variant selection of the prim on the active layer. Final variant selection will be determined by layer composition below your active layer. In a single layer stage, this will be the fallback variant defined in your variantSet.
.. </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", "None"
"inputs:prim", "``target``", "The prim with the variantSet", "None"
"inputs:setVariant", "``bool``", "Sets the variant selection when finished rather than writing to the attribute values", "False"
"inputs:variantSetName", "``token``", "The variantSet name", ""
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"outputs:execOut", "``execution``", "The output execution", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.nodes.ClearVariantSelection"
"Version", "2"
"Extension", "omni.graph.nodes"
"Icon", "ogn/icons/omni.graph.nodes.ClearVariantSelection.svg"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Clear Variant Selection"
"Categories", "graph:action,sceneGraph,variants"
"Generated Class Name", "OgnClearVariantSelectionDatabase"
"Python Module", "omni.graph.nodes"
| 2,184 | reStructuredText | 29.347222 | 251 | 0.619048 |
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnConstantQuatf.rst | .. _omni_graph_nodes_ConstantQuatf_1:
.. _omni_graph_nodes_ConstantQuatf:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Constant Quatf
:keywords: lang-en omnigraph node constants nodes constant-quatf
Constant Quatf
==============
.. <description>
Holds a single-precision quaternion constant: A real coefficient and three imaginary coefficients.
.. </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*)", "``quatf[4]``", "The constant value", "[0.0, 0.0, 0.0, 0.0]"
"", "*outputOnly*", "1", ""
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.nodes.ConstantQuatf"
"Version", "1"
"Extension", "omni.graph.nodes"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"Categories", "constants"
"Generated Class Name", "OgnConstantQuatfDatabase"
"Python Module", "omni.graph.nodes"
| 1,396 | reStructuredText | 22.677966 | 98 | 0.555158 |
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/OgnConstantDouble4.rst | .. _omni_graph_nodes_ConstantDouble4_1:
.. _omni_graph_nodes_ConstantDouble4:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Constant Double4
:keywords: lang-en omnigraph node constants nodes constant-double4
Constant Double4
================
.. <description>
Holds a 4-component double constant.
.. </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*)", "``double[4]``", "The constant value", "[0.0, 0.0, 0.0, 0.0]"
"", "*outputOnly*", "1", ""
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.nodes.ConstantDouble4"
"Version", "1"
"Extension", "omni.graph.nodes"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"Categories", "constants"
"Generated Class Name", "OgnConstantDouble4Database"
"Python Module", "omni.graph.nodes"
| 1,351 | reStructuredText | 21.915254 | 95 | 0.544782 |
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnNoOp.rst | .. _omni_graph_nodes_Noop_1:
.. _omni_graph_nodes_Noop:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: No-Op
:keywords: lang-en omnigraph node debug threadsafe nodes noop
No-Op
=====
.. <description>
Empty node used only as a placeholder
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.nodes<ext_omni_graph_nodes>` in the Extension Manager.
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.nodes.Noop"
"Version", "1"
"Extension", "omni.graph.nodes"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "No-Op"
"Categories", "debug"
"Generated Class Name", "OgnNoOpDatabase"
"Python Module", "omni.graph.nodes"
| 1,051 | reStructuredText | 20.04 | 95 | 0.528069 |
omniverse-code/kit/exts/omni.graph.nodes/ogn/docs/OgnMakeVector2.rst | .. _omni_graph_nodes_MakeVector2_1:
.. _omni_graph_nodes_MakeVector2:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Make 2-Vector
:keywords: lang-en omnigraph node math:conversion threadsafe nodes make-vector2
Make 2-Vector
=============
.. <description>
Merge 2 input values into a single output vector. If the inputs are arrays, the output will be 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
"X (*inputs:x*)", "``['double', 'double[]', 'float', 'float[]', 'half', 'half[]', 'int', 'int[]']``", "The first component of the vector", "None"
"Y (*inputs:y*)", "``['double', 'double[]', 'float', 'float[]', 'half', 'half[]', 'int', 'int[]']``", "The second component of the vector", "None"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"Vector (*outputs:tuple*)", "``['double[2]', 'double[2][]', 'float[2]', 'float[2][]', 'half[2]', 'half[2][]', 'int[2]', 'int[2][]']``", "Output vector(s)", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.nodes.MakeVector2"
"Version", "1"
"Extension", "omni.graph.nodes"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"tags", "compose,combine,join"
"uiName", "Make 2-Vector"
"Categories", "math:conversion"
"Generated Class Name", "OgnMakeVector2Database"
"Python Module", "omni.graph.nodes"
| 1,948 | reStructuredText | 26.842857 | 166 | 0.545175 |
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/OgnArrayResize.rst | .. _omni_graph_nodes_ArrayResize_1:
.. _omni_graph_nodes_ArrayResize:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Array Resize
:keywords: lang-en omnigraph node math:array threadsafe nodes array-resize
Array Resize
============
.. <description>
Resizes an array. If the new size is larger, zeroed values will be added to the end.
.. </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:newSize", "``int``", "The new size of the array, negative values are treated as size of 0", "0"
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"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.nodes.ArrayResize"
"Version", "1"
"Extension", "omni.graph.nodes"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Array Resize"
"Categories", "math:array"
"Generated Class Name", "OgnArrayResizeDatabase"
"Python Module", "omni.graph.nodes"
| 3,105 | reStructuredText | 44.014492 | 800 | 0.516264 |
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 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.