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 Ofieldforce

Ofieldforce

Attributes

  • ENGLISH NAME : FieldForceObject
  • NAME : Ofieldforce
  • INCLUDE : Oparticlebase
  • PATH : objects/description/ofieldforce.res
  • PLUGIN : objects
  • MAXON online help (may not exist): OFIELDFORCE

Elements

ID UI Name Type Parameters Cycle
ID_FIELDFORCE_MODE VelocityType LONG  
ID_FIELDFORCE_MODE_ADD AddtoVelocity
ID_FIELDFORCE_MODE_ABSOLUTE SetAbsoluteVelocity
ID_FIELDFORCE_MODE_DIRECTION ChangeDirection
ID_FIELDFORCE_STRENGTH Strength REAL STEP
ID_FIELDFORCE_CONSIDER_MASS ConsiderMass BOOL NAME
ID_FIELDFORCE_FIELDLIST Field FIELDLIST
ANIM ON
NEWLINE
NOVALUE
NOCOLOR
NOROTATION
ID_FIELDFORCE_DISPLAY DisplayBox BOOL NAME
ID_FIELDFORCE_BOX_SIZE BoxSize VECTOR
MIN 0.0
STEP 0.1
UNIT METER
ID_FIELDFORCE_DENSITY LineDensity REAL
CUSTOMGUI REALSLIDER
MIN 1.0
MAX 100.0
MAXSLIDER 100.0
STEP 1.0
UNIT PERCENT
ID_FIELDFORCE_DISPLAY_LENGTH DisplayVectorLength BOOL
NAME ID_FIELDFORCE_DISPLAY_LENGTH
PARENTCOLLAPSE
ID_FIELDFORCE_VECTOR_MODE LengthAs LONG
PARENTCOLLAPSE ID_FIELDFORCE_DISPLAY_LENGTH
SCALE_H
ID_FIELDFORCE_VECTOR_MODE_LINES LineLength
ID_FIELDFORCE_VECTOR_MODE_COLOR Brightness
ID_FIELDFORCE_SCALE_LENGTH_DISPLAY ScaleDisplayedLength REAL
PARENTCOLLAPSE ID_FIELDFORCE_DISPLAY_LENGTH
MIN 0.001
STEP 0.01

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.Ofieldforce)
    doc.InsertObject(obj)
    c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
    
    #You can set parameters two different ways. 
    #First way              
    obj[c4d.ID_FIELDFORCE_MODE] = c4d.ID_FIELDFORCE_MODE_ADD
    obj[c4d.ID_FIELDFORCE_STRENGTH] = 0.1
    obj[c4d.ID_FIELDFORCE_CONSIDER_MASS] = True
    obj[c4d.ID_FIELDFORCE_DISPLAY] = True
    obj[c4d.ID_FIELDFORCE_BOX_SIZE] = c4d.Vector(1.0,1.0,1.0)
    obj[c4d.ID_FIELDFORCE_DENSITY] = 0.1
    obj[c4d.ID_FIELDFORCE_DISPLAY_LENGTH] = True
    obj[c4d.ID_FIELDFORCE_VECTOR_MODE] = c4d.ID_FIELDFORCE_VECTOR_MODE_LINES
    obj[c4d.ID_FIELDFORCE_SCALE_LENGTH_DISPLAY] = 0.1
    
    #Second way, using the base container.
    bc = obj.GetDataInstance()
    bc.SetInt32(c4d.ID_FIELDFORCE_MODE,c4d.ID_FIELDFORCE_MODE_ADD)
    bc.SetFloat(c4d.ID_FIELDFORCE_STRENGTH,0.1)
    bc.SetBool(c4d.ID_FIELDFORCE_CONSIDER_MASS,True)
    bc.SetBool(c4d.ID_FIELDFORCE_DISPLAY,True)
    bc.SetVector(c4d.ID_FIELDFORCE_BOX_SIZE, c4d.Vector(1.0,1.0,1.0)
    bc.SetFloat(c4d.ID_FIELDFORCE_DENSITY,0.1)
    bc.SetBool(c4d.ID_FIELDFORCE_DISPLAY_LENGTH,True)
    bc.SetInt32(c4d.ID_FIELDFORCE_VECTOR_MODE,c4d.ID_FIELDFORCE_VECTOR_MODE_LINES)
    bc.SetFloat(c4d.ID_FIELDFORCE_SCALE_LENGTH_DISPLAY,0.1)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../objects/description/ofieldforce.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseObject *pObject = BaseObject::Alloc(Ofieldforce);
    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(ID_FIELDFORCE_MODE),GeData(ID_FIELDFORCE_MODE_ADD),flags);
    pObject->SetParameter(DescID(ID_FIELDFORCE_STRENGTH),GeData(0.1),flags);
    pObject->SetParameter(DescID(ID_FIELDFORCE_CONSIDER_MASS),GeData(true),flags);
    pObject->SetParameter(DescID(ID_FIELDFORCE_DISPLAY),GeData(true),flags);
    pObject->SetParameter(DescID(ID_FIELDFORCE_BOX_SIZE),GeData(Vector(1.0,1.0,1.0)),flags);
    pObject->SetParameter(DescID(ID_FIELDFORCE_DENSITY),GeData(0.1),flags);
    pObject->SetParameter(DescID(ID_FIELDFORCE_DISPLAY_LENGTH),GeData(true),flags);
    pObject->SetParameter(DescID(ID_FIELDFORCE_VECTOR_MODE),GeData(ID_FIELDFORCE_VECTOR_MODE_LINES),flags);
    pObject->SetParameter(DescID(ID_FIELDFORCE_SCALE_LENGTH_DISPLAY),GeData(0.1),flags);
    pObject->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pObject->GetDataInstance();
    bc->SetInt32(ID_FIELDFORCE_MODE,ID_FIELDFORCE_MODE_ADD);
    bc->SetFloat(ID_FIELDFORCE_STRENGTH,0.1);
    bc->SetBool(ID_FIELDFORCE_CONSIDER_MASS,true);
    bc->SetBool(ID_FIELDFORCE_DISPLAY,true);
    bc->SetVector(ID_FIELDFORCE_BOX_SIZE, c4d.Vector(1.0,1.0,1.0);
    bc->SetFloat(ID_FIELDFORCE_DENSITY,0.1);
    bc->SetBool(ID_FIELDFORCE_DISPLAY_LENGTH,true);
    bc->SetInt32(ID_FIELDFORCE_VECTOR_MODE,ID_FIELDFORCE_VECTOR_MODE_LINES);
    bc->SetFloat(ID_FIELDFORCE_SCALE_LENGTH_DISPLAY,0.1);
    pObject->Message(MSG_UPDATE);                                                      
}