Hi,
I’d like to know how to read the points attribute of a mesh type object using OmniGraph, and how to check the node’s output to verify the points’ positions are properly read by it?
For more information on my case, the mesh type object is imported from a usd file using:
prim_path_sensor_asm_rotated = "/World/sensor_asm_rotated"
usd_prim_sensor_asm_rotated = stage_utils.add_reference_to_stage(usd_path="/.../usd_assets/sensor_asm_rotated.usd",
prim_path=prim_path_sensor_asm_rotated)
Which I’m unsure if I should be using og.GraphController.expose_prim node to pass the mesh points’ positions to other OmniGraph Nodes.
The imported object should have a valid mesh because the print message did show …, (0.035023678, 0.006584438, 0.01376495), (0.035023008, 0.0065625263, 0.013764963)] from:
mesh_sensor_asm_rotated = prims_utils.get_prim_at_path(prim_path=f"{prim_path_sensor_asm_rotated}/sensor_asm_rotated")
mesh_value = mesh_sensor_asm_rotated.GetAttribute("points").Get()
print(mesh_value)
The omni.graph.nodes.ReadPrimAttribute node and a print statement are then created:
og_controller = og.Controller(
#omitted for brevity
)
graph_controller = og.GraphController(
#omitted for brevity
)
action_graph_path = "/World/WarpActionGraph"
graph = graph_controller.create_graph(action_graph_path)
graph.create_node(
path=f"{action_graph_path}/ReadPrimAttribute",
node_type="omni.graph.nodes.ReadPrimAttribute",
use_usd=True
)
og_controller.set(
attribute=f"{action_graph_path}/ReadPrimAttribute.inputs:prim",
value=f"{prim_path_sensor_asm_rotated}/sensor_asm_rotated"
)
og_controller.set(
attribute=f"{action_graph_path}/ReadPrimAttribute.inputs:name",
value="points"
)
points_value = og_controller.attribute("outputs:value", f"{action_graph_path}/ReadPrimAttribute")
print(f"Read points value: {og.DataView.get(attribute=points_value)}")
The terminal returned Read points value: [] which I’m confused as to why the mesh points’ positions weren’t read. I’m sure this is the problem because passing on the outputs:value information to a calculation node turned the output to a list of nothing.