I have a custom node that takes multiple meshes stored in one array attribute.
Meshes are added trough the for loop in python.
The problem is that compute() function is called each time when new mesh is added, which is absolutely redundant operation. I am interesting in computation only when all meshes have been added. Is there a way to call compute() only when for loop ends ?
for x in range(10):
cmds.connectAttr("pSphereShape1.outMesh", ("testNode1.inMeshe[%i]" % (x)))
There are several options for that, but it’s depends how is your compute methods works. If input and ouput mesh attributes are binded together you can check: if ouput is connected - do compute(). That means you have to disconnect output connection before populating inputs.