How could I set the parameter's value, using attributes values?

   5778   6   0
User Avatar
Member
407 posts
Joined: Aug. 2015
Offline
Hello;

In my “Attribute VOP” , I add a “Bind Export” node, called “HitDistance” attribute.
Now in Material node, I would like to access to value of it. How could I access?

I add “detail(”../../obj/MyGeo/attribvop1/“, ”HitDistance“, 0)” but not works.



Thanks.
MSD.
Edited by Masoud - Nov. 4, 2016 11:24:13

Attachments:
Capture.JPG (182.7 KB)

Masoud Saadatmand (MSDVFX)
User Avatar
Member
407 posts
Joined: Aug. 2015
Offline
Any Idea?
Masoud Saadatmand (MSDVFX)
User Avatar
Member
575 posts
Joined: Nov. 2005
Offline
You can not use any variables here, You have to use bind or parameter vops in the shader to pick up the parameter value.
In Your case You have to add a bind or parameter vop with the attributet HitDistance to the network. there You get Your parameter value, that is stored on geometry.
the difference between bind and parametervop is that bind only draws data from geometry, paramtervop instead enables a input value on the shader that is used only when there is no attribute found with that name.
User Avatar
Member
407 posts
Joined: Aug. 2015
Offline
Thanks Sanostol ,

Actually , because I'm beginner in Houdini, I don't know how to use “parametervop” , is there any tutorial or example ?

Based on Houdini's Help:
The Parameter node represents the value of one of the parameters the user can set in the shader’s parameter editor interface.

So , it seems the “parameters” VOP , can not access to attributes of geometries!
Edited by Masoud - Nov. 7, 2016 04:52:38
Masoud Saadatmand (MSDVFX)
User Avatar
Member
731 posts
Joined: Dec. 2006
Offline
Easiest way to achieve what you're trying to do is to put your mouse over the label in the shader. You will see the paramater name, in this case it might be “density” or “densityfield”. Then simply change the name “hitDistance” to this name.
Sean Lewkiw
CG Supervisor
Machine FX - Cinesite MTL
User Avatar
Member
407 posts
Joined: Aug. 2015
Offline
Hi mrCatfish,

It affects all smokes in my scene.
Masoud Saadatmand (MSDVFX)
User Avatar
Member
731 posts
Joined: Dec. 2006
Offline
If the attribute is not present on the geo, the shader's parm value will be used. If it is present, the geo's value will be used. So this should “just work,” and any other sims using the same shader that don't have this geo attribute should look exactly the same.
Sean Lewkiw
CG Supervisor
Machine FX - Cinesite MTL
  • Quick Links