On 30/05/2013 at 13:03, xxxxxxxx wrote:
Originally posted by xxxxxxxx
Thanks for the help LD, that did stop the error. However it only returns the value of the last number in the iteration. Trying to get it to set either a value of 1 or 0 to every object per frame. I tried messing with it to make it work but no luck. I have it working with without the python node, but thought code would be much easier/cleaner way to do it. Guess i'll just do without the py node for now, but thanks anyway.
I am not sure if I do understand correctly what you are trying to do, but Xpresso does neither
support arrays nor can scripting nodes (coffee / python) work as an iterator on its own. There
are three ways to work your way around that.
1. Make your python node compute a step in a loop. As an example xpresso setup for your
object problem (you just need an iterator node, in that case the object list node) :
|--- Loop called n times per pass -------------------------------->
ObjectListNode.instance >> input0.PythonNode.result >> result.SomeNode
in the same xpresso setup /group :
|--- Only called once per pass -------------->
SomeNode.out >> in.SomeNode.out >> in.SomeNode
2. You can also use a link port to cheat your way around the no array restriction of xpresso.
simply pass a linkable object derived from BaseList2D which does allow you store data in
a array like fashion. A PointObject (spline, PolygonObject) is a good candidate for that.
3. Simply keep everything inside the python node and do not use output ports. Or in other
words do all the computing inside the python node.