THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 15/02/2012 at 03:29, xxxxxxxx wrote:
i have got the folloing code :
def PPrimEmit(Num) :
pid = tp.AllocParticles(Num)
for id in pid:
pid is passed to a TP Particle(TP Particle) output port in the python node which
is plugged into PGroup node TP Particle(TP Particle) port. the console returns :
TypeError: could not convert 'list'
so my question is - in which way is TP Particle expecting the particle steam if
not in an int of particle ids ?
On 15/02/2012 at 06:50, xxxxxxxx wrote:
Hi, TP_MasterSystem.AllocParticles returns a list and the port just accepts one particle ID per trigger action. C.O.F.F.E.E. and Python nodes cannot be iterators like the "TP Storm" node but there is another way how to solve this.
Create an iterator ("XPresso->Iterator->Iteration") and connect the outport with an integer port of the Python node called e.g. 'id'. This small setup works like a normal 'TP Storm' node.
P.S. If you want to create all particles at frame 0, just create them in the global scope and store the list somewhere so you can access it in the main function.
On 16/02/2012 at 07:40, xxxxxxxx wrote:
thanks for your reply, helped me a lot