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 Oetarget

Oetarget

Attributes

  • ENGLISH NAME : Target
  • NAME : Oetarget
  • INCLUDE : Obase
  • INCLUDE : Oedeformer_panel
  • PATH : mograph/description/oetarget.res
  • PLUGIN : mograph
  • MAXON online help (may not exist): OETARGET

Elements

ID UI Name Type Parameters Cycle
MGTARGETEFFECTOR_STRENGTH Strength REAL
MINSLIDER 0.0
MAXSLIDER 100.0
UNIT PERCENT
CUSTOMGUI REALSLIDER
MGTARGETEFFECTOR_SELECTION Selection STRING  
MGTARGETEFFECTOR_MODE TargetMode LONG FIT_H
MGTARGETEFFECTOR_MODE_OBJECT ObjectTarget
MGTARGETEFFECTOR_MODE_CAMERA LookAtCamera
MGTARGETEFFECTOR_MODE_NEXT NextNode
MGTARGETEFFECTOR_MODE_PREV PreviousNode
MGTARGETEFFECTOR_MODE_FIELDS FieldDirection
MGTARGETEFFECTOR_SETWEIGHT SetWeight BOOL  
MGTARGETEFFECTOR_OBJECT TargetObject LINK  
MGTARGETEFFECTOR_PITCH UsePitch BOOL  
MGTARGETEFFECTOR_REVERSEVECTOR ReverseHeading BOOL  
MGTARGETEFFECTOR_PRIMITIVEAXIS UpVector LONG  
MGTARGETEFFECTOR_PRIMITIVEAXIS_NONE None
MGTARGETEFFECTOR_PRIMITIVEAXIS_LINK Object
MGTARGETEFFECTOR_PRIMITIVEAXIS_XP X+
MGTARGETEFFECTOR_PRIMITIVEAXIS_XN X-
MGTARGETEFFECTOR_PRIMITIVEAXIS_YP Y+
MGTARGETEFFECTOR_PRIMITIVEAXIS_YN Y-
MGTARGETEFFECTOR_PRIMITIVEAXIS_ZP Z+
MGTARGETEFFECTOR_PRIMITIVEAXIS_ZN Z-
MGTARGETEFFECTOR_UP Object LINK  
MGTARGETEFFECTOR_REACT Repel BOOL  
MGTARGETEFFECTOR_RANGE Distance REAL
MIN 0.0
MINSLIDER 0.0
MAXSLIDER 100.0
UNIT METER
CUSTOMGUI REALSLIDER
ETARG_RANGE_STRENGTH DistanceStrength REAL
MINSLIDER 0.0
MAXSLIDER 100.0
UNIT PERCENT
CUSTOMGUI REALSLIDER

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.Oetarget)
    doc.InsertObject(obj)
    c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
    
    #You can set parameters two different ways. 
    #First way              
    obj[c4d.MGTARGETEFFECTOR_STRENGTH] = 0.1
    obj[c4d.MGTARGETEFFECTOR_SELECTION] = "Hello World"
    obj[c4d.MGTARGETEFFECTOR_MODE] = c4d.MGTARGETEFFECTOR_MODE_OBJECT
    obj[c4d.MGTARGETEFFECTOR_SETWEIGHT] = True
    obj[c4d.MGTARGETEFFECTOR_PITCH] = True
    obj[c4d.MGTARGETEFFECTOR_REVERSEVECTOR] = True
    obj[c4d.MGTARGETEFFECTOR_PRIMITIVEAXIS] = c4d.MGTARGETEFFECTOR_PRIMITIVEAXIS_NONE
    obj[c4d.MGTARGETEFFECTOR_REACT] = True
    obj[c4d.MGTARGETEFFECTOR_RANGE] = 0.1
    obj[c4d.ETARG_RANGE_STRENGTH] = 0.1
    
    #Second way, using the base container.
    bc = obj.GetDataInstance()
    bc.SetFloat(c4d.MGTARGETEFFECTOR_STRENGTH,0.1)
    bc.SetString(c4d.MGTARGETEFFECTOR_SELECTION,"Hello World")
    bc.SetInt32(c4d.MGTARGETEFFECTOR_MODE,c4d.MGTARGETEFFECTOR_MODE_OBJECT)
    bc.SetBool(c4d.MGTARGETEFFECTOR_SETWEIGHT,True)
    bc.SetBool(c4d.MGTARGETEFFECTOR_PITCH,True)
    bc.SetBool(c4d.MGTARGETEFFECTOR_REVERSEVECTOR,True)
    bc.SetInt32(c4d.MGTARGETEFFECTOR_PRIMITIVEAXIS,c4d.MGTARGETEFFECTOR_PRIMITIVEAXIS_NONE)
    bc.SetBool(c4d.MGTARGETEFFECTOR_REACT,True)
    bc.SetFloat(c4d.MGTARGETEFFECTOR_RANGE,0.1)
    bc.SetFloat(c4d.ETARG_RANGE_STRENGTH,0.1)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../mograph/description/oetarget.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseObject *pObject = BaseObject::Alloc(Oetarget);
    pDoc->InsertObject(pObject);
    pDoc->StartUndo();
    pDoc->AddUndo(UNDO_NEW,pObject);
    pDoc->EndUndo();
    EventAdd(EVENT_FORCEREDRAW);
    
    //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;
    pObject->SetParameter(DescID(MGTARGETEFFECTOR_STRENGTH),GeData(0.1),flags);
    pObject->SetParameter(DescID(MGTARGETEFFECTOR_SELECTION),GeData("Hello World"),flags);
    pObject->SetParameter(DescID(MGTARGETEFFECTOR_MODE),GeData(MGTARGETEFFECTOR_MODE_OBJECT),flags);
    pObject->SetParameter(DescID(MGTARGETEFFECTOR_SETWEIGHT),GeData(true),flags);
    pObject->SetParameter(DescID(MGTARGETEFFECTOR_PITCH),GeData(true),flags);
    pObject->SetParameter(DescID(MGTARGETEFFECTOR_REVERSEVECTOR),GeData(true),flags);
    pObject->SetParameter(DescID(MGTARGETEFFECTOR_PRIMITIVEAXIS),GeData(MGTARGETEFFECTOR_PRIMITIVEAXIS_NONE),flags);
    pObject->SetParameter(DescID(MGTARGETEFFECTOR_REACT),GeData(true),flags);
    pObject->SetParameter(DescID(MGTARGETEFFECTOR_RANGE),GeData(0.1),flags);
    pObject->SetParameter(DescID(ETARG_RANGE_STRENGTH),GeData(0.1),flags);
    pObject->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pObject->GetDataInstance();
    bc->SetFloat(MGTARGETEFFECTOR_STRENGTH,0.1);
    bc->SetString(MGTARGETEFFECTOR_SELECTION,"Hello World");
    bc->SetInt32(MGTARGETEFFECTOR_MODE,MGTARGETEFFECTOR_MODE_OBJECT);
    bc->SetBool(MGTARGETEFFECTOR_SETWEIGHT,true);
    bc->SetBool(MGTARGETEFFECTOR_PITCH,true);
    bc->SetBool(MGTARGETEFFECTOR_REVERSEVECTOR,true);
    bc->SetInt32(MGTARGETEFFECTOR_PRIMITIVEAXIS,MGTARGETEFFECTOR_PRIMITIVEAXIS_NONE);
    bc->SetBool(MGTARGETEFFECTOR_REACT,true);
    bc->SetFloat(MGTARGETEFFECTOR_RANGE,0.1);
    bc->SetFloat(ETARG_RANGE_STRENGTH,0.1);
    pObject->Message(MSG_UPDATE);                                                      
}