Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5877

Issue Programmatically Saving "Raytraced" (Cycles) Renderings

$
0
0

@Dow wrote:

Hello All,

When attempting to render and save in the “Raytraced” (Cycles) mode, the image is written to disk prior to any passes being generated. I’ve researched this for several hours and tried a number of approaches, to no avail.

How does one save the image only after a specified number of passes have completed? (I don’t necessarily have to set the number of passes in the script- using the number of passes specified in Cycles preferences would be acceptable.)

Any help would be greatly appreciated. Thanks.


import Rhino as rc
from   scriptcontext import doc

def SaveRaytracedRender():

  desc = rc.Display.DisplayModeDescription.FindByName("Raytraced")
  desc.DisplayAttributes.RealtimeRenderPasses = 50

  view = doc.Views.ActiveView
  view.ActiveViewport.DisplayMode = desc

  doc.Views.Redraw()

  fullpath = "C:\Users\user\Desktop\raytraced 1.png"
  capture = rc.Display.RhinoView.CaptureToBitmap( view, desc )
  capture.Save( fullpath );

if __name__ == "__main__":
    SaveRaytracedRender()

raytraced_test_file.3dm (1.2 MB)

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 5877

Trending Articles