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 Osketch

Osketch

Attributes

  • ENGLISH NAME : SketchLinesObject
  • NAME : Osketch
  • INCLUDE : Obase
  • INCLUDE : Moutliner
  • PATH : sketch/description/osketch.res
  • PLUGIN : sketch
  • MAXON online help (may not exist): OSKETCH

Elements

ID UI Name Type Parameters Cycle
ID_ST_OBJECT_OBJECTS Objects IN_EXCLUDE
NUM_FLAGS 2
INIT_STATE 3
SEND_SELCHNGMSG 1
SCALE_V
IMAGE_01_ON 1009316
IMAGE_01_OFF 1009320
IMAGE_02_ON 300000231
IMAGE_02_OFF 300000230
ID_ST_OBJECT_LINE_HIDDEN Hidden BOOL  
ID_ST_OBJECT_LINE_VISIBLE Visible BOOL  
ID_ST_OBJECT_SPLINE_TYPE Type LONG  
ID_ST_OBJECT_SPLINE_TYPE_LINEAR Linear
ID_ST_OBJECT_SPLINE_TYPE_CUBIC Cubic
ID_ST_OBJECT_SPLINE_TYPE_AKIMA Akima
ID_ST_OBJECT_SPLINE_TYPE_BSPLINE B-Spline
ID_ST_OBJECT_SPLINE_TYPE_BEZIER Bezier
ID_ST_OBJECT_SPLINE_INTERPOLATION IntermediatePoints LONG  
ID_ST_OBJECT_SPLINE_INTERPOLATION_NONE None
ID_ST_OBJECT_SPLINE_INTERPOLATION_NATURAL Natural
ID_ST_OBJECT_SPLINE_INTERPOLATION_UNIFORM Uniform
ID_ST_OBJECT_SPLINE_INTERPOLATION_ADAPTIVE Adaptive
ID_ST_OBJECT_SPLINE_INTERPOLATION_SUBDIVIDED Subdivided
ID_ST_OBJECT_SPLINE_SUBD Number LONG
MIN 0
MAX 5000
ID_ST_OBJECT_SPLINE_ANGLE Angle REAL
UNIT DEGREE
MIN 0.0
MAX 90.0
ID_ST_OBJECT_SPLINE_LENGTH MaximumLength REAL
UNIT METER
MIN 0.01
ID_ST_OBJECT_LINES_MODE Mode LONG  
ID_ST_OBJECT_LINES_MODE_INCLUDE Include
ID_ST_OBJECT_LINES_MODE_EXCLUDE Exclude
ID_ST_OBJECT_LINES Lines IN_EXCLUDE
NUM_FLAGS 0
INIT_STATE 0
SEND_SELCHNGMSG 1
SCALE_V
ID_ST_OBJECT_BORDER Border IN_EXCLUDE
NUM_FLAGS 0
INIT_STATE 0
SEND_SELCHNGMSG 1
SCALE_V
ID_ST_OBJECT_EDGES Edges IN_EXCLUDE
NUM_FLAGS 0
INIT_STATE 0
SEND_SELCHNGMSG 1
SCALE_V
ID_ST_OBJECT_UVW ContourUVW IN_EXCLUDE
NUM_FLAGS 0
INIT_STATE 0
SEND_SELCHNGMSG 1
SCALE_V

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.Osketch)
    doc.InsertObject(obj)
    c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
    
    #You can set parameters two different ways. 
    #First way              
    obj[c4d.ID_ST_OBJECT_LINE_HIDDEN] = True
    obj[c4d.ID_ST_OBJECT_LINE_VISIBLE] = True
    obj[c4d.ID_ST_OBJECT_SPLINE_TYPE] = c4d.ID_ST_OBJECT_SPLINE_TYPE_LINEAR
    obj[c4d.ID_ST_OBJECT_SPLINE_INTERPOLATION] = c4d.ID_ST_OBJECT_SPLINE_INTERPOLATION_NONE
    obj[c4d.ID_ST_OBJECT_SPLINE_SUBD] = 1
    obj[c4d.ID_ST_OBJECT_SPLINE_ANGLE] = 0.1
    obj[c4d.ID_ST_OBJECT_SPLINE_LENGTH] = 0.1
    obj[c4d.ID_ST_OBJECT_LINES_MODE] = c4d.ID_ST_OBJECT_LINES_MODE_INCLUDE
    
    #Second way, using the base container.
    bc = obj.GetDataInstance()
    bc.SetBool(c4d.ID_ST_OBJECT_LINE_HIDDEN,True)
    bc.SetBool(c4d.ID_ST_OBJECT_LINE_VISIBLE,True)
    bc.SetInt32(c4d.ID_ST_OBJECT_SPLINE_TYPE,c4d.ID_ST_OBJECT_SPLINE_TYPE_LINEAR)
    bc.SetInt32(c4d.ID_ST_OBJECT_SPLINE_INTERPOLATION,c4d.ID_ST_OBJECT_SPLINE_INTERPOLATION_NONE)
    bc.SetInt32(c4d.ID_ST_OBJECT_SPLINE_SUBD,1)
    bc.SetFloat(c4d.ID_ST_OBJECT_SPLINE_ANGLE,0.1)
    bc.SetFloat(c4d.ID_ST_OBJECT_SPLINE_LENGTH,0.1)
    bc.SetInt32(c4d.ID_ST_OBJECT_LINES_MODE,c4d.ID_ST_OBJECT_LINES_MODE_INCLUDE)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../sketch/description/osketch.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseObject *pObject = BaseObject::Alloc(Osketch);
    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_ST_OBJECT_LINE_HIDDEN),GeData(true),flags);
    pObject->SetParameter(DescID(ID_ST_OBJECT_LINE_VISIBLE),GeData(true),flags);
    pObject->SetParameter(DescID(ID_ST_OBJECT_SPLINE_TYPE),GeData(ID_ST_OBJECT_SPLINE_TYPE_LINEAR),flags);
    pObject->SetParameter(DescID(ID_ST_OBJECT_SPLINE_INTERPOLATION),GeData(ID_ST_OBJECT_SPLINE_INTERPOLATION_NONE),flags);
    pObject->SetParameter(DescID(ID_ST_OBJECT_SPLINE_SUBD),GeData(1),flags);
    pObject->SetParameter(DescID(ID_ST_OBJECT_SPLINE_ANGLE),GeData(0.1),flags);
    pObject->SetParameter(DescID(ID_ST_OBJECT_SPLINE_LENGTH),GeData(0.1),flags);
    pObject->SetParameter(DescID(ID_ST_OBJECT_LINES_MODE),GeData(ID_ST_OBJECT_LINES_MODE_INCLUDE),flags);
    pObject->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pObject->GetDataInstance();
    bc->SetBool(ID_ST_OBJECT_LINE_HIDDEN,true);
    bc->SetBool(ID_ST_OBJECT_LINE_VISIBLE,true);
    bc->SetInt32(ID_ST_OBJECT_SPLINE_TYPE,ID_ST_OBJECT_SPLINE_TYPE_LINEAR);
    bc->SetInt32(ID_ST_OBJECT_SPLINE_INTERPOLATION,ID_ST_OBJECT_SPLINE_INTERPOLATION_NONE);
    bc->SetInt32(ID_ST_OBJECT_SPLINE_SUBD,1);
    bc->SetFloat(ID_ST_OBJECT_SPLINE_ANGLE,0.1);
    bc->SetFloat(ID_ST_OBJECT_SPLINE_LENGTH,0.1);
    bc->SetInt32(ID_ST_OBJECT_LINES_MODE,ID_ST_OBJECT_LINES_MODE_INCLUDE);
    pObject->Message(MSG_UPDATE);                                                      
}