I would like to specify the value range of a channel created in the VEX expression
of an attributewrangle sop
In my searches for resolving this I have found
docs describing adding #pragma statements
so I tried this:
float distance_amount = ch("distance_amount");
#pragma range distance_amount 0.0 2.0
but I keep getting the following error
Error: Syntax error, unexpected T_pragma. (1,1).
What is the right syntax to do this?
Help!
set value range for a channel in attributewrangle
2561 5 0-
- WillA
- Member
- 98 posts
- Joined: July 2005
- Offline
-
- jsmack
- Member
- 8177 posts
- Joined: Sept. 2011
- Offline
-
- WillA
- Member
- 98 posts
- Joined: July 2005
- Offline
jsmack
There is none. Pragmas are for actual shader code defined nodes, not snippets such as wrangles. To edit the parameter range, edit the parameter interface, as with any other node, to edit the spare parameters.
Thanks very much for letting me know jsmack.
I am quite disappointed that I had to do the following
which is old school houdini approach
instead of just using a @pragma line.
Open up edit parameters interface gui in two ways
1)
click on the little gear icon in the attributewrangle parameter pane
select "edit parameter interface" at the top of the pop up
2) right click on the attributewrangle sop
in the popup menu hover over the "parameters and channels"
select "edit parameter interface"
Once you are in the "Edit Parameter Interface" gui
in the middle panel titled "Existing Parameters"
scroll down to the bottom
where you will see the parameters created by the attributewrangle expression code
click on the parameter you want to specify a range
in the rightmost panel turn on the range toggle and type in the range values
Thats a lot of clicking IMHO.
-
- jsmack
- Member
- 8177 posts
- Joined: Sept. 2011
- Offline
WillA
which is old school houdini approach
instead of just using a @pragma line.
pragmas are the old school way--using shaders for nodes predates wrangles.
There are existing RFEs requesting a way to define hints for the auto-parm button on the wrangle for populating the spare parameters from ch() calls. Feel free to submit another.
My solution for defining parameter ranges taking too many clicks is just don't. Parameter ranges don't matter.
Edited by jsmack - Aug. 20, 2022 21:55:01
-
- WillA
- Member
- 98 posts
- Joined: July 2005
- Offline
jsmack
My solution for defining parameter ranges taking too many clicks is just don't. Parameter ranges don't matter.
Yeah, ranges are mostly just a convenient way to help the user pick good values. Plus, range is optionally a hard limit so a user can discover interesting results if they want to.
How about hint pop ups that explain what a parameter does? They are important, aren't they? Worth a few developer clicks?
User friendliness can make a cg artist have a happy day.
-
- tamte
- Member
- 9380 posts
- Joined: July 2007
- Offline
defining hints would be great especially if they had very compact syntax, or similar to OSL
currently however I got used to opening Edit Parameter Interface after creating parameters from ch() references anyway since they are all at the bottom and I need them on the top, so at the same time I edit ranges, reorder them, add tabs, multiparms, types, menus conditionals, very occasionally tooltips, ...
in a long run I'd hate to have to describe all that as pragmas like in old days of shaders, even though having a robust hint system for ch() references that allows for that would definitely allow the best middle ground of defining whatever is easy and still leave some more descriptive changes to Edit Parameter Interface
currently however I got used to opening Edit Parameter Interface after creating parameters from ch() references anyway since they are all at the bottom and I need them on the top, so at the same time I edit ranges, reorder them, add tabs, multiparms, types, menus conditionals, very occasionally tooltips, ...
in a long run I'd hate to have to describe all that as pragmas like in old days of shaders, even though having a robust hint system for ch() references that allows for that would definitely allow the best middle ground of defining whatever is easy and still leave some more descriptive changes to Edit Parameter Interface
Edited by tamte - Aug. 20, 2022 22:36:55
Tomas Slancik
CG Supervisor
Framestore, NY
CG Supervisor
Framestore, NY
-
- Quick Links

