I am leveraging the new Rhino 8 model viewport nodes in GH and so far so good in getting them to be dynamically created from a list of details.
If I manually right click and bake the viewport node or the model object node I get the expected results I am after.
What I am trying to create is just a very simple bake component that takes a boolean toggle in GH and bakes the model object/viewport(s) that I have created.
In testing Elefront, Human, Blickfeld, and other dynamic baking solutions do not appear to work with model viewports.
Any help is appreciated. I admittedly don’t know what I’m doing with python or C# but thinking it should be somewhat straightforward? I’m just not sure what I need to call for the bake exactly from Rhino.Common in regards to the viewport object type.
Any help is appreciated, thank you!
Here is some psuedo python code (generated from ChatGPT so I’m sure it’s not right at all?):
import Rhino
import scriptcontext as sc
class BakeObjectComponent(component):
def __init__(self):
super(BakeObjectComponent, self).__init__()
def RunScript(self, obj, toggle):
if toggle:
# create a Rhino object based on the input geometry
rhino_obj = sc.doc.Objects.Add(obj)
# select the newly created object
sc.doc.Objects.Select(rhino_obj)
# update the Rhino viewport
sc.doc.Views.Redraw()
Not that i’m aware of, but speaking of tracking; that will be a feature of the baker as well (re-baked objects retain their Rhino guid and subsequent dimensions, history, etc)
Wonderful! Does this mean we can potentially query history in a way where: if we dynamically bake something, it overwrites the previous object as expected but if a user has manually overridden something on the baked object (from within Rhino) there will be some kind of tracking/history of that change accessible from the grasshopper bake node?
My initial impression (i’ve only seen early demos) would be no, but can’t rule it out. The grasshopper change would overwrite the user change. You will have to chose who is in charge (Rhino or GH). There is a public demo next week, so I would expect it to be available then, if not soon after.
Found out I can have them as additional windows, once I bake the component itself. I´d be even more convenient to export them as named views though. Any ideas?