i want to expose a string parameter which will define the name of the attribute to import from geometry
for example:
i have a geometry with 3 vector attributes named “red”, “green”, “blue”
i want to use one of those attribs to define a surface color
so i create a parameter VOP with the name of the attribute
but i want to be able to choose the name of the attribute later by typing the name directly in the material parameters pane
is something like this possible?
or is renaming the attribute in SOPs to match hardcoded shader name the only way?
I dont want to force artists to dig inside the shader network and rename it there
import attribute in shader by name?
5037 2 1-
- tamte
- Member
- 9403 posts
- Joined: 7月 2007
- オフライン
-
- pbowmar
- Member
- 7046 posts
- Joined: 7月 2005
- オフライン
Hey,
Unfortunately, the way that Mantra (and PRman for that matter) work is you have to define the parameters' name before compiling the shader since it's in the parameter area of the shader. So yes, you'll have to set the attribute name in the SOP network.
However, you can easily make a very simple “custom SOP” (really just an HDA) that simply exposes the From and To fields of the Attribute SOP's renaming. If you really want to do a little scripting you can even write a script that would list all the attributes on the geometry and expose that as a menu item, but that would take a bit more work
Cheers,
Peter B
Unfortunately, the way that Mantra (and PRman for that matter) work is you have to define the parameters' name before compiling the shader since it's in the parameter area of the shader. So yes, you'll have to set the attribute name in the SOP network.
However, you can easily make a very simple “custom SOP” (really just an HDA) that simply exposes the From and To fields of the Attribute SOP's renaming. If you really want to do a little scripting you can even write a script that would list all the attributes on the geometry and expose that as a menu item, but that would take a bit more work

Cheers,
Peter B
Cheers,
Peter Bowmar
____________
Houdini 20.5.262 Win 10 Py 3.11
Peter Bowmar
____________
Houdini 20.5.262 Win 10 Py 3.11
-
- tamte
- Member
- 9403 posts
- Joined: 7月 2007
- オフライン
-
- Quick Links
