algorithmic modeling for Rhino
In the rhinoNest grasshopper addon, they made these cool multi-value toggles.
How did they make them?
See the attached image for an example. This is one component, copied multiple times and toggled to different values to show what I mean.
Thanks
Tags:
I wrote a basic implementation for that when I met Rafa in Seattle a few months ago, and it looks like they didn't change it much. You essentially have to override both the display of standard parameters and mouse event handling. This is exactly how all those special objects like Slider and Text panels etc. are created as well.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Is this something that is easy to do for a commoner like me?
By commoner I mean noob. ;-)
Is this something that you might be able to sneak in as a component?
It's fairly easy to accomplish, but that's mostly because this was such a specific case. If I had to make a generic version of this control, you would either be limited to String outputs or I'd need some way for the user to associate data of a specific type with a text label.
For example, let's say you define the list of possible values in this way:
"Minimum" = "0.0"
"Medium" = "0.5"
"Maximum" = "1.0"
"Insane" = "10.0"
Then showing one of these labels on the control and have it output the associated text is a piece of cake. However if you want to output actual numbers, how would you specify that?
Wait, I just had an idea. You could supply any expression, which then evaluates to either a String or an Integer or a Number or a Complex Number or a Boolean or a Point or a Plane (those are the possible data types in Expressions). So you could define this list as:
"Minimum" = "0"
"Medium" = 0.5
"Maximum" = 1
"Insane" = Sum(pi * 18, e * 15, 13.6)
Where "Minimum" would then output a String with the character zero, "Medium" would output a floating point number, "Maximum" would output an integer and "Insane" would also output a floating point number.
I'll see if I can find the time between now and next release to shove this in.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
sounds good, if you can't no biggie.
thanks David.
Added. It's called ValueList and it's in the same panel as the Slider and the Text Panel.
The value editor is a bit cheezy, but I think it will do for now. One limitation is you cannot use a label with an equals symbol. Everything after the first equals symbol is considered to be part of the expression.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by