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 Olod

Olod

Attributes

  • ENGLISH NAME : LOD
  • NAME : Olod
  • INCLUDE : Obase
  • PATH : objects/description/olod.res
  • PLUGIN : objects
  • MAXON online help (may not exist): OLOD

Elements

ID UI Name Type Parameters Cycle
LOD_MODE LODMode LONG  
LOD_MODE_CHILD Children
LOD_MODE_MANUAL_GROUPS ManualGroups
LOD_MODE_SIMPLIFY Simplify
LOD_CRITERIA Criteria LONG  
LOD_CRITERIA_MANUAL UserLODLevel
LOD_CRITERIA_MANUAL_SLIDER UserLODValue
LOD_CRITERIA_SCREEN_H ScreenSizeH
LOD_CRITERIA_SCREEN_V ScreenSizeV
LOD_CRITERIA_SCREEN_SURFACE ScreenSurface
LOD_CRITERIA_CAMERA_DIST CameraDistance
LOD_CRITERIA_GLOBAL Global
LOD_CAMERA_MINDIST MinDist REAL
UNIT METER
MIN 0
LOD_CAMERA_MAXDIST MaxDist REAL
UNIT METER
MIN 0
LOD_CURRENT_LEVEL CurrentLevel LONG  
LOD_LEVEL_COUNT_DYN LevelCount LONG MIN
LOD_BAR LODBar RANGE  
LOD_PROGRESIVE Progressive BOOL  
LOD_SHOW_UNASSIGNED AlwaysShowUnassignedObject BOOL  
LOD_VIEWPORT_ONLY UseLOD0forRendering BOOL  
LOD_RENDER_INCREMENT RenderLODIncrement REAL
UNIT PERCENT
MIN 0
MAX 100
LOD_CAMERA_CLIP UseCameraClip BOOL  
LOD_CAMERA_CLIP_SAFEDISTANCE ConeSafeDistance REAL
UNIT METER
MIN 0
LOD_CAMERA_CLIP_SAFESPHERE POVSafeDistance REAL
UNIT METER
MIN 0
LOD_CAMERA_CLIP_AFFECTRENDER UseCameraClipinRender BOOL  
LOD_POLYGONIZE PolygonizeObjects BOOL  

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.Olod)
    doc.InsertObject(obj)
    c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
    
    #You can set parameters two different ways. 
    #First way              
    obj[c4d.LOD_MODE] = c4d.LOD_MODE_CHILD
    obj[c4d.LOD_CRITERIA] = c4d.LOD_CRITERIA_MANUAL
    obj[c4d.LOD_CAMERA_MINDIST] = 0.1
    obj[c4d.LOD_CAMERA_MAXDIST] = 0.1
    obj[c4d.LOD_CURRENT_LEVEL] = 1
    obj[c4d.LOD_LEVEL_COUNT_DYN] = 1
    obj[c4d.LOD_PROGRESIVE] = True
    obj[c4d.LOD_SHOW_UNASSIGNED] = True
    obj[c4d.LOD_VIEWPORT_ONLY] = True
    obj[c4d.LOD_RENDER_INCREMENT] = 0.1
    obj[c4d.LOD_CAMERA_CLIP] = True
    obj[c4d.LOD_CAMERA_CLIP_SAFEDISTANCE] = 0.1
    obj[c4d.LOD_CAMERA_CLIP_SAFESPHERE] = 0.1
    obj[c4d.LOD_CAMERA_CLIP_AFFECTRENDER] = True
    obj[c4d.LOD_POLYGONIZE] = True
    
    #Second way, using the base container.
    bc = obj.GetDataInstance()
    bc.SetInt32(c4d.LOD_MODE,c4d.LOD_MODE_CHILD)
    bc.SetInt32(c4d.LOD_CRITERIA,c4d.LOD_CRITERIA_MANUAL)
    bc.SetFloat(c4d.LOD_CAMERA_MINDIST,0.1)
    bc.SetFloat(c4d.LOD_CAMERA_MAXDIST,0.1)
    bc.SetInt32(c4d.LOD_CURRENT_LEVEL,1)
    bc.SetInt32(c4d.LOD_LEVEL_COUNT_DYN,1)
    bc.SetBool(c4d.LOD_PROGRESIVE,True)
    bc.SetBool(c4d.LOD_SHOW_UNASSIGNED,True)
    bc.SetBool(c4d.LOD_VIEWPORT_ONLY,True)
    bc.SetFloat(c4d.LOD_RENDER_INCREMENT,0.1)
    bc.SetBool(c4d.LOD_CAMERA_CLIP,True)
    bc.SetFloat(c4d.LOD_CAMERA_CLIP_SAFEDISTANCE,0.1)
    bc.SetFloat(c4d.LOD_CAMERA_CLIP_SAFESPHERE,0.1)
    bc.SetBool(c4d.LOD_CAMERA_CLIP_AFFECTRENDER,True)
    bc.SetBool(c4d.LOD_POLYGONIZE,True)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../objects/description/olod.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseObject *pObject = BaseObject::Alloc(Olod);
    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(LOD_MODE),GeData(LOD_MODE_CHILD),flags);
    pObject->SetParameter(DescID(LOD_CRITERIA),GeData(LOD_CRITERIA_MANUAL),flags);
    pObject->SetParameter(DescID(LOD_CAMERA_MINDIST),GeData(0.1),flags);
    pObject->SetParameter(DescID(LOD_CAMERA_MAXDIST),GeData(0.1),flags);
    pObject->SetParameter(DescID(LOD_CURRENT_LEVEL),GeData(1),flags);
    pObject->SetParameter(DescID(LOD_LEVEL_COUNT_DYN),GeData(1),flags);
    pObject->SetParameter(DescID(LOD_PROGRESIVE),GeData(true),flags);
    pObject->SetParameter(DescID(LOD_SHOW_UNASSIGNED),GeData(true),flags);
    pObject->SetParameter(DescID(LOD_VIEWPORT_ONLY),GeData(true),flags);
    pObject->SetParameter(DescID(LOD_RENDER_INCREMENT),GeData(0.1),flags);
    pObject->SetParameter(DescID(LOD_CAMERA_CLIP),GeData(true),flags);
    pObject->SetParameter(DescID(LOD_CAMERA_CLIP_SAFEDISTANCE),GeData(0.1),flags);
    pObject->SetParameter(DescID(LOD_CAMERA_CLIP_SAFESPHERE),GeData(0.1),flags);
    pObject->SetParameter(DescID(LOD_CAMERA_CLIP_AFFECTRENDER),GeData(true),flags);
    pObject->SetParameter(DescID(LOD_POLYGONIZE),GeData(true),flags);
    pObject->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pObject->GetDataInstance();
    bc->SetInt32(LOD_MODE,LOD_MODE_CHILD);
    bc->SetInt32(LOD_CRITERIA,LOD_CRITERIA_MANUAL);
    bc->SetFloat(LOD_CAMERA_MINDIST,0.1);
    bc->SetFloat(LOD_CAMERA_MAXDIST,0.1);
    bc->SetInt32(LOD_CURRENT_LEVEL,1);
    bc->SetInt32(LOD_LEVEL_COUNT_DYN,1);
    bc->SetBool(LOD_PROGRESIVE,true);
    bc->SetBool(LOD_SHOW_UNASSIGNED,true);
    bc->SetBool(LOD_VIEWPORT_ONLY,true);
    bc->SetFloat(LOD_RENDER_INCREMENT,0.1);
    bc->SetBool(LOD_CAMERA_CLIP,true);
    bc->SetFloat(LOD_CAMERA_CLIP_SAFEDISTANCE,0.1);
    bc->SetFloat(LOD_CAMERA_CLIP_SAFESPHERE,0.1);
    bc->SetBool(LOD_CAMERA_CLIP_AFFECTRENDER,true);
    bc->SetBool(LOD_POLYGONIZE,true);
    pObject->Message(MSG_UPDATE);                                                      
}