UI/monitor independent view capture

Hi!

What I want is a way to export a named view consistently so that doing it in the future, from the same model, produces a synchronized image (with the exact same camera angle, fov etc). When updating a presentation it’s a nightmare if the image changes slightly when updating…

I usually save named views automated using python and GH and the CaptureToBitmap function, but get the exact same issue using regular ViewCapture in Rhino. The exact same named view produces slightly different images if I change monitor, or expand/shrink some part of the UI. I thought saving a view ignored the UI and was based only on the camera settings etc.

These images are produced using ViewCapture, same exact view, only difference is I shrunk the layers panel in between saves:

Surely there is a way to generate consistent images from a model independent of what UI settings/monitor is being used?

Hi Jacob,

This isn’t something that I have ever had to consider, but, now you’ve raised it, it seems like a significant weakness. My initial thought was to create a floating view which would not be affected by view layout changes. However I find that when restoring a named view into a floating window, the restored view can be a different size from the floating view that was stored, even on the same computer, in the same session, with an unchanged layout, and even when the initial view was locked.

However, if you render the named view in cycles without restoring it to the screen first, it renders at the original size.

I wonder if this will work across machines - I’m not able to test at present? Could this be (a slightly clunky) solution?

Regards
Jeremy

Hi Jeremy,

Thanks for responding!

I must admit that I’m unfamiliar with cycles, based on a quick google I wonder if this is limited to the raytraced display mode? (assuming I understand what you meant). I need is a system that can export a list of named views regardless of display mode.

My goal is to trigger a reliable batch export of a chosen set of named views, from Grasshopper. I also need this to work without plugins, for the purpose of deployment to a large group of colleagues.

Hi everyone,

I have also encountered the problem described here.

The solution that has worked for me is to check the “Restore aspect ratio” checkbox. If this is activated and you go to a saved named view, the viewport is adjusted to the aspect ratio when the view was saved. This means that the image section is always the same when saving the image.

image

Unfortunately, I have not yet tried how to automate this with several views for a batch export.

If anyone can find a solution, that would be very helpful.

Hope this helps.

Cheers
Ben

Hi again,
I managed to solve this using a combo of your suggestions @jeremy5 and @Bdkt, thanks a lot!

For reference my code does this when I click the batch export button:

  • Pop open a new floating window
  • Loop over list of named views to export
  • in loop 1: Fetch ID of named view
  • in loop 2: Run the “RestoreWithAspectRatio” function on the named view table of the document
  • in loop 3: Capture the view to a file
  • Close the popped view after the loop

This has produced consistent exports so far :slight_smile:

/ Jacob

1 Like