C4D Mini Script #03 - Render Current Frame Only
Mini Script #03
Render Current Frame Only
Description
 
This script will render the Current Frame ONLY. It will NOT save the image.
After doing so, it will return all settings to its original values.
 
Works great when bound to a shortdcut key (eg. Ctrl + R )
 
See video above for demo.
Code below is with tab spacing 4.
import c4d
from c4d import gui
# Credits to the forum help on cgsociety
def main():
    
    # Get render settings node from document
    MyRenderSetting = doc.GetActiveRenderData()
    
    # Save original render settings
    saveImageOSettings = MyRenderSetting[c4d.RDATA_SAVEIMAGE]
    multipassOSettings = MyRenderSetting[c4d.RDATA_MULTIPASS_SAVEIMAGE]
    oRange = MyRenderSetting[c4d.RDATA_FRAMESEQUENCE]

    # Apply current frame only without saving image
    MyRenderSetting[c4d.RDATA_SAVEIMAGE] = 0
    MyRenderSetting[c4d.RDATA_MULTIPASS_SAVEIMAGE] = 0
    MyRenderSetting[c4d.RDATA_FRAMESEQUENCE] = 1
    
    # Call render to picture viewer
    c4d.CallCommand(12099)
    
    # Set to original settings
    MyRenderSetting[c4d.RDATA_SAVEIMAGE] = saveImageOSettings
    MyRenderSetting[c4d.RDATA_MULTIPASS_SAVEIMAGE] = multipassOSettings
    MyRenderSetting[c4d.RDATA_FRAMESEQUENCE] = oRange
    
    # refresh ui
    c4d.EventAdd()
    
if __name__=='__main__':
    main()
C4D Mini Script #03 - Render Current Frame Only
7
249
0
Published:

C4D Mini Script #03 - Render Current Frame Only

Script to render current frame without change your frame range setup
7
249
0
Published:

Creative Fields