Snapshot Rhino API for render plugins like Rhino

When can it be expected? Is it on the way?

https://forums.chaosgroup.com/forum/v-ray-for-rhino-forums/v-ray-for-rhino-general/996812-batch-render-snapshots

1 Like

Yes, it would be great!

@andy - from a post in that thread on ChaosGroup, it seems like we’re pointing at them and they at us. Is there an API for SnapShots that ChaosGroup can use? From RH-39359, I would say there is…

Restoring snapshots can be scripted, i.e. a model with two snapshots called “One” and “Two” you can do

-_Snapshot _Restore Two _Enter _Enter
and
-_Snapshot _Restore One _Enter _Enter

Then script _Render.

@wim the SDK you link to is for creating new Snapshot clients: providing snapshot support for new data.

@nathanletwory - so the answer to Peter’s question is that they have to use the macro script in their batch render feature?
https://forums.chaosgroup.com/forum/v-ray-for-rhino-forums/v-ray-for-rhino-general/996812-batch-render-snapshots?p=996841#post996841
CC: @Peter.Chaushev

@wim, yes.

1 Like

Hi everyone,
It is obvious that snapshots can be restored once you have the names, but here the real problem is getting their names in a first place.

V-Ray batch render needs the snapshot names, so the user can toggle a checkbox if he/she wants given snapshot to be rendered or not. There is no way to get those names without doing a costly file | open a given file, listing the snapshot names, and then closing it (and handle all cases where the user may have unsaved stuff in the current session). And that is for every file in the batch renderer list

The problem with the animation is similar - it is not “queriable” by reading the .3dm file with just the OpenNurbs toolset. One must open the file in an actual Rhino session.

In contrast standard and named views are readily available by reading the .3dm file with OpenNurbs and getting the first 3 data structures - very convinient.

Since the snapshots are actually a plugin, only that plugin’s code knows how to serialize/deserialize the data. That being said, I don’t think that a generic way to read the names would be available at all, and the only option is to scan the .3dm and search for the signs:
image

To get the list of names of snapshots you use the Names property on the Snapshots table of the Document you are interested in at doc.Snapshots.

Yes, of course, both C++ and .NET APIs have methods to get the snapshots.
But the trick is to do it without opening the file in Rhino.

I see, although I read your post for some reason it didn’t click with me that you are reading from outside Rhino.

https://mcneel.myjetbrains.com/youtrack/issue/RH-41625

I’ve bumped the priority.

1 Like