Hi @omers - It seems like the script is not able to find the attribute for the input1 of the velocity_command_duplicator node. This error could be caused by the node not being created properly before trying to set its input values.
To fix this issue, you can try splitting the creation and setting of values into two separate calls to the og.Controller.edit() method. Here’s the modified script:
Hi @omers - Can you try this other script? if it doesn’t work then I will bring this issue to the Omnigraph experts.
import omni.graph.core as og
keys = og.Controller.Keys
og.Controller.edit(
{"graph_path": "/nakai_container/MovementGraph", "evaluator_name": "execution"},
{
keys.CREATE_NODES: [
("velocity_command_duplicator", "omni.graph.nodes.ConstructArray"),
],
keys.SET_VALUES: [
("velocity_command_duplicator.inputs:arraySize", 4),
("velocity_command_duplicator.inputs:arrayType", "double[]"),
("velocity_command_duplicator.inputs:input0", 1),
]
},
)
# Create a separate node or function to set the values of the other array elements
for i in range(1, 4):
og.Controller.edit(
{"graph_path": "/nakai_container/MovementGraph", "evaluator_name": "execution"},
{
keys.SET_VALUES: [
(f"velocity_command_duplicator.inputs:input{i}", i + 1),
]
},
)
I am also experiencing the same issue. When creating a MakeArray omnigraph node using a Python script, the inputs value is not being added, and the problem was not resolved even when I used the suggested method. I would like to know if there is another way.