Chaos Corona Forum
Chaos Corona for Cinema 4D => [C4D] I need help! => Topic started by: JPeters on 2022-10-03, 16:08:07
-
Hi guys,
For an in-house tool/plugin I'd like to be able to remove the Corona VFB render region selection if it's enabled.
In the vprendersettings.h I've found the following two calls which seem to be for this purpose:
CORONA_SETTINGS_RENDER_REGION = 3024,
CORONA_SETTINGS_RENDER_REGION_ENABLED = 3025,
When I try to apply these to the render post however, nothing happens.
What am I missing? Any pointers on how I can achieve a disabling/deletion of the render region in a file via Python?
Cheers,
-
Sorry can't help you with thisone. But this tool would be super helpful. How many times I found my final render in the morning ruined by regions. Super annoying!
Would be cool if you let me know when you get this to work. THX!
-
Hi,
setting False into CORONA_SETTINGS_RENDER_REGION_ENABLED parameter of renderer video post should work - and it seems to be working here. I am attaching example that I tested here - running this script for any Corona scene should ensure it will render with render regions disabled.
# Get Corona renderer video post
PLUGINID_CORONA4D = 1030480
videoPost = c4d.documents.GetActiveDocument().GetActiveRenderData().GetFirstVideoPost()
while videoPost and not videoPost.IsInstanceOf(PLUGINID_CORONA4D):
videoPost = videoPost.GetNext()
# Disable regions
if videoPost:
videoPost[c4d.CORONA_SETTINGS_RENDER_REGION_ENABLED] = False
Note that setting this will either disable it immediately in VFB in case the current document is being rendered in VFB at the time you run this script or disable it for following render in case the render is not in progress.
-
Hi Ales,
Thanks a ton for the pointer, it's weird because I had a similar code that didn't seem to work:
CORONA = 1030480 #Declaring Corona render for GetVideoPost function
def getCoronaRenderSettings(rdata): #Courtesy of mmarcotic, check if Corona is the actual video post
videopost = rdata.GetFirstVideoPost()
while videopost:
if videopost.GetType() == CORONA:
return videopost
videopost = videopost.GetNext()
rdata = doc.GetActiveRenderData()
rpost = getCoronaRenderSettings(rdata)
rpost[c4d.CORONA_SETTINGS_RENDER_REGION_ENABLED] = False
c4d.StopAllThreads()
doc.InsertRenderDataLast(rdata)
doc.SetActiveRenderData(rdata)
c4d.EventAdd()
But I guess my error was that I applied it to the render post and render data, not the actual video post.
I will try your code instead, let's see!
Cheers,
-
Hi Ales,
Just a quick update, I got it to work in my plugin as well now, thanks again for the help!