Calling a saved state?

Is it possible to call a saved state from within GH itself ie. programmatically? I noticed Human UI has it, but only for its own ui elements it seems.

How can I access and load a saved state? Must be possible with C#, but I don’t know much of it.

Thanks for any hints.

You can use the State Manager user object of Peacock.

Canvas at 14;38;55

Awesome. Just tried it out and it works great. Batch rendering using Vray for Grasshopper will be so much better. Now we can have different parameters for each view and just save them as states and then during rendering it just loads a state for each frame of the “animation”. Love it.

Could you give an example of how this is used?

Let me try. So what we are doing is a sort of batch rendering. We have any number of objects we want to render (like product images).

First there is a loop to create the objects and each is saved in a folder with a .3dm file of the geometry.

Then we have a ready-made scene that we export as a .vrscene file (Vray scene). Now we want to place each geometry into the scene, render an image of it, go the next, etc.

So I use the Vray animation component (basically a timeline or loop) and for each frame I load one of the .3dm files, place it into the scene using some predefined placement points, and then it gets rendered by vray.

Since the objects are different size the camera position has to be different for each. So you just step through the vray animation timeline, set the camera parameters from Grasshopper (the Heteroptera plugin has this Camera Crane component where you can change the Rhino viewport cam from GH) and save a named state that just has the frame number as the state name.

So then when the animation/loop runs for each frame it loads the state and the camera changes.

Finally you can either render using vray directly from GH or, even better, you can use the Render in Rhino component, right-click > Export Camera Animation and then hit Render Animation.

It will now do a batch render with different geometry and different camera position for each frame.

1 Like

Thank you, sorry I wasn’t clearer, but what I really meant was a simple schematic using the actual component.