Hey @tx3008 ,
You need check the Octane BaseVideoPost
to get the data container.
You can change the render settings and use RenderDocument
to render images.
In case if you didn't want to use my extra libs, the GetVideoPost
is not complicated.
Cheer~
DunHou
# 获取渲染器VideoPost
def GetVideoPost(document: c4d.documents.BaseDocument = None, videopost: int = ID_REDSHIFT) -> Optional[c4d.documents.BaseVideoPost]:
"""
Get the videopost of given render engine of filled document.
Args:
document (c4d.documents.BaseDocument, optional): Fill None to check active documents. Defaults to None.
videopost (int, optional): The id of the videopost. Defaults to ID_REDSHIFT.
Returns:
Optional[c4d.documents.BaseVideoPost]: The videopost we get.
"""
if not document:
document = c4d.documents.GetActiveDocument()
rdata: c4d.documents.RenderData = document.GetActiveRenderData()
vpost: c4d.documents.BaseVideoPost = rdata.GetFirstVideoPost()
theVp: c4d.documents.BaseVideoPost = None
while vpost:
if vpost.GetType() == int(videopost):
theVp = vpost
vpost = vpost.GetNext()
return theVp
import c4d
import Renderer
def main():
OctaneRenderer = Renderer.GetVideoPost(c4d.documents.GetActiveDocument(),
Renderer.ID_OCTANE)
OctaneRenderer[c4d.SET_PASSES_FILEFORMAT] = 10 # Octane PNG, 6 = PNG
OctaneRenderer[c4d.SET_PASSES_SAVE_MAINPASS] = True
OctaneRenderer[c4d.SET_PASSES_ENABLED] = True
OctaneRenderer[c4d.SET_PASSES_SAVEPATH] = "Render/$prj/$prj"
c4d.EventAdd()
if __name__=='__main__':
main()