# Polygon velocity inheritance

#1

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

#2

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.

#3

Thanks.
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

#4

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

fuat

#5

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

#6

i would prefer python on this, something like this (just paste it into a python

``````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.

#7

https://dl.dropbox.com/u/17197754/speed%20weight.c4d
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.

#8

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

#9

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.

#10

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.

d

#11

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

Thank you, that’s really helped! Nice

#12

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.