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 Osds

Osds

Attributes

  • ENGLISH NAME : SubdivisionSurface
  • NAME : Osds
  • INCLUDE : Obase
  • PATH : objects/description/osds.res
  • PLUGIN : objects
  • MAXON online help (may not exist): OSDS

Elements

ID UI Name Type Parameters Cycle
SDSOBJECT_TYPE Type LONG  
SDSOBJECT_TYPE_CM Catmull-Clark
SDSOBJECT_TYPE_CM_N Catmull-Clark(N-Gons)
SDSOBJECT_TYPE_OSD_CATMARK OpenSubdivCatmull-Clark
SDSOBJECT_TYPE_OSD_LOOP OpenSubdivLoop
SDSOBJECT_TYPE_OSD_BILINEAR OpenSubdivBilinear
SDSOBJECT_R12_COMPATIBILITY R12Compatibility BOOL ANIM
SDSOBJECT_SUBEDITOR_CM SubdivisionEditor LONG
MIN 0
MAX 6
SDSOBJECT_SUBRAY_CM SubdivisionRenderer LONG
MIN 0
MAX 6
SDSOBJECT_SUBDIVIDE_UV SubdivideUVs LONG  
SDSOBJECT_SUBDIVIDE_UV_STANDARD Standard
SDSOBJECT_SUBDIVIDE_UV_BOUNDARY Boundary
SDSOBJECT_SUBDIVIDE_UV_EDGE Edge
SDSOBJECT_OSD_FVAR_BOUNDARY_METHOD SubdivideUVs LONG  
SDSOBJECT_OSD_FVAR_BOUNDARY_METHOD_BOUNDARIES Linear,Boundaries
SDSOBJECT_OSD_FVAR_BOUNDARY_METHOD_ALL Linear,All
SDSOBJECT_OSD_BOUNDARY_METHOD BoundaryInterpolation LONG  
SDSOBJECT_OSD_BOUNDARY_METHOD_EDGEONLY Edge
SDSOBJECT_OSD_BOUNDARY_METHOD_EDGEANDCORNER EdgeandCorner
SDSOBJECT_OSD_CATMARK_TRI_SUBD TriangleSubdivision LONG  
SDSOBJECT_OSD_CATMARK_TRI_SUBD_CATMARK Catmark
SDSOBJECT_OSD_CATMARK_TRI_SUBD_SMOOTH Smooth
SDSOBJECT_OSD_EDGE_CREASE EdgeCrease LONG  
SDSOBJECT_OSD_EDGE_CREASE_UNIFORM Uniform
SDSOBJECT_OSD_EDGE_CREASE_CHAIKIN Chaikin
SDSOBJECT_OSD_ADAPTIVE_TESSELLATION_LEVEL Adaptive(GPU)TessellationLevel LONG
MIN 1
MAX 64

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.Osds)
    doc.InsertObject(obj)
    c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
    
    #You can set parameters two different ways. 
    #First way              
    obj[c4d.SDSOBJECT_TYPE] = c4d.SDSOBJECT_TYPE_CM
    obj[c4d.SDSOBJECT_R12_COMPATIBILITY] = True
    obj[c4d.SDSOBJECT_SUBEDITOR_CM] = 1
    obj[c4d.SDSOBJECT_SUBRAY_CM] = 1
    obj[c4d.SDSOBJECT_SUBDIVIDE_UV] = c4d.SDSOBJECT_SUBDIVIDE_UV_STANDARD
    obj[c4d.SDSOBJECT_OSD_FVAR_BOUNDARY_METHOD] = c4d.SDSOBJECT_OSD_FVAR_BOUNDARY_METHOD_BOUNDARIES
    obj[c4d.SDSOBJECT_OSD_BOUNDARY_METHOD] = c4d.SDSOBJECT_OSD_BOUNDARY_METHOD_EDGEONLY
    obj[c4d.SDSOBJECT_OSD_CATMARK_TRI_SUBD] = c4d.SDSOBJECT_OSD_CATMARK_TRI_SUBD_CATMARK
    obj[c4d.SDSOBJECT_OSD_EDGE_CREASE] = c4d.SDSOBJECT_OSD_EDGE_CREASE_UNIFORM
    obj[c4d.SDSOBJECT_OSD_ADAPTIVE_TESSELLATION_LEVEL] = 1
    
    #Second way, using the base container.
    bc = obj.GetDataInstance()
    bc.SetInt32(c4d.SDSOBJECT_TYPE,c4d.SDSOBJECT_TYPE_CM)
    bc.SetBool(c4d.SDSOBJECT_R12_COMPATIBILITY,True)
    bc.SetInt32(c4d.SDSOBJECT_SUBEDITOR_CM,1)
    bc.SetInt32(c4d.SDSOBJECT_SUBRAY_CM,1)
    bc.SetInt32(c4d.SDSOBJECT_SUBDIVIDE_UV,c4d.SDSOBJECT_SUBDIVIDE_UV_STANDARD)
    bc.SetInt32(c4d.SDSOBJECT_OSD_FVAR_BOUNDARY_METHOD,c4d.SDSOBJECT_OSD_FVAR_BOUNDARY_METHOD_BOUNDARIES)
    bc.SetInt32(c4d.SDSOBJECT_OSD_BOUNDARY_METHOD,c4d.SDSOBJECT_OSD_BOUNDARY_METHOD_EDGEONLY)
    bc.SetInt32(c4d.SDSOBJECT_OSD_CATMARK_TRI_SUBD,c4d.SDSOBJECT_OSD_CATMARK_TRI_SUBD_CATMARK)
    bc.SetInt32(c4d.SDSOBJECT_OSD_EDGE_CREASE,c4d.SDSOBJECT_OSD_EDGE_CREASE_UNIFORM)
    bc.SetInt32(c4d.SDSOBJECT_OSD_ADAPTIVE_TESSELLATION_LEVEL,1)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../objects/description/osds.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseObject *pObject = BaseObject::Alloc(Osds);
    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(SDSOBJECT_TYPE),GeData(SDSOBJECT_TYPE_CM),flags);
    pObject->SetParameter(DescID(SDSOBJECT_R12_COMPATIBILITY),GeData(true),flags);
    pObject->SetParameter(DescID(SDSOBJECT_SUBEDITOR_CM),GeData(1),flags);
    pObject->SetParameter(DescID(SDSOBJECT_SUBRAY_CM),GeData(1),flags);
    pObject->SetParameter(DescID(SDSOBJECT_SUBDIVIDE_UV),GeData(SDSOBJECT_SUBDIVIDE_UV_STANDARD),flags);
    pObject->SetParameter(DescID(SDSOBJECT_OSD_FVAR_BOUNDARY_METHOD),GeData(SDSOBJECT_OSD_FVAR_BOUNDARY_METHOD_BOUNDARIES),flags);
    pObject->SetParameter(DescID(SDSOBJECT_OSD_BOUNDARY_METHOD),GeData(SDSOBJECT_OSD_BOUNDARY_METHOD_EDGEONLY),flags);
    pObject->SetParameter(DescID(SDSOBJECT_OSD_CATMARK_TRI_SUBD),GeData(SDSOBJECT_OSD_CATMARK_TRI_SUBD_CATMARK),flags);
    pObject->SetParameter(DescID(SDSOBJECT_OSD_EDGE_CREASE),GeData(SDSOBJECT_OSD_EDGE_CREASE_UNIFORM),flags);
    pObject->SetParameter(DescID(SDSOBJECT_OSD_ADAPTIVE_TESSELLATION_LEVEL),GeData(1),flags);
    pObject->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pObject->GetDataInstance();
    bc->SetInt32(SDSOBJECT_TYPE,SDSOBJECT_TYPE_CM);
    bc->SetBool(SDSOBJECT_R12_COMPATIBILITY,true);
    bc->SetInt32(SDSOBJECT_SUBEDITOR_CM,1);
    bc->SetInt32(SDSOBJECT_SUBRAY_CM,1);
    bc->SetInt32(SDSOBJECT_SUBDIVIDE_UV,SDSOBJECT_SUBDIVIDE_UV_STANDARD);
    bc->SetInt32(SDSOBJECT_OSD_FVAR_BOUNDARY_METHOD,SDSOBJECT_OSD_FVAR_BOUNDARY_METHOD_BOUNDARIES);
    bc->SetInt32(SDSOBJECT_OSD_BOUNDARY_METHOD,SDSOBJECT_OSD_BOUNDARY_METHOD_EDGEONLY);
    bc->SetInt32(SDSOBJECT_OSD_CATMARK_TRI_SUBD,SDSOBJECT_OSD_CATMARK_TRI_SUBD_CATMARK);
    bc->SetInt32(SDSOBJECT_OSD_EDGE_CREASE,SDSOBJECT_OSD_EDGE_CREASE_UNIFORM);
    bc->SetInt32(SDSOBJECT_OSD_ADAPTIVE_TESSELLATION_LEVEL,1);
    pObject->Message(MSG_UPDATE);                                                      
}