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 Omograph_displacer

Omograph_displacer

Attributes

  • ENGLISH NAME : Displacer
  • NAME : Omograph_displacer
  • INCLUDE : Obase
  • PATH : mograph/description/omograph_displacer.res
  • PLUGIN : mograph
  • MAXON online help (may not exist): OMOGRAPH_DISPLACER

Elements

ID UI Name Type Parameters Cycle
MGDISPLACER_EMULATION Emulation BOOL  
MGDISPLACER_DISPLACEMENT_STRENGTH Strength REAL
UNIT PERCENT
MINSLIDER -100.0
MAXSLIDER 100.0
CUSTOMGUI REALSLIDER
MGDISPLACER_DISPLACEMENT_HEIGHT Height REAL UNIT
MGDISPLACER_DISPLACEMENTMODE Type LONG  
MGDISPLACER_DISPLACEMENTMODE_INTENSITY Intensity
MGDISPLACER_DISPLACEMENTMODE_CENTEREDINTENSITY Intensity(Centered)
MGDISPLACER_DISPLACEMENTMODE_REDGREEN Red/Green
MGDISPLACER_DISPLACEMENTMODE_RGBTANGENT RGB(XYZTangent)
MGDISPLACER_DISPLACEMENTMODE_RGBLOCAL RGB(XYZObject)
MGDISPLACER_DISPLACEMENTMODE_RGBWORLD RGB(XYZWorld)
MGDISPLACER_POLYNORMALMODE Direction LONG  
MGDISPLACER_VERTEXNORMAL Vertexnormal
MGDISPLACER_SPHERICALNORMAL Spherical
MGDISPLACER_PLANARNORMAL Planar
MGDISPLACER_PROCESS_NORMALTAGS ProcessNormalTag BOOL NAME
MGDISPLACER_LEGACY LegacyMode BOOL NAME
MGDISPLACER_REFRESH_OBJECT Object BOOL  
MGDISPLACER_REFRESH_CAMERA Camera BOOL  
MGDISPLACER_REFRESH_BACKFACECULL BackfaceCull 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.Omograph_displacer)
    doc.InsertObject(obj)
    c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
    
    #You can set parameters two different ways. 
    #First way              
    obj[c4d.MGDISPLACER_EMULATION] = True
    obj[c4d.MGDISPLACER_DISPLACEMENT_STRENGTH] = 0.1
    obj[c4d.MGDISPLACER_DISPLACEMENT_HEIGHT] = 0.1
    obj[c4d.MGDISPLACER_DISPLACEMENTMODE] = c4d.MGDISPLACER_DISPLACEMENTMODE_INTENSITY
    obj[c4d.MGDISPLACER_POLYNORMALMODE] = c4d.MGDISPLACER_VERTEXNORMAL
    obj[c4d.MGDISPLACER_PROCESS_NORMALTAGS] = True
    obj[c4d.MGDISPLACER_LEGACY] = True
    obj[c4d.MGDISPLACER_REFRESH_OBJECT] = True
    obj[c4d.MGDISPLACER_REFRESH_CAMERA] = True
    obj[c4d.MGDISPLACER_REFRESH_BACKFACECULL] = True
    
    #Second way, using the base container.
    bc = obj.GetDataInstance()
    bc.SetBool(c4d.MGDISPLACER_EMULATION,True)
    bc.SetFloat(c4d.MGDISPLACER_DISPLACEMENT_STRENGTH,0.1)
    bc.SetFloat(c4d.MGDISPLACER_DISPLACEMENT_HEIGHT,0.1)
    bc.SetInt32(c4d.MGDISPLACER_DISPLACEMENTMODE,c4d.MGDISPLACER_DISPLACEMENTMODE_INTENSITY)
    bc.SetInt32(c4d.MGDISPLACER_POLYNORMALMODE,c4d.MGDISPLACER_VERTEXNORMAL)
    bc.SetBool(c4d.MGDISPLACER_PROCESS_NORMALTAGS,True)
    bc.SetBool(c4d.MGDISPLACER_LEGACY,True)
    bc.SetBool(c4d.MGDISPLACER_REFRESH_OBJECT,True)
    bc.SetBool(c4d.MGDISPLACER_REFRESH_CAMERA,True)
    bc.SetBool(c4d.MGDISPLACER_REFRESH_BACKFACECULL,True)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../mograph/description/omograph_displacer.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseObject *pObject = BaseObject::Alloc(Omograph_displacer);
    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(MGDISPLACER_EMULATION),GeData(true),flags);
    pObject->SetParameter(DescID(MGDISPLACER_DISPLACEMENT_STRENGTH),GeData(0.1),flags);
    pObject->SetParameter(DescID(MGDISPLACER_DISPLACEMENT_HEIGHT),GeData(0.1),flags);
    pObject->SetParameter(DescID(MGDISPLACER_DISPLACEMENTMODE),GeData(MGDISPLACER_DISPLACEMENTMODE_INTENSITY),flags);
    pObject->SetParameter(DescID(MGDISPLACER_POLYNORMALMODE),GeData(MGDISPLACER_VERTEXNORMAL),flags);
    pObject->SetParameter(DescID(MGDISPLACER_PROCESS_NORMALTAGS),GeData(true),flags);
    pObject->SetParameter(DescID(MGDISPLACER_LEGACY),GeData(true),flags);
    pObject->SetParameter(DescID(MGDISPLACER_REFRESH_OBJECT),GeData(true),flags);
    pObject->SetParameter(DescID(MGDISPLACER_REFRESH_CAMERA),GeData(true),flags);
    pObject->SetParameter(DescID(MGDISPLACER_REFRESH_BACKFACECULL),GeData(true),flags);
    pObject->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pObject->GetDataInstance();
    bc->SetBool(MGDISPLACER_EMULATION,true);
    bc->SetFloat(MGDISPLACER_DISPLACEMENT_STRENGTH,0.1);
    bc->SetFloat(MGDISPLACER_DISPLACEMENT_HEIGHT,0.1);
    bc->SetInt32(MGDISPLACER_DISPLACEMENTMODE,MGDISPLACER_DISPLACEMENTMODE_INTENSITY);
    bc->SetInt32(MGDISPLACER_POLYNORMALMODE,MGDISPLACER_VERTEXNORMAL);
    bc->SetBool(MGDISPLACER_PROCESS_NORMALTAGS,true);
    bc->SetBool(MGDISPLACER_LEGACY,true);
    bc->SetBool(MGDISPLACER_REFRESH_OBJECT,true);
    bc->SetBool(MGDISPLACER_REFRESH_CAMERA,true);
    bc->SetBool(MGDISPLACER_REFRESH_BACKFACECULL,true);
    pObject->Message(MSG_UPDATE);                                                      
}