Expression problem

   9195   12   2
User Avatar
Member
383 posts
Joined:
Offline
Hello,

I begin to learn Houdini and, of course, i have some to question to achieve a specified task !

I watched the tornado and sprite shader tutorial from 3dbuzz. I made my own tornado sim and procedural sprite surface shader.
I include parameters to my shader to allow me to change it easely.

And now my question :
I would like the parameters of my shader change regarding the attributes ( not sure if it's the good term) of my particles ( life, velocity etc …)
What is the kind of expression to do that ?

thank for you help
http://vimeo.com/vbkstudio [vimeo.com]
User Avatar
Member
696 posts
Joined: March 2006
Offline
this [sidefx.com]
Stephen Tucker
VFXTD
User Avatar
Member
383 posts
Joined:
Offline
hmm ok

i have to get particle attribute inside my vopsop …
i was afraid of that !

Another question :

In the attribute of my particles there is "life“
why two ”value" for life ?
don't understand

thanks again
http://vimeo.com/vbkstudio [vimeo.com]
User Avatar
Member
696 posts
Joined: March 2006
Offline
pretty sure that was also answered in http://download.sidefx.com/images/stories/tutorials/expressions/12_custom_attributes_within_vops.mov [download.sidefx.com]

but it's because the life attribute contains one index which is the current life, and one index which is the allowed lifespan.

In vops this coresponds to life and age

in sops $LIFE is the equivalent of life/life or life/age
Stephen Tucker
VFXTD
User Avatar
Member
383 posts
Joined:
Offline
wow you're fast to answer
i will check it deeper

thanks

(i think i will love this forum)
http://vimeo.com/vbkstudio [vimeo.com]
User Avatar
Member
383 posts
Joined:
Offline
ok

I understand better now but i have still some problems importing attributes in vop shop.
In the file attached ( simple particle emission) I try to make some change in the color of my sprite using attribute like speed or life …

When I connect a parameter node ( with the specific attribute name) nothing is append except for color ( Cd) and alpha (Alpha).

I don't know what I miss …

Attachments:
sprite_att.hip (244.2 KB)

http://vimeo.com/vbkstudio [vimeo.com]
User Avatar
Member
383 posts
Joined:
Offline
okok

i forgot to add my new attributes in the vm_geo_sprite !

newbie i said …



PS: don't with life attribute
but work fine with speed or spritescale
as always i don't know what i miss

Attachments:
sprite03.hip (323.4 KB)

http://vimeo.com/vbkstudio [vimeo.com]
User Avatar
Member
383 posts
Joined:
Offline
here is my test file.
The only problem is the life attribute.

Attachments:
sprite04.hip (265.1 KB)

http://vimeo.com/vbkstudio [vimeo.com]
User Avatar
Member
696 posts
Joined: March 2006
Offline
sorry all my cpu power is in use this week at work… I won't get a chance to look at it for a bit… but maybe someone else can.
Stephen Tucker
VFXTD
User Avatar
Member
383 posts
Joined:
Offline
don't be sorry

you helped me a lot with your link
http://vimeo.com/vbkstudio [vimeo.com]
User Avatar
Member
383 posts
Joined:
Offline
I create new attribute and it works fine now.
I've got some explaination from Itriix in the odforce forum.


http://vimeo.com/vbkstudio [vimeo.com]
User Avatar
Member
383 posts
Joined:
Offline
I am playing with my new attribute.

I created metaballs link with a popnet by a copySOP.
I wonder how to change the size of my metaballs with this attribute ( the life of my particles).
The only examples i found show expression global variables …

Thank for your help
http://vimeo.com/vbkstudio [vimeo.com]
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
You need to add the pscale attribute to your particle points. The Copy SOP uses the pscale attribute on the template points to scale the copied geometry.

You can do this in either POPs or SOPs.

In POPs you need to add a Property POP and find/enable the Uniform Scale parameter. Replace the $PSCALE string with whatever you want. You said life which goes from 0-1 over the lifetime of the particle so use $LIFE.
I like to use $AGE which is the current age of the particle in seconds so something like: smooth($AGE, 0, 2) will give you a scale going from 0-1 when the age goes from 0 to 2 seconds. Then you can modify this:
fit01( smooth($AGE, 0, 2), 0, 0.2) will remap the 0-1 returnedfrom the smooth() function to 0-0.2.

In SOPs add a Point SOP and go to the Particle tab and find the scale parameter and use the same expression above.

Don't forget to turn off the “Transform Cumulative” option on the Copy SOP.
There's at least one school like the old school!
  • Quick Links