Adding tools to a Merge3D Node via a script?
Posted: Tue Jan 21, 2020 7:41 pm
In a Lua script, how do I programatically add a new 3D tool I just instantiated to a Merge3D node? Ultimately, I want to create a whole bunch of nodes and after creating it, add it to a Merge3D node as an input. However, I on;y see how to add a tool to a Merge3D node if you know which input you want to attach it to -- not if you're calculating that input dynamically. There's a FindMainInput method where you can query inputs; I was hoping for something like a SetMainInput method that would set them...?
I want to do something like this:
mym = comp:AddTool("Merge3D")
cnt=1
for i=-5,5,1
do
myt = comp:AddTool("Text3D")
myt.StyledText = string.format("%10d", math.random()*10000000000)
mym.SetMainInput(cnt, myt) // <== this is what I don't know how to do...
cnt = cnt + 1
end
Any ideas on how to do this? Help would be much appreciated!
I want to do something like this:
mym = comp:AddTool("Merge3D")
cnt=1
for i=-5,5,1
do
myt = comp:AddTool("Text3D")
myt.StyledText = string.format("%10d", math.random()*10000000000)
mym.SetMainInput(cnt, myt) // <== this is what I don't know how to do...
cnt = cnt + 1
end
Any ideas on how to do this? Help would be much appreciated!