Jump to content

H13 - POP's no $ID


Recommended Posts

I'm trying to have each particle individually affected by the "Air Resistance" in the POP Drag node.

My approach is to put: fit01(rand($ID), 0, 0.5) into the air resistance field but it looks like the POP's inside DOP's dont read the Particle $ID, how would one achieve this inside the new POP's

The new pop nodes are using vex expressions.

Tick the vex expression checkbox and put

airresist *= fit01(rand(@id),0,0.5);[/CODE]

Then go to the help and search for vex expressions. There is a really good help card for it. :)

Link to comment
Share on other sites

Thanks for shedding some light on this!

Managed to get a bunch of basic VEX commands going.

Is there a repository for simple functions?

What I'm now trying to do is change the Swirl Size per particle with: swirlsize *= fit01(rand(@id),0.01,1);

It doesn't seem to be working as expected, it changes all the particles swirl size and I think this is why:

"rand produces vector noise when applied to a vector variable. This can be unexpected, like in the force example, where you may have expected all components of the force to be randomized equally by @id. Use a float() cast to force it scalar."

Not sure what that means?

Link to comment
Share on other sites

swirlsize is float so this shouldn't be an issue, and your vexpression should work, at least it's working for me

the float() cast can be used for functions that have more forms than just float, rand is one of them so if you assign it to vector variable you'll get 3 different values for the same seed

vector xyz = rand(@id); -->rand will evaluate in it's vector form so it can give you for example (0.12, 0.5, 0.28)

vector xyz = float(rand(@id)); -->rand will evaluate as float therefore assigns the same value to all 3 components of the xyz variable, like (0.12, 0.12, 0.12)

but this doesn't seem to be your problem

Link to comment
Share on other sites

Ah thanks, Tomas.

Is there a way to create a test Attribute / Parameter to view what this is doing in my details view, right now it's affecting force and it's difficult to see because I've got a bunch of other stuff affecting force.

ie: I'd like to create a "Test" Attribute just for swirlsize , whats the best way to go about doing that?

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