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 MGspline

MGspline

Attributes

  • ENGLISH NAME : SplineObjectClone
  • NAME : MGspline
  • INCLUDE : Obase
  • PATH : mograph/description/mgspline.res
  • PLUGIN : mograph
  • MAXON online help (may not exist): MGSPLINE

Elements

ID UI Name Type Parameters Cycle
MG_SPLINE_RAIL Rail LINK  
MG_SPLINE_RAIL_TARGET Target BOOL  
MG_SPLINE_RAIL_SCALE Scale BOOL  
MG_SPLINE_MODE Distribution LONG  
MG_SPLINE_MODE_COUNT Count
MG_SPLINE_MODE_STEP Step
MG_SPLINE_MODE_EVEN Even
MG_SPLINE_MODE_VERTEX Vertex
MG_SPLINE_MODE_AXIS Axis
MG_SPLINE_MODE_GROUP1 Group1
MG_SPLINE_MODE_GROUP2 Group2
MG_SPLINE_MODE_GROUP3 Group3
MG_SPLINE_MODE_GROUP4 Group4
MG_SPLINE_COUNT Count LONG MIN
MG_SPLINE_STEP Step REAL
MIN 0.01
UNIT METER
MG_SPLINE_PERSEG PerSegment BOOL  
MG_SPLINE_SMOOTH SmoothRotation BOOL  
MG_SPLINE_OFFSET Offset REAL
UNIT PERCENT
MINSLIDER 0.0
MAXSLIDER 100.0
CUSTOMGUI REALSLIDER
MG_SPLINE_OFFSETVAR OffsetVariation REAL
UNIT PERCENT
MINSLIDER 0.0
MAXSLIDER 100.0
CUSTOMGUI REALSLIDER
MG_SPLINE_START Start REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
CUSTOMGUI REALSLIDER
MG_SPLINE_END End REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
CUSTOMGUI REALSLIDER
MG_SPLINE_LOOP Loop BOOL  
MG_SPLINE_RATE Rate REAL
UNIT PERCENT
MINSLIDER 0.0
MAXSLIDER 100.0
CUSTOMGUI REALSLIDER
MG_SPLINE_RATEVAR RateVariation REAL
UNIT PERCENT
MINSLIDER 0.0
MAXSLIDER 100.0
CUSTOMGUI REALSLIDER
MG_SPLINE_SEED RandomSeed LONG MIN
MG_SPLINE_VOLUME_SPREAD VolumeSpread REAL
UNIT PERCENT
MINSLIDER 0.0
MAXSLIDER 100.0
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.MGspline)
    doc.InsertObject(obj)
    c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
    
    #You can set parameters two different ways. 
    #First way              
    obj[c4d.MG_SPLINE_RAIL_TARGET] = True
    obj[c4d.MG_SPLINE_RAIL_SCALE] = True
    obj[c4d.MG_SPLINE_MODE] = c4d.MG_SPLINE_MODE_COUNT
    obj[c4d.MG_SPLINE_COUNT] = 1
    obj[c4d.MG_SPLINE_STEP] = 0.1
    obj[c4d.MG_SPLINE_PERSEG] = True
    obj[c4d.MG_SPLINE_SMOOTH] = True
    obj[c4d.MG_SPLINE_OFFSET] = 0.1
    obj[c4d.MG_SPLINE_OFFSETVAR] = 0.1
    obj[c4d.MG_SPLINE_START] = 0.1
    obj[c4d.MG_SPLINE_END] = 0.1
    obj[c4d.MG_SPLINE_LOOP] = True
    obj[c4d.MG_SPLINE_RATE] = 0.1
    obj[c4d.MG_SPLINE_RATEVAR] = 0.1
    obj[c4d.MG_SPLINE_SEED] = 1
    obj[c4d.MG_SPLINE_VOLUME_SPREAD] = 0.1
    
    #Second way, using the base container.
    bc = obj.GetDataInstance()
    bc.SetBool(c4d.MG_SPLINE_RAIL_TARGET,True)
    bc.SetBool(c4d.MG_SPLINE_RAIL_SCALE,True)
    bc.SetInt32(c4d.MG_SPLINE_MODE,c4d.MG_SPLINE_MODE_COUNT)
    bc.SetInt32(c4d.MG_SPLINE_COUNT,1)
    bc.SetFloat(c4d.MG_SPLINE_STEP,0.1)
    bc.SetBool(c4d.MG_SPLINE_PERSEG,True)
    bc.SetBool(c4d.MG_SPLINE_SMOOTH,True)
    bc.SetFloat(c4d.MG_SPLINE_OFFSET,0.1)
    bc.SetFloat(c4d.MG_SPLINE_OFFSETVAR,0.1)
    bc.SetFloat(c4d.MG_SPLINE_START,0.1)
    bc.SetFloat(c4d.MG_SPLINE_END,0.1)
    bc.SetBool(c4d.MG_SPLINE_LOOP,True)
    bc.SetFloat(c4d.MG_SPLINE_RATE,0.1)
    bc.SetFloat(c4d.MG_SPLINE_RATEVAR,0.1)
    bc.SetInt32(c4d.MG_SPLINE_SEED,1)
    bc.SetFloat(c4d.MG_SPLINE_VOLUME_SPREAD,0.1)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../mograph/description/mgspline.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseObject *pObject = BaseObject::Alloc(MGspline);
    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(MG_SPLINE_RAIL_TARGET),GeData(true),flags);
    pObject->SetParameter(DescID(MG_SPLINE_RAIL_SCALE),GeData(true),flags);
    pObject->SetParameter(DescID(MG_SPLINE_MODE),GeData(MG_SPLINE_MODE_COUNT),flags);
    pObject->SetParameter(DescID(MG_SPLINE_COUNT),GeData(1),flags);
    pObject->SetParameter(DescID(MG_SPLINE_STEP),GeData(0.1),flags);
    pObject->SetParameter(DescID(MG_SPLINE_PERSEG),GeData(true),flags);
    pObject->SetParameter(DescID(MG_SPLINE_SMOOTH),GeData(true),flags);
    pObject->SetParameter(DescID(MG_SPLINE_OFFSET),GeData(0.1),flags);
    pObject->SetParameter(DescID(MG_SPLINE_OFFSETVAR),GeData(0.1),flags);
    pObject->SetParameter(DescID(MG_SPLINE_START),GeData(0.1),flags);
    pObject->SetParameter(DescID(MG_SPLINE_END),GeData(0.1),flags);
    pObject->SetParameter(DescID(MG_SPLINE_LOOP),GeData(true),flags);
    pObject->SetParameter(DescID(MG_SPLINE_RATE),GeData(0.1),flags);
    pObject->SetParameter(DescID(MG_SPLINE_RATEVAR),GeData(0.1),flags);
    pObject->SetParameter(DescID(MG_SPLINE_SEED),GeData(1),flags);
    pObject->SetParameter(DescID(MG_SPLINE_VOLUME_SPREAD),GeData(0.1),flags);
    pObject->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pObject->GetDataInstance();
    bc->SetBool(MG_SPLINE_RAIL_TARGET,true);
    bc->SetBool(MG_SPLINE_RAIL_SCALE,true);
    bc->SetInt32(MG_SPLINE_MODE,MG_SPLINE_MODE_COUNT);
    bc->SetInt32(MG_SPLINE_COUNT,1);
    bc->SetFloat(MG_SPLINE_STEP,0.1);
    bc->SetBool(MG_SPLINE_PERSEG,true);
    bc->SetBool(MG_SPLINE_SMOOTH,true);
    bc->SetFloat(MG_SPLINE_OFFSET,0.1);
    bc->SetFloat(MG_SPLINE_OFFSETVAR,0.1);
    bc->SetFloat(MG_SPLINE_START,0.1);
    bc->SetFloat(MG_SPLINE_END,0.1);
    bc->SetBool(MG_SPLINE_LOOP,true);
    bc->SetFloat(MG_SPLINE_RATE,0.1);
    bc->SetFloat(MG_SPLINE_RATEVAR,0.1);
    bc->SetInt32(MG_SPLINE_SEED,1);
    bc->SetFloat(MG_SPLINE_VOLUME_SPREAD,0.1);
    pObject->Message(MSG_UPDATE);                                                      
}