About
A RenderData object represents a set of render settings of a BaseDocument. The render settings include:
- Various parameters like resolution, image format, save path etc.
- A list of MultipassObject elements that represent multipasses.
- A list of BaseVideoPost elements that represent post filters or render engines.
RenderData objects are an instance of Rbase
.
Access
RenderData elements can be accessed from the BaseDocument:
- BaseDocument::GetFirstRenderData(): Returns the first RenderData object in the tree.
- BaseDocument::GetActiveRenderData(): Returns the currently active render settings.
const RenderData*
const renderData =
doc->GetActiveRenderData();
#define ApplicationOutput(formatString,...)
Definition: debugdiagnostics.h:204
const char * doc
Definition: pyerrors.h:226
Allocation/Deallocation
RenderData objects can be created with the usual tools:
- RenderData::Alloc(): Creates a new RenderData object.
- RenderData::Free(): Deletes the given RenderData object.
The RenderData object can be handed over to a BaseDocument using:
- BaseDocument::InsertRenderData(): Adds the given RenderData to the BaseDocument as the first element in the list.
- BaseDocument::InsertRenderDataLast(): Adds the given RenderData to the BaseDocument as the last element in the list.
- BaseDocument::SetActiveRenderData(): Sets the given RenderData as the currently active render settings.
RenderData* const renderData = RenderData::Alloc();
if (renderData == nullptr)
renderData->SetName("Preview Render Settings"_s);
doc->InsertRenderDataLast(renderData);
doc->SetActiveRenderData(renderData);
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:69
Navigation
RenderData is based on ::GeListNode and the render settings are organized in a tree. This tree can be navigated with:
- RenderData::GetNext(): Returns the next RenderData object.
- RenderData::GetPred(): Returns the previous RenderData object.
- RenderData::GetUp(): Returns the parent RenderData object.
- RenderData::GetDown(): Returns the child RenderData object.
- RenderData::GetDownLast(): Returns the last RenderData child object.
RenderData*
const renderData =
doc->GetActiveRenderData();
RenderData* parentRenderData = renderData;
while (parentRenderData->GetUp())
{
parentRenderData = parentRenderData->GetUp();
}
doc->SetActiveRenderData(parentRenderData);
Properties
The RenderData object gives access to render settings, Multipasses and post effects.
Data
RenderData is based on ::BaseList2D so the data can be accessed with
- BaseList2D::GetData(): Returns a copy of the object's BaseContainer.
- BaseList2D::GetDataInstance(): Returns a pointer to the object's BaseContainer.
The container IDs are defined in drendersettings.h
.
RenderData*
const renderData =
doc->GetActiveRenderData();
BaseContainer& bc = renderData->GetDataInstanceRef();
@ RDATA_STEREO
Definition: drendersettings.h:427
@ RDATA_XRES
Definition: drendersettings.h:152
@ RDATA_YRES
Definition: drendersettings.h:153
Changing the RDATA_RENDERENGINE parameter to change the render engine will not automatically create the needed video post for that render engine. The video post has to be created manually.
RenderData* const renderData = RenderData::Alloc();
if (renderData == nullptr)
renderData->SetName("Hardware Rendering"_s);
doc->InsertRenderDataLast(renderData);
if (videoPost == nullptr)
renderData->InsertVideoPost(videoPost);
BaseContainer& bc = renderData->GetDataInstanceRef();
@ RDATA_RENDERENGINE_PREVIEWHARDWARE
Definition: drendersettings.h:41
@ RDATA_RENDERENGINE
Definition: drendersettings.h:39
If a given RenderData element is active can be checked with a bit. To set a given RenderData object as the active one, use BaseDocument::SetActiveRenderData().
RenderData* renderData =
doc->GetFirstRenderData();
while (renderData != nullptr)
{
renderData = renderData->GetNext();
}
#define BIT_ACTIVERENDERDATA
Active render data.
Definition: ge_prepass.h:934
The image format settings are defined in a maxon::DataDictionary that is saved within the BaseContainer. These functions are used to access the image format settings:
RenderData*
const renderData =
doc->GetActiveRenderData();
if (renderData == nullptr)
BaseContainer* const renderDataBaseContainer = renderData->GetDataInstance();
if (renderDataBaseContainer == nullptr)
maxon::DataDictionary exportSettings;
exportSettings.Set(maxon::MEDIASESSION::OPENEXR::EXPORT::HALFFLOAT,
true)
iferr_return;
exportSettings.Set(maxon::MEDIASESSION::OPENEXR::EXPORT::LAYERNUMBERING,
true)
iferr_return;
exportSettings.Set(maxon::MEDIASESSION::OPENEXR::EXPORT::COMPRESSIONMETHOD, maxon::MEDIASESSION::OPENEXR::EXPORT::COMPRESSIONMETHOD.ENUM_NONE)
iferr_return;
BaseContainer subContainer;
@ RDATA_FORMAT
Definition: drendersettings.h:67
@ RDATA_SAVEOPTIONS
Definition: drendersettings.h:69
#define FILTER_EXR
EXR.
Definition: ge_prepass.h:201
maxon::Result< void > SetImageSettingsDictionary(const maxon::DataDictionary &settings, BaseContainer *data, Int32 filterId)
#define iferr_return
Definition: resultbase.h:1531
RenderData*
const renderData =
doc->GetActiveRenderData();
if (renderData == nullptr)
BaseContainer* const renderDataBaseContainer = renderData->GetDataInstance();
if (renderDataBaseContainer == nullptr)
BaseContainer subContainer = renderDataBaseContainer->GetContainer(
RDATA_SAVEOPTIONS);
maxon::Id method = data.GetOrDefault(maxon::MEDIASESSION::OPENEXR::EXPORT::COMPRESSIONMETHOD);
const char * format
Definition: abstract.h:183
Definition: apibaseid.h:243
return OK
Definition: apibase.h:2740
#define DiagnosticOutput(formatString,...)
Definition: debugdiagnostics.h:170
maxon::Result< maxon::DataDictionary > GetImageSettingsDictionary(const BaseContainer *data, Int32 filterId)
maxon::Int Int
Definition: ge_sys_math.h:55
struct _Py_Identifier struct _Py_Identifier PyObject struct _Py_Identifier PyObject PyObject struct _Py_Identifier PyObject PyObject PyObject ** method
Definition: object.h:330
Multipasses
A render multipass contains different elements of the render result. What multipasses should be created is stored in a list of MultipassObject elements.
- RenderData::GetFirstMultipass(): Returns the first MultipassObject element.
- RenderData::InsertMultipass(): Inserts a MultipassObject element into the list.
See also MultipassObject Manual.
RenderData*
const renderData =
doc->GetActiveRenderData();
MultipassObject* multipass = renderData->GetFirstMultipass();
while (multipass != nullptr)
{
GeData data;
{
{
const Int32 bufferID = data.GetInt32();
}
}
multipass = multipass->GetNext();
}
NONE
Definition: asset_browser.h:1
#define VPBUFFER_OBJECTBUFFER
Object buffer multipass channel.
Definition: c4d_videopostdata.h:140
#define ConstDescID(...)
Definition: lib_description.h:592
maxon::Int32 Int32
Definition: ge_sys_math.h:51
@ MULTIPASSOBJECT_TYPE
Definition: zmultipass.h:6
@ MULTIPASSOBJECT_OBJECTBUFFER
Definition: zmultipass.h:8
Post Effects
Post effects are executed during the rendering process to apply filters like color correction to the final image. BaseVideoPost objects can also represent a render engine. These BaseVideoPost elements are stored in a list.
- RenderData::GetFirstVideoPost(): Returns the first BaseVideoPost element.
- RenderData::InsertVideoPost(): Adds the given BaseVideoPost element to the list.
- RenderData::InsertVideoPostLast(): Adds the given BaseVideoPost element as the last element to the list.
See also BaseVideoPost Manual.
RenderData*
const renderData =
doc->GetActiveRenderData();
BaseVideoPost* videoPost = renderData->GetFirstVideoPost();
while (videoPost != nullptr)
{
if (videoPost->GetType() == 1025462)
{
break;
}
videoPost = videoPost->GetNext();
}
@ VP_WATERMARK_TEXT_ENABLE
Definition: vpwatermark.h:68
Further Reading