Polygon velocity inheritance


Is there any way to inherit polygon’s velocity to the particles when emitting from the surface? Thx.


You can take the objects velocity and additionaly calculate the distance the point moves due to rotation of the object, however, this will only work for rotations around the object axis. If the object is controlled by Dynamics you can use the angular velocity to get the real value.
In both cases you need to do a bit of vector mathmatics to calculate the difference vector for the point and hence the velocity.


So I need polygon’s current and previous position to calculate local movement, also polygon may be streched and etc… Pretty complicated.
There is motion pass in Cinema and I hoped there is built-in possibility. So sad


what exactly do you want to achieve?
do you mean like subframe emission within TP?
or simple motion inheritance?
could you specify your task?



I need to emit particles from moving polygons with speed inheretance. You know if character is moving his arms and legs moves fast and they change direction of movement while body moves constantly and with smooth direction change.
So I want to emit particles from speedy polygons and inherit its speed


i would prefer python on this, something like this (just paste it into a python
tag on your polygonobject).

import c4d
from c4d import utils as u

class CacheStruct():
    def __init__(self):
        self.Points = []
cache     = CacheStruct()

def main():
    obj = op.GetObject().GetDeformCache()
    if isinstance(obj, c4d.PointObject):
        curpoints = obj.GetAllPoints()
        if len(cache.Points) > 0 :
            for i in xrange(len(curpoints)):
                pid = tp.AllocParticle()
                tp.SetPosition(pid, curpoints[i])
                tp.SetVelocity(pid, (curpoints[i] - cache.Points[i]).GetNormalized() * 100)
        cache.Points = curpoints

it is just a rough sketch, it emits particles form an point object vertices and sets
their velocity to the vertex velocity. i used vertices, because i did not want to
bloat the code with polygon handling, there is also missing a meaningful mapping
of the vertex velocity to particle data (min/max speed, min/max pcount, …)
general idea should be clear. just cache the velocity by yourself.


How to force to update polygon selection every time? Material displaying and particles emits from an initial state, while real polygon selection is changed every frame.


Wow Ferdinand, that’s really nice. Never used python before
I see just one issue — that’s should be rendered frame by frame from first frame? Farm will produce surprizing results :slight_smile:


as i said there is no mapping/clamping, the code does not clip a speed of zero,this is the
reson for funny first frame and some of the unexpected emissions. it is a fun topic maybe
i’ll write an enhanced version when i come home.


Not sure why you turned David’s VertexMaptoPolySelection Tag into a Node.
You could continuously update the Enable Port of the Tag with an Iteration from 0 to 1.



As I know coffee tag executes just once. Coffee node recalculating every time.

Thank you, that’s really helped! Nice :slight_smile:


This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.