Parenting particles to a specific part of an object

   14567   16   1
User Avatar
Member
330 posts
Joined: July 2005
Offline
Hello,

I am having trouble parenting a particle system to a specific part of a main object. A picture says a thousand words, so I attached a .hip

You can see the main object is a digital asset with 2 controls (turret rotate, and body rotate). I want the particle system to follow the tube on the turret no matter where it goes.

In the actual scene, I used a channel reference to bind the particle's rotate to the turrent xform node rotate. Also, the wiring up at object level makes the particles translate with the main object.

This wasn't a complete solution unfortunately - if the main object rotates, or deforms, the particles don't follow the object at all.

I see a lot of suggestion for the pivot sop, but that seems to work at object level - i want to parent the particle to part of an object - the tube sticking out of the turret.

The requirement seems basic enough. The question is how?

Thanks for reading

Mark

Attachments:
particle_turret.hipnc (75.4 KB)

User Avatar
Member
330 posts
Joined: July 2005
Offline
I might have got myself a bit tangled up, let me explain.

The particle system was originally inside the digital asset, merged into the geometry at the appropriate place. Easy!

I had to move it out into a separate object because assigning the material at object level was essential to getting it to render correctly. Applying a constant shader to the particles any other way (material or shader SOP) gave strange looking renders.

So I guess the other question might be how do i shade the particle system so i can put it back into my digital asset.

Not sure of the recommended workflow.

I just hope someone understands me
User Avatar
Member
9374 posts
Joined: July 2007
Online
you probably don't want to parent it, it would transform all particles according to parent object as if all particles was one solid object with animation inside

just parent emitter, then take it into particle object via object merge

example

Attachments:
particle_turret_fix.hipnc (80.9 KB)

Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
330 posts
Joined: July 2005
Offline
Tomas, that is exactly what I wanted to achieve. I am still getting my head around what you've done.

Thank you!

Mark
Edited by - March 17, 2011 06:16:28
User Avatar
Member
330 posts
Joined: July 2005
Offline
Ok let me see if I understand

1. The group SOP sets a variable (emitter) that references a part of the SOP chain. (the ‘hook’)

2. the object merge, between the emitter group and a null at the end of the SOP chain, applies any transformations through the SOP chain onto the group (clever).

3. finally use the merged geometry as the input to the popnet, so the particles are emitted from it.

Thanks again!
User Avatar
Member
330 posts
Joined: July 2005
Offline
Just one question; curious why the facet SOP?

User Avatar
Member
9374 posts
Joined: July 2007
Online
facet SOP just generates normal (N) attribute for emitter
if emitter contains N or v attribute, source POP can use it as initial direction/speed for emitted particles when you are inheriting emitters velocity
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
330 posts
Joined: July 2005
Offline
I wonder whether you mind one more question … so close!

How can I apply velocity to the particles so the force is always along the axis of the emitter normal?

Previously I just set Velocity(x) in the Source SOP Attributes to the desired value. Somehow the particles were forced out the correct way relative to the turret rotation. Now this forces the particles along the x axis, no matter how the turret is rotated.

I can think of one approach; to build expressions in the Velocity(x) and (y) channels to calculate the force on each, depending on the rotation of the turret. Is there a more elegant way?

I appreciate your help, Tomas, thanks.

User Avatar
Member
9374 posts
Joined: July 2007
Online
in file I posted it's done the way you want
my previous post is about it, but maybe not clear

the facet SOP created normal (N) for the emitter, and since all transform sop are transforming normals too it's pointing to the right direction

now the only thing you need to do is increase Inherit Velocity parameter in Source POP to give particles initial velocity along normal N (or velocity ‘v’ attribute if present)

you can set mode to Add To Inherited velocity to add some global velocity variance to inherited one

in the file I posted is all set, just increase Inherit parameter and Variance if you want
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
330 posts
Joined: July 2005
Offline
Thanks Tomas. I will experiment some more with it.

Have a great weekend!

Mark
User Avatar
Member
330 posts
Joined: July 2005
Offline
btw it was not your explanation that was lacking but my understanding this new method totally changed my particle system, which is fine because its the correct way of doing it, i just need to make it look good again
User Avatar
Member
349 posts
Joined: Aug. 2006
Offline
This does'nt really work in your case, but once the normal attribute is created you can use an attribcreate sop and create the attribute “N” (which was already created by the facetsop), and modify that value. E.g: $NX * 2, $NY * 2, $NZ * 2, and using inherit velocity in a popnet will still use those values. Enabling point normals display can help as it gives you a visual giude as to how much force will occur without cooking the popnet.

Does'nt really help in animated emission areas like a turret, but can come in handy.

Also can be done in the normal attrib in a pointsop instead of a attribcreate.
User Avatar
Member
330 posts
Joined: July 2005
Offline
hi Ragupasta, you must have known what I have been doing for much of the weekend

Thanks, I learnt another new concept and have applied an Attribcreate SOP with settings (Group: Emitter, Name: N, Class: Point, Type: Vector) to bring the normal variables into the POPnet.

I missed what turns out to be a crucial step in the sample file I attached here. In the actual scene, I had the (source POP) Velocity at 15,0,0 and variance at 14,2,2. The high variance in X overcame the effect you can see in the attached image, and the variance in Y and Z helped to produce a nice random effect.

I can't rely on hard-coding directions to X,Y,Z with the new solution, I need to now use $NX, $NY, $NZ.

I feel like I am missing one more step - how can I apply high variance to the normal direction, (and also low variance to the other directions for some randomness)?

Thanks!!
Mark

Attachments:
particle.png (11.2 KB)

User Avatar
Member
349 posts
Joined: Aug. 2006
Offline
I havent had the chance to look at your hipfile since you did'nt post one , but the emisson from the pop_emitter is something ive run into before.
Enabling “accurate births”in the sourcepop helps a lot, but it wont fix the issue.
If I remeber a timeblendsop in conjunction with the accurate births works, but computation times get very large.



BTW: Your velocites are very large from what you say.
User Avatar
Member
330 posts
Joined: July 2005
Offline
Good point, time for an updated example! Unless I have totally exhausted people's generosity.. ops:

The attached is a modified version of Tamte's file. I deleted the animation channels from the OTL (for simplicity), then set the Inherit Velocity to 10, so you see the ‘clumping’ effect from the image above.

I do need fast particles (effect similar to aerosol spray).

I think it boils down to one question; how can I apply velocity variance along the normal axis? Alternatively, any other way to fix that clumping effect (perhaps as you say the timeblend SOP - I will investigate that).

If you're still reading I appreciate it 8)

Attachments:
particle_turret_fix_108.hipnc (80.8 KB)

User Avatar
Member
9374 posts
Joined: July 2007
Online
to apply different initial velocities in emitter's N direction you can use Velocity POP
firstly change Initial Velocity Parameter on Source POP to Set Initial Velocity to get rid of inherited velocity from N but keep the variance
then fill in Birth Group in Source POP, this will group emitted particles (don't check Preserve Group, because you want to set velocity just on newly born particles)
then append Velocity POP, put your group in group parameter
and as an expression you can use something like this
fit01(rand($ID), 2,5)*vector3($NX, $NY, $NZ) + vector3($VX, $VY, $VZ)

to explain:
vector3($VX, $VY, $VZ) is current velocity of born particles, this now contains just the variance which is set by Source POP
vector3($NX, $NY, $NZ) is normal (N) vector which is set on emitter and contains the main direction in which you want to emit particles
rand($ID) - will give you random number between 0-1 based on $ID of the particles so basically 0-1 number unique for each particle
fit01(rand($ID), 2,5) will rescale this number from 0-1 range to 2-5 range

so basically the expression is scaling the emitted velocity along N by unique 2-5 number for each particle (therefore varying it in the main direction) and adding Source POP's variance to it

this will apply only on particles created in last timestep so older particles will not be affected by Velocity POP and you can adjust their velocity freely as you wish (by forces for example)

you can of course use many other methods for this, VOPs will give you much more control, but for start this is ok

to reduce any additional stepping effect you can increase oversampling on POP net, but avoid high numbers

Attachments:
particle_turret_fix2.hipnc (82.3 KB)

Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
330 posts
Joined: July 2005
Offline
Yessssssss! you got it Tomas

You know those moments when your eyes open and you realise how much you don't know about something? I had a few of those with this challenge, learnt a lot.. so much still to learn!

Thank you very much
  • Quick Links