VPxmbsampler
Attributes
-
ENGLISH NAME : PhysicalRenderer
-
NAME : VPxmbsampler
-
INCLUDE : VPbase
-
PATH : c4dplugin/description/vpxmbsampler.res
-
PLUGIN : c4dplugin
-
MAXON online help (may not exist): VPXMBSAMPLER
Elements
Example Code
The following code does not use the correct values when setting the data. You should check directly in C4D for the correct values that you should use in place of the ones that are shown.
This code is just to show you how to access the values for getting and setting the parameters.
Python
import c4d
from c4d import gui
def main():
videoPost = c4d.BaseVideoPost(c4d.VPxmbsampler)
#You can set parameters two different ways.
#First way
videoPost[c4d.VP_XMB_DOF] = True
videoPost[c4d.VP_XMB_MOTIONBLUR] = True
videoPost[c4d.VP_XMB_MOTION_SAMPLES_MOTION] = 1
videoPost[c4d.VP_XMB_MOTION_SAMPLES_DEFORMATION] = 1
videoPost[c4d.VP_XMB_MOTION_SAMPLES_HAIR] = 1
videoPost[c4d.VP_XMB_RAYTRACING_SAMPLER] = c4d.VP_XMB_RAYTRACING_SAMPLER_FIXED
videoPost[c4d.VP_XMB_RAYTRACING_INTERACTIVE_MODE] = c4d.VP_XMB_RAYTRACING_INTERACTIVE_MODE_NOEND
videoPost[c4d.VP_XMB_RAYTRACING_INTERACTIVE_PASSES] = 1
videoPost[c4d.VP_XMB_RAYTRACING_INTERACTIVE_TIME] = 0.1
videoPost[c4d.VP_XMB_RAYTRACING_INTERACTIVE_NET] = 1
videoPost[c4d.VP_XMB_RAYTRACING_QUALITY] = c4d.VP_XMB_RAYTRACING_QUALITY_PREVIEW
videoPost[c4d.VP_XMB_RAYTRACING_SAMPLES] = 0.1
videoPost[c4d.VP_XMB_RAYTRACING_SAMPLES_SHADING_MIN] = 0.1
videoPost[c4d.VP_XMB_RAYTRACING_SAMPLES_SHADING_MAX] = 0.1
videoPost[c4d.VP_XMB_RAYTRACING_SAMPLES_SHADING_ERROR] = 0.1
videoPost[c4d.VP_XMB_RAYTRACING_SAMPLES_SHADING_TRANS] = True
videoPost[c4d.VP_XMB_RAYTRACING_SAMPLES_HDR_THRESHOLD] = 0.1
videoPost[c4d.VP_XMB_RAYTRACING_SAMPLES_BLURRY_SHADING] = 0.1
videoPost[c4d.VP_XMB_RAYTRACING_SAMPLES_BLURRY_LIGHT] = 0.1
videoPost[c4d.VP_XMB_RAYTRACING_SAMPLES_BLURRY_AO] = 0.1
videoPost[c4d.VP_XMB_RAYTRACING_SAMPLES_BLURRY_SSS] = 0.1
videoPost[c4d.VP_XMB_RAYTRACING_SAMPLES_GI_ENABLED] = True
videoPost[c4d.VP_XMB_RAYTRACING_SAMPLES_GI_DEPTH] = 1
videoPost[c4d.VP_XMB_RAYTRACING_SAMPLES_GI_SAMPLES] = 0.1
videoPost[c4d.VP_XMB_RAYTRACING_ADVANCED_ENGINE] = c4d.VP_XMB_RAYTRACING_ADVANCED_ENGINE_PHYSICAL
videoPost[c4d.VP_XMB_RAYTRACING_ADVANCED_PREVIEW] = c4d.VP_XMB_RAYTRACING_ADVANCED_PREVIEW_NEVER
videoPost[c4d.VP_XMB_RAYTRACING_ADVANCED_PREVIEW_MIN] = c4d.VP_XMB_RAYTRACING_ADVANCED_PREVIEW_HALF
videoPost[c4d.VP_XMB_RAYTRACING_ADVANCED_PREVIEW_MAX] = c4d.VP_XMB_RAYTRACING_ADVANCED_PREVIEW_HALF
videoPost[c4d.VP_XMB_RAYTRACING_ADVANCED_STATS] = c4d.VP_XMB_RAYTRACING_ADVANCED_STATS_NONE
videoPost[c4d.VP_XMB_RAYTRACING_DEBUG_NO_SHADE] = True
videoPost[c4d.VP_XMB_RAYTRACING_DEBUG_LUX] = True
videoPost[c4d.VP_XMB_RAYTRACING_DEBUG_LOCK_TIME] = True
videoPost[c4d.VP_XMB_RAYTRACING_DEBUG_TIME] = 0.1
videoPost[c4d.VP_XMB_RAYTRACING_DEBUG_SAMPLING] = 1
#Second way, using the base container.
bc = videoPost.GetDataInstance()
bc.SetBool(c4d.VP_XMB_DOF,True)
bc.SetBool(c4d.VP_XMB_MOTIONBLUR,True)
bc.SetInt32(c4d.VP_XMB_MOTION_SAMPLES_MOTION,1)
bc.SetInt32(c4d.VP_XMB_MOTION_SAMPLES_DEFORMATION,1)
bc.SetInt32(c4d.VP_XMB_MOTION_SAMPLES_HAIR,1)
bc.SetInt32(c4d.VP_XMB_RAYTRACING_SAMPLER,c4d.VP_XMB_RAYTRACING_SAMPLER_FIXED)
bc.SetInt32(c4d.VP_XMB_RAYTRACING_INTERACTIVE_MODE,c4d.VP_XMB_RAYTRACING_INTERACTIVE_MODE_NOEND)
bc.SetInt32(c4d.VP_XMB_RAYTRACING_INTERACTIVE_PASSES,1)
bc.SetFloat(c4d.VP_XMB_RAYTRACING_INTERACTIVE_TIME,0.1)
bc.SetInt32(c4d.VP_XMB_RAYTRACING_INTERACTIVE_NET,1)
bc.SetInt32(c4d.VP_XMB_RAYTRACING_QUALITY,c4d.VP_XMB_RAYTRACING_QUALITY_PREVIEW)
bc.SetFloat(c4d.VP_XMB_RAYTRACING_SAMPLES,0.1)
bc.SetFloat(c4d.VP_XMB_RAYTRACING_SAMPLES_SHADING_MIN,0.1)
bc.SetFloat(c4d.VP_XMB_RAYTRACING_SAMPLES_SHADING_MAX,0.1)
bc.SetFloat(c4d.VP_XMB_RAYTRACING_SAMPLES_SHADING_ERROR,0.1)
bc.SetBool(c4d.VP_XMB_RAYTRACING_SAMPLES_SHADING_TRANS,True)
bc.SetFloat(c4d.VP_XMB_RAYTRACING_SAMPLES_HDR_THRESHOLD,0.1)
bc.SetFloat(c4d.VP_XMB_RAYTRACING_SAMPLES_BLURRY_SHADING,0.1)
bc.SetFloat(c4d.VP_XMB_RAYTRACING_SAMPLES_BLURRY_LIGHT,0.1)
bc.SetFloat(c4d.VP_XMB_RAYTRACING_SAMPLES_BLURRY_AO,0.1)
bc.SetFloat(c4d.VP_XMB_RAYTRACING_SAMPLES_BLURRY_SSS,0.1)
bc.SetBool(c4d.VP_XMB_RAYTRACING_SAMPLES_GI_ENABLED,True)
bc.SetInt32(c4d.VP_XMB_RAYTRACING_SAMPLES_GI_DEPTH,1)
bc.SetFloat(c4d.VP_XMB_RAYTRACING_SAMPLES_GI_SAMPLES,0.1)
bc.SetInt32(c4d.VP_XMB_RAYTRACING_ADVANCED_ENGINE,c4d.VP_XMB_RAYTRACING_ADVANCED_ENGINE_PHYSICAL)
bc.SetInt32(c4d.VP_XMB_RAYTRACING_ADVANCED_PREVIEW,c4d.VP_XMB_RAYTRACING_ADVANCED_PREVIEW_NEVER)
bc.SetInt32(c4d.VP_XMB_RAYTRACING_ADVANCED_PREVIEW_MIN,c4d.VP_XMB_RAYTRACING_ADVANCED_PREVIEW_HALF)
bc.SetInt32(c4d.VP_XMB_RAYTRACING_ADVANCED_PREVIEW_MAX,c4d.VP_XMB_RAYTRACING_ADVANCED_PREVIEW_HALF)
bc.SetInt32(c4d.VP_XMB_RAYTRACING_ADVANCED_STATS,c4d.VP_XMB_RAYTRACING_ADVANCED_STATS_NONE)
bc.SetBool(c4d.VP_XMB_RAYTRACING_DEBUG_NO_SHADE,True)
bc.SetBool(c4d.VP_XMB_RAYTRACING_DEBUG_LUX,True)
bc.SetBool(c4d.VP_XMB_RAYTRACING_DEBUG_LOCK_TIME,True)
bc.SetFloat(c4d.VP_XMB_RAYTRACING_DEBUG_TIME,0.1)
bc.SetInt32(c4d.VP_XMB_RAYTRACING_DEBUG_SAMPLING,1)
if __name__=='__main__':
main()
C++
#include "c4d.h"
#include "../c4dplugin/description/vpxmbsampler.h"
void SampleFunction()
{
BaseDocument *pDoc = GetActiveDocument();
BaseVideoPost *pVideoPost = BaseVideoPost::Alloc(VPxmbsampler);
//You can set parameters two different ways.
//First way
//Some objects do not store all their data in the container. You need to use GetParameter()/SetParameter() instead.
DESCFLAGS_SET flags = DESCFLAGS_SET_PARAM_SET;
pVideoPost->SetParameter(DescID(VP_XMB_DOF),GeData(true),flags);
pVideoPost->SetParameter(DescID(VP_XMB_MOTIONBLUR),GeData(true),flags);
pVideoPost->SetParameter(DescID(VP_XMB_MOTION_SAMPLES_MOTION),GeData(1),flags);
pVideoPost->SetParameter(DescID(VP_XMB_MOTION_SAMPLES_DEFORMATION),GeData(1),flags);
pVideoPost->SetParameter(DescID(VP_XMB_MOTION_SAMPLES_HAIR),GeData(1),flags);
pVideoPost->SetParameter(DescID(VP_XMB_RAYTRACING_SAMPLER),GeData(VP_XMB_RAYTRACING_SAMPLER_FIXED),flags);
pVideoPost->SetParameter(DescID(VP_XMB_RAYTRACING_INTERACTIVE_MODE),GeData(VP_XMB_RAYTRACING_INTERACTIVE_MODE_NOEND),flags);
pVideoPost->SetParameter(DescID(VP_XMB_RAYTRACING_INTERACTIVE_PASSES),GeData(1),flags);
pVideoPost->SetParameter(DescID(VP_XMB_RAYTRACING_INTERACTIVE_TIME),GeData(0.1),flags);
pVideoPost->SetParameter(DescID(VP_XMB_RAYTRACING_INTERACTIVE_NET),GeData(1),flags);
pVideoPost->SetParameter(DescID(VP_XMB_RAYTRACING_QUALITY),GeData(VP_XMB_RAYTRACING_QUALITY_PREVIEW),flags);
pVideoPost->SetParameter(DescID(VP_XMB_RAYTRACING_SAMPLES),GeData(0.1),flags);
pVideoPost->SetParameter(DescID(VP_XMB_RAYTRACING_SAMPLES_SHADING_MIN),GeData(0.1),flags);
pVideoPost->SetParameter(DescID(VP_XMB_RAYTRACING_SAMPLES_SHADING_MAX),GeData(0.1),flags);
pVideoPost->SetParameter(DescID(VP_XMB_RAYTRACING_SAMPLES_SHADING_ERROR),GeData(0.1),flags);
pVideoPost->SetParameter(DescID(VP_XMB_RAYTRACING_SAMPLES_SHADING_TRANS),GeData(true),flags);
pVideoPost->SetParameter(DescID(VP_XMB_RAYTRACING_SAMPLES_HDR_THRESHOLD),GeData(0.1),flags);
pVideoPost->SetParameter(DescID(VP_XMB_RAYTRACING_SAMPLES_BLURRY_SHADING),GeData(0.1),flags);
pVideoPost->SetParameter(DescID(VP_XMB_RAYTRACING_SAMPLES_BLURRY_LIGHT),GeData(0.1),flags);
pVideoPost->SetParameter(DescID(VP_XMB_RAYTRACING_SAMPLES_BLURRY_AO),GeData(0.1),flags);
pVideoPost->SetParameter(DescID(VP_XMB_RAYTRACING_SAMPLES_BLURRY_SSS),GeData(0.1),flags);
pVideoPost->SetParameter(DescID(VP_XMB_RAYTRACING_SAMPLES_GI_ENABLED),GeData(true),flags);
pVideoPost->SetParameter(DescID(VP_XMB_RAYTRACING_SAMPLES_GI_DEPTH),GeData(1),flags);
pVideoPost->SetParameter(DescID(VP_XMB_RAYTRACING_SAMPLES_GI_SAMPLES),GeData(0.1),flags);
pVideoPost->SetParameter(DescID(VP_XMB_RAYTRACING_ADVANCED_ENGINE),GeData(VP_XMB_RAYTRACING_ADVANCED_ENGINE_PHYSICAL),flags);
pVideoPost->SetParameter(DescID(VP_XMB_RAYTRACING_ADVANCED_PREVIEW),GeData(VP_XMB_RAYTRACING_ADVANCED_PREVIEW_NEVER),flags);
pVideoPost->SetParameter(DescID(VP_XMB_RAYTRACING_ADVANCED_PREVIEW_MIN),GeData(VP_XMB_RAYTRACING_ADVANCED_PREVIEW_HALF),flags);
pVideoPost->SetParameter(DescID(VP_XMB_RAYTRACING_ADVANCED_PREVIEW_MAX),GeData(VP_XMB_RAYTRACING_ADVANCED_PREVIEW_HALF),flags);
pVideoPost->SetParameter(DescID(VP_XMB_RAYTRACING_ADVANCED_STATS),GeData(VP_XMB_RAYTRACING_ADVANCED_STATS_NONE),flags);
pVideoPost->SetParameter(DescID(VP_XMB_RAYTRACING_DEBUG_NO_SHADE),GeData(true),flags);
pVideoPost->SetParameter(DescID(VP_XMB_RAYTRACING_DEBUG_LUX),GeData(true),flags);
pVideoPost->SetParameter(DescID(VP_XMB_RAYTRACING_DEBUG_LOCK_TIME),GeData(true),flags);
pVideoPost->SetParameter(DescID(VP_XMB_RAYTRACING_DEBUG_TIME),GeData(0.1),flags);
pVideoPost->SetParameter(DescID(VP_XMB_RAYTRACING_DEBUG_SAMPLING),GeData(1),flags);
pVideoPost->Message(MSG_UPDATE);
//Second way, using the base container.
BaseContainer *bc = pVideoPost->GetDataInstance();
bc->SetBool(VP_XMB_DOF,true);
bc->SetBool(VP_XMB_MOTIONBLUR,true);
bc->SetInt32(VP_XMB_MOTION_SAMPLES_MOTION,1);
bc->SetInt32(VP_XMB_MOTION_SAMPLES_DEFORMATION,1);
bc->SetInt32(VP_XMB_MOTION_SAMPLES_HAIR,1);
bc->SetInt32(VP_XMB_RAYTRACING_SAMPLER,VP_XMB_RAYTRACING_SAMPLER_FIXED);
bc->SetInt32(VP_XMB_RAYTRACING_INTERACTIVE_MODE,VP_XMB_RAYTRACING_INTERACTIVE_MODE_NOEND);
bc->SetInt32(VP_XMB_RAYTRACING_INTERACTIVE_PASSES,1);
bc->SetFloat(VP_XMB_RAYTRACING_INTERACTIVE_TIME,0.1);
bc->SetInt32(VP_XMB_RAYTRACING_INTERACTIVE_NET,1);
bc->SetInt32(VP_XMB_RAYTRACING_QUALITY,VP_XMB_RAYTRACING_QUALITY_PREVIEW);
bc->SetFloat(VP_XMB_RAYTRACING_SAMPLES,0.1);
bc->SetFloat(VP_XMB_RAYTRACING_SAMPLES_SHADING_MIN,0.1);
bc->SetFloat(VP_XMB_RAYTRACING_SAMPLES_SHADING_MAX,0.1);
bc->SetFloat(VP_XMB_RAYTRACING_SAMPLES_SHADING_ERROR,0.1);
bc->SetBool(VP_XMB_RAYTRACING_SAMPLES_SHADING_TRANS,true);
bc->SetFloat(VP_XMB_RAYTRACING_SAMPLES_HDR_THRESHOLD,0.1);
bc->SetFloat(VP_XMB_RAYTRACING_SAMPLES_BLURRY_SHADING,0.1);
bc->SetFloat(VP_XMB_RAYTRACING_SAMPLES_BLURRY_LIGHT,0.1);
bc->SetFloat(VP_XMB_RAYTRACING_SAMPLES_BLURRY_AO,0.1);
bc->SetFloat(VP_XMB_RAYTRACING_SAMPLES_BLURRY_SSS,0.1);
bc->SetBool(VP_XMB_RAYTRACING_SAMPLES_GI_ENABLED,true);
bc->SetInt32(VP_XMB_RAYTRACING_SAMPLES_GI_DEPTH,1);
bc->SetFloat(VP_XMB_RAYTRACING_SAMPLES_GI_SAMPLES,0.1);
bc->SetInt32(VP_XMB_RAYTRACING_ADVANCED_ENGINE,VP_XMB_RAYTRACING_ADVANCED_ENGINE_PHYSICAL);
bc->SetInt32(VP_XMB_RAYTRACING_ADVANCED_PREVIEW,VP_XMB_RAYTRACING_ADVANCED_PREVIEW_NEVER);
bc->SetInt32(VP_XMB_RAYTRACING_ADVANCED_PREVIEW_MIN,VP_XMB_RAYTRACING_ADVANCED_PREVIEW_HALF);
bc->SetInt32(VP_XMB_RAYTRACING_ADVANCED_PREVIEW_MAX,VP_XMB_RAYTRACING_ADVANCED_PREVIEW_HALF);
bc->SetInt32(VP_XMB_RAYTRACING_ADVANCED_STATS,VP_XMB_RAYTRACING_ADVANCED_STATS_NONE);
bc->SetBool(VP_XMB_RAYTRACING_DEBUG_NO_SHADE,true);
bc->SetBool(VP_XMB_RAYTRACING_DEBUG_LUX,true);
bc->SetBool(VP_XMB_RAYTRACING_DEBUG_LOCK_TIME,true);
bc->SetFloat(VP_XMB_RAYTRACING_DEBUG_TIME,0.1);
bc->SetInt32(VP_XMB_RAYTRACING_DEBUG_SAMPLING,1);
pVideoPost->Message(MSG_UPDATE);
}