Jump to content

Scale over time and kill after a few frames

Recommended Posts

Hello there !
I'm having a hard time doing something seemingly simple.

I have some particles birthing out from the bottom of a capped cylinder and going up.
I used a copyToPoints to put a sphere to every points, and I want these spheres to scale up for a few frame and then die after they went over the surface of the cylinder.

So I grouped the points based on the cylinder as a bounding object, and with an attribute wrangle placed before the copyToPoints, I set "@pscale *= 1.1" for the points inside the "escaped" group.
The thing is, the scale is only being set once, and not over time.
I've read that the solver sop could make my life easier... ? I've got no idea how to use it tho. Will continue to explore that avenue, but if someone have some pointers I'd be grateful.

One other thing is to kill the particles a few frames after they escaped the cylinder's bound.
I planned to store the frame that they escaped the cylinder on an attribute, than delete the points if the Frame number is greater than this attribute + a number.
The thing is, when in the attribute wrangle I set "i@outFrame = $F", I end up only with values of 1 (or 0 if not in escaped group).
Why is that ?

See attached scene.

Thanks !


Link to comment
Share on other sites

It look like an order of operation bug. Try scattering points into the popnet and birthing supplied points. But before you enter the popnet create a pscale attribute. Also when you delete attributes after the popnet, don't delete pscale then it will remain active and your wrangle can modify it.



Link to comment
Share on other sites

Hey @Atom, thanks for the fast answer !
Sadly, I think I wasn't clear with my question

I don't need a continuous flow of particles from specific birth points. The random is good, as the particles will be used as bubbles to drive a flip simulation (temperature and velocity). I want the bubbles to burst when they get over the surface of the flip sim.
Said surface is here the top of the cylinder, and to emulate the bubbles bursting, I want the bubbles to continuously grow after they escaped the cylinder (aka flip volume, but not relevant here), and then be killed.

Thanks again !

Link to comment
Share on other sites

I did some test with the solver, not quite there yet.
I am able to make a object grow steadily over time with an attribute wrangle in the solver sop set to "@pscale = @pscale * 1.01;" with it connected to Prev_Frame.
But when I implement this with the animated points coming from the pop simulation, I only have the first frame's points steadily growing.
I did some other tries, with no success so far.
Here's the updated scene.


Edit : Also, I've found that in VEX $F does not work, we must use @Frame - thanks to Daryl Dunlap:)
But this bring another problem : The frame attribute is set every frame. I tried doing a verification if the frame attribute is 0 and if the group is "escaped" then set the frame attribute, but strangely it does not work.
I suspect the problem to be that this frame attribute is reset every frame, but I don't know how to verify this.

Edited by Alain2131
Link to comment
Share on other sites

Why would you not use @age to scale your particles? The popnet will give you that for free. Something like f@pscale = fit(f@age, 0, 2, 0, 0.1); will scale the particles between 0 and 0.1 between the ages of 0 and 2. If you want to delete points not in the group drop down a blast, select your group from the drop down and then check delete non-selected. No solvers required. 

If you needed to test against the eventual flip surface you could do that with VDBs. 


Link to comment
Share on other sites

Hey @adrianr,
Your solution is working, only it's just in a specific situation.
To make it work, the surface needs to always be the same height and the particles needs to always go at the same speed to be able to scale them up with something like "f@pscale = fit(f@age, 1.3, 1.4, 0.05, 0.1);"
And then as you said delete all the points in the "escaped" group.

I need to do not quite the opposite but almost. I need a pscale that scales the particles based on the current pscale value multiplicated by like 1.1 to be applied only on the particles in the escaped group, and then kill those particles after a few frames.

The big problem with your solution is that it uses the @age attribute. But all the points does not go at the same speed (there is a noise applied in the pop force), so I cannot use that.

I've attached a file with your solution working, but again, it's too limited for my needs.

Thanks tho !


Alright, so a co-worker proposed to look up the y postion and somehow scale the pscale according to that. So I simply inputted P.y to the fit funciton and it's working.
The problem here is that the original pscale must be the same on every points. >.<
On with the quest I go !

Edited by Alain2131
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.

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