TP_Particle format ?



  • 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:

    hi,

    i have got the folloing code :

    def PPrimEmit(Num) :
        pid = tp.AllocParticles(Num)
        for id in pid:
            tp.SetVelocity(id,c4d.Vector(0,0,100))
        return 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 ?
    _
    _

    _
    _



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    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.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 16/02/2012 at 07:40, xxxxxxxx wrote:

    hi,

    thanks for your reply, helped me a lot :)


Log in to reply