MotionBlur
Attributes
-
ENGLISH NAME : VectorMotionBlur
-
NAME : MBLUR_NAME
-
INCLUDE : VPbase
-
PATH : advanced_render/description/motionblur.res
-
PLUGIN : advanced_render
-
MAXON online help (may not exist): MOTIONBLUR
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.MotionBlur)
#You can set parameters two different ways.
#First way
videoPost[c4d.MBLUR_PHASE] = 0.1
videoPost[c4d.MBLUR_DENSITY] = 0.1
videoPost[c4d.MBLUR_SAMPLES] = 1
videoPost[c4d.MBLUR_BLUR] = 0.1
videoPost[c4d.MBLUR_TRAILS] = True
videoPost[c4d.MBLUR_MESHTRACK] = True
#Second way, using the base container.
bc = videoPost.GetDataInstance()
bc.SetFloat(c4d.MBLUR_PHASE,0.1)
bc.SetFloat(c4d.MBLUR_DENSITY,0.1)
bc.SetInt32(c4d.MBLUR_SAMPLES,1)
bc.SetFloat(c4d.MBLUR_BLUR,0.1)
bc.SetBool(c4d.MBLUR_TRAILS,True)
bc.SetBool(c4d.MBLUR_MESHTRACK,True)
if __name__=='__main__':
main()
C++
#include "c4d.h"
#include "../advanced_render/description/motionblur.h"
void SampleFunction()
{
BaseDocument *pDoc = GetActiveDocument();
BaseVideoPost *pVideoPost = BaseVideoPost::Alloc(MotionBlur);
//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(MBLUR_PHASE),GeData(0.1),flags);
pVideoPost->SetParameter(DescID(MBLUR_DENSITY),GeData(0.1),flags);
pVideoPost->SetParameter(DescID(MBLUR_SAMPLES),GeData(1),flags);
pVideoPost->SetParameter(DescID(MBLUR_BLUR),GeData(0.1),flags);
pVideoPost->SetParameter(DescID(MBLUR_TRAILS),GeData(true),flags);
pVideoPost->SetParameter(DescID(MBLUR_MESHTRACK),GeData(true),flags);
pVideoPost->Message(MSG_UPDATE);
//Second way, using the base container.
BaseContainer *bc = pVideoPost->GetDataInstance();
bc->SetFloat(MBLUR_PHASE,0.1);
bc->SetFloat(MBLUR_DENSITY,0.1);
bc->SetInt32(MBLUR_SAMPLES,1);
bc->SetFloat(MBLUR_BLUR,0.1);
bc->SetBool(MBLUR_TRAILS,true);
bc->SetBool(MBLUR_MESHTRACK,true);
pVideoPost->Message(MSG_UPDATE);
}