I have written a script utilizing rhinoscriptsyntax to create snapshots out of existing geometry. Simplified, it works like this:
import rhinoscriptsyntax as rs
objects = rs.GetObjects()
rs.Command("-_Snapshots Save FIRST _EnterEnd")
for object in objects:
name = rs.ObjectName(object)
rs.MoveObject(object, (0,0,50))
rs.Command("-_Snapshots Save " + name + " _EnterEnd")
In small groups of objects, it doesn’t seem to be an issue. However, in larger groups, the process becomes extremely slow until eventually the entire program crashes. I suspect this is because of Snapshots being quite large storage wise. My questions would be as follows:
Is there a way to set which attributes (object position, material, etc.) I want saved in the snapshot through rs.Command()? Like the way you can do it through a manual save. I would assume this would make the individual snapshots lighter each.
If not, is there a way to avoid the program from crashing? Or is creating consecutive snapshots impossible?
Unrelated to the rest, but is there a way to set the camera position after the snapshots have been created?
Can you recommend another way that we could use Rhino to make animations programmatically? It seems that Snapshots should be the tool, but they bloat the file size if you’re adding via script.
@nathanletwory would you suggest using Blender for animations?
Just as a side note, a long, long time ago I made a fairly long animation via Python (no snapshots) and found a similar thing happening. Every move you make in the script goes into the undo stack and sooner or later you run your computer out of memory. Since my animation script was in a loop, at every certain increment, I ran sc.doc.ClearUndoRecords(False). I seem to remember that helped.
Thanks for your help. It seems like Bongo hasn’t had an update in quite some time. Is it something that will be updated/supported with future versions of Rhino?
No, I simply set up the animation loop and let it run full-screen and captured the screen with Camtasia. So no single-frame images generated at all. It was a video that ran 35 minutes…