file_path
stringlengths 32
153
| content
stringlengths 0
3.14M
|
---|---|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/TestOgnBuildString.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:a', {'type': 'token', 'value': '/'}, False],
['inputs:b', {'type': 'token', 'value': 'foo'}, False],
],
'outputs': [
['outputs:value', {'type': 'token', 'value': '/foo'}, False],
],
},
{
'inputs': [
['inputs:a', {'type': 'token[]', 'value': ['/World', '/World2']}, False],
['inputs:b', {'type': 'token', 'value': '/foo'}, False],
],
'outputs': [
['outputs:value', {'type': 'token[]', 'value': ['/World/foo', '/World2/foo']}, False],
],
},
{
'inputs': [
['inputs:a', {'type': 'token[]', 'value': ['/World', '/World2']}, False],
['inputs:b', {'type': 'token[]', 'value': ['/foo', '/bar']}, False],
],
'outputs': [
['outputs:value', {'type': 'token[]', 'value': ['/World/foo', '/World2/bar']}, False],
],
},
{
'inputs': [
['inputs:a', {'type': 'string', 'value': '/'}, False],
['inputs:b', {'type': 'string', 'value': 'foo'}, False],
],
'outputs': [
['outputs:value', {'type': 'string', 'value': '/foo'}, 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_nodes_BuildString", "omni.graph.nodes.BuildString", test_run, test_info)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.nodes.BuildString 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_nodes_BuildString","omni.graph.nodes.BuildString", test_run, test_info, 16)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.nodes.BuildString User test case #{i+1}", 16)
async def test_thread_safety(self):
import omni.kit
# Generate multiple instances of the test setup to run them concurrently
instance_setup = dict()
for n in range(24):
instance_setup[f"/TestGraph_{n}"] = _TestGraphAndNode()
for i, test_run in enumerate(self.TEST_DATA):
await _test_clear_scene(self, test_run)
for (key, test_info) in instance_setup.items():
test_info = await _test_setup_scene(self, og.Controller(allow_exists_prim=True), key, "TestNode_omni_graph_nodes_BuildString", "omni.graph.nodes.BuildString", test_run, test_info)
self.assertEqual(len(og.get_all_graphs()), 24)
# We want to evaluate all graphs concurrently. Kick them all.
# Evaluate multiple times to skip 2 serial frames and increase chances for a race condition.
for _ in range(10):
await omni.kit.app.get_app().next_update_async()
for (key, test_instance) in instance_setup.items():
_test_verify_scene(self, og.Controller(), test_run, test_info, f"omni.graph.nodes.BuildString User test case #{i+1}, instance{key}")
async def test_data_access(self):
from omni.graph.nodes.ogn.OgnBuildStringDatabase import OgnBuildStringDatabase
test_file_name = "OgnBuildStringTemplate.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_nodes_BuildString")
database = OgnBuildStringDatabase(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"
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/TestOgnGetGraphTargetId.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.nodes.ogn.OgnGetGraphTargetIdDatabase import OgnGetGraphTargetIdDatabase
test_file_name = "OgnGetGraphTargetIdTemplate.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_nodes_GetGraphTargetId")
database = OgnGetGraphTargetIdDatabase(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:targetId"))
attribute = test_node.get_attribute("outputs:targetId")
db_value = database.outputs.targetId
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/TestOgnRenameAttr.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.nodes.ogn.OgnRenameAttrDatabase import OgnRenameAttrDatabase
test_file_name = "OgnRenameAttrTemplate.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_nodes_RenameAttribute")
database = OgnRenameAttrDatabase(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:data"))
attribute = test_node.get_attribute("inputs:data")
db_value = database.inputs.data
self.assertTrue(test_node.get_attribute_exists("inputs:inputAttrNames"))
attribute = test_node.get_attribute("inputs:inputAttrNames")
db_value = database.inputs.inputAttrNames
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:outputAttrNames"))
attribute = test_node.get_attribute("inputs:outputAttrNames")
db_value = database.inputs.outputAttrNames
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("outputs_data"))
attribute = test_node.get_attribute("outputs_data")
db_value = database.outputs.data
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/TestOgnGetMatrix4Rotation.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:matrix', {'type': 'matrixd[4]', 'value': [1, 0, 0, 0, 0, 0.70711, 0.70711, 0, 0, -0.70711, 0.70711, 0, 50, 0, 0, 1]}, False],
],
'outputs': [
['outputs:rotation', {'type': 'vectord[3]', 'value': [45, 0, 0]}, False],
],
},
{
'inputs': [
['inputs:matrix', {'type': 'matrixd[4][]', 'value': [[1.0, 0, 0, 0, 0, 0.70711, 0.70711, 0, 0, -0.70711, 0.70711, 0, 50, 0, 0, 1], [1.0, 0, 0, 0, 0, 0.70711, 0.70711, 0, 0, -0.70711, 0.70711, 0, 100, 0, 0, 1]]}, False],
],
'outputs': [
['outputs:rotation', {'type': 'vectord[3][]', 'value': [[45, 0, 0], [45, 0, 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_nodes_GetMatrix4Rotation", "omni.graph.nodes.GetMatrix4Rotation", test_run, test_info)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.nodes.GetMatrix4Rotation 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_nodes_GetMatrix4Rotation","omni.graph.nodes.GetMatrix4Rotation", test_run, test_info, 16)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.nodes.GetMatrix4Rotation User test case #{i+1}", 16)
async def test_thread_safety(self):
import omni.kit
# Generate multiple instances of the test setup to run them concurrently
instance_setup = dict()
for n in range(24):
instance_setup[f"/TestGraph_{n}"] = _TestGraphAndNode()
for i, test_run in enumerate(self.TEST_DATA):
await _test_clear_scene(self, test_run)
for (key, test_info) in instance_setup.items():
test_info = await _test_setup_scene(self, og.Controller(allow_exists_prim=True), key, "TestNode_omni_graph_nodes_GetMatrix4Rotation", "omni.graph.nodes.GetMatrix4Rotation", test_run, test_info)
self.assertEqual(len(og.get_all_graphs()), 24)
# We want to evaluate all graphs concurrently. Kick them all.
# Evaluate multiple times to skip 2 serial frames and increase chances for a race condition.
for _ in range(10):
await omni.kit.app.get_app().next_update_async()
for (key, test_instance) in instance_setup.items():
_test_verify_scene(self, og.Controller(), test_run, test_info, f"omni.graph.nodes.GetMatrix4Rotation User test case #{i+1}, instance{key}")
async def test_data_access(self):
from omni.graph.nodes.ogn.OgnGetMatrix4RotationDatabase import OgnGetMatrix4RotationDatabase
test_file_name = "OgnGetMatrix4RotationTemplate.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_nodes_GetMatrix4Rotation")
database = OgnGetMatrix4RotationDatabase(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"
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/TestOgnRotateVector.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:rotation', {'type': 'matrixd[4]', 'value': [1, 0, 0, 0, 0, 1, 0, 0, 10, 10, 1, 0, 50, 0, 0, 1]}, False],
['inputs:vector', {'type': 'vectord[3]', 'value': [1, 2, 3]}, False],
],
'outputs': [
['outputs:result', {'type': 'vectord[3]', 'value': [31, 32, 3]}, False],
],
},
{
'inputs': [
['inputs:rotation', {'type': 'matrixd[3]', 'value': [1, 0, 0, 0, 0, 1, 0, -1, 0]}, False],
['inputs:vector', {'type': 'vectorf[3]', 'value': [0, 0, 1]}, False],
],
'outputs': [
['outputs:result', {'type': 'vectorf[3]', 'value': [0, -1, 0]}, False],
],
},
{
'inputs': [
['inputs:rotation', {'type': 'vectord[3]', 'value': [90, 0, 0]}, False],
['inputs:vector', {'type': 'vectord[3]', 'value': [0, 0, 1]}, False],
],
'outputs': [
['outputs:result', {'type': 'vectord[3]', 'value': [0, -1, 0]}, False],
],
},
{
'inputs': [
['inputs:rotation', {'type': 'quatf[4]', 'value': [0.7071068, 0, 0, 0.7071068]}, False],
['inputs:vector', {'type': 'vectorf[3]', 'value': [0, 0, 1]}, False],
],
'outputs': [
['outputs:result', {'type': 'vectorf[3]', 'value': [0, -1, 0]}, False],
],
},
{
'inputs': [
['inputs:rotation', {'type': 'vectorf[3][]', 'value': [[0, 90, 0], [90, 0, 0], [90, 90, 0]]}, False],
['inputs:vector', {'type': 'vectorf[3]', 'value': [0, 0, 1]}, False],
],
'outputs': [
['outputs:result', {'type': 'vectorf[3][]', 'value': [[1, 0, 0], [0, -1, 0], [0, -1, 0]]}, False],
],
},
{
'inputs': [
['inputs:rotation', {'type': 'vectord[3]', 'value': [90, 90, 0]}, False],
['inputs:vector', {'type': 'vectord[3][]', 'value': [[0, 0, 1], [0, 1, 0], [1, 0, 0]]}, False],
],
'outputs': [
['outputs:result', {'type': 'vectord[3][]', 'value': [[0, -1, 0], [1, 0, 0], [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_nodes_RotateVector", "omni.graph.nodes.RotateVector", test_run, test_info)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.nodes.RotateVector 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_nodes_RotateVector","omni.graph.nodes.RotateVector", test_run, test_info, 16)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.nodes.RotateVector User test case #{i+1}", 16)
async def test_thread_safety(self):
import omni.kit
# Generate multiple instances of the test setup to run them concurrently
instance_setup = dict()
for n in range(24):
instance_setup[f"/TestGraph_{n}"] = _TestGraphAndNode()
for i, test_run in enumerate(self.TEST_DATA):
await _test_clear_scene(self, test_run)
for (key, test_info) in instance_setup.items():
test_info = await _test_setup_scene(self, og.Controller(allow_exists_prim=True), key, "TestNode_omni_graph_nodes_RotateVector", "omni.graph.nodes.RotateVector", test_run, test_info)
self.assertEqual(len(og.get_all_graphs()), 24)
# We want to evaluate all graphs concurrently. Kick them all.
# Evaluate multiple times to skip 2 serial frames and increase chances for a race condition.
for _ in range(10):
await omni.kit.app.get_app().next_update_async()
for (key, test_instance) in instance_setup.items():
_test_verify_scene(self, og.Controller(), test_run, test_info, f"omni.graph.nodes.RotateVector User test case #{i+1}, instance{key}")
async def test_data_access(self):
from omni.graph.nodes.ogn.OgnRotateVectorDatabase import OgnRotateVectorDatabase
test_file_name = "OgnRotateVectorTemplate.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_nodes_RotateVector")
database = OgnRotateVectorDatabase(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"
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/TestOgnTransformVector.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:matrix', {'type': 'matrixd[4]', 'value': [1, 0, 0, 0, 0, 1, 0, 0, 10, 10, 1, 0, 50, 0, 0, 1]}, False],
['inputs:vector', {'type': 'vectord[3]', 'value': [1, 2, 3]}, False],
],
'outputs': [
['outputs:result', {'type': 'vectord[3]', 'value': [81, 32, 3]}, False],
],
},
{
'inputs': [
['inputs:matrix', {'type': 'matrixd[4][]', 'value': [[1, 0, 0, 0, 0, 1, 0, 0, 10, 10, 1, 0, 50, 0, 0, 1], [1, 0, 0, 0, 0, 1, 0, 0, 10, 10, 1, 0, 50, 0, 0, 1]]}, False],
['inputs:vector', {'type': 'vectorf[3][]', 'value': [[1, 2, 3], [1, 2, 3]]}, False],
],
'outputs': [
['outputs:result', {'type': 'vectorf[3][]', 'value': [[81, 32, 3], [81, 32, 3]]}, False],
],
},
{
'inputs': [
['inputs:matrix', {'type': 'matrixd[4]', 'value': [1, 0, 0, 0, 0, 1, 0, 0, 10, 10, 1, 0, 50, 0, 0, 1]}, False],
['inputs:vector', {'type': 'vectorf[3][]', 'value': [[1, 2, 3], [1, 2, 3]]}, False],
],
'outputs': [
['outputs:result', {'type': 'vectorf[3][]', 'value': [[81, 32, 3], [81, 32, 3]]}, False],
],
},
{
'inputs': [
['inputs:matrix', {'type': 'matrixd[4][]', 'value': [[1, 0, 0, 0, 0, 1, 0, 0, 10, 10, 1, 0, 50, 0, 0, 1], [1, 0, 0, 0, 0, 1, 0, 0, 10, 10, 1, 0, 50, 0, 0, 1]]}, False],
['inputs:vector', {'type': 'vectorf[3]', 'value': [1, 2, 3]}, False],
],
'outputs': [
['outputs:result', {'type': 'vectorf[3][]', 'value': [[81, 32, 3], [81, 32, 3]]}, 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_nodes_TransformVector", "omni.graph.nodes.TransformVector", test_run, test_info)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.nodes.TransformVector 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_nodes_TransformVector","omni.graph.nodes.TransformVector", test_run, test_info, 16)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.nodes.TransformVector User test case #{i+1}", 16)
async def test_thread_safety(self):
import omni.kit
# Generate multiple instances of the test setup to run them concurrently
instance_setup = dict()
for n in range(24):
instance_setup[f"/TestGraph_{n}"] = _TestGraphAndNode()
for i, test_run in enumerate(self.TEST_DATA):
await _test_clear_scene(self, test_run)
for (key, test_info) in instance_setup.items():
test_info = await _test_setup_scene(self, og.Controller(allow_exists_prim=True), key, "TestNode_omni_graph_nodes_TransformVector", "omni.graph.nodes.TransformVector", test_run, test_info)
self.assertEqual(len(og.get_all_graphs()), 24)
# We want to evaluate all graphs concurrently. Kick them all.
# Evaluate multiple times to skip 2 serial frames and increase chances for a race condition.
for _ in range(10):
await omni.kit.app.get_app().next_update_async()
for (key, test_instance) in instance_setup.items():
_test_verify_scene(self, og.Controller(), test_run, test_info, f"omni.graph.nodes.TransformVector User test case #{i+1}, instance{key}")
async def test_data_access(self):
from omni.graph.nodes.ogn.OgnTransformVectorDatabase import OgnTransformVectorDatabase
test_file_name = "OgnTransformVectorTemplate.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_nodes_TransformVector")
database = OgnTransformVectorDatabase(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"
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/TestOgnArrayRotate.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:array', {'type': 'int[]', 'value': [41, 42]}, False],
['inputs:steps', 0, False],
],
'outputs': [
['outputs:array', {'type': 'int[]', 'value': [41, 42]}, False],
],
},
{
'inputs': [
['inputs:array', {'type': 'int[]', 'value': [41, 42, 43]}, False],
['inputs:steps', 1, False],
],
'outputs': [
['outputs:array', {'type': 'int[]', 'value': [43, 41, 42]}, False],
],
},
{
'inputs': [
['inputs:array', {'type': 'float[2][]', 'value': [[1, 2], [3, 4], [5, 6]]}, False],
['inputs:steps', 1, False],
],
'outputs': [
['outputs:array', {'type': 'float[2][]', 'value': [[5, 6], [1, 2], [3, 4]]}, False],
],
},
{
'inputs': [
['inputs:array', {'type': 'int[]', 'value': [41, 42, 43]}, False],
['inputs:steps', -1, False],
],
'outputs': [
['outputs:array', {'type': 'int[]', 'value': [42, 43, 41]}, False],
],
},
{
'inputs': [
['inputs:array', {'type': 'bool[]', 'value': [True, False, True]}, False],
['inputs:steps', -1, False],
],
'outputs': [
['outputs:array', {'type': 'bool[]', 'value': [False, True, True]}, False],
],
},
{
'inputs': [
['inputs:array', {'type': 'int[]', 'value': [41, 42, 43]}, False],
['inputs:steps', -2, False],
],
'outputs': [
['outputs:array', {'type': 'int[]', 'value': [43, 41, 42]}, 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_nodes_ArrayRotate", "omni.graph.nodes.ArrayRotate", test_run, test_info)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.nodes.ArrayRotate 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_nodes_ArrayRotate","omni.graph.nodes.ArrayRotate", test_run, test_info, 16)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.nodes.ArrayRotate User test case #{i+1}", 16)
async def test_thread_safety(self):
import omni.kit
# Generate multiple instances of the test setup to run them concurrently
instance_setup = dict()
for n in range(24):
instance_setup[f"/TestGraph_{n}"] = _TestGraphAndNode()
for i, test_run in enumerate(self.TEST_DATA):
await _test_clear_scene(self, test_run)
for (key, test_info) in instance_setup.items():
test_info = await _test_setup_scene(self, og.Controller(allow_exists_prim=True), key, "TestNode_omni_graph_nodes_ArrayRotate", "omni.graph.nodes.ArrayRotate", test_run, test_info)
self.assertEqual(len(og.get_all_graphs()), 24)
# We want to evaluate all graphs concurrently. Kick them all.
# Evaluate multiple times to skip 2 serial frames and increase chances for a race condition.
for _ in range(10):
await omni.kit.app.get_app().next_update_async()
for (key, test_instance) in instance_setup.items():
_test_verify_scene(self, og.Controller(), test_run, test_info, f"omni.graph.nodes.ArrayRotate User test case #{i+1}, instance{key}")
async def test_data_access(self):
from omni.graph.nodes.ogn.OgnArrayRotateDatabase import OgnArrayRotateDatabase
test_file_name = "OgnArrayRotateTemplate.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_nodes_ArrayRotate")
database = OgnArrayRotateDatabase(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:steps"))
attribute = test_node.get_attribute("inputs:steps")
db_value = database.inputs.steps
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))
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/TestOgnArrayFill.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:array', {'type': 'int[]', 'value': [41, 42]}, False],
['inputs:fillValue', {'type': 'int', 'value': 0}, False],
],
'outputs': [
['outputs:array', {'type': 'int[]', 'value': [0, 0]}, False],
],
},
{
'inputs': [
['inputs:array', {'type': 'int[2][]', 'value': [[41, 42], [43, 44]]}, False],
['inputs:fillValue', {'type': 'int[2]', 'value': [1, 2]}, False],
],
'outputs': [
['outputs:array', {'type': 'int[2][]', 'value': [[1, 2], [1, 2]]}, False],
],
},
{
'inputs': [
['inputs:array', {'type': 'int64[]', 'value': [41, 42]}, False],
['inputs:fillValue', {'type': 'int64', 'value': 0}, False],
],
'outputs': [
['outputs:array', {'type': 'int64[]', 'value': [0, 0]}, False],
],
},
{
'inputs': [
['inputs:array', {'type': 'uchar[]', 'value': [41, 42]}, False],
['inputs:fillValue', {'type': 'uchar', 'value': 0}, False],
],
'outputs': [
['outputs:array', {'type': 'uchar[]', 'value': [0, 0]}, False],
],
},
{
'inputs': [
['inputs:array', {'type': 'uint[]', 'value': [41, 42]}, False],
['inputs:fillValue', {'type': 'uint', 'value': 0}, False],
],
'outputs': [
['outputs:array', {'type': 'uint[]', 'value': [0, 0]}, False],
],
},
{
'inputs': [
['inputs:array', {'type': 'uint64[]', 'value': [41, 42]}, False],
['inputs:fillValue', {'type': 'uint64', 'value': 0}, False],
],
'outputs': [
['outputs:array', {'type': 'uint64[]', 'value': [0, 0]}, False],
],
},
{
'inputs': [
['inputs:array', {'type': 'bool[]', 'value': [True, True]}, False],
['inputs:fillValue', {'type': 'bool', 'value': False}, False],
],
'outputs': [
['outputs:array', {'type': 'bool[]', 'value': [False, False]}, False],
],
},
{
'inputs': [
['inputs:array', {'type': 'token[]', 'value': ['41', '42']}, False],
['inputs:fillValue', {'type': 'token', 'value': ''}, False],
],
'outputs': [
['outputs:array', {'type': 'token[]', 'value': ['', '']}, False],
],
},
{
'inputs': [
['inputs:array', {'type': 'half[2][]', 'value': [[1.0, 2.0], [3.0, 4.0]]}, False],
['inputs:fillValue', {'type': 'half[2]', 'value': [5.0, 6.0]}, False],
],
'outputs': [
['outputs:array', {'type': 'half[2][]', 'value': [[5.0, 6.0], [5.0, 6.0]]}, False],
],
},
{
'inputs': [
['inputs:array', {'type': 'double[3][]', 'value': [[1.0, 2.0, 3.0], [3.0, 4.0, 5.0]]}, False],
['inputs:fillValue', {'type': 'double[3]', 'value': [5.0, 6.0, 7.0]}, False],
],
'outputs': [
['outputs:array', {'type': 'double[3][]', 'value': [[5.0, 6.0, 7.0], [5.0, 6.0, 7.0]]}, False],
],
},
{
'inputs': [
['inputs:array', {'type': 'int[4][]', 'value': [[1, 2, 3, 4], [3, 4, 5, 6]]}, False],
['inputs:fillValue', {'type': 'int[4]', 'value': [5, 6, 7, 8]}, False],
],
'outputs': [
['outputs:array', {'type': 'int[4][]', 'value': [[5, 6, 7, 8], [5, 6, 7, 8]]}, 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_nodes_ArrayFill", "omni.graph.nodes.ArrayFill", test_run, test_info)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.nodes.ArrayFill 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_nodes_ArrayFill","omni.graph.nodes.ArrayFill", test_run, test_info, 16)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.nodes.ArrayFill User test case #{i+1}", 16)
async def test_thread_safety(self):
import omni.kit
# Generate multiple instances of the test setup to run them concurrently
instance_setup = dict()
for n in range(24):
instance_setup[f"/TestGraph_{n}"] = _TestGraphAndNode()
for i, test_run in enumerate(self.TEST_DATA):
await _test_clear_scene(self, test_run)
for (key, test_info) in instance_setup.items():
test_info = await _test_setup_scene(self, og.Controller(allow_exists_prim=True), key, "TestNode_omni_graph_nodes_ArrayFill", "omni.graph.nodes.ArrayFill", test_run, test_info)
self.assertEqual(len(og.get_all_graphs()), 24)
# We want to evaluate all graphs concurrently. Kick them all.
# Evaluate multiple times to skip 2 serial frames and increase chances for a race condition.
for _ in range(10):
await omni.kit.app.get_app().next_update_async()
for (key, test_instance) in instance_setup.items():
_test_verify_scene(self, og.Controller(), test_run, test_info, f"omni.graph.nodes.ArrayFill User test case #{i+1}, instance{key}")
async def test_data_access(self):
from omni.graph.nodes.ogn.OgnArrayFillDatabase import OgnArrayFillDatabase
test_file_name = "OgnArrayFillTemplate.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_nodes_ArrayFill")
database = OgnArrayFillDatabase(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"
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/TestOgnArrayGetSize.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:array', {'type': 'int[]', 'value': [41, 42]}, False],
],
'outputs': [
['outputs:size', 2, False],
],
},
{
'inputs': [
['inputs:array', {'type': 'half[]', 'value': [41, 42]}, False],
],
'outputs': [
['outputs:size', 2, False],
],
},
{
'inputs': [
['inputs:array', {'type': 'token[]', 'value': []}, False],
],
'outputs': [
['outputs:size', 0, False],
],
},
{
'inputs': [
['inputs:array', {'type': 'int64[]', 'value': [41]}, False],
],
'outputs': [
['outputs:size', 1, False],
],
},
{
'inputs': [
['inputs:array', {'type': 'uchar[]', 'value': [41, 42]}, False],
],
'outputs': [
['outputs:size', 2, False],
],
},
{
'inputs': [
['inputs:array', {'type': 'uint[]', 'value': [41, 42]}, False],
],
'outputs': [
['outputs:size', 2, False],
],
},
{
'inputs': [
['inputs:array', {'type': 'uint64[]', 'value': [41, 42]}, False],
],
'outputs': [
['outputs:size', 2, False],
],
},
{
'inputs': [
['inputs:array', {'type': 'bool[]', 'value': [False, True]}, False],
],
'outputs': [
['outputs:size', 2, False],
],
},
{
'inputs': [
['inputs:array', {'type': 'half[2][]', 'value': [[41, 42], [43, 44]]}, False],
],
'outputs': [
['outputs:size', 2, False],
],
},
{
'inputs': [
['inputs:array', {'type': 'double[3][]', 'value': [[41, 42, 43], [43, 44, 56]]}, False],
],
'outputs': [
['outputs:size', 2, False],
],
},
{
'inputs': [
['inputs:array', {'type': 'int[4][]', 'value': [[1, 2, 3, 4], [3, 4, 5, 6]]}, False],
],
'outputs': [
['outputs:size', 2, 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_nodes_ArrayGetSize", "omni.graph.nodes.ArrayGetSize", test_run, test_info)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.nodes.ArrayGetSize 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_nodes_ArrayGetSize","omni.graph.nodes.ArrayGetSize", test_run, test_info, 16)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.nodes.ArrayGetSize User test case #{i+1}", 16)
async def test_thread_safety(self):
import omni.kit
# Generate multiple instances of the test setup to run them concurrently
instance_setup = dict()
for n in range(24):
instance_setup[f"/TestGraph_{n}"] = _TestGraphAndNode()
for i, test_run in enumerate(self.TEST_DATA):
await _test_clear_scene(self, test_run)
for (key, test_info) in instance_setup.items():
test_info = await _test_setup_scene(self, og.Controller(allow_exists_prim=True), key, "TestNode_omni_graph_nodes_ArrayGetSize", "omni.graph.nodes.ArrayGetSize", test_run, test_info)
self.assertEqual(len(og.get_all_graphs()), 24)
# We want to evaluate all graphs concurrently. Kick them all.
# Evaluate multiple times to skip 2 serial frames and increase chances for a race condition.
for _ in range(10):
await omni.kit.app.get_app().next_update_async()
for (key, test_instance) in instance_setup.items():
_test_verify_scene(self, og.Controller(), test_run, test_info, f"omni.graph.nodes.ArrayGetSize User test case #{i+1}, instance{key}")
async def test_data_access(self):
from omni.graph.nodes.ogn.OgnArrayGetSizeDatabase import OgnArrayGetSizeDatabase
test_file_name = "OgnArrayGetSizeTemplate.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_nodes_ArrayGetSize")
database = OgnArrayGetSizeDatabase(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:size"))
attribute = test_node.get_attribute("outputs:size")
db_value = database.outputs.size
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/TestOgnRenderPostprocessEntry.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.nodes.ogn.OgnRenderPostprocessEntryDatabase import OgnRenderPostprocessEntryDatabase
test_file_name = "OgnRenderPostprocessEntryTemplate.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_nodes_RenderPostProcessEntry")
database = OgnRenderPostprocessEntryDatabase(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:sourceName"))
attribute = test_node.get_attribute("inputs:sourceName")
db_value = database.inputs.sourceName
expected_value = "ldrColor"
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:cudaMipmappedArray"))
attribute = test_node.get_attribute("outputs:cudaMipmappedArray")
db_value = database.outputs.cudaMipmappedArray
self.assertTrue(test_node.get_attribute_exists("outputs:format"))
attribute = test_node.get_attribute("outputs:format")
db_value = database.outputs.format
self.assertTrue(test_node.get_attribute_exists("outputs:height"))
attribute = test_node.get_attribute("outputs:height")
db_value = database.outputs.height
self.assertTrue(test_node.get_attribute_exists("outputs:hydraTime"))
attribute = test_node.get_attribute("outputs:hydraTime")
db_value = database.outputs.hydraTime
self.assertTrue(test_node.get_attribute_exists("outputs:mipCount"))
attribute = test_node.get_attribute("outputs:mipCount")
db_value = database.outputs.mipCount
self.assertTrue(test_node.get_attribute_exists("outputs:simTime"))
attribute = test_node.get_attribute("outputs:simTime")
db_value = database.outputs.simTime
self.assertTrue(test_node.get_attribute_exists("outputs:stream"))
attribute = test_node.get_attribute("outputs:stream")
db_value = database.outputs.stream
self.assertTrue(test_node.get_attribute_exists("outputs:width"))
attribute = test_node.get_attribute("outputs:width")
db_value = database.outputs.width
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/TestOgnTimelineStart.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.nodes.ogn.OgnTimelineStartDatabase import OgnTimelineStartDatabase
test_file_name = "OgnTimelineStartTemplate.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_nodes_StartTimeline")
database = OgnTimelineStartDatabase(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:execIn"))
attribute = test_node.get_attribute("inputs:execIn")
db_value = database.inputs.execIn
self.assertTrue(test_node.get_attribute_exists("outputs:execOut"))
attribute = test_node.get_attribute("outputs:execOut")
db_value = database.outputs.execOut
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/TestOgnFloor.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:a', {'type': 'float', 'value': 4.1}, False],
],
'outputs': [
['outputs:result', 4, False],
],
},
{
'inputs': [
['inputs:a', {'type': 'half', 'value': -4.9}, False],
],
'outputs': [
['outputs:result', -5, False],
],
},
{
'inputs': [
['inputs:a', {'type': 'double[3]', 'value': [1.3, 2.4, -3.7]}, False],
],
'outputs': [
['outputs:result', [1, 2, -4], False],
],
},
{
'inputs': [
['inputs:a', {'type': 'double[]', 'value': [1.3, 2.4, -3.7, 4.5]}, False],
],
'outputs': [
['outputs:result', [1, 2, -4, 4], 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_nodes_Floor", "omni.graph.nodes.Floor", test_run, test_info)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.nodes.Floor 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_nodes_Floor","omni.graph.nodes.Floor", test_run, test_info, 16)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.nodes.Floor User test case #{i+1}", 16)
async def test_thread_safety(self):
import omni.kit
# Generate multiple instances of the test setup to run them concurrently
instance_setup = dict()
for n in range(24):
instance_setup[f"/TestGraph_{n}"] = _TestGraphAndNode()
for i, test_run in enumerate(self.TEST_DATA):
await _test_clear_scene(self, test_run)
for (key, test_info) in instance_setup.items():
test_info = await _test_setup_scene(self, og.Controller(allow_exists_prim=True), key, "TestNode_omni_graph_nodes_Floor", "omni.graph.nodes.Floor", test_run, test_info)
self.assertEqual(len(og.get_all_graphs()), 24)
# We want to evaluate all graphs concurrently. Kick them all.
# Evaluate multiple times to skip 2 serial frames and increase chances for a race condition.
for _ in range(10):
await omni.kit.app.get_app().next_update_async()
for (key, test_instance) in instance_setup.items():
_test_verify_scene(self, og.Controller(), test_run, test_info, f"omni.graph.nodes.Floor User test case #{i+1}, instance{key}")
async def test_data_access(self):
from omni.graph.nodes.ogn.OgnFloorDatabase import OgnFloorDatabase
test_file_name = "OgnFloorTemplate.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_nodes_Floor")
database = OgnFloorDatabase(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"
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/TestOgnGetPrimsAtPath.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.nodes.ogn.OgnGetPrimsAtPathDatabase import OgnGetPrimsAtPathDatabase
test_file_name = "OgnGetPrimsAtPathTemplate.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_nodes_GetPrimsAtPath")
database = OgnGetPrimsAtPathDatabase(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:prims"))
attribute = test_node.get_attribute("outputs:prims")
db_value = database.outputs.prims
self.assertTrue(test_node.get_attribute_exists("state:path"))
attribute = test_node.get_attribute("state:path")
db_value = database.state.path
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/TestOgnBundleConstructor.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.nodes.ogn.OgnBundleConstructorDatabase import OgnBundleConstructorDatabase
test_file_name = "OgnBundleConstructorTemplate.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_nodes_BundleConstructor")
database = OgnBundleConstructorDatabase(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_bundle"))
attribute = test_node.get_attribute("outputs_bundle")
db_value = database.outputs.bundle
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/TestOgnRpResourceExampleDeformer.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.nodes.ogn.OgnRpResourceExampleDeformerDatabase import OgnRpResourceExampleDeformerDatabase
test_file_name = "OgnRpResourceExampleDeformerTemplate.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_nodes_RpResourceExampleDeformer")
database = OgnRpResourceExampleDeformerDatabase(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:deformScale"))
attribute = test_node.get_attribute("inputs:deformScale")
db_value = database.inputs.deformScale
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("inputs:displacementAxis"))
attribute = test_node.get_attribute("inputs:displacementAxis")
db_value = database.inputs.displacementAxis
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:pointCountCollection"))
attribute = test_node.get_attribute("inputs:pointCountCollection")
db_value = database.inputs.pointCountCollection
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:positionScale"))
attribute = test_node.get_attribute("inputs:positionScale")
db_value = database.inputs.positionScale
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("inputs:primPathCollection"))
attribute = test_node.get_attribute("inputs:primPathCollection")
db_value = database.inputs.primPathCollection
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:resourcePointerCollection"))
attribute = test_node.get_attribute("inputs:resourcePointerCollection")
db_value = database.inputs.resourcePointerCollection
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:runDeformerKernel"))
attribute = test_node.get_attribute("inputs:runDeformerKernel")
db_value = database.inputs.runDeformerKernel
expected_value = True
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:stream"))
attribute = test_node.get_attribute("inputs:stream")
db_value = database.inputs.stream
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:timeScale"))
attribute = test_node.get_attribute("inputs:timeScale")
db_value = database.inputs.timeScale
expected_value = 0.01
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:verbose"))
attribute = test_node.get_attribute("inputs:verbose")
db_value = database.inputs.verbose
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("outputs:pointCountCollection"))
attribute = test_node.get_attribute("outputs:pointCountCollection")
db_value = database.outputs.pointCountCollection
self.assertTrue(test_node.get_attribute_exists("outputs:primPathCollection"))
attribute = test_node.get_attribute("outputs:primPathCollection")
db_value = database.outputs.primPathCollection
self.assertTrue(test_node.get_attribute_exists("outputs:reload"))
attribute = test_node.get_attribute("outputs:reload")
db_value = database.outputs.reload
self.assertTrue(test_node.get_attribute_exists("outputs:resourcePointerCollection"))
attribute = test_node.get_attribute("outputs:resourcePointerCollection")
db_value = database.outputs.resourcePointerCollection
self.assertTrue(test_node.get_attribute_exists("outputs:stream"))
attribute = test_node.get_attribute("outputs:stream")
db_value = database.outputs.stream
self.assertTrue(test_node.get_attribute_exists("state:sequenceCounter"))
attribute = test_node.get_attribute("state:sequenceCounter")
db_value = database.state.sequenceCounter
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/TestOgnAttrType.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.nodes.ogn.OgnAttrTypeDatabase import OgnAttrTypeDatabase
test_file_name = "OgnAttrTypeTemplate.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_nodes_AttributeType")
database = OgnAttrTypeDatabase(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:attrName"))
attribute = test_node.get_attribute("inputs:attrName")
db_value = database.inputs.attrName
expected_value = "input"
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:data"))
attribute = test_node.get_attribute("inputs:data")
db_value = database.inputs.data
self.assertTrue(test_node.get_attribute_exists("outputs:arrayDepth"))
attribute = test_node.get_attribute("outputs:arrayDepth")
db_value = database.outputs.arrayDepth
self.assertTrue(test_node.get_attribute_exists("outputs:baseType"))
attribute = test_node.get_attribute("outputs:baseType")
db_value = database.outputs.baseType
self.assertTrue(test_node.get_attribute_exists("outputs:componentCount"))
attribute = test_node.get_attribute("outputs:componentCount")
db_value = database.outputs.componentCount
self.assertTrue(test_node.get_attribute_exists("outputs:fullType"))
attribute = test_node.get_attribute("outputs:fullType")
db_value = database.outputs.fullType
self.assertTrue(test_node.get_attribute_exists("outputs:role"))
attribute = test_node.get_attribute("outputs:role")
db_value = database.outputs.role
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/TestOgnConstantHalf3.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.nodes.ogn.OgnConstantHalf3Database import OgnConstantHalf3Database
test_file_name = "OgnConstantHalf3Template.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_nodes_ConstantHalf3")
database = OgnConstantHalf3Database(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:value"))
attribute = test_node.get_attribute("inputs:value")
db_value = database.inputs.value
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))
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/TestOgnStopAllSound.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.nodes.ogn.OgnStopAllSoundDatabase import OgnStopAllSoundDatabase
test_file_name = "OgnStopAllSoundTemplate.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_nodes_StopAllSound")
database = OgnStopAllSoundDatabase(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:execIn"))
attribute = test_node.get_attribute("inputs:execIn")
db_value = database.inputs.execIn
self.assertTrue(test_node.get_attribute_exists("outputs:execOut"))
attribute = test_node.get_attribute("outputs:execOut")
db_value = database.outputs.execOut
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/TestOgnConstantColor3f.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.nodes.ogn.OgnConstantColor3fDatabase import OgnConstantColor3fDatabase
test_file_name = "OgnConstantColor3fTemplate.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_nodes_ConstantColor3f")
database = OgnConstantColor3fDatabase(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:value"))
attribute = test_node.get_attribute("inputs:value")
db_value = database.inputs.value
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))
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/TestOgnSetGatheredAttribute.py | import omni.kit.test
import omni.graph.core as og
import omni.graph.core.tests as ogts
import os
class TestOgn(ogts.OmniGraphTestCase):
async def test_data_access(self):
from omni.graph.nodes.ogn.OgnSetGatheredAttributeDatabase import OgnSetGatheredAttributeDatabase
test_file_name = "OgnSetGatheredAttributeTemplate.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_nodes_SetGatheredAttribute")
database = OgnSetGatheredAttributeDatabase(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:execIn"))
attribute = test_node.get_attribute("inputs:execIn")
db_value = database.inputs.execIn
self.assertTrue(test_node.get_attribute_exists("inputs:gatherId"))
attribute = test_node.get_attribute("inputs:gatherId")
db_value = database.inputs.gatherId
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:name"))
attribute = test_node.get_attribute("inputs:name")
db_value = database.inputs.name
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("outputs:execOut"))
attribute = test_node.get_attribute("outputs:execOut")
db_value = database.outputs.execOut
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/TestOgnGetVariantSetNames.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.nodes.ogn.OgnGetVariantSetNamesDatabase import OgnGetVariantSetNamesDatabase
test_file_name = "OgnGetVariantSetNamesTemplate.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_nodes_GetVariantSetNames")
database = OgnGetVariantSetNamesDatabase(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:prim"))
attribute = test_node.get_attribute("inputs:prim")
db_value = database.inputs.prim
self.assertTrue(test_node.get_attribute_exists("outputs:variantSetNames"))
attribute = test_node.get_attribute("outputs:variantSetNames")
db_value = database.outputs.variantSetNames
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/TestOgnConstantInt4.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.nodes.ogn.OgnConstantInt4Database import OgnConstantInt4Database
test_file_name = "OgnConstantInt4Template.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_nodes_ConstantInt4")
database = OgnConstantInt4Database(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:value"))
attribute = test_node.get_attribute("inputs:value")
db_value = database.inputs.value
expected_value = [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))
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/TestOgnAppendPath.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:path', {'type': 'token', 'value': '/'}, False],
['inputs:suffix', "foo", False],
],
'outputs': [
['outputs:path', {'type': 'token', 'value': '/foo'}, False],
],
},
{
'inputs': [
['inputs:path', {'type': 'token', 'value': '/World'}, False],
['inputs:suffix', "foo", False],
],
'outputs': [
['outputs:path', {'type': 'token', 'value': '/World/foo'}, False],
],
},
{
'inputs': [
['inputs:path', {'type': 'token', 'value': '/World'}, False],
['inputs:suffix', "foo/bar", False],
],
'outputs': [
['outputs:path', {'type': 'token', 'value': '/World/foo/bar'}, False],
],
},
{
'inputs': [
['inputs:path', {'type': 'token', 'value': '/World'}, False],
['inputs:suffix', "foo/bar.attrib", False],
],
'outputs': [
['outputs:path', {'type': 'token', 'value': '/World/foo/bar.attrib'}, False],
],
},
{
'inputs': [
['inputs:path', {'type': 'token[]', 'value': ['/World', '/World2']}, False],
['inputs:suffix', "foo", False],
],
'outputs': [
['outputs:path', {'type': 'token[]', 'value': ['/World/foo', '/World2/foo']}, 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_nodes_AppendPath", "omni.graph.nodes.AppendPath", test_run, test_info)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.nodes.AppendPath 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_nodes_AppendPath","omni.graph.nodes.AppendPath", test_run, test_info, 16)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.nodes.AppendPath User test case #{i+1}", 16)
async def test_thread_safety(self):
import omni.kit
# Generate multiple instances of the test setup to run them concurrently
instance_setup = dict()
for n in range(24):
instance_setup[f"/TestGraph_{n}"] = _TestGraphAndNode()
for i, test_run in enumerate(self.TEST_DATA):
await _test_clear_scene(self, test_run)
for (key, test_info) in instance_setup.items():
test_info = await _test_setup_scene(self, og.Controller(allow_exists_prim=True), key, "TestNode_omni_graph_nodes_AppendPath", "omni.graph.nodes.AppendPath", test_run, test_info)
self.assertEqual(len(og.get_all_graphs()), 24)
# We want to evaluate all graphs concurrently. Kick them all.
# Evaluate multiple times to skip 2 serial frames and increase chances for a race condition.
for _ in range(10):
await omni.kit.app.get_app().next_update_async()
for (key, test_instance) in instance_setup.items():
_test_verify_scene(self, og.Controller(), test_run, test_info, f"omni.graph.nodes.AppendPath User test case #{i+1}, instance{key}")
async def test_data_access(self):
from omni.graph.nodes.ogn.OgnAppendPathDatabase import OgnAppendPathDatabase
test_file_name = "OgnAppendPathTemplate.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_nodes_AppendPath")
database = OgnAppendPathDatabase(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:suffix"))
attribute = test_node.get_attribute("inputs:suffix")
db_value = database.inputs.suffix
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("state:path"))
attribute = test_node.get_attribute("state:path")
db_value = database.state.path
self.assertTrue(test_node.get_attribute_exists("state:suffix"))
attribute = test_node.get_attribute("state:suffix")
db_value = database.state.suffix
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/TestOgnAnyZero.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:value', {'type': 'int', 'value': 6}, False],
],
'outputs': [
['outputs:result', False, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'int', 'value': -3}, False],
],
'outputs': [
['outputs:result', False, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'int', 'value': 0}, False],
],
'outputs': [
['outputs:result', True, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'float', 'value': 42.5}, False],
],
'outputs': [
['outputs:result', False, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'float', 'value': -7.1}, False],
],
'outputs': [
['outputs:result', False, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'float', 'value': 0.0}, False],
],
'outputs': [
['outputs:result', True, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'float', 'value': 0.01}, False],
],
'outputs': [
['outputs:result', False, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'float', 'value': -0.01}, False],
],
'outputs': [
['outputs:result', False, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'float', 'value': 42.5}, False],
['inputs:tolerance', 0.1, False],
],
'outputs': [
['outputs:result', False, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'float', 'value': -7.1}, False],
['inputs:tolerance', 0.1, False],
],
'outputs': [
['outputs:result', False, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'float', 'value': 0.0}, False],
['inputs:tolerance', 0.1, False],
],
'outputs': [
['outputs:result', True, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'float', 'value': 0.01}, False],
['inputs:tolerance', 0.1, False],
],
'outputs': [
['outputs:result', True, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'float', 'value': -0.01}, False],
['inputs:tolerance', 0.1, False],
],
'outputs': [
['outputs:result', True, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'int', 'value': 6}, False],
['inputs:tolerance', 0.1, False],
],
'outputs': [
['outputs:result', False, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'int', 'value': -3}, False],
['inputs:tolerance', 0.1, False],
],
'outputs': [
['outputs:result', False, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'int', 'value': 0}, False],
['inputs:tolerance', 0.1, False],
],
'outputs': [
['outputs:result', True, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'int', 'value': 6}, False],
['inputs:tolerance', 10.0, False],
],
'outputs': [
['outputs:result', True, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'int', 'value': -3}, False],
['inputs:tolerance', 10.0, False],
],
'outputs': [
['outputs:result', True, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'int', 'value': 0}, False],
['inputs:tolerance', 10.0, False],
],
'outputs': [
['outputs:result', True, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'int[2]', 'value': [0, 0]}, False],
],
'outputs': [
['outputs:result', True, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'int[2]', 'value': [0, 3]}, False],
],
'outputs': [
['outputs:result', True, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'int[2]', 'value': [3, 0]}, False],
],
'outputs': [
['outputs:result', True, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'int[2]', 'value': [3, 5]}, False],
],
'outputs': [
['outputs:result', False, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'float[3]', 'value': [1.7, 0.05, -4.3]}, False],
['inputs:tolerance', 0.1, False],
],
'outputs': [
['outputs:result', True, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'float[3][]', 'value': [[1.7, 0.05, -4.3], [0.0, -0.1, 0.3]]}, False],
['inputs:tolerance', 0.1, False],
],
'outputs': [
['outputs:result', False, 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_nodes_AnyZero", "omni.graph.nodes.AnyZero", test_run, test_info)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.nodes.AnyZero 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_nodes_AnyZero","omni.graph.nodes.AnyZero", test_run, test_info, 16)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.nodes.AnyZero User test case #{i+1}", 16)
async def test_thread_safety(self):
import omni.kit
# Generate multiple instances of the test setup to run them concurrently
instance_setup = dict()
for n in range(24):
instance_setup[f"/TestGraph_{n}"] = _TestGraphAndNode()
for i, test_run in enumerate(self.TEST_DATA):
await _test_clear_scene(self, test_run)
for (key, test_info) in instance_setup.items():
test_info = await _test_setup_scene(self, og.Controller(allow_exists_prim=True), key, "TestNode_omni_graph_nodes_AnyZero", "omni.graph.nodes.AnyZero", test_run, test_info)
self.assertEqual(len(og.get_all_graphs()), 24)
# We want to evaluate all graphs concurrently. Kick them all.
# Evaluate multiple times to skip 2 serial frames and increase chances for a race condition.
for _ in range(10):
await omni.kit.app.get_app().next_update_async()
for (key, test_instance) in instance_setup.items():
_test_verify_scene(self, og.Controller(), test_run, test_info, f"omni.graph.nodes.AnyZero User test case #{i+1}, instance{key}")
async def test_data_access(self):
from omni.graph.nodes.ogn.OgnAnyZeroDatabase import OgnAnyZeroDatabase
test_file_name = "OgnAnyZeroTemplate.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_nodes_AnyZero")
database = OgnAnyZeroDatabase(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:tolerance"))
attribute = test_node.get_attribute("inputs:tolerance")
db_value = database.inputs.tolerance
expected_value = 0.0
actual_value = og.Controller.get(attribute)
ogts.verify_values(expected_value, actual_value, _attr_error(attribute, True))
ogts.verify_values(expected_value, db_value, _attr_error(attribute, False))
self.assertTrue(test_node.get_attribute_exists("outputs:result"))
attribute = test_node.get_attribute("outputs:result")
db_value = database.outputs.result
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/TestOgnRenderPreprocessEntry.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.nodes.ogn.OgnRenderPreprocessEntryDatabase import OgnRenderPreprocessEntryDatabase
test_file_name = "OgnRenderPreprocessEntryTemplate.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_nodes_RenderPreProcessEntry")
database = OgnRenderPreprocessEntryDatabase(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:hydraTime"))
attribute = test_node.get_attribute("outputs:hydraTime")
db_value = database.outputs.hydraTime
self.assertTrue(test_node.get_attribute_exists("outputs:simTime"))
attribute = test_node.get_attribute("outputs:simTime")
db_value = database.outputs.simTime
self.assertTrue(test_node.get_attribute_exists("outputs:stream"))
attribute = test_node.get_attribute("outputs:stream")
db_value = database.outputs.stream
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/TestOgnConstantColor4f.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.nodes.ogn.OgnConstantColor4fDatabase import OgnConstantColor4fDatabase
test_file_name = "OgnConstantColor4fTemplate.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_nodes_ConstantColor4f")
database = OgnConstantColor4fDatabase(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:value"))
attribute = test_node.get_attribute("inputs:value")
db_value = database.inputs.value
expected_value = [0.0, 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))
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/TestOgnRpResourceExampleHydra.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.nodes.ogn.OgnRpResourceExampleHydraDatabase import OgnRpResourceExampleHydraDatabase
test_file_name = "OgnRpResourceExampleHydraTemplate.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_nodes_RpResourceExampleHydra")
database = OgnRpResourceExampleHydraDatabase(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:pointCountCollection"))
attribute = test_node.get_attribute("inputs:pointCountCollection")
db_value = database.inputs.pointCountCollection
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:primPathCollection"))
attribute = test_node.get_attribute("inputs:primPathCollection")
db_value = database.inputs.primPathCollection
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:resourcePointerCollection"))
attribute = test_node.get_attribute("inputs:resourcePointerCollection")
db_value = database.inputs.resourcePointerCollection
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:sendToHydra"))
attribute = test_node.get_attribute("inputs:sendToHydra")
db_value = database.inputs.sendToHydra
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:verbose"))
attribute = test_node.get_attribute("inputs:verbose")
db_value = database.inputs.verbose
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("outputs:reload"))
attribute = test_node.get_attribute("outputs:reload")
db_value = database.outputs.reload
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/TestOgnConstantPoint3f.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.nodes.ogn.OgnConstantPoint3fDatabase import OgnConstantPoint3fDatabase
test_file_name = "OgnConstantPoint3fTemplate.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_nodes_ConstantPoint3f")
database = OgnConstantPoint3fDatabase(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:value"))
attribute = test_node.get_attribute("inputs:value")
db_value = database.inputs.value
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))
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/TestOgnAcos.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:value', {'type': 'float', 'value': 0.707107}, False],
],
'outputs': [
['outputs:value', {'type': 'float', 'value': 45.0}, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'double[]', 'value': [-0.5, -1.0]}, False],
],
'outputs': [
['outputs:value', {'type': 'double[]', 'value': [120, 180]}, 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_nodes_Acos", "omni.graph.nodes.Acos", test_run, test_info)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.nodes.Acos 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_nodes_Acos","omni.graph.nodes.Acos", test_run, test_info, 16)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.nodes.Acos User test case #{i+1}", 16)
async def test_thread_safety(self):
import omni.kit
# Generate multiple instances of the test setup to run them concurrently
instance_setup = dict()
for n in range(24):
instance_setup[f"/TestGraph_{n}"] = _TestGraphAndNode()
for i, test_run in enumerate(self.TEST_DATA):
await _test_clear_scene(self, test_run)
for (key, test_info) in instance_setup.items():
test_info = await _test_setup_scene(self, og.Controller(allow_exists_prim=True), key, "TestNode_omni_graph_nodes_Acos", "omni.graph.nodes.Acos", test_run, test_info)
self.assertEqual(len(og.get_all_graphs()), 24)
# We want to evaluate all graphs concurrently. Kick them all.
# Evaluate multiple times to skip 2 serial frames and increase chances for a race condition.
for _ in range(10):
await omni.kit.app.get_app().next_update_async()
for (key, test_instance) in instance_setup.items():
_test_verify_scene(self, og.Controller(), test_run, test_info, f"omni.graph.nodes.Acos User test case #{i+1}, instance{key}")
async def test_data_access(self):
from omni.graph.nodes.ogn.OgnAcosDatabase import OgnAcosDatabase
test_file_name = "OgnAcosTemplate.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_nodes_Acos")
database = OgnAcosDatabase(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"
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/TestOgnMoveToTransform.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.nodes.ogn.OgnMoveToTransformDatabase import OgnMoveToTransformDatabase
test_file_name = "OgnMoveToTransformTemplate.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_nodes_MoveToTransform")
database = OgnMoveToTransformDatabase(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:execIn"))
attribute = test_node.get_attribute("inputs:execIn")
db_value = database.inputs.execIn
self.assertTrue(test_node.get_attribute_exists("inputs:exponent"))
attribute = test_node.get_attribute("inputs:exponent")
db_value = database.inputs.exponent
expected_value = 2.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:speed"))
attribute = test_node.get_attribute("inputs:speed")
db_value = database.inputs.speed
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("inputs:stop"))
attribute = test_node.get_attribute("inputs:stop")
db_value = database.inputs.stop
self.assertTrue(test_node.get_attribute_exists("inputs:target"))
attribute = test_node.get_attribute("inputs:target")
db_value = database.inputs.target
expected_value = [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]]
actual_value = og.Controller.get(attribute)
ogts.verify_values(expected_value, actual_value, _attr_error(attribute, True))
ogts.verify_values(expected_value, db_value, _attr_error(attribute, False))
self.assertTrue(test_node.get_attribute_exists("inputs:usePath"))
attribute = test_node.get_attribute("inputs:usePath")
db_value = database.inputs.usePath
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("outputs:finished"))
attribute = test_node.get_attribute("outputs:finished")
db_value = database.outputs.finished
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/TestOgnIsZero.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:value', {'type': 'int', 'value': 6}, False],
],
'outputs': [
['outputs:result', False, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'int', 'value': -3}, False],
],
'outputs': [
['outputs:result', False, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'int', 'value': 0}, False],
],
'outputs': [
['outputs:result', True, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'float', 'value': 42.5}, False],
],
'outputs': [
['outputs:result', False, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'float', 'value': -7.1}, False],
],
'outputs': [
['outputs:result', False, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'float', 'value': 0.0}, False],
],
'outputs': [
['outputs:result', True, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'float', 'value': 0.01}, False],
],
'outputs': [
['outputs:result', False, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'float', 'value': -0.01}, False],
],
'outputs': [
['outputs:result', False, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'float', 'value': 42.5}, False],
['inputs:tolerance', 0.1, False],
],
'outputs': [
['outputs:result', False, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'float', 'value': -7.1}, False],
['inputs:tolerance', 0.1, False],
],
'outputs': [
['outputs:result', False, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'float', 'value': 0.0}, False],
['inputs:tolerance', 0.1, False],
],
'outputs': [
['outputs:result', True, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'float', 'value': 0.01}, False],
['inputs:tolerance', 0.1, False],
],
'outputs': [
['outputs:result', True, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'float', 'value': -0.01}, False],
['inputs:tolerance', 0.1, False],
],
'outputs': [
['outputs:result', True, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'int', 'value': 6}, False],
['inputs:tolerance', 0.1, False],
],
'outputs': [
['outputs:result', False, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'int', 'value': -3}, False],
['inputs:tolerance', 0.1, False],
],
'outputs': [
['outputs:result', False, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'int', 'value': 0}, False],
['inputs:tolerance', 0.1, False],
],
'outputs': [
['outputs:result', True, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'int', 'value': 6}, False],
['inputs:tolerance', 10.0, False],
],
'outputs': [
['outputs:result', True, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'int', 'value': -3}, False],
['inputs:tolerance', 10.0, False],
],
'outputs': [
['outputs:result', True, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'int', 'value': 0}, False],
['inputs:tolerance', 10.0, False],
],
'outputs': [
['outputs:result', True, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'int[2]', 'value': [0, 0]}, False],
],
'outputs': [
['outputs:result', True, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'int[2]', 'value': [0, 3]}, False],
],
'outputs': [
['outputs:result', False, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'int[2]', 'value': [3, 0]}, False],
],
'outputs': [
['outputs:result', False, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'int[2]', 'value': [3, 5]}, False],
],
'outputs': [
['outputs:result', False, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'float[3]', 'value': [1.7, 0.05, -4.3]}, False],
['inputs:tolerance', 0.1, False],
],
'outputs': [
['outputs:result', False, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'float[3]', 'value': [0.02, 0.05, -0.03]}, False],
['inputs:tolerance', 0.1, False],
],
'outputs': [
['outputs:result', True, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'float[3][]', 'value': [[1.7, 0.05, -4.3], [0.02, 0.05, -0.03]]}, False],
['inputs:tolerance', 0.1, False],
],
'outputs': [
['outputs:result', False, False],
],
},
{
'inputs': [
['inputs:value', {'type': 'float[3][]', 'value': [[0.0, 0.0, 0.0], [0.02, 0.05, -0.03]]}, False],
['inputs:tolerance', 0.1, False],
],
'outputs': [
['outputs:result', True, 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_nodes_IsZero", "omni.graph.nodes.IsZero", test_run, test_info)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.nodes.IsZero 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_nodes_IsZero","omni.graph.nodes.IsZero", test_run, test_info, 16)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.nodes.IsZero User test case #{i+1}", 16)
async def test_thread_safety(self):
import omni.kit
# Generate multiple instances of the test setup to run them concurrently
instance_setup = dict()
for n in range(24):
instance_setup[f"/TestGraph_{n}"] = _TestGraphAndNode()
for i, test_run in enumerate(self.TEST_DATA):
await _test_clear_scene(self, test_run)
for (key, test_info) in instance_setup.items():
test_info = await _test_setup_scene(self, og.Controller(allow_exists_prim=True), key, "TestNode_omni_graph_nodes_IsZero", "omni.graph.nodes.IsZero", test_run, test_info)
self.assertEqual(len(og.get_all_graphs()), 24)
# We want to evaluate all graphs concurrently. Kick them all.
# Evaluate multiple times to skip 2 serial frames and increase chances for a race condition.
for _ in range(10):
await omni.kit.app.get_app().next_update_async()
for (key, test_instance) in instance_setup.items():
_test_verify_scene(self, og.Controller(), test_run, test_info, f"omni.graph.nodes.IsZero User test case #{i+1}, instance{key}")
async def test_data_access(self):
from omni.graph.nodes.ogn.OgnIsZeroDatabase import OgnIsZeroDatabase
test_file_name = "OgnIsZeroTemplate.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_nodes_IsZero")
database = OgnIsZeroDatabase(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:tolerance"))
attribute = test_node.get_attribute("inputs:tolerance")
db_value = database.inputs.tolerance
expected_value = 0.0
actual_value = og.Controller.get(attribute)
ogts.verify_values(expected_value, actual_value, _attr_error(attribute, True))
ogts.verify_values(expected_value, db_value, _attr_error(attribute, False))
self.assertTrue(test_node.get_attribute_exists("outputs:result"))
attribute = test_node.get_attribute("outputs:result")
db_value = database.outputs.result
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/TestOgnReadSetting.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.nodes.ogn.OgnReadSettingDatabase import OgnReadSettingDatabase
test_file_name = "OgnReadSettingTemplate.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_nodes_ReadSetting")
database = OgnReadSettingDatabase(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:settingPath"))
attribute = test_node.get_attribute("inputs:settingPath")
db_value = database.inputs.settingPath
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))
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/TestOgnReadPrimBundle.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.nodes.ogn.OgnReadPrimBundleDatabase import OgnReadPrimBundleDatabase
test_file_name = "OgnReadPrimBundleTemplate.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_nodes_ReadPrimBundle")
database = OgnReadPrimBundleDatabase(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), 7)
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:attrNamesToImport"))
attribute = test_node.get_attribute("inputs:attrNamesToImport")
db_value = database.inputs.attrNamesToImport
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:computeBoundingBox"))
attribute = test_node.get_attribute("inputs:computeBoundingBox")
db_value = database.inputs.computeBoundingBox
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:usdTimecode"))
attribute = test_node.get_attribute("inputs:usdTimecode")
db_value = database.inputs.usdTimecode
expected_value = float("NaN")
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:usePath"))
attribute = test_node.get_attribute("inputs:usePath")
db_value = database.inputs.usePath
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("outputs_primBundle"))
attribute = test_node.get_attribute("outputs_primBundle")
db_value = database.outputs.primBundle
self.assertTrue(test_node.get_attribute_exists("state:attrNamesToImport"))
attribute = test_node.get_attribute("state:attrNamesToImport")
db_value = database.state.attrNamesToImport
self.assertTrue(test_node.get_attribute_exists("state:computeBoundingBox"))
attribute = test_node.get_attribute("state:computeBoundingBox")
db_value = database.state.computeBoundingBox
self.assertTrue(test_node.get_attribute_exists("state:primPath"))
attribute = test_node.get_attribute("state:primPath")
db_value = database.state.primPath
self.assertTrue(test_node.get_attribute_exists("state:usdTimecode"))
attribute = test_node.get_attribute("state:usdTimecode")
db_value = database.state.usdTimecode
self.assertTrue(test_node.get_attribute_exists("state:usePath"))
attribute = test_node.get_attribute("state:usePath")
db_value = database.state.usePath
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnRpResourceExampleDeformerTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnRpResourceExampleDeformer.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_RpResourceExampleDeformer" (
docs="""Allocate CUDA-interoperable RpResource"""
)
{
token node:type = "omni.graph.nodes.RpResourceExampleDeformer"
int node:typeVersion = 1
# 10 attributes
custom float inputs:deformScale = 1.0 (
docs="""Deformation control"""
)
custom int inputs:displacementAxis = 0 (
docs="""dimension in which mesh is translated"""
)
custom uint64[] inputs:pointCountCollection = [] (
docs="""Pointer to point counts collection"""
)
custom float inputs:positionScale = 1.0 (
docs="""Deformation control"""
)
custom token[] inputs:primPathCollection = [] (
docs="""Pointer to prim path collection"""
)
custom uint64[] inputs:resourcePointerCollection = [] (
docs="""Pointer to RpResource collection"""
)
custom bool inputs:runDeformerKernel = true (
docs="""Whether cuda kernel will be executed"""
)
custom uint64 inputs:stream = 0 (
docs="""Pointer to the CUDA Stream"""
)
custom float inputs:timeScale = 0.01 (
docs="""Deformation control"""
)
custom bool inputs:verbose = false (
docs="""verbose printing"""
)
# 5 attributes
custom uint64[] outputs:pointCountCollection (
docs="""Point count for each prim being deformed"""
)
custom token[] outputs:primPathCollection (
docs="""Path for each prim being deformed"""
)
custom bool outputs:reload = false (
docs="""Force RpResource reload"""
)
custom uint64[] outputs:resourcePointerCollection (
docs="""Pointers to RpResources
(two resources per prim are assumed -- one for rest positions and one for deformed positions)"""
)
custom uint64 outputs:stream (
docs="""Pointer to the CUDA Stream"""
)
# 1 attribute
custom uint64 state:sequenceCounter = 0 (
docs="""tick counter for animation"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnConstantQuatdTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnConstantQuatd.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_ConstantQuatd" (
docs="""Holds a double-precision quaternion constant: A real coefficient and three imaginary coefficients"""
)
{
token node:type = "omni.graph.nodes.ConstantQuatd"
int node:typeVersion = 1
# 1 attribute
custom quatd inputs:value = (0.0, 0.0, 0.0, 0.0) (
docs="""The constant value"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnEaseTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnEase.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_Ease" (
docs="""Easing function which iterpolates between a start and end value. Vectors are eased component-wise. The easing functions can be applied to decimal types. Linear: Interpolates between start and finish at a fixed rate. EaseIn: Starts slowly and ends fast according to an exponential, the slope is determined by the 'exponent' input. EaseOut: Same as EaseIn, but starts fast and ends slow EaseInOut: Combines EaseIn and EaseOut SinIn: Starts slowly and ends fast according to a sinusoidal curve SinOut: Same as SinIn, but starts fast and ends slow SinInOut: Combines SinIn and SinOut"""
)
{
token node:type = "omni.graph.nodes.Ease"
int node:typeVersion = 2
# 5 attributes
custom token inputs:alpha (
docs="""The normalized time (0 - 1.0). Values outside this range will be clamped"""
)
custom int inputs:blendExponent = 2 (
docs="""The blend exponent, which is the degree of the ease curve
(1 = linear, 2 = quadratic, 3 = cubic, etc).
This only applies to the Ease* functions"""
)
custom token inputs:easeFunc = "EaseInOut" (
docs="""The easing function to apply (EaseIn, EaseOut, EaseInOut, Linear, SinIn, SinOut, SinInOut)"""
)
custom token inputs:end (
docs="""The end value"""
)
custom token inputs:start (
docs="""The start value"""
)
# 1 attribute
custom token outputs:result (
docs="""The eased result of the function applied to value"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnToRadTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnToRad.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_ToRad" (
docs="""Convert degree input into radians"""
)
{
token node:type = "omni.graph.nodes.ToRad"
int node:typeVersion = 1
# 1 attribute
custom token inputs:degrees (
docs="""Angle value in degrees to be converted"""
)
# 1 attribute
custom token outputs:radians (
docs="""Angle value in radians"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnMakeTransformTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnMakeTransform.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_MakeTransform" (
docs="""Make a transformation matrix that performs a translation, rotation (in euler angles), and scale in that order"""
)
{
token node:type = "omni.graph.nodes.MakeTransform"
int node:typeVersion = 1
# 3 attributes
custom vector3d inputs:rotationXYZ = (0, 0, 0) (
docs="""The desired orientation in euler angles (XYZ)"""
)
custom vector3d inputs:scale = (1, 1, 1) (
docs="""The desired scaling factor about the X, Y, and Z axis respectively"""
)
custom vector3d inputs:translation = (0, 0, 0) (
docs="""the desired translation as a vector"""
)
# 1 attribute
custom matrix4d outputs:transform (
docs="""the resulting transformation matrix"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnModuloTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnModulo.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_Modulo" (
docs="""Computes the modulo of integer inputs (A % B), which is the remainder of A / B If B is zero, the result is zero. If A and B are both non-negative the result is non-negative, otherwise the sign of the result is undefined."""
)
{
token node:type = "omni.graph.nodes.Modulo"
int node:typeVersion = 1
# 2 attributes
custom token inputs:a (
docs="""The dividend of (A % B)"""
)
custom token inputs:b (
docs="""The divisor of (A % B)"""
)
# 1 attribute
custom token outputs:result (
docs="""Modulo (A % B), the remainder of A / B"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnWritePrimMaterialTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnWritePrimMaterial.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_WritePrimMaterial" (
docs="""Given a path to a prim and a path to a material on the current USD stage, assigns the material to the prim. Gives an error if the given prim or material can not be found."""
)
{
token node:type = "omni.graph.nodes.WritePrimMaterial"
int node:typeVersion = 1
# 3 attributes
custom uint inputs:execIn (
docs="""Input execution"""
)
custom string inputs:materialPath = "" (
docs="""The path of the material to be assigned to the prim"""
)
custom string inputs:primPath = "" (
docs="""Path of the prim to be assigned a material."""
)
# 1 attribute
custom uint outputs:execOut (
docs="""Output execution"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnConstantHalf3Template.usda | #usda 1.0
(
doc ="""Generated from node description file OgnConstantHalf3.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_ConstantHalf3" (
docs="""Holds a 3-component half-precision constant."""
)
{
token node:type = "omni.graph.nodes.ConstantHalf3"
int node:typeVersion = 1
# 1 attribute
custom half3 inputs:value = (0.0, 0.0, 0.0) (
docs="""The constant value"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnSubtractTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnSubtract.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_Subtract" (
docs="""Subtracts two values of any numeric type."""
)
{
token node:type = "omni.graph.nodes.Subtract"
int node:typeVersion = 1
# 2 attributes
custom token inputs:a (
docs="""The number B is subtracted from"""
)
custom token inputs:b (
docs="""The number to subtract from A"""
)
# 1 attribute
custom token outputs:difference (
docs="""Result of A-B"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnCurveTubeSTTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnCurveTubeST.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_CurveTubeST" (
docs="""Compute curve tube ST values"""
)
{
token node:type = "omni.graph.nodes.CurveTubeST"
int node:typeVersion = 1
# 8 attributes
custom int[] inputs:cols = [] (
docs="""Columns of the tubes"""
)
custom int[] inputs:curveVertexCounts = [] (
docs="""Vertex counts for the curve points"""
)
custom int[] inputs:curveVertexStarts = [] (
docs="""Vertex starting points"""
)
custom bool inputs:scaleTLikeS = false (
docs="""If true then scale T the same as S"""
)
custom float[] inputs:t = [] (
docs="""T values of the tubes"""
)
custom int[] inputs:tubeQuadStarts = [] (
docs="""Vertex index values for the tube quad starting points"""
)
custom int[] inputs:tubeSTStarts = [] (
docs="""Vertex index values for the tube ST starting points"""
)
custom float[] inputs:width = [] (
docs="""Width of tube positions, if scaling T like S"""
)
# 2 attributes
custom float2[] outputs:primvars:st (
docs="""Array of computed ST values"""
)
custom int[] outputs:primvars:st:indices (
docs="""Array of computed ST indices"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnReadKeyboardStateTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnReadKeyboardState.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_ReadKeyboardState" (
docs="""Reads the current state of the keyboard"""
)
{
token node:type = "omni.graph.nodes.ReadKeyboardState"
int node:typeVersion = 1
# 1 attribute
custom token inputs:key = "A" (
docs="""The key to check the state of"""
)
# 4 attributes
custom bool outputs:altOut (
docs="""True if Alt is held"""
)
custom bool outputs:ctrlOut (
docs="""True if Ctrl is held"""
)
custom bool outputs:isPressed (
docs="""True if the key is currently pressed, false otherwise"""
)
custom bool outputs:shiftOut (
docs="""True if Shift is held"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnAsinTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnAsin.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_Asin" (
docs="""Trigonometric operation arcsin of one input in degrees."""
)
{
token node:type = "omni.graph.nodes.Asin"
int node:typeVersion = 1
# 1 attribute
custom token inputs:value (
docs="""Angle value in degrees whose inverse sine is to be found"""
)
# 1 attribute
custom token outputs:value (
docs="""The arcsin value of the input angle in degrees"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnScaleToSizeTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnScaleToSize.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_ScaleToSize" (
docs="""Perform a smooth scaling maneuver, scaling a prim to a desired size tuple given a speed and easing factor"""
)
{
token node:type = "omni.graph.nodes.ScaleToSize"
int node:typeVersion = 1
# 8 attributes
custom uint inputs:execIn (
docs="""The input execution"""
)
custom float inputs:exponent = 2.0 (
docs="""The blend exponent, which is the degree of the ease curve
(1 = linear, 2 = quadratic, 3 = cubic, etc). """
)
custom rel inputs:prim (
docs="""The prim to be scaled"""
)
custom string inputs:primPath (
docs="""The source prim to be transformed, used when 'usePath' is true"""
)
custom double inputs:speed = 1.0 (
docs="""The peak speed of approach (Units / Second)"""
)
custom uint inputs:stop (
docs="""Stops the maneuver"""
)
custom vector3d inputs:target = (0.0, 0.0, 0.0) (
docs="""The desired local scale"""
)
custom bool inputs:usePath = false (
docs="""When true, the 'primPath' attribute is used, otherwise it will read the connection at the 'prim' attribute"""
)
# 1 attribute
custom uint outputs:finished (
docs="""The output execution, sent one the maneuver is completed"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnGetMatrix4RotationTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnGetMatrix4Rotation.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_GetMatrix4Rotation" (
docs="""Gets the rotation of the given matrix4d value which represents a linear transformation. Returns euler angles (XYZ)"""
)
{
token node:type = "omni.graph.nodes.GetMatrix4Rotation"
int node:typeVersion = 1
# 1 attribute
custom token inputs:matrix (
docs="""The transformation matrix"""
)
# 1 attribute
custom token outputs:rotation (
docs="""vector representing the rotation component of the transformation (XYZ)"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnConstantQuatfTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnConstantQuatf.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_ConstantQuatf" (
docs="""Holds a single-precision quaternion constant: A real coefficient and three imaginary coefficients."""
)
{
token node:type = "omni.graph.nodes.ConstantQuatf"
int node:typeVersion = 1
# 1 attribute
custom quatf inputs:value = (0.0, 0.0, 0.0, 0.0) (
docs="""The constant value"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnCompareTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnCompare.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_Compare" (
docs="""Outputs the truth value of a comparison operation. Tuples are compared in lexicographic order. If one input is an array and the other is a scaler, the scaler will be broadcast to the size of the array"""
)
{
token node:type = "omni.graph.nodes.Compare"
int node:typeVersion = 1
# 3 attributes
custom token inputs:a = "any" (
docs="""Input A"""
)
custom token inputs:b = "any" (
docs="""Input B"""
)
custom token inputs:operation = ">" (
docs="""The comparison operation to perform (>,<,>=,<=,==,!=))"""
)
# 1 attribute
custom token outputs:result (
docs="""The result of the comparison operation"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnWriteVariableTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnWriteVariable.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_core_WriteVariable" (
docs="""Node that writes a value to a variable"""
)
{
token node:type = "omni.graph.core.WriteVariable"
int node:typeVersion = 1
# 5 attributes
custom uint inputs:execIn (
docs="""Input execution state"""
)
custom rel inputs:graph (
docs="""Ignored. Do not use"""
)
custom token inputs:targetPath (
docs="""Ignored. Do not use."""
)
custom token inputs:value = "any" (
docs="""The new value to be written"""
)
custom token inputs:variableName = "" (
docs="""The name of the graph variable to use."""
)
# 2 attributes
custom uint outputs:execOut (
docs="""Output execution"""
)
custom token outputs:value = "any" (
docs="""The written variable value"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnBooleanExprTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnBooleanExpr.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_BooleanExpr" (
docs="""NOTE: DEPRECATED AS OF 1.26.0 IN FAVOUR OF INDIVIDAL BOOLEAN OP NODES Boolean operation on two inputs. The supported operations are:
AND, OR, NAND, NOR, XOR, XNOR"""
)
{
token node:type = "omni.graph.nodes.BooleanExpr"
int node:typeVersion = 1
# 3 attributes
custom bool inputs:a = false (
docs="""Input A"""
)
custom bool inputs:b = false (
docs="""Input B"""
)
custom token inputs:operator = "AND" (
docs="""The boolean operation to perform (AND, OR, NAND, NOR, XOR, XNOR))"""
)
# 1 attribute
custom bool outputs:result (
docs="""The result of the boolean expression"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnRotateVectorTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnRotateVector.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_RotateVector" (
docs="""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."""
)
{
token node:type = "omni.graph.nodes.RotateVector"
int node:typeVersion = 1
# 2 attributes
custom token inputs:rotation (
docs="""The rotation to be applied"""
)
custom token inputs:vector (
docs="""The row vector(s) to be rotated"""
)
# 1 attribute
custom token outputs:result (
docs="""The transformed row vector(s)"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnMultiplyTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnMultiply.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_Multiply" (
docs="""Computes the element-wise product of two inputs A and B (multiplication). If one input has a higher dimension than the other, then the input with lower dimension will be repeated to match the dimension of the other input (broadcasting). eg: scalar * tuple, tuple * array of tuples, scalar * array of tuples."""
)
{
token node:type = "omni.graph.nodes.Multiply"
int node:typeVersion = 1
# 2 attributes
custom token inputs:a (
docs="""First number to multiply"""
)
custom token inputs:b (
docs="""Second number to multiply"""
)
# 1 attribute
custom token outputs:product (
docs="""Product of the two numbers"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnReadPrimBundleTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnReadPrimBundle.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_ReadPrimBundle" (
docs="""Exposes the authored attributes for a single Prim on the USD stage as a bundle output on this node. When this node computes it will read the latest attribute values from the target Prim into the bundle attributes. It will also expose the world matrix if available under the attribute "worldMatrix". It can optionally compute the bounding box of the prim, and expose it under the following attributes: "bboxTransform", "bboxMinCorner", "bboxMaxCorner"."""
)
{
token node:type = "omni.graph.nodes.ReadPrimBundle"
int node:typeVersion = 1
# 6 attributes
custom bool inputs:computeBoundingBox = false (
docs="""Compute and store local bounding box of a prim and its children."""
)
custom bool inputs:forceUSDRead = false (
docs="""This flag forces to re-read from USD each time.
If set, the node will re-fetch the value from USD on each execution. Otherwise it will read from USD only once if the value is not yet in Fabric"""
)
custom rel inputs:prim (
docs="""The prim whose attributes are to be read"""
)
custom token inputs:primPath (
docs="""The path of the prim to be read when 'usePath' is true"""
)
custom timecode inputs:usdTimecode = -1 (
docs="""The time at which to evaluate the transform of the USD prim. A value of "-1" indicates that the default USD time stamp should be used"""
)
custom bool inputs:usePath = false (
docs="""When true, the 'primPath' attribute is used as the path to the prim being read, otherwise it will read the connection at the 'prim' attribute"""
)
# 1 attribute
def Output "outputs_primBundle" (
docs="""A bundle of the source Prim attributes.
In addition to the data attributes, there is a token attribute named sourcePrimPath
which contains the path of the Prim being read"""
)
{
}
# 2 attributes
custom uint64 state:target = 0 (
docs="""The path ID of the targeted prim last frame"""
)
custom timecode state:usdTimecode = -1 (
docs="""The time at which previous run has been evaluated"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnCopyAttrTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnCopyAttr.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_CopyAttribute" (
docs="""Copies all attributes from one input bundle and specified attributes from a second input bundle to the output bundle."""
)
{
token node:type = "omni.graph.nodes.CopyAttribute"
int node:typeVersion = 1
# 4 attributes
custom rel inputs:fullData (
docs="""Collection of attributes to fully copy to the output"""
)
custom token inputs:inputAttrNames = "" (
docs="""Comma or space separated text, listing the names of attributes to copy from partialData"""
)
custom token inputs:outputAttrNames = "" (
docs="""Comma or space separated text, listing the new names of attributes copied from partialData"""
)
custom rel inputs:partialData (
docs="""Collection of attributes from which to select named attributes"""
)
# 1 attribute
def Output "outputs_data" (
docs="""Collection of attributes consisting of all attributes from input 'fullData' and
selected inputs from input 'partialData'"""
)
{
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnGpuInteropRenderProductEntryTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnGpuInteropRenderProductEntry.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_GpuInteropRenderProductEntry" (
docs="""Entry node for post-processing hydra render results for a single view """
)
{
token node:type = "omni.graph.nodes.GpuInteropRenderProductEntry"
int node:typeVersion = 1
# 4 attributes
custom uint outputs:exec (
docs="""Trigger for scheduling dependencies"""
)
custom uint64 outputs:gpu (
docs="""Pointer to shared context containing gpu foundations"""
)
custom uint64 outputs:rp (
docs="""Pointer to render product for this view"""
)
custom uint64 outputs:swhFrameNumber (
docs="""Fabric frame number"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnATan2Template.usda | #usda 1.0
(
doc ="""Generated from node description file OgnATan2.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_ATan2" (
docs="""Outputs the arc tangent of a/b in degrees"""
)
{
token node:type = "omni.graph.nodes.ATan2"
int node:typeVersion = 1
# 2 attributes
custom token inputs:a (
docs="""Input A"""
)
custom token inputs:b (
docs="""Input B"""
)
# 1 attribute
custom token outputs:result (
docs="""The result of ATan2(A,B)"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnPartialSumTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnPartialSum.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_PartialSum" (
docs="""Compute the partial sums of the input integer array named 'array' and put the result in an output integer array named 'partialSum'. A partial sum is the sum of all of the elements up to but not including a certain point in an array, so output element 0 is always 0, element 1 is array[0], element 2 is array[0] + array[1], etc."""
)
{
token node:type = "omni.graph.nodes.PartialSum"
int node:typeVersion = 1
# 1 attribute
custom int[] inputs:array = [] (
docs="""List of integers whose partial sum is to be computed"""
)
# 1 attribute
custom int[] outputs:partialSum = [] (
docs="""Array whose nth value equals the nth partial sum of the input 'array'"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnNthRootTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnNthRoot.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_NthRoot" (
docs="""Computes the nth root of value. The result is the same type as the input value if the numerator is a decimal type. Otherwise the result is a double. If the input is a vector or matrix, then the node will calculate the square root of each element , and output a vector or matrix of the same size. Note that there are combinations of inputs that can result in a loss of precision due to different value ranges. Taking roots of a negative number will give a result of NaN except for cube root."""
)
{
token node:type = "omni.graph.nodes.NthRoot"
int node:typeVersion = 1
# 2 attributes
custom int inputs:nthRoot = 2 (
docs="""Take the nth root"""
)
custom token inputs:value (
docs="""The input value"""
)
# 1 attribute
custom token outputs:result (
docs="""Result of square root"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnReadOmniGraphValueTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnReadOmniGraphValue.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_ReadOmniGraphValue" (
docs="""Imports a data value from the Fabric cache that is located at the given path and attribute name. This is for data that is not already present in OmniGraph as that data can be accessed through a direct connection to the underlying OmniGraph node."""
)
{
token node:type = "omni.graph.nodes.ReadOmniGraphValue"
int node:typeVersion = 1
# 2 attributes
custom token inputs:name = "" (
docs="""The name of the attribute to be queried"""
)
custom string inputs:path = "" (
docs="""The path to the Fabric data bucket in which the attribute being queried lives."""
)
# 1 attribute
custom token outputs:value = "any" (
docs="""The attribute value"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnNormalizeTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnNormalize.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_Normalize" (
docs="""Normalize the input vector. If the input vector has a magnitude of zero, the null vector is returned."""
)
{
token node:type = "omni.graph.nodes.Normalize"
int node:typeVersion = 1
# 1 attribute
custom token inputs:vector (
docs="""Vector to normalize"""
)
# 1 attribute
custom token outputs:result (
docs="""Normalized vector"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnArrayGetSizeTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnArrayGetSize.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_ArrayGetSize" (
docs="""Returns the number of elements in an array"""
)
{
token node:type = "omni.graph.nodes.ArrayGetSize"
int node:typeVersion = 1
# 1 attribute
custom token inputs:array (
docs="""The array in question"""
)
# 1 attribute
custom int outputs:size (
docs="""The size of the array"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnIsPrimActiveTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnIsPrimActive.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_IsPrimActive" (
docs="""Query if a Prim is active or not in the stage."""
)
{
token node:type = "omni.graph.nodes.IsPrimActive"
int node:typeVersion = 1
# 1 attribute
custom string inputs:prim = "" (
docs="""The prim to be queried"""
)
# 1 attribute
custom bool outputs:active (
docs="""Whether the prim is active or not"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnArrayFillTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnArrayFill.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_ArrayFill" (
docs="""Creates a copy of the input array, filled with the given value"""
)
{
token node:type = "omni.graph.nodes.ArrayFill"
int node:typeVersion = 1
# 2 attributes
custom token inputs:array (
docs="""The array to be modified"""
)
custom token inputs:fillValue (
docs="""The value to be repeated in the new array"""
)
# 1 attribute
custom token outputs:array (
docs="""The modified array"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnReadTimeTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnReadTime.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_ReadTime" (
docs="""Holds the values related to the current global time and the timeline"""
)
{
token node:type = "omni.graph.nodes.ReadTime"
int node:typeVersion = 1
# 6 attributes
custom double outputs:absoluteSimTime (
docs="""The accumulated total of elapsed times between rendered frames"""
)
custom double outputs:deltaSeconds (
docs="""The number of seconds elapsed since the last OmniGraph update"""
)
custom double outputs:frame (
docs="""The global animation time in frames, equivalent to (time * fps), during playback"""
)
custom bool outputs:isPlaying (
docs="""True during global animation timeline playback"""
)
custom double outputs:time (
docs="""The global animation time in seconds during playback"""
)
custom double outputs:timeSinceStart (
docs="""Elapsed time since the App started"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnReadPrimMaterialTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnReadPrimMaterial.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_ReadPrimMaterial" (
docs="""Given a path to a prim on the current USD stage, outputs the material of the prim. Gives an error if the given prim can not be found."""
)
{
token node:type = "omni.graph.nodes.ReadPrimMaterial"
int node:typeVersion = 1
# 1 attribute
custom string inputs:primPath = "" (
docs="""Path of the prim with the material to be read."""
)
# 1 attribute
custom string outputs:material (
docs="""The material of the inputed prim"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnToDegTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnToDeg.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_ToDeg" (
docs="""Convert radian input into degrees"""
)
{
token node:type = "omni.graph.nodes.ToDeg"
int node:typeVersion = 1
# 1 attribute
custom token inputs:radians (
docs="""Angle value in radians to be converted"""
)
# 1 attribute
custom token outputs:degrees (
docs="""Angle value in degrees"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnConstantTexCoord2hTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnConstantTexCoord2h.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_ConstantTexCoord2h" (
docs="""Holds a 2D uv texture coordinate."""
)
{
token node:type = "omni.graph.nodes.ConstantTexCoord2h"
int node:typeVersion = 1
# 1 attribute
custom texCoord2h inputs:value = (0.0, 0.0) (
docs="""The constant value"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnGetGatheredAttributeTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnGetGatheredAttribute.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_GetGatheredAttribute" (
docs="""Copies gathered scaler/vector attribute values from the Gather buckets into an array attribute PROTOTYPE DO NOT USE, Requires GatherPrototype"""
)
{
token node:type = "omni.graph.nodes.GetGatheredAttribute"
int node:typeVersion = 1
# 2 attributes
custom uint64 inputs:gatherId = 0 (
docs="""The GatherId of the Gather containing the attribute values"""
)
custom token inputs:name = "" (
docs="""The name of the gathered attribute to join"""
)
# 1 attribute
custom token outputs:value = "any" (
docs="""The gathered attribute values as an array"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnMakeVector4Template.usda | #usda 1.0
(
doc ="""Generated from node description file OgnMakeVector4.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_MakeVector4" (
docs="""Merge 4 input values into a single output vector. If the inputs are arrays, the output will be an array of vectors."""
)
{
token node:type = "omni.graph.nodes.MakeVector4"
int node:typeVersion = 1
# 4 attributes
custom token inputs:w (
docs="""The fourth component of the vector"""
)
custom token inputs:x (
docs="""The first component of the vector"""
)
custom token inputs:y (
docs="""The second component of the vector"""
)
custom token inputs:z (
docs="""The third component of the vector"""
)
# 1 attribute
custom token outputs:tuple (
docs="""Output 4-vector"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnGetPrimLocalToWorldTransformTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnGetPrimLocalToWorldTransform.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_GetPrimLocalToWorldTransform" (
docs="""Given a path to a prim on the current USD stage, return the the transformation matrix. that transforms a vector from the local frame to the global frame """
)
{
token node:type = "omni.graph.nodes.GetPrimLocalToWorldTransform"
int node:typeVersion = 1
# 3 attributes
custom rel inputs:prim (
docs="""The prim used as the local coordinate system when 'usePath' is false"""
)
custom token inputs:primPath = "" (
docs="""The path of the prim used as the local coordinate system when 'usePath' is true"""
)
custom bool inputs:usePath = true (
docs="""When true, the 'primPath' attribute is used as the path to the prim being read, otherwise it will read the connection at the 'prim' attribute"""
)
# 1 attribute
custom matrix4d outputs:localToWorldTransform (
docs="""the local to world transformation matrix for the prim"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnToDoubleTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnToDouble.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_ToDouble" (
docs="""Converts the given input to 64 bit double. The node will attempt to convert array and tuple inputs to doubles of the same shape"""
)
{
token node:type = "omni.graph.nodes.ToDouble"
int node:typeVersion = 1
# 1 attribute
custom token inputs:value (
docs="""The numeric value to convert to double"""
)
# 1 attribute
custom token outputs:converted (
docs="""Output double-based value"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnEventUpdateTickTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnEventUpdateTick.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_UpdateTickEvent" (
docs="""Triggers on update ticks."""
)
{
token node:type = "omni.graph.nodes.UpdateTickEvent"
int node:typeVersion = 1
# 1 attribute
custom uint64 outputs:event (
docs="""Currently incomplete - always 0. Eventually should use a bundle for this."""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnGatherByPathTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnGatherByPath.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_GatherByPath" (
docs="""Node to vectorize data by paths passed in via input. PROTOTYPE DO NOT USE. Requires GatherPrototype"""
)
{
token node:type = "omni.graph.nodes.GatherByPath"
int node:typeVersion = 1
# 7 attributes
custom bool inputs:allAttributes = true (
docs="""When true, all USD attributes will be gathered. Otherwise those specified by 'attributes' will be gathered."""
)
custom string inputs:attributes = "" (
docs="""A space-separated list of attribute names to be gathered when allAttributes is false"""
)
custom bool inputs:checkResyncAttributes = false (
docs="""When true, the data vectorization will be updated when new attributes to the Prims are added."""
)
custom bool inputs:forceExportToHistory = false (
docs="""When true, all USD gathered paths will be tagged for being exported to the history."""
)
custom token inputs:hydraFastPath = "Disabled" (
docs="""When not 'Disabled', will extract USD Geometry transforms into Hydra fast-path attributes.
'World' will add _worldPosition, _worldOrientation. 'Local' will add _localMatrix."""
)
custom token[] inputs:primPaths = [] (
docs="""A list of Prim paths whose data should be vectorized"""
)
custom bool inputs:shouldWriteBack = false (
docs="""Write the data back into USD if true."""
)
# 2 attributes
custom uint64 outputs:gatherId (
docs="""The GatherId corresponding to this Gather, kInvalidGatherId if the Gather failed"""
)
custom token[] outputs:gatheredPaths (
docs="""The list of gathered prim paths in gathered-order"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnConstantHalf2Template.usda | #usda 1.0
(
doc ="""Generated from node description file OgnConstantHalf2.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_ConstantHalf2" (
docs="""Holds a 2-component half constant."""
)
{
token node:type = "omni.graph.nodes.ConstantHalf2"
int node:typeVersion = 1
# 1 attribute
custom half2 inputs:value = (0.0, 0.0) (
docs="""The constant value"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnReadGamepadStateTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnReadGamepadState.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_ReadGamepadState" (
docs="""Reads the current state of the gamepad"""
)
{
token node:type = "omni.graph.nodes.ReadGamepadState"
int node:typeVersion = 1
# 3 attributes
custom float inputs:deadzone = 0.1 (
docs="""Threshold from [0, 1] that the value must pass for it to be registered as input"""
)
custom token inputs:gamepadElement = "Left Stick X Axis" (
docs="""The gamepad element to check the state of"""
)
custom uint inputs:gamepadId = 0 (
docs="""Gamepad id number starting from 0"""
)
# 2 attributes
custom bool outputs:isPressed (
docs="""True if the gamepad element is currently pressed, false otherwise"""
)
custom float outputs:value (
docs="""Value of how much the gamepad element is being pressed. [0, 1] for buttons [-1, 1] for stick and trigger"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnSetMatrix4QuaternionTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnSetMatrix4Quaternion.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_SetMatrix4Quaternion" (
docs="""Sets the rotation of the given matrix4d value which represents a linear transformation. Does not modify the translation (row 3) of the matrix."""
)
{
token node:type = "omni.graph.nodes.SetMatrix4Quaternion"
int node:typeVersion = 1
# 2 attributes
custom token inputs:matrix (
docs="""The matrix to be modified"""
)
custom token inputs:quaternion (
docs="""The quaternion the matrix will apply about the given rotationAxis."""
)
# 1 attribute
custom token outputs:matrix (
docs="""The updated matrix"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnBundleConstructorTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnBundleConstructor.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_BundleConstructor" (
docs="""This node creates a bundle mirroring all of the dynamic input attributes that have been added to it. If no dynamic attributes exist then the bundle will be empty. See the 'InsertAttribute' node for something that can construct a bundle from existing connected attributes."""
)
{
token node:type = "omni.graph.nodes.BundleConstructor"
int node:typeVersion = 1
# 1 attribute
def Output "outputs_bundle" (
docs="""The bundle consisting of copies of all of the dynamic input attributes."""
)
{
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnGetMatrix4TranslationTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnGetMatrix4Translation.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_GetMatrix4Translation" (
docs="""Gets the translation of the given matrix4d value which represents a linear transformation. Returns a vector3"""
)
{
token node:type = "omni.graph.nodes.GetMatrix4Translation"
int node:typeVersion = 1
# 1 attribute
custom token inputs:matrix (
docs="""The matrix to be modified"""
)
# 1 attribute
custom token outputs:translation (
docs="""The translation from the transformation matrix"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnConstantTexCoord3hTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnConstantTexCoord3h.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_ConstantTexCoord3h" (
docs="""Holds a 3D uvw texture coordinate."""
)
{
token node:type = "omni.graph.nodes.ConstantTexCoord3h"
int node:typeVersion = 1
# 1 attribute
custom texCoord3h inputs:value = (0.0, 0.0, 0.0) (
docs="""The constant value"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnConstantDouble4Template.usda | #usda 1.0
(
doc ="""Generated from node description file OgnConstantDouble4.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_ConstantDouble4" (
docs="""Holds a 4-component double constant."""
)
{
token node:type = "omni.graph.nodes.ConstantDouble4"
int node:typeVersion = 1
# 1 attribute
custom double4 inputs:value = (0.0, 0.0, 0.0, 0.0) (
docs="""The constant value"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnBreakVector4Template.usda | #usda 1.0
(
doc ="""Generated from node description file OgnBreakVector4.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_BreakVector4" (
docs="""Split vector into 4 component values."""
)
{
token node:type = "omni.graph.nodes.BreakVector4"
int node:typeVersion = 1
# 1 attribute
custom token inputs:tuple (
docs="""4-vector to be broken"""
)
# 4 attributes
custom token outputs:w (
docs="""The fourth component of the vector"""
)
custom token outputs:x (
docs="""The first component of the vector"""
)
custom token outputs:y (
docs="""The second component of the vector"""
)
custom token outputs:z (
docs="""The third component of the vector"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnGetPrimRelationshipTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnGetPrimRelationship.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_GetPrimRelationship" (
docs="""Outputs the paths of the prims associated with a relationship property,"""
)
{
token node:type = "omni.graph.nodes.GetPrimRelationship"
int node:typeVersion = 1
# 2 attributes
custom token inputs:name = "" (
docs="""Name of the relationship property"""
)
custom token inputs:path = "" (
docs="""Path of the prim with the relationship property"""
)
# 1 attribute
custom token[] outputs:paths (
docs="""The prim paths for the given relationship"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnRenderPreprocessEntryTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnRenderPreprocessEntry.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_RenderPreProcessEntry" (
docs="""Entry point for RTX Renderer Preprocessing"""
)
{
token node:type = "omni.graph.nodes.RenderPreProcessEntry"
int node:typeVersion = 1
# 3 attributes
custom double outputs:hydraTime (
docs="""Hydra time in stage"""
)
custom double outputs:simTime (
docs="""Simulation time"""
)
custom uint64 outputs:stream (
docs="""Pointer to the CUDA Stream"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnAtanTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnAtan.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_Atan" (
docs="""Trigonometric operation arctangent of one input in degrees."""
)
{
token node:type = "omni.graph.nodes.Atan"
int node:typeVersion = 1
# 1 attribute
custom token inputs:value (
docs="""Angle value in degrees whose inverse tan is to be found"""
)
# 1 attribute
custom token outputs:value (
docs="""The atan value of the input angle in degrees"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnNoiseTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnNoise.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_Noise" (
docs="""Sample values from a Perlin noise field.
The noise field for any given seed is static: the same input position will always give the same result. This is useful in many areas, such as texturing and animation, where repeatability is essential. If you want a result that varies then you will need to vary either the position or the seed. For example, connecting the 'frame' output of an OnTick node to position will provide a noise result which varies from frame to frame. Perlin noise is locally smooth, meaning that small changes in the sample position will produce small changes in the resulting noise. Varying the seed value will produce a more chaotic result.
Another characteristic of Perlin noise is that it is zero at the corners of each cell in the field. In practical terms this means that integral positions, such as 5.0 in a one-dimensional field or (3.0, -1.0) in a two-dimensional field, will return a result of 0.0. Thus, if the source of your sample positions provides only integral values then all of your results will be zero. To avoid this try offsetting your position values by a fractional amount, such as 0.5."""
)
{
token node:type = "omni.graph.nodes.Noise"
int node:typeVersion = 1
# 2 attributes
custom token inputs:position (
docs="""Position(s) within the noise field to be sampled. For a given seed, the same position
will always return the same noise value."""
)
custom uint inputs:seed = 0 (
docs="""Seed for generating the noise field."""
)
# 1 attribute
custom token outputs:result (
docs="""Value at the selected position(s) in the noise field."""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnArraySetIndexTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnArraySetIndex.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_ArraySetIndex" (
docs="""Sets an element of an array. If the given index is negative it will be an offset from the end of the array."""
)
{
token node:type = "omni.graph.nodes.ArraySetIndex"
int node:typeVersion = 1
# 4 attributes
custom token inputs:array (
docs="""The array to be modified"""
)
custom int inputs:index = 0 (
docs="""The index into the array, a negative value indexes from the end of the array"""
)
custom bool inputs:resizeToFit = false (
docs="""When true, and the given positive index is larger than the highest index in the array
resize the output array to length 1 + index, and fill the new spaces with zeros"""
)
custom token inputs:value (
docs="""The value to set at the given index"""
)
# 1 attribute
custom token outputs:array (
docs="""The modified array"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnNoOpTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnNoOp.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_Noop" (
docs="""Empty node used only as a placeholder"""
)
{
token node:type = "omni.graph.nodes.Noop"
int node:typeVersion = 1
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnRpResourceExampleHydraTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnRpResourceExampleHydra.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_RpResourceExampleHydra" (
docs="""Send RpResource to Hydra"""
)
{
token node:type = "omni.graph.nodes.RpResourceExampleHydra"
int node:typeVersion = 1
# 5 attributes
custom uint64[] inputs:pointCountCollection = [] (
docs="""Point count for each prim being deformed"""
)
custom token[] inputs:primPathCollection = [] (
docs="""Path for each prim being deformed"""
)
custom uint64[] inputs:resourcePointerCollection = [] (
docs="""Pointers to RpResources
(two resources per prim are assumed -- one for rest positions and one for deformed positions)"""
)
custom bool inputs:sendToHydra = false (
docs="""Send rpresource pointer to hydra using the specified prim path"""
)
custom bool inputs:verbose = false (
docs="""verbose printing"""
)
# 1 attribute
custom bool outputs:reload = false (
docs="""Force RpResource reload"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnNotTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnNot.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_BooleanNot" (
docs="""Inverts a bool or bool array"""
)
{
token node:type = "omni.graph.nodes.BooleanNot"
int node:typeVersion = 1
# 1 attribute
custom token inputs:valueIn (
docs="""bool or bool array to invert"""
)
# 1 attribute
custom token outputs:valueOut (
docs="""inverted bool or bool array"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnFindPrimsTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnFindPrims.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_FindPrims" (
docs="""Finds Prims on the stage which match the given criteria"""
)
{
token node:type = "omni.graph.nodes.FindPrims"
int node:typeVersion = 1
# 7 attributes
custom token inputs:namePrefix = "" (
docs="""Only prims with a name starting with the given prefix will be returned."""
)
custom bool inputs:recursive = false (
docs="""False means only consider children of the root prim, True means all prims in the hierarchy"""
)
custom string inputs:requiredAttributes = "" (
docs="""A space-separated list of attribute names that are required to be present on matched prims"""
)
custom token inputs:requiredRelationship = "" (
docs="""The name of a relationship which must have a target specified by requiredRelationshipTarget"""
)
custom string inputs:requiredRelationshipTarget = "" (
docs="""The path that must be a target of the requiredRelationship"""
)
custom token inputs:rootPrimPath = "" (
docs="""Only children of the given prim will be considered. Empty will search the whole stage"""
)
custom token inputs:type = "" (
docs="""The type name of the prims to get, Empty means match any type"""
)
# 1 attribute
custom token[] outputs:primPaths (
docs="""A list of Prim paths which match the given type"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnEndsWithTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnEndsWith.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_EndsWith" (
docs="""Determines if a string ends with a given string value"""
)
{
token node:type = "omni.graph.nodes.EndsWith"
int node:typeVersion = 1
# 2 attributes
custom string inputs:suffix = "" (
docs="""The suffix to test"""
)
custom string inputs:value = "" (
docs="""The string to check"""
)
# 1 attribute
custom bool outputs:isSuffix (
docs="""True if 'value' ends with 'suffix'"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnClampTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnClamp.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_Clamp" (
docs="""Clamp a number or array of numbers to a specified range. If an array of numbers is provided as the input and lower/upper are scalers Then each input numeric will be clamped to the range [lower, upper] If all inputs are arrays, clamping will be done element-wise. lower & upper are broadcast against input Error will be reported if lower > upper."""
)
{
token node:type = "omni.graph.nodes.Clamp"
int node:typeVersion = 1
# 3 attributes
custom token inputs:input (
docs="""The input numerics to clamp"""
)
custom token inputs:lower (
docs="""Lower bound of the clamp"""
)
custom token inputs:upper (
docs="""Upper bound of the clamp"""
)
# 1 attribute
custom token outputs:result (
docs="""The resulting clamped output"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnSourceIndicesTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnSourceIndices.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_SourceIndices" (
docs="""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"""
)
{
token node:type = "omni.graph.nodes.SourceIndices"
int node:typeVersion = 1
# 1 attribute
custom int[] inputs:sourceStartsInTarget = [] (
docs="""List of index values encoding the increments for the output array values"""
)
# 1 attribute
custom int[] outputs:sourceIndices = [] (
docs="""Decoded list of index values as described by the node algorithm"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnConstantInt64Template.usda | #usda 1.0
(
doc ="""Generated from node description file OgnConstantInt64.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_ConstantInt64" (
docs="""Holds a 64 bit signed integer constant value"""
)
{
token node:type = "omni.graph.nodes.ConstantInt64"
int node:typeVersion = 1
# 1 attribute
custom int64 inputs:value = 0 (
docs="""The constant value"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnSinTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnSin.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_Sin" (
docs="""Trigonometric operation sine of one input in degrees."""
)
{
token node:type = "omni.graph.nodes.Sin"
int node:typeVersion = 1
# 1 attribute
custom token inputs:value (
docs="""Angle in degrees whose sine value is to be found"""
)
# 1 attribute
custom token outputs:value (
docs="""The sine value of the input angle"""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnReadPrimTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnReadPrim.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_ReadPrim" (
docs="""Exposes readable attributes for a single Prim on the USD stage as outputs on this node. When this node computes it will read the latest attribute values from the target Prim into these node attributes"""
)
{
token node:type = "omni.graph.nodes.ReadPrim"
int node:typeVersion = 1
# 2 attributes
custom bool inputs:forceUSDRead = false (
docs="""This flag forces to re-read from USD each time.
If set, the node will be re-fetch the value from USD on each execution, else it will read from USD only once, if the value is not in Fabric yet"""
)
custom rel inputs:prim (
docs="""The prim to be read from"""
)
# 1 attribute
def Output "outputs_primBundle" (
docs="""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"""
)
{
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnAttrTypeTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnAttrType.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_AttributeType" (
docs="""Queries information about the type of a specified attribute in an input bundle"""
)
{
token node:type = "omni.graph.nodes.AttributeType"
int node:typeVersion = 1
# 2 attributes
custom token inputs:attrName = "input" (
docs="""The name of the attribute to be queried"""
)
custom rel inputs:data (
docs="""Bundle of attributes to examine"""
)
# 5 attributes
custom int outputs:arrayDepth (
docs="""Zero for a single value, one for an array, two for an array of arrays.
Set to -1 if the named attribute was not in the bundle."""
)
custom int outputs:baseType (
docs="""An integer representing the type of the individual components.
Set to -1 if the named attribute was not in the bundle."""
)
custom int outputs:componentCount (
docs="""Number of components in each tuple, e.g. one for float, three for point3f, 16 for
matrix4d. Set to -1 if the named attribute was not in the bundle."""
)
custom int outputs:fullType (
docs="""A single int representing the full type information.
Set to -1 if the named attribute was not in the bundle."""
)
custom int outputs:role (
docs="""An integer representing semantic meaning of the type, e.g. point3f vs. normal3f vs. vector3f vs. float3.
Set to -1 if the named attribute was not in the bundle."""
)
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnExtractBundleTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnExtractBundle.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_ExtractBundle" (
docs="""Exposes readable attributes for a bundle as outputs on this node. When this node computes it will read the latest attribute values from the target bundle into these node attributes"""
)
{
token node:type = "omni.graph.nodes.ExtractBundle"
int node:typeVersion = 1
# 1 attribute
custom rel inputs:bundle (
docs="""The bundle to be read from"""
)
# 1 attribute
def Output "outputs_passThrough" (
docs="""The input bundle passed as-is"""
)
{
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/tests/usd/OgnAppendStringTemplate.usda | #usda 1.0
(
doc ="""Generated from node description file OgnAppendString.ogn
Contains templates for node types found in that file."""
)
def OmniGraph "TestGraph"
{
token evaluator:type = "push"
int2 fileFormatVersion = (1, 3)
token flatCacheBacking = "Shared"
token pipelineStage = "pipelineStageSimulation"
def OmniGraphNode "Template_omni_graph_nodes_AppendString" (
docs="""Creates a new token or string by appending the given token or string. token[] inputs will be appended element-wise."""
)
{
token node:type = "omni.graph.nodes.AppendString"
int node:typeVersion = 1
# 2 attributes
custom token inputs:suffix (
docs="""The string to be appended"""
)
custom token inputs:value (
docs="""The string(s) to be appended to"""
)
# 1 attribute
custom token outputs:value (
docs="""The new string(s)"""
)
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.