Jump to content

use attrib to control the emission of particles


jon3de

Recommended Posts

hi,

I want to control the emission of my particles via attrib. E.g. Cd, or a custom attrib it doesnt matter.

In the attached example file I animated some points to get white after frame 30. When I use Cd for emission after that in the pop network it spawns particles everywhere on the surface until frame 30 is reached and than it uses the attribute as expected.

Can I control the emitter in the particle network with attributes like if (@Cd> 0.5) ---> spawn!!  if not - dont spawn anything.

Or with a custom attribute like if(@heat > 30 ) spawn particle....etc.

Or is this better achieved in another way in houdini?  Thank you in advance. 

kind regards

Jon

attrib_as_emit_value.hiplc

Link to comment
Share on other sites

There's a few ways to tackle this. One way is to put down a pop kill, use the drop-down to choose kill by condition, and modify the example to kill if the colour is black:

dead = (@Cd.r == 0) ? 1 : 0;

(btw, thats a shortcut way of writing this which you might be more familiar with: )

if (@Cd.r == 0) {
   dead = 1;
} else {
    dead = 0;
}

 

Another way that a workmate showed me that I'm using more and more, is to keep as much control in sops before the popnet. The default behaviour of the pop source is to scatter over the input geo; but if you change the mode to 'all points', then it's up to you to feed it points that move around like the pop source scatter does. A scatter sop can do this. :)

The advantage now is that you can use all your usual sop tricks, and get non-sim based, very accurate control of your emission. In the attached example I made @density based on colour, have a scatter sop that is driven by density, but was surprised to find that even with density at 0, it still scatters points. 

No matter. A blast that kills points where @density=0 fixes that, and can feed that directly to the pop sim. Setting the seed on the scatter to @Frame so its constantly jittering, and we're done.

This might cause issues if you're emitting really fast particles and need nicely distributed emissions in sub-frame regions, but it's never bothered me so far.

-matt

attrib_as_emit_value_fix.hipnc

  • Like 1
Link to comment
Share on other sites

  • 4 years later...

I know this post is old but someone like me might stumble on this and find it helpful. Like most things in houdini this is unnecessarily complex. I asked them about this and they said they designed it to be used with the pop replicate. I've attached an example file.

Basically scatter points all over your object. I've added normals and converted them to velocity vectors on the scattered points. Add Cd noise. Inside the Pop Network chose birth from All Points. Then add a pop replicate node after that and chose your emission attribute from there.

particle emission.hiplc

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...