generative modeling for Rhino
I'm currently working on a small plug-in and came to the point where I have to think about backing the geometry.
When using the regular bake functionality a lot of the non-geometrical information (I already calculated) is lost. In my case, for example, it would make a lot of sense to create blocks, change the objects color and store them on certain layers.
This of course could be done by a special function within the component, which would be triggered by some kind of “bakeNow” Boolean input.
However I personally think it’s not desirable to do that, since it easily confuses the users. As a matter of fact, it’s hard to change the Boolean input back to “False” automatically after backing the output once. It is therefore often forgotten to be switched back which results in backing the geometry every time a parameter is changed …. Just to name one confusion point.
So my suggestion/wish would be to offer a new context menu dropdown item called “Clever Bake” (or some other wording) right below the bake item. It should allow the developer to predefine a “clever” custom way to bake the output. This item would have to only appear, if it varies from the regular baking behavior.
So let me know what you think about this suggestion.
if you implement your own Geometry data type with additional properties such as colours or layers, you are also in control of baking that geometry. Do you have your own type?
Thanks, I didn't know that.
Currently I'm not working with own datatypes. I might have to rethink using them.
Could you point me to some examples/tutorials on controlling the baking of custom data types.
Hi Martin this is simple you just have to clear and dispose the display at the end or you will have the thinks drawn forever..
Rhino.Display.CustomDisplay my_disp = new Rhino.Display.CustomDisplay(true);
my_disp.AddCircle(new Circle(), System.Drawing.Color.Aqua, 12);
// now you see it on the screen
// now its gone
If you write your own data type (must implement the IGH_Goo interface) you can also chose to implement the IGH_BakeAwareData interface. Your data will now be treated as bakeable. If you write a custom parameter for your data type, that parameter should implement the IGH_BakeAwareObject interface.
that should get me going.