About

A BaseVideoPost object represents a video post effect in the render settings. Such a video post can be a simple filter or a complete render engine. Custom video posts can be created using the VideoPostData class.

BaseVideoPost objects are an instance of VPbase.

// This example searches for the "Watermark" post effect and enables it.
// If it does not exist, it is added.
RenderData* renderData = doc->GetActiveRenderData();
BaseVideoPost* vp = renderData->GetFirstVideoPost();
BaseVideoPost* watermark = nullptr;
// search for the "Watermark" video post
while (vp)
{
// check if this is a "Watermark"
if (vp->GetType() == 1025462)
{
watermark = vp;
break;
}
vp = vp->GetNext();
}
// if not found, create the watermark
if (!watermark)
{
watermark = BaseVideoPost::Alloc(1025462);
if (!watermark)
return false;
renderData->InsertVideoPost(watermark);
}
// enable
watermark->DelBit(BIT_VPDISABLED);

Access

BaseVideoPost elements are stored in an RenderData object:

See also RenderData Manual.

Allocation/Deallocation

BaseVideoPost object are created with the usual tools:

Newly created BaseVideoPost objects can be added to the render settings by adding them to the RenderData object:

// This example adds the color correction video post to the current render settings.
if (colorCorrection)
rdata->InsertVideoPost(colorCorrection);

Navigation

BaseVideoPost objects are organized in a list. This list can be navigated with:

// This example loops through all video posts and prints their names.
RenderData* renderData = doc->GetActiveRenderData();
BaseVideoPost* vp = renderData->GetFirstVideoPost();
while (vp)
{
GePrint("VideoPost Name: " + vp->GetName());
vp = vp->GetNext();
}

Properties

The parameters of a video post can be accessed through C4DAtom::GetParameter() and C4DAtom::SetParameter(). The IDs of these parameters are defined in the header file of the specific video post like vpxmbsampler.h, vppreviewhardware.h, vpwatermark.h etc.

Read-Only Properties

Not every video post can be combined with every render engine. It is needed to ask the BaseVideoPost object if it can be used with the given render engine.

// This example checks if the video post can be added to used render engine
RenderData* renderData = doc->GetActiveRenderData();
// check render engine
BaseContainer* bc = renderData->GetDataInstance();
const Int32 renderEngine = bc->GetInt32(RDATA_RENDERENGINE);
// create new video post
BaseVideoPost* watermark = BaseVideoPost::Alloc(1025462);
// check if the video post is compatible with the given render engine
if (watermark && watermark->RenderEngineCheck(renderEngine))
{
// insert video post
renderData->InsertVideoPost(watermark);
}
else
{
// delete video post
GePrint("This VideoPost cannot work with the current render engine");
BaseVideoPost::Free(watermark);
}

Stereo

A video post could also handle stereoscopic related functionality. By default the only existing video post that does handle stereoscopic images is the stereo video post (ID 450000225). To check if a plugin video post handles stereo images check the flag PLUGINFLAG_VIDEOPOST_STEREO_RENDERING. The source and target bitmap data is stored as a BaseBitmap (see BaseBitmap Manual).

// This example merges the two given BaseBitmaps in the src array into a single anaglyph bitmap
AutoAlloc<BaseVideoPost> stereoVP(450000225);
if (!stereoVP)
return false;
BaseContainer settings;
// merge bitmaps
stereoVP->StereoMergeImages(targetBitmap, src, 2, settings, COLORSPACETRANSFORMATION_NONE);
// show the result image
ShowBitmap(targetBitmap);

See also CameraObject Manual.

Bits

If a videopost is enabed or not is controlled with a bit:

if (rd)
{
if (vp)
}

Further Reading