I created an Octane file with lua script. And I need to import a orbx file into current graph as 'node graph', and then use a scatter node to link it.
But the error is happened in the scatter node connected to the orbx node graph. and the error info is 'bad argument #2 to 'connectTo' (octane.node expected, got nil)'
And my question is how to fix this script and make it work?
Thanks.
Below is the scripts:
---import the orbx file into current graph.
mm=octane.nodegraph.createRootGraph("BLDG")
octane.nodegraph.importFromFile(mm, "z:\\lib\\Model_orbx\\BLDG\\BLDG_5400_4500_LR.orbx")
octane.project.getSceneGraph():copyFromGraph(mm,{})
octane.nodegraph.destroy(mm)
---create a scatter node and connect to the orbx-imported node graph.
BLDGScatterNode=octane.node.create{
name="BLDG";
type=octane.NT_GEO_SCATTER;
position={-1019.26,28};
}
BLDGScatterNode:connectTo(octane.P_GEOMETRY,BLDG);
BLDGScatterNode:setAttribute("scaleUnitType",4);
transforms =
{
{
{ 1,0,-0,0 },
{ 0,1,-0,0 },
{-0,-0,1,-0 }
},
}
BLDGScatterNode:setAttribute(octane.A_TRANSFORMS,transforms);
BLDGScatterNode:setAttribute("inherit",true);