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 Omcolour

Omcolour

Attributes

  • ENGLISH NAME : X-ParticlesColorModifier
  • NAME : Omcolour
  • INCLUDE : Obase
  • PATH : res/description/omcolour.res
  • PLUGIN : X-Particles
  • MAXON online help (may not exist): OMCOLOUR

Elements

ID UI Name Type Parameters Cycle
XMCL_COLOUR_ENABLED Enabled BOOL  
XMCL_COLOUR_MODE Mode LONG  
COLOUR_MODE_INDEP Independent
COLOUR_MODE_ACTION Action-Controlled
XMCL_COLOUR_OPERATION Operation LONG  
COLOUR_OP_SET SetColor
COLOUR_OP_SET_FALLOFF SetbyFalloff
COLOUR_OP_RATE Increment/DecrementColor
COLOUR_OP_RANDOM Random
COLOUR_OP_RANDOM_SHADER Random(fromShader)
COLOUR_OP_GRADIENT_TIME Time-Dependent
COLOUR_OP_GRADIENT_AGE Age-Dependent
COLOUR_OP_GRADIENT_SPEED Speed-Dependent
XMCL_COLOUR_COLOUR Color COLOR  
XMCL_COLOUR_SHADER Shader SHADERLINK  
XMCL_SHADER_SAMPLE_RANDOM ShaderRandomSample BOOL  
XMCL_COLOUR_TIME ChangeEvery BASETIME  
XMCL_COLOUR_THRESHOLD Threshold REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
MINSLIDER 0.0
MAXSLIDER 100.0
CUSTOMGUI REALSLIDER
XMCL_COLOUR_DELTA_R RedRateofChange LONG
MIN -255
MAX 255
MINSLIDER -255
MAXSLIDER 255
CUSTOMGUI LONGSLIDER
XMCL_COLOUR_DELTA_G GreenRateofChange LONG
MIN -255
MAX 255
MINSLIDER -255
MAXSLIDER 255
CUSTOMGUI LONGSLIDER
XMCL_COLOUR_DELTA_B BlueRateofChange LONG
MIN -255
MAX 255
MINSLIDER -255
MAXSLIDER 255
CUSTOMGUI LONGSLIDER
XMCL_COLOUR_BLEND MixMode LONG  
COLOUR_BLEND_NORMAL Normal
COLOUR_BLEND_ADD Add
COLOUR_BLEND_SUBTRACT Subtract
COLOUR_BLEND_MULTIPLY Multiply
XMCL_COLOUR_BLEND_VALUE MixStrength REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
MINSLIDER 0.0
MAXSLIDER 100.0
CUSTOMGUI REALSLIDER
XMCL_COLOUR_GRADIENT Gradient GRADIENT COLOR
XMCL_COLOUR_GRADIENT_TIME TimetoCompletion BASETIME  
XMCL_COLOUR_GRADIENT_COMPLETE OnCompletion LONG  
GRAD_COMPLETE_NONE DoNothing
GRAD_COMPLETE_WRAP WraptoStart
GRAD_COMPLETE_REVERSE Reverse
XMCL_COLOUR_GRADIENT_SPEED_MIN LowerSpeedBoundary REAL
UNIT METER
MIN 0.0
MINSLIDER 0.0
MAXSLIDER 1000.0
CUSTOMGUI REALSLIDER
XMCL_COLOUR_GRADIENT_SPEED_MAX UpperSpeedBoundary REAL
UNIT METER
MIN 0.0
MINSLIDER 0.0
MAXSLIDER 1000.0
CUSTOMGUI REALSLIDER
XMCL_COLOUR_GROUP Groups 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

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.Omcolour)
    doc.InsertObject(obj)
    c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
    
    #You can set parameters two different ways. 
    #First way              
    obj[c4d.XMCL_COLOUR_ENABLED] = True
    obj[c4d.XMCL_COLOUR_MODE] = c4d.COLOUR_MODE_INDEP
    obj[c4d.XMCL_COLOUR_OPERATION] = c4d.COLOUR_OP_SET
    obj[c4d.XMCL_SHADER_SAMPLE_RANDOM] = True
    obj[c4d.XMCL_COLOUR_THRESHOLD] = 0.1
    obj[c4d.XMCL_COLOUR_DELTA_R] = 1
    obj[c4d.XMCL_COLOUR_DELTA_G] = 1
    obj[c4d.XMCL_COLOUR_DELTA_B] = 1
    obj[c4d.XMCL_COLOUR_BLEND] = c4d.COLOUR_BLEND_NORMAL
    obj[c4d.XMCL_COLOUR_BLEND_VALUE] = 0.1
    obj[c4d.XMCL_COLOUR_GRADIENT_COMPLETE] = c4d.GRAD_COMPLETE_NONE
    obj[c4d.XMCL_COLOUR_GRADIENT_SPEED_MIN] = 0.1
    obj[c4d.XMCL_COLOUR_GRADIENT_SPEED_MAX] = 0.1
    
    #Second way, using the base container.
    bc = obj.GetDataInstance()
    bc.SetBool(c4d.XMCL_COLOUR_ENABLED,True)
    bc.SetInt32(c4d.XMCL_COLOUR_MODE,c4d.COLOUR_MODE_INDEP)
    bc.SetInt32(c4d.XMCL_COLOUR_OPERATION,c4d.COLOUR_OP_SET)
    bc.SetBool(c4d.XMCL_SHADER_SAMPLE_RANDOM,True)
    bc.SetFloat(c4d.XMCL_COLOUR_THRESHOLD,0.1)
    bc.SetInt32(c4d.XMCL_COLOUR_DELTA_R,1)
    bc.SetInt32(c4d.XMCL_COLOUR_DELTA_G,1)
    bc.SetInt32(c4d.XMCL_COLOUR_DELTA_B,1)
    bc.SetInt32(c4d.XMCL_COLOUR_BLEND,c4d.COLOUR_BLEND_NORMAL)
    bc.SetFloat(c4d.XMCL_COLOUR_BLEND_VALUE,0.1)
    bc.SetInt32(c4d.XMCL_COLOUR_GRADIENT_COMPLETE,c4d.GRAD_COMPLETE_NONE)
    bc.SetFloat(c4d.XMCL_COLOUR_GRADIENT_SPEED_MIN,0.1)
    bc.SetFloat(c4d.XMCL_COLOUR_GRADIENT_SPEED_MAX,0.1)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../res/description/omcolour.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseObject *pObject = BaseObject::Alloc(Omcolour);
    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(XMCL_COLOUR_ENABLED),GeData(true),flags);
    pObject->SetParameter(DescID(XMCL_COLOUR_MODE),GeData(COLOUR_MODE_INDEP),flags);
    pObject->SetParameter(DescID(XMCL_COLOUR_OPERATION),GeData(COLOUR_OP_SET),flags);
    pObject->SetParameter(DescID(XMCL_SHADER_SAMPLE_RANDOM),GeData(true),flags);
    pObject->SetParameter(DescID(XMCL_COLOUR_THRESHOLD),GeData(0.1),flags);
    pObject->SetParameter(DescID(XMCL_COLOUR_DELTA_R),GeData(1),flags);
    pObject->SetParameter(DescID(XMCL_COLOUR_DELTA_G),GeData(1),flags);
    pObject->SetParameter(DescID(XMCL_COLOUR_DELTA_B),GeData(1),flags);
    pObject->SetParameter(DescID(XMCL_COLOUR_BLEND),GeData(COLOUR_BLEND_NORMAL),flags);
    pObject->SetParameter(DescID(XMCL_COLOUR_BLEND_VALUE),GeData(0.1),flags);
    pObject->SetParameter(DescID(XMCL_COLOUR_GRADIENT_COMPLETE),GeData(GRAD_COMPLETE_NONE),flags);
    pObject->SetParameter(DescID(XMCL_COLOUR_GRADIENT_SPEED_MIN),GeData(0.1),flags);
    pObject->SetParameter(DescID(XMCL_COLOUR_GRADIENT_SPEED_MAX),GeData(0.1),flags);
    pObject->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pObject->GetDataInstance();
    bc->SetBool(XMCL_COLOUR_ENABLED,true);
    bc->SetInt32(XMCL_COLOUR_MODE,COLOUR_MODE_INDEP);
    bc->SetInt32(XMCL_COLOUR_OPERATION,COLOUR_OP_SET);
    bc->SetBool(XMCL_SHADER_SAMPLE_RANDOM,true);
    bc->SetFloat(XMCL_COLOUR_THRESHOLD,0.1);
    bc->SetInt32(XMCL_COLOUR_DELTA_R,1);
    bc->SetInt32(XMCL_COLOUR_DELTA_G,1);
    bc->SetInt32(XMCL_COLOUR_DELTA_B,1);
    bc->SetInt32(XMCL_COLOUR_BLEND,COLOUR_BLEND_NORMAL);
    bc->SetFloat(XMCL_COLOUR_BLEND_VALUE,0.1);
    bc->SetInt32(XMCL_COLOUR_GRADIENT_COMPLETE,GRAD_COMPLETE_NONE);
    bc->SetFloat(XMCL_COLOUR_GRADIENT_SPEED_MIN,0.1);
    bc->SetFloat(XMCL_COLOUR_GRADIENT_SPEED_MAX,0.1);
    pObject->Message(MSG_UPDATE);                                                      
}
             

Gradients

This node has gradients. Gradients can manually be edited by calling the following code

Python


C++

           
#include "customgui_gradient.h"
XMCL_COLOUR_GRADIENT
GeData data; pObject->GetParameter(DescID(XMCL_COLOUR_GRADIENT),data,DESCFLAGS_GET_PARAM_GET)); Gradient *pGradient = (Gradient*)data.GetCustomDataType(CUSTOMDATATYPE_GRADIENT); if(pGradient) { //must be set before any knot is set pGradient->SetData(GRADIENT_MODE, GeData(GRADIENTMODE_ALPHA)); GradientKnot k1, k2; k1.col = Vector(0.0, 0.0, 1.0); k1.pos = 0.0; k2.col = 1.0; k2.pos = 1.0; pGradient->InsertKnot(k1); pGradient->InsertKnot(k2); } pObject->SetParameter(DescID(XMCL_COLOUR_GRADIENT),data,DESCFLAGS_SET_PARAM_SET));