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 Tdriver

Tdriver

Attributes

  • ENGLISH NAME : DriverTag
  • NAME : Tdriver
  • INCLUDE : Texpression
  • PATH : ca2/description/tdriver.res
  • PLUGIN : ca2
  • MAXON online help (may not exist): TDRIVER

Elements

ID UI Name Type Parameters Cycle
DRIVERTAG_DRIVERPARAMETER DrivingParameter LONG  
DRIVERTAG_SOURCEMODE_OFF None
DRIVERTAG_DRIVERVECTORMODE UseDirection LONG
FIT_H
ANIM OFF
DRIVERTAG_DRIVERVECTORMODEX X
DRIVERTAG_DRIVERVECTORMODEY Y
DRIVERTAG_DRIVERVECTORMODEZ Z
DRIVERTAG_DRIVERVECTORMIN Min REAL ANIM
DRIVERTAG_DRIVERVECTORMAX Max REAL ANIM
DRIVERTAG_DRIVERGRIDX XResolution LONG
MIN 1
MAX 25
ANIM OFF
DRIVERTAG_DRIVERGRIDY YResolution LONG
MIN 1
MAX 25
ANIM OFF
DRIVERTAG_DRIVERGRID Setup DRIVERGRID
CUSTOMGUI DRIVERCONTROLLER
COLUMNS 3
ROWS 3
DRIVERTAG_CLAMP Clamp BOOL  
DRIVERTAG_DRIVENOBJECT DrivenObject LINK  
DRIVERTAG_MODE Mode LONG  
DRIVERTAG_MODE_SINGLES SingleAbsolute
DRIVERTAG_MODE_RELATIVES ListRelative
DRIVERTAG_DRIVENPARAMETER Parameter LONG
ANIM OFF
FIT_H
SCALE_H
DRIVERTAG_TARGETMODE_OFF Off
DRIVERTAG_DRIVERMIX Mix BOOL
ANIM OFF
FIT_H
SCALE_H
DRIVERTAG_DRIVERRELATIVE Relative BOOL
ANIM OFF
FIT_H
SCALE_H
DRIVERTAG_ABSMODE Method LONG  
DRIVERTAG_ABSMODE_NORMAL Replace
DRIVERTAG_ABSMODE_ADD Add
DRIVERTAG_ABSMODE_MULTIPLY Multiply
DRIVERTAG_DRIVERMIN Min REAL
UNIT PERCENT
MINSLIDER 0.0
MAXSLIDER 100.0
CUSTOMGUI REALSLIDER
ANIM OFF
FIT_H
SCALE_H
DRIVERTAG_DRIVERMAX Max REAL
UNIT PERCENT
MINSLIDER 0.0
MAXSLIDER 100.0
CUSTOMGUI REALSLIDER
ANIM OFF
FIT_H
SCALE_H

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():
    obj = c4d.BaseObject(c4d.Osphere)
    tag = obj.MakeTag(c4d.Tdriver)
    doc.InsertObject(obj)
    c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
    
    #You can set parameters two different ways. 
    #First way              
    tag[c4d.DRIVERTAG_DRIVERPARAMETER] = c4d.DRIVERTAG_SOURCEMODE_OFF
    tag[c4d.DRIVERTAG_DRIVERVECTORMODE] = c4d.DRIVERTAG_DRIVERVECTORMODEX
    tag[c4d.DRIVERTAG_DRIVERVECTORMIN] = 0.1
    tag[c4d.DRIVERTAG_DRIVERVECTORMAX] = 0.1
    tag[c4d.DRIVERTAG_DRIVERGRIDX] = 1
    tag[c4d.DRIVERTAG_DRIVERGRIDY] = 1
    tag[c4d.DRIVERTAG_CLAMP] = True
    tag[c4d.DRIVERTAG_MODE] = c4d.DRIVERTAG_MODE_SINGLES
    tag[c4d.DRIVERTAG_DRIVENPARAMETER] = c4d.DRIVERTAG_TARGETMODE_OFF
    tag[c4d.DRIVERTAG_DRIVERMIX] = True
    tag[c4d.DRIVERTAG_DRIVERRELATIVE] = True
    tag[c4d.DRIVERTAG_ABSMODE] = c4d.DRIVERTAG_ABSMODE_NORMAL
    tag[c4d.DRIVERTAG_DRIVERMIN] = 0.1
    tag[c4d.DRIVERTAG_DRIVERMAX] = 0.1
    
    #Second way, using the base container.
    bc = tag.GetDataInstance()
    bc.SetInt32(c4d.DRIVERTAG_DRIVERPARAMETER,c4d.DRIVERTAG_SOURCEMODE_OFF)
    bc.SetInt32(c4d.DRIVERTAG_DRIVERVECTORMODE,c4d.DRIVERTAG_DRIVERVECTORMODEX)
    bc.SetFloat(c4d.DRIVERTAG_DRIVERVECTORMIN,0.1)
    bc.SetFloat(c4d.DRIVERTAG_DRIVERVECTORMAX,0.1)
    bc.SetInt32(c4d.DRIVERTAG_DRIVERGRIDX,1)
    bc.SetInt32(c4d.DRIVERTAG_DRIVERGRIDY,1)
    bc.SetBool(c4d.DRIVERTAG_CLAMP,True)
    bc.SetInt32(c4d.DRIVERTAG_MODE,c4d.DRIVERTAG_MODE_SINGLES)
    bc.SetInt32(c4d.DRIVERTAG_DRIVENPARAMETER,c4d.DRIVERTAG_TARGETMODE_OFF)
    bc.SetBool(c4d.DRIVERTAG_DRIVERMIX,True)
    bc.SetBool(c4d.DRIVERTAG_DRIVERRELATIVE,True)
    bc.SetInt32(c4d.DRIVERTAG_ABSMODE,c4d.DRIVERTAG_ABSMODE_NORMAL)
    bc.SetFloat(c4d.DRIVERTAG_DRIVERMIN,0.1)
    bc.SetFloat(c4d.DRIVERTAG_DRIVERMAX,0.1)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../ca2/description/tdriver.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseObject *pObject = BaseObject::Alloc(Osphere);
    pDoc->InsertObject(pObject);
    pDoc->StartUndo();
    pDoc->AddUndo(UNDOTYPE_NEW,pObject);
    pDoc->EndUndo();
    pDoc->StartUndo();
    BaseTag *pTag = pObject->MakeTag(Tdriver);
    pDoc->AddUndo(UNDOTYPE_NEW,pTag);
    pDoc->EndUndo();
    pObject->Message(MSG_UPDATE);
    
    //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;
    pTag->SetParameter(DescID(DRIVERTAG_DRIVERPARAMETER),GeData(DRIVERTAG_SOURCEMODE_OFF),flags);
    pTag->SetParameter(DescID(DRIVERTAG_DRIVERVECTORMODE),GeData(DRIVERTAG_DRIVERVECTORMODEX),flags);
    pTag->SetParameter(DescID(DRIVERTAG_DRIVERVECTORMIN),GeData(0.1),flags);
    pTag->SetParameter(DescID(DRIVERTAG_DRIVERVECTORMAX),GeData(0.1),flags);
    pTag->SetParameter(DescID(DRIVERTAG_DRIVERGRIDX),GeData(1),flags);
    pTag->SetParameter(DescID(DRIVERTAG_DRIVERGRIDY),GeData(1),flags);
    pTag->SetParameter(DescID(DRIVERTAG_CLAMP),GeData(true),flags);
    pTag->SetParameter(DescID(DRIVERTAG_MODE),GeData(DRIVERTAG_MODE_SINGLES),flags);
    pTag->SetParameter(DescID(DRIVERTAG_DRIVENPARAMETER),GeData(DRIVERTAG_TARGETMODE_OFF),flags);
    pTag->SetParameter(DescID(DRIVERTAG_DRIVERMIX),GeData(true),flags);
    pTag->SetParameter(DescID(DRIVERTAG_DRIVERRELATIVE),GeData(true),flags);
    pTag->SetParameter(DescID(DRIVERTAG_ABSMODE),GeData(DRIVERTAG_ABSMODE_NORMAL),flags);
    pTag->SetParameter(DescID(DRIVERTAG_DRIVERMIN),GeData(0.1),flags);
    pTag->SetParameter(DescID(DRIVERTAG_DRIVERMAX),GeData(0.1),flags);
    pTag->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pTag->GetDataInstance();
    bc->SetInt32(DRIVERTAG_DRIVERPARAMETER,DRIVERTAG_SOURCEMODE_OFF);
    bc->SetInt32(DRIVERTAG_DRIVERVECTORMODE,DRIVERTAG_DRIVERVECTORMODEX);
    bc->SetFloat(DRIVERTAG_DRIVERVECTORMIN,0.1);
    bc->SetFloat(DRIVERTAG_DRIVERVECTORMAX,0.1);
    bc->SetInt32(DRIVERTAG_DRIVERGRIDX,1);
    bc->SetInt32(DRIVERTAG_DRIVERGRIDY,1);
    bc->SetBool(DRIVERTAG_CLAMP,true);
    bc->SetInt32(DRIVERTAG_MODE,DRIVERTAG_MODE_SINGLES);
    bc->SetInt32(DRIVERTAG_DRIVENPARAMETER,DRIVERTAG_TARGETMODE_OFF);
    bc->SetBool(DRIVERTAG_DRIVERMIX,true);
    bc->SetBool(DRIVERTAG_DRIVERRELATIVE,true);
    bc->SetInt32(DRIVERTAG_ABSMODE,DRIVERTAG_ABSMODE_NORMAL);
    bc->SetFloat(DRIVERTAG_DRIVERMIN,0.1);
    bc->SetFloat(DRIVERTAG_DRIVERMAX,0.1);
    pTag->Message(MSG_UPDATE);                                                      
}