Jump to content
Sign in to follow this  
fixxorion

Expression Functions

Recommended Posts

Hi all,

In my continued quest to master particles, I have run up against some more problems. I'm trying to create some more complicated particle effects, but I need to make some more complex expressions. I managed to create some actual expression functions (after much help from forums), but I can't figure out how to actually change parameter values from within the function. As a test, I'm trying to create a group of particles that move up, and then after reaching a certain height, start moving down, and cycle back and forth like that. I'm trying to accomplish this with actual function expressions, but I can't quite figure it out...I feel so close, but I can't get it. :( I've attached what I have so far...if someone helps me find a way to do this, I'd be eternally grateful!

Thanks,

fixxorion

Share this post


Link to post
Share on other sites

Hey,

Rather than trying to controll the behavior with a single expressin in a position pop, try using the pops that are already available to you.

You could do what you wanted in your test with a velocity pop. Also check out the group pop, and definetly look into what the little 'preserve group' check does. Also look into the event pop.

If you really want to go into scripting for ultimate controll, check out vops rather than expressions. Vops will give you an incredible amount of controll.

But to learn particles, I'd say play around with the default tools first. Know that it'll always look more natural to affect acceleration, rather than forcing velocity. Know your gravity and your drag.

Cheers,

Jens

Share this post


Link to post
Share on other sites

Hi,

Thanks for the info...much appreciated. I do know the regular tools and how I would use them to create the effect that I said, but I just want to create that same effect using some sort of script. I've tried both VOPs and a regular expression to do it, but with both methods, I don't know how to actually access the custom attributes that I created in POPs...it seems like a fairly necessary thing to be able to do....

Thanks,

fixxorion

Share this post


Link to post
Share on other sites

well, with vops it's the same thing as with the shaders. You can pass in any attribute by having a parameter of the same name. So if you have an attribute called direction, you can create a parameter called direction, and the values will be passed in.

In expressions, you can use the poppoint() expression

Share this post


Link to post
Share on other sites

Hi anakin78z,

I see...what If I wanted to change that attribute? I used the Add Attribute within my VEX POP...that seemed to work. However, I'm afraid I might be doing it wrong.

Let me give an example of what I would want to do with this. Say I have a group of particles being generated. I want to add a custom attribute called "Weight" to each of the particles, and as time goes by, each particle's "Weight" attribute will increase. Then, as soon as the "Weight" attribute passes a value, say 5, the velocity of that particle in Y starts to increase. How would you go about create a scenario like that?

Thanks so much for all the help anakin78z...you're saving my life!

fixxorion

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×