About
A MultipassObject represents a multipass element of the render settings. Cinema 4D's render engines will render and save different multipasses based on these settings.
MultipassObject objects are an instance of Zmultipass
.
RenderData*
const renderData =
doc->GetActiveRenderData();
MultipassObject* multipass = renderData->GetFirstMultipass();
MultipassObject* depthPass = nullptr;
while (multipass != nullptr)
{
BaseContainer& data = multipass->GetDataInstanceRef();
{
depthPass = multipass;
break;
}
multipass = multipass->GetNext();
}
if (depthPass == nullptr)
{
depthPass =
static_cast<MultipassObject*
>(BaseList2D::Alloc(
Zmultipass));
if (depthPass == nullptr)
BaseContainer& data = depthPass->GetDataInstanceRef();
renderData->InsertMultipass(depthPass);
}
NONE
Definition: asset_browser.h:1
@ RDATA_MULTIPASS_ENABLE
Definition: drendersettings.h:330
#define MSG_UPDATE
Must be sent if the bounding box has to be recalculated. (Otherwise use MSG_CHANGE....
Definition: c4d_baselist.h:372
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:69
#define VPBUFFER_DEPTH
Depth multipass channel.
Definition: c4d_videopostdata.h:130
#define Zmultipass
Definition: ge_prepass.h:1302
#define ConstDescID(...)
Definition: lib_description.h:592
maxon::Int32 Int32
Definition: ge_sys_math.h:51
PyObject ** type
Definition: pycore_pyerrors.h:34
const char * doc
Definition: pyerrors.h:226
@ MULTIPASSOBJECT_TYPE
Definition: zmultipass.h:6
Access
Existing MultipassObject elements are stored in a list and can be accessed from a RenderData object:
- RenderData::GetFirstMultipass(): Returns the first MultipassObject element.
Allocation/Deallocation
The MultipassObject class does not offer a static "Alloc" or "Free" function so the functions of BaseList2D have to be used with Zmultipass.
- BaseList2D::Alloc(): Can be used to create a new MultipassObject object.
- BaseList2D::Free(): Can be used to delete the given MultipassObject object.
A newly created MultipassObject is added to the render settings by adding it to the RenderData object:
- RenderData::InsertMultipass(): inserts a MultipassObject element into the list.
MultipassObject*
const depthPass = (MultipassObject*)BaseList2D::Alloc(
Zmultipass);
if (depthPass == nullptr)
BaseContainer& data = depthPass->GetDataInstanceRef();
renderData->InsertMultipass(depthPass);
Navigate
MultipassObject objects are organized in a list:
- MultipassObject::GetNext(): Returns the next MultipassObject in the list.
- MultipassObject::GetPred(): Returns the previous MultipassObject in the list.
RenderData*
const renderData =
doc->GetActiveRenderData();
MultipassObject* multipass = renderData->GetFirstMultipass();
while (multipass != nullptr)
{
multipass = multipass->GetNext();
}
#define ApplicationOutput(formatString,...)
Definition: debugdiagnostics.h:204
Types
All multipasses are MultipassObject objects. They only differ in their parameters. The type of a multipass is defined with:
Simple multipass types are:
Configurable multipass types are:
The parameter IDs of configurable multipasses are defined in zmultipass.h
.
Additional multipass types are:
- VPBUFFER_ALLPOSTEFFECTS: All post effects channel. Use this to create the "Post Effects" multipass needed to support custom multipasses created by VideoPostData plugins.
- VPBUFFER_IMAGEBUILDING_PASS: The maximum number of the image building layers. This can be used to loop through the multipass types.
Example object buffer:
MultipassObject*
const multipass =
static_cast<MultipassObject*
>(BaseList2D::Alloc(
Zmultipass));
if (multipass == nullptr)
BaseContainer& data = multipass->GetDataInstanceRef();
renderData->InsertMultipass(multipass);
#define VPBUFFER_OBJECTBUFFER
Object buffer multipass channel.
Definition: c4d_videopostdata.h:140
@ MULTIPASSOBJECT_OBJECTBUFFER
Definition: zmultipass.h:8
Example blend channel:
MultipassObject*
const multipass =
static_cast<MultipassObject*
>(BaseList2D::Alloc(
Zmultipass));
if (multipass == nullptr)
BaseContainer& data = multipass->GetDataInstanceRef();
renderData->InsertMultipass(multipass);
#define VPBUFFER_BLEND
Blend multipass channel.
Definition: c4d_videopostdata.h:150
@ MULTIPASSOBJECT_DIFFUSE
Definition: zmultipass.h:14
@ MULTIPASSOBJECT_SHADOW
Definition: zmultipass.h:16
Example reflection channel:
MultipassObject*
const multipass =
static_cast<MultipassObject*
>(BaseList2D::Alloc(
Zmultipass));
if (multipass == nullptr)
BaseContainer& data = multipass->GetDataInstanceRef();
renderData->InsertMultipass(multipass);
#define VPBUFFER_REFLECTION
Reflection multipass channel.
Definition: c4d_videopostdata.h:120
@ MULTIPASSOBJECT_REFLECTION_MATERIALS
Definition: zmultipass.h:25
@ MULTIPASSOBJECT_REFLECTION_SEPARATE_ALL
Definition: zmultipass.h:27
Example specular channel:
MultipassObject*
const multipass =
static_cast<MultipassObject*
>(BaseList2D::Alloc(
Zmultipass));
if (multipass == nullptr)
BaseContainer& data = multipass->GetDataInstanceRef();
renderData->InsertMultipass(multipass);
#define VPBUFFER_SPECULAR
Specular multipass channel.
Definition: c4d_videopostdata.h:118
@ MULTIPASSOBJECT_SPECULAR_SEPARATE_ALL
Definition: zmultipass.h:40
@ MULTIPASSOBJECT_SPECULAR_MATERIALS
Definition: zmultipass.h:38
Further Reading