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 Oepushapart

Oepushapart

Attributes

  • ENGLISH NAME : PushApart
  • NAME : Oepushapart
  • INCLUDE : Obase
  • INCLUDE : Oedeformer_panel
  • PATH : mograph/description/oepushapart.res
  • PLUGIN : mograph
  • MAXON online help (may not exist): OEPUSHAPART

Elements

ID UI Name Type Parameters Cycle
MGPUSHAPARTEFFECTOR_STRENGTH Strength REAL
MINSLIDER 0.0
MAXSLIDER 100.0
UNIT PERCENT
CUSTOMGUI REALSLIDER
MGPUSHAPARTEFFECTOR_SELECTION Selection STRING  
MGPUSHAPARTEFFECTOR_MODE Mode LONG FIT_H
MGPUSHAPARTEFFECTOR_MODE_HIDE Hide
MGPUSHAPARTEFFECTOR_MODE_PUSHAPART PushApart
MGPUSHAPARTEFFECTOR_MODE_SCALEAPART ScaleApart
MGPUSHAPARTEFFECTOR_MODE_ALONGX AlongX
MGPUSHAPARTEFFECTOR_MODE_ALONGY AlongY
MGPUSHAPARTEFFECTOR_MODE_ALONGZ AlongZ
MGPUSHAPARTEFFECTOR_RADIUS Radius REAL
MIN 0.0
UNIT METER
MGPUSHAPARTEFFECTOR_ITERATIONS Iterations LONG
MIN 0
MAX 1000

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.Oepushapart)
    doc.InsertObject(obj)
    c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
    
    #You can set parameters two different ways. 
    #First way              
    obj[c4d.MGPUSHAPARTEFFECTOR_STRENGTH] = 0.1
    obj[c4d.MGPUSHAPARTEFFECTOR_SELECTION] = "Hello World"
    obj[c4d.MGPUSHAPARTEFFECTOR_MODE] = c4d.MGPUSHAPARTEFFECTOR_MODE_HIDE
    obj[c4d.MGPUSHAPARTEFFECTOR_RADIUS] = 0.1
    obj[c4d.MGPUSHAPARTEFFECTOR_ITERATIONS] = 1
    
    #Second way, using the base container.
    bc = obj.GetDataInstance()
    bc.SetFloat(c4d.MGPUSHAPARTEFFECTOR_STRENGTH,0.1)
    bc.SetString(c4d.MGPUSHAPARTEFFECTOR_SELECTION,"Hello World")
    bc.SetInt32(c4d.MGPUSHAPARTEFFECTOR_MODE,c4d.MGPUSHAPARTEFFECTOR_MODE_HIDE)
    bc.SetFloat(c4d.MGPUSHAPARTEFFECTOR_RADIUS,0.1)
    bc.SetInt32(c4d.MGPUSHAPARTEFFECTOR_ITERATIONS,1)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../mograph/description/oepushapart.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseObject *pObject = BaseObject::Alloc(Oepushapart);
    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(MGPUSHAPARTEFFECTOR_STRENGTH),GeData(0.1),flags);
    pObject->SetParameter(DescID(MGPUSHAPARTEFFECTOR_SELECTION),GeData("Hello World"),flags);
    pObject->SetParameter(DescID(MGPUSHAPARTEFFECTOR_MODE),GeData(MGPUSHAPARTEFFECTOR_MODE_HIDE),flags);
    pObject->SetParameter(DescID(MGPUSHAPARTEFFECTOR_RADIUS),GeData(0.1),flags);
    pObject->SetParameter(DescID(MGPUSHAPARTEFFECTOR_ITERATIONS),GeData(1),flags);
    pObject->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pObject->GetDataInstance();
    bc->SetFloat(MGPUSHAPARTEFFECTOR_STRENGTH,0.1);
    bc->SetString(MGPUSHAPARTEFFECTOR_SELECTION,"Hello World");
    bc->SetInt32(MGPUSHAPARTEFFECTOR_MODE,MGPUSHAPARTEFFECTOR_MODE_HIDE);
    bc->SetFloat(MGPUSHAPARTEFFECTOR_RADIUS,0.1);
    bc->SetInt32(MGPUSHAPARTEFFECTOR_ITERATIONS,1);
    pObject->Message(MSG_UPDATE);                                                      
}