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 Ospline

Ospline

Attributes

  • ENGLISH NAME : Spline
  • NAME : Ospline
  • INCLUDE : Obase
  • PATH : c4dplugin/description/ospline.res
  • PLUGIN : c4dplugin
  • MAXON online help (may not exist): OSPLINE

Elements

ID UI Name Type Parameters Cycle
SPLINEOBJECT_TYPE Type LONG  
SPLINEOBJECT_TYPE_LINEAR Linear
SPLINEOBJECT_TYPE_CUBIC Cubic
SPLINEOBJECT_TYPE_AKIMA Akima
SPLINEOBJECT_TYPE_BSPLINE B-Spline
SPLINEOBJECT_TYPE_BEZIER Bezier
SPLINEOBJECT_CLOSED CloseSpline BOOL  
SPLINEOBJECT_INTERPOLATION IntermediatePoints LONG  
SPLINEOBJECT_INTERPOLATION_NONE None
SPLINEOBJECT_INTERPOLATION_NATURAL Natural
SPLINEOBJECT_INTERPOLATION_UNIFORM Uniform
SPLINEOBJECT_INTERPOLATION_ADAPTIVE Adaptive
SPLINEOBJECT_INTERPOLATION_SUBDIV Subdivided
SPLINEOBJECT_SUB Number LONG
MIN 0
MAX 5000
SPLINEOBJECT_ANGLE Angle REAL
UNIT DEGREE
MIN 0.0
MAX 90.0
SPLINEOBJECT_MAXIMUMLENGTH MaximumLength REAL
UNIT METER
MIN 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.Ospline)
    doc.InsertObject(obj)
    c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
    
    #You can set parameters two different ways. 
    #First way              
    obj[c4d.SPLINEOBJECT_TYPE] = c4d.SPLINEOBJECT_TYPE_LINEAR
    obj[c4d.SPLINEOBJECT_CLOSED] = True
    obj[c4d.SPLINEOBJECT_INTERPOLATION] = c4d.SPLINEOBJECT_INTERPOLATION_NONE
    obj[c4d.SPLINEOBJECT_SUB] = 1
    obj[c4d.SPLINEOBJECT_ANGLE] = 0.1
    obj[c4d.SPLINEOBJECT_MAXIMUMLENGTH] = 0.1
    
    #Second way, using the base container.
    bc = obj.GetDataInstance()
    bc.SetInt32(c4d.SPLINEOBJECT_TYPE,c4d.SPLINEOBJECT_TYPE_LINEAR)
    bc.SetBool(c4d.SPLINEOBJECT_CLOSED,True)
    bc.SetInt32(c4d.SPLINEOBJECT_INTERPOLATION,c4d.SPLINEOBJECT_INTERPOLATION_NONE)
    bc.SetInt32(c4d.SPLINEOBJECT_SUB,1)
    bc.SetFloat(c4d.SPLINEOBJECT_ANGLE,0.1)
    bc.SetFloat(c4d.SPLINEOBJECT_MAXIMUMLENGTH,0.1)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../c4dplugin/description/ospline.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseObject *pObject = BaseObject::Alloc(Ospline);
    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(SPLINEOBJECT_TYPE),GeData(SPLINEOBJECT_TYPE_LINEAR),flags);
    pObject->SetParameter(DescID(SPLINEOBJECT_CLOSED),GeData(true),flags);
    pObject->SetParameter(DescID(SPLINEOBJECT_INTERPOLATION),GeData(SPLINEOBJECT_INTERPOLATION_NONE),flags);
    pObject->SetParameter(DescID(SPLINEOBJECT_SUB),GeData(1),flags);
    pObject->SetParameter(DescID(SPLINEOBJECT_ANGLE),GeData(0.1),flags);
    pObject->SetParameter(DescID(SPLINEOBJECT_MAXIMUMLENGTH),GeData(0.1),flags);
    pObject->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pObject->GetDataInstance();
    bc->SetInt32(SPLINEOBJECT_TYPE,SPLINEOBJECT_TYPE_LINEAR);
    bc->SetBool(SPLINEOBJECT_CLOSED,true);
    bc->SetInt32(SPLINEOBJECT_INTERPOLATION,SPLINEOBJECT_INTERPOLATION_NONE);
    bc->SetInt32(SPLINEOBJECT_SUB,1);
    bc->SetFloat(SPLINEOBJECT_ANGLE,0.1);
    bc->SetFloat(SPLINEOBJECT_MAXIMUMLENGTH,0.1);
    pObject->Message(MSG_UPDATE);                                                      
}