Here you will find documentation on all the descriptions that Cinema 4D currently has. You can list them Alphabetically, by Type or Plugin . The sample Python and C++ code is automatically generated and in some cases may not be 100% correct. If something doesn't work then please refer to the official Cinema 4D SDK documentation for more information.

IDs and information for DistanceBlur

DistanceBlur

Attributes

  • ENGLISH NAME : DepthofField
  • NAME : DB_NAME
  • INCLUDE : VPbase
  • PATH : advanced_render/description/distanceblur.res
  • PLUGIN : advanced_render
  • MAXON online help (may not exist): DISTANCEBLUR

Elements

ID UI Name Type Parameters Cycle
DB_FBLUR BlurStrength REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
DB_DBLURON UseDistanceBlur BOOL  
DB_DBLUR DistanceBlur REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
DB_BBLURON UseBackgroundBlur BOOL  
DB_BBLUR BackgroundBlur REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
DB_DOFON UseRadialBlur BOOL  
DB_DOF RadialBlur REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
DB_AFOCUSON UseAutofocus BOOL  
DB_AFOCUS AutofocusSize REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
DB_RANGE_USE UseGradients BOOL  
DB_RANGE_FGRAD FrontBlur GRADIENT
PARENTID DB_RANGE_USE
ALPHA
ICC_BASEDOCUMENT
DB_RANGE_BGRAD RearBlur GRADIENT
PARENTID DB_RANGE_USE
ALPHA
ICC_BASEDOCUMENT
DB_SHARP LensSharpness REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
DB_MINT LensIntensity REAL
UNIT PERCENT
MIN 0.0
DB_REFTYPE LensShape LONG  
CIRCULAR Circle
TRIANGLE Triangle
RHOMBIC Rhombus
PENTAGON Pentagon
HEXAGON Hexagon
HEPTAGON Heptagon
OCTAGON Octagon
NANOGON Nonagon
DB_ROT LensRotate REAL UNIT
DB_TINT_USE UseTint BOOL  
DB_TINT_FGRAD FrontColor GRADIENT
PARENTID DB_TINT_USE
COLOR
ALPHA
ICC_BASEDOCUMENT
DB_TINT_BGRAD RearColor GRADIENT
PARENTID DB_TINT_USE
COLOR
ALPHA
ICC_BASEDOCUMENT
DB_TINT_USERANGE UseRanges BOOL  
DB_TINT_USECAM UseCameraRanges BOOL  
DB_TINT_FSTART FrontStart REAL
PARENTID DB_TINT_USECAM
MIN 0.0
UNIT METER
DB_TINT_BSTART RearStart REAL
PARENTID DB_TINT_USECAM
MIN 0.0
UNIT METER
DB_TINT_FEND FrontEnd REAL
PARENTID DB_TINT_USECAM
MIN 0.0
UNIT METER
DB_TINT_BEND RearEnd REAL
PARENTID DB_TINT_USECAM
MIN 0.0
UNIT METER

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.DistanceBlur)
    
    #You can set parameters two different ways. 
    #First way              
    videoPost[c4d.DB_FBLUR] = 0.1
    videoPost[c4d.DB_DBLURON] = True
    videoPost[c4d.DB_DBLUR] = 0.1
    videoPost[c4d.DB_BBLURON] = True
    videoPost[c4d.DB_BBLUR] = 0.1
    videoPost[c4d.DB_DOFON] = True
    videoPost[c4d.DB_DOF] = 0.1
    videoPost[c4d.DB_AFOCUSON] = True
    videoPost[c4d.DB_AFOCUS] = 0.1
    videoPost[c4d.DB_RANGE_USE] = True
    videoPost[c4d.DB_SHARP] = 0.1
    videoPost[c4d.DB_MINT] = 0.1
    videoPost[c4d.DB_REFTYPE] = c4d.CIRCULAR
    videoPost[c4d.DB_ROT] = 0.1
    videoPost[c4d.DB_TINT_USE] = True
    videoPost[c4d.DB_TINT_USERANGE] = True
    videoPost[c4d.DB_TINT_USECAM] = True
    videoPost[c4d.DB_TINT_FSTART] = 0.1
    videoPost[c4d.DB_TINT_BSTART] = 0.1
    videoPost[c4d.DB_TINT_FEND] = 0.1
    videoPost[c4d.DB_TINT_BEND] = 0.1
    
    #Second way, using the base container.
    bc = videoPost.GetDataInstance()
    bc.SetFloat(c4d.DB_FBLUR,0.1)
    bc.SetBool(c4d.DB_DBLURON,True)
    bc.SetFloat(c4d.DB_DBLUR,0.1)
    bc.SetBool(c4d.DB_BBLURON,True)
    bc.SetFloat(c4d.DB_BBLUR,0.1)
    bc.SetBool(c4d.DB_DOFON,True)
    bc.SetFloat(c4d.DB_DOF,0.1)
    bc.SetBool(c4d.DB_AFOCUSON,True)
    bc.SetFloat(c4d.DB_AFOCUS,0.1)
    bc.SetBool(c4d.DB_RANGE_USE,True)
    bc.SetFloat(c4d.DB_SHARP,0.1)
    bc.SetFloat(c4d.DB_MINT,0.1)
    bc.SetInt32(c4d.DB_REFTYPE,c4d.CIRCULAR)
    bc.SetFloat(c4d.DB_ROT,0.1)
    bc.SetBool(c4d.DB_TINT_USE,True)
    bc.SetBool(c4d.DB_TINT_USERANGE,True)
    bc.SetBool(c4d.DB_TINT_USECAM,True)
    bc.SetFloat(c4d.DB_TINT_FSTART,0.1)
    bc.SetFloat(c4d.DB_TINT_BSTART,0.1)
    bc.SetFloat(c4d.DB_TINT_FEND,0.1)
    bc.SetFloat(c4d.DB_TINT_BEND,0.1)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../advanced_render/description/distanceblur.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseVideoPost *pVideoPost = BaseVideoPost::Alloc(DistanceBlur);  
    
    //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(DB_FBLUR),GeData(0.1),flags);
    pVideoPost->SetParameter(DescID(DB_DBLURON),GeData(true),flags);
    pVideoPost->SetParameter(DescID(DB_DBLUR),GeData(0.1),flags);
    pVideoPost->SetParameter(DescID(DB_BBLURON),GeData(true),flags);
    pVideoPost->SetParameter(DescID(DB_BBLUR),GeData(0.1),flags);
    pVideoPost->SetParameter(DescID(DB_DOFON),GeData(true),flags);
    pVideoPost->SetParameter(DescID(DB_DOF),GeData(0.1),flags);
    pVideoPost->SetParameter(DescID(DB_AFOCUSON),GeData(true),flags);
    pVideoPost->SetParameter(DescID(DB_AFOCUS),GeData(0.1),flags);
    pVideoPost->SetParameter(DescID(DB_RANGE_USE),GeData(true),flags);
    pVideoPost->SetParameter(DescID(DB_SHARP),GeData(0.1),flags);
    pVideoPost->SetParameter(DescID(DB_MINT),GeData(0.1),flags);
    pVideoPost->SetParameter(DescID(DB_REFTYPE),GeData(CIRCULAR),flags);
    pVideoPost->SetParameter(DescID(DB_ROT),GeData(0.1),flags);
    pVideoPost->SetParameter(DescID(DB_TINT_USE),GeData(true),flags);
    pVideoPost->SetParameter(DescID(DB_TINT_USERANGE),GeData(true),flags);
    pVideoPost->SetParameter(DescID(DB_TINT_USECAM),GeData(true),flags);
    pVideoPost->SetParameter(DescID(DB_TINT_FSTART),GeData(0.1),flags);
    pVideoPost->SetParameter(DescID(DB_TINT_BSTART),GeData(0.1),flags);
    pVideoPost->SetParameter(DescID(DB_TINT_FEND),GeData(0.1),flags);
    pVideoPost->SetParameter(DescID(DB_TINT_BEND),GeData(0.1),flags);
    pVideoPost->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pVideoPost->GetDataInstance();
    bc->SetFloat(DB_FBLUR,0.1);
    bc->SetBool(DB_DBLURON,true);
    bc->SetFloat(DB_DBLUR,0.1);
    bc->SetBool(DB_BBLURON,true);
    bc->SetFloat(DB_BBLUR,0.1);
    bc->SetBool(DB_DOFON,true);
    bc->SetFloat(DB_DOF,0.1);
    bc->SetBool(DB_AFOCUSON,true);
    bc->SetFloat(DB_AFOCUS,0.1);
    bc->SetBool(DB_RANGE_USE,true);
    bc->SetFloat(DB_SHARP,0.1);
    bc->SetFloat(DB_MINT,0.1);
    bc->SetInt32(DB_REFTYPE,CIRCULAR);
    bc->SetFloat(DB_ROT,0.1);
    bc->SetBool(DB_TINT_USE,true);
    bc->SetBool(DB_TINT_USERANGE,true);
    bc->SetBool(DB_TINT_USECAM,true);
    bc->SetFloat(DB_TINT_FSTART,0.1);
    bc->SetFloat(DB_TINT_BSTART,0.1);
    bc->SetFloat(DB_TINT_FEND,0.1);
    bc->SetFloat(DB_TINT_BEND,0.1);
    pVideoPost->Message(MSG_UPDATE);                                                      
}
             

Gradients

This node has gradients. Gradients can manually be edited by calling the following code

Python


C++

           
#include "customgui_gradient.h"
DB_RANGE_FGRAD
GeData data; pVideoPost->GetParameter(DescID(DB_RANGE_FGRAD),data,DESCFLAGS_GET_PARAM_GET)); Gradient *pGradient = (Gradient*)data.GetCustomDataType(CUSTOMDATATYPE_GRADIENT); if(pGradient) { //must be set before any knot is set pGradient->SetData(GRADIENT_MODE, GeData(GRADIENTMODE_ALPHA)); GradientKnot k1, k2; k1.col = Vector(0.0, 0.0, 1.0); k1.pos = 0.0; k2.col = 1.0; k2.pos = 1.0; pGradient->InsertKnot(k1); pGradient->InsertKnot(k2); } pVideoPost->SetParameter(DescID(DB_RANGE_FGRAD),data,DESCFLAGS_SET_PARAM_SET));
DB_RANGE_BGRAD
pVideoPost->GetParameter(DescID(DB_RANGE_BGRAD),data,DESCFLAGS_GET_PARAM_GET));
DB_TINT_FGRAD
pVideoPost->GetParameter(DescID(DB_TINT_FGRAD),data,DESCFLAGS_GET_PARAM_GET));
DB_TINT_BGRAD
pVideoPost->GetParameter(DescID(DB_TINT_BGRAD),data,DESCFLAGS_GET_PARAM_GET));