APEX Make Template Graph in Component Script?

   224   2   1
User Avatar
Member
11 posts
Joined: 6月 2022
オフライン
Hi! Does anyone know how to define a function in APEX Script, and then tell a component script to create a graph::Template node containing that function in the graph it’s modifying? I need to plug a compiled graph into a SimEngine node in the rig. OR does anyone know how to modify the internal subnet of a graph::Template after it’s created?

The SideFX website has an example of “Invoking a graph” with script which only creates a graph::Template node containing a function IN the component script. I’d like the component script to create this node in the actual rig.
User Avatar
スタッフ
124 posts
Joined: 5月 2021
オフライン
def myTest(a: Int, b: Int):
    a += 1
    a += b
    return a

templ  = graph.addNode('templ', 'graph::Template')
templ.setSubnetContents(myTest)

here you go
User Avatar
Member
11 posts
Joined: 6月 2022
オフライン
Ahh got it. I can just set the internal subnet with a function call. Vey helpful, thank you so much!
  • Quick Links