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 Obasesurface

Obasesurface

Attributes

  • ENGLISH NAME : BaseSurface
  • NAME : Obasesurface
  • INCLUDE : Obase
  • PATH : dwgobjects/description/Obasesurface.res
  • PLUGIN : dwgobjects
  • MAXON online help (may not exist): OBASESURFACE

Elements

ID UI Name Type Parameters Cycle
BASESURFACE_TYPE SurfaceType LONG  
BASESURFACE_TYPE_UNKNOWN Unknown
BASESURFACE_TYPE_NURBS NURBS
BASESURFACE_TYPE_POLYNOMIAL Polynomial
BASESURFACE_TYPE_PLANE Plane
BASESURFACE_TYPE_EXTRUDE Extrusion
BASESURFACE_TYPE_ROTATE Rotation
BASESURFACE_MAKENURBS MakeNURBS BUTTON HIDDEN
BASESURFACE_OUTPUT Output LONG HIDDEN
BASESURFACE_OUTPUT_LINEAR Linear
BASESURFACE_OUTPUT_BSPLINE B-Spline
BASESURFACE_OUTPUT_HYPERNURBS SubdivisionSurface
BASESURFACE_OUTPUT_CONVERT Basis-Convert
BASESURFACE_USUB SubdivisionsU LONG
MIN 1
MAX 5000
BASESURFACE_VSUB SubdivisionsV LONG
MIN 1
MAX 5000
BASESURFACE_NORMALS CalculateNormals BOOL  
BASESURFACE_SWAPNORMALS SwapNormals BOOL  
BASESURFACE_TESTON Enable BOOL  
BASESURFACE_TESTUPOINT PositionU REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
BASESURFACE_TESTVPOINT PositionV REAL
UNIT PERCENT
MIN 0.0
MAX 100.0

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.Obasesurface)
    doc.InsertObject(obj)
    c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
    
    #You can set parameters two different ways. 
    #First way              
    obj[c4d.BASESURFACE_TYPE] = c4d.BASESURFACE_TYPE_UNKNOWN
    obj[c4d.BASESURFACE_OUTPUT] = c4d.BASESURFACE_OUTPUT_LINEAR
    obj[c4d.BASESURFACE_USUB] = 1
    obj[c4d.BASESURFACE_VSUB] = 1
    obj[c4d.BASESURFACE_NORMALS] = True
    obj[c4d.BASESURFACE_SWAPNORMALS] = True
    obj[c4d.BASESURFACE_TESTON] = True
    obj[c4d.BASESURFACE_TESTUPOINT] = 0.1
    obj[c4d.BASESURFACE_TESTVPOINT] = 0.1
    
    #Second way, using the base container.
    bc = obj.GetDataInstance()
    bc.SetInt32(c4d.BASESURFACE_TYPE,c4d.BASESURFACE_TYPE_UNKNOWN)
    bc.SetInt32(c4d.BASESURFACE_OUTPUT,c4d.BASESURFACE_OUTPUT_LINEAR)
    bc.SetInt32(c4d.BASESURFACE_USUB,1)
    bc.SetInt32(c4d.BASESURFACE_VSUB,1)
    bc.SetBool(c4d.BASESURFACE_NORMALS,True)
    bc.SetBool(c4d.BASESURFACE_SWAPNORMALS,True)
    bc.SetBool(c4d.BASESURFACE_TESTON,True)
    bc.SetFloat(c4d.BASESURFACE_TESTUPOINT,0.1)
    bc.SetFloat(c4d.BASESURFACE_TESTVPOINT,0.1)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../dwgobjects/description/Obasesurface.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseObject *pObject = BaseObject::Alloc(Obasesurface);
    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(BASESURFACE_TYPE),GeData(BASESURFACE_TYPE_UNKNOWN),flags);
    pObject->SetParameter(DescID(BASESURFACE_OUTPUT),GeData(BASESURFACE_OUTPUT_LINEAR),flags);
    pObject->SetParameter(DescID(BASESURFACE_USUB),GeData(1),flags);
    pObject->SetParameter(DescID(BASESURFACE_VSUB),GeData(1),flags);
    pObject->SetParameter(DescID(BASESURFACE_NORMALS),GeData(true),flags);
    pObject->SetParameter(DescID(BASESURFACE_SWAPNORMALS),GeData(true),flags);
    pObject->SetParameter(DescID(BASESURFACE_TESTON),GeData(true),flags);
    pObject->SetParameter(DescID(BASESURFACE_TESTUPOINT),GeData(0.1),flags);
    pObject->SetParameter(DescID(BASESURFACE_TESTVPOINT),GeData(0.1),flags);
    pObject->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pObject->GetDataInstance();
    bc->SetInt32(BASESURFACE_TYPE,BASESURFACE_TYPE_UNKNOWN);
    bc->SetInt32(BASESURFACE_OUTPUT,BASESURFACE_OUTPUT_LINEAR);
    bc->SetInt32(BASESURFACE_USUB,1);
    bc->SetInt32(BASESURFACE_VSUB,1);
    bc->SetBool(BASESURFACE_NORMALS,true);
    bc->SetBool(BASESURFACE_SWAPNORMALS,true);
    bc->SetBool(BASESURFACE_TESTON,true);
    bc->SetFloat(BASESURFACE_TESTUPOINT,0.1);
    bc->SetFloat(BASESURFACE_TESTVPOINT,0.1);
    pObject->Message(MSG_UPDATE);                                                      
}
             

Buttons

This node has buttons. Buttons can manually be executed by calling the following code

Python

c4d.CallButton(obj,c4d.BASESURFACE_MAKENURBS)

C++

DescriptionCommand dc;
dc.id = DescID(BASESURFACE_MAKENURBS);             
pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);