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 Osplinerail

Osplinerail

Attributes

  • ENGLISH NAME : SplineRail
  • NAME : Osplinerail
  • INCLUDE : Obase
  • PATH : objects/description/osplinerail.res
  • PLUGIN : objects
  • MAXON online help (may not exist): OSPLINERAIL

Elements

ID UI Name Type Parameters Cycle
SPLINERAILOBJECT_SPLINE1 ZSplineLeft LINK  
SPLINERAILOBJECT_SPLINE2 ZSplineRight LINK  
SPLINERAILOBJECT_SPLINE3 XSplineTop LINK  
SPLINERAILOBJECT_SPLINE4 XSplineBottom LINK  
SPLINERAILOBJECT_REFERENCE Reference LINK  
SPLINERAILOBJECT_MODE Mode LONG  
SPLINERAILOBJECT_MODE_LIMIT Limited
SPLINERAILOBJECT_MODE_BOX WithinBox
SPLINERAILOBJECT_MODE_UNLIMITED Unlimited
SPLINERAILOBJECT_SIZE Size VECTOR
MIN 0
UNIT METER
SPLINERAILOBJECT_SCALEBEFORESTART ScaleBeforeStart REAL UNIT
SPLINERAILOBJECT_SCALEAFTEREND ScaleAfterEnd REAL UNIT

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.Osplinerail)
    doc.InsertObject(obj)
    c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
    
    #You can set parameters two different ways. 
    #First way              
    obj[c4d.SPLINERAILOBJECT_MODE] = c4d.SPLINERAILOBJECT_MODE_LIMIT
    obj[c4d.SPLINERAILOBJECT_SIZE] = c4d.Vector(1.0,1.0,1.0)
    obj[c4d.SPLINERAILOBJECT_SCALEBEFORESTART] = 0.1
    obj[c4d.SPLINERAILOBJECT_SCALEAFTEREND] = 0.1
    
    #Second way, using the base container.
    bc = obj.GetDataInstance()
    bc.SetInt32(c4d.SPLINERAILOBJECT_MODE,c4d.SPLINERAILOBJECT_MODE_LIMIT)
    bc.SetVector(c4d.SPLINERAILOBJECT_SIZE, c4d.Vector(1.0,1.0,1.0)
    bc.SetFloat(c4d.SPLINERAILOBJECT_SCALEBEFORESTART,0.1)
    bc.SetFloat(c4d.SPLINERAILOBJECT_SCALEAFTEREND,0.1)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../objects/description/osplinerail.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseObject *pObject = BaseObject::Alloc(Osplinerail);
    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(SPLINERAILOBJECT_MODE),GeData(SPLINERAILOBJECT_MODE_LIMIT),flags);
    pObject->SetParameter(DescID(SPLINERAILOBJECT_SIZE),GeData(Vector(1.0,1.0,1.0)),flags);
    pObject->SetParameter(DescID(SPLINERAILOBJECT_SCALEBEFORESTART),GeData(0.1),flags);
    pObject->SetParameter(DescID(SPLINERAILOBJECT_SCALEAFTEREND),GeData(0.1),flags);
    pObject->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pObject->GetDataInstance();
    bc->SetInt32(SPLINERAILOBJECT_MODE,SPLINERAILOBJECT_MODE_LIMIT);
    bc->SetVector(SPLINERAILOBJECT_SIZE, c4d.Vector(1.0,1.0,1.0);
    bc->SetFloat(SPLINERAILOBJECT_SCALEBEFORESTART,0.1);
    bc->SetFloat(SPLINERAILOBJECT_SCALEAFTEREND,0.1);
    pObject->Message(MSG_UPDATE);                                                      
}