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 Xchanlum

Xchanlum

Attributes

  • ENGLISH NAME : ChanLum
  • NAME : Xchanlum
  • INCLUDE : Mpreview
  • INCLUDE : Xbase
  • PATH : shader/description/xchanlum.res
  • PLUGIN : shader
  • MAXON online help (may not exist): XCHANLUM

Elements

ID UI Name Type Parameters Cycle
CHANLUM_SAMPLES Samples LONG MIN
CHANLUM_OFFSET InitalOffset REAL UNIT
CHANLUM_RADIUS SampleRadius REAL UNIT
CHANLUM_TYPE SampleType LONG  
CHANLUM_TYPE_NORMAL AlongNormal
CHANLUM_TYPE_AREA Area
CHANLUM_STOCASTIC Stochastic BOOL  
CHANLUM_GAUSSIAN Gaussian BOOL  
CHANLUM_SHADOWS Shadows BOOL  
CHANLUM_SEED Seed LONG  
CHANLUM_LIGHTS_MODE UseLights LONG  
CHANLUM_LIGHTS_MODE_INCLUDE Include
CHANLUM_LIGHTS_MODE_EXCLUDE Exclude
CHANLUM_LIGHTS Lights IN_EXCLUDE
NUM_FLAGS 0
INIT_STATE 0
SEND_SELCHNGMSG 1

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():
    shader = c4d.BaseShader(c4d.Xchanlum)
    
    #You can set parameters two different ways. 
    #First way              
    shader[c4d.CHANLUM_SAMPLES] = 1
    shader[c4d.CHANLUM_OFFSET] = 0.1
    shader[c4d.CHANLUM_RADIUS] = 0.1
    shader[c4d.CHANLUM_TYPE] = c4d.CHANLUM_TYPE_NORMAL
    shader[c4d.CHANLUM_STOCASTIC] = True
    shader[c4d.CHANLUM_GAUSSIAN] = True
    shader[c4d.CHANLUM_SHADOWS] = True
    shader[c4d.CHANLUM_SEED] = 1
    shader[c4d.CHANLUM_LIGHTS_MODE] = c4d.CHANLUM_LIGHTS_MODE_INCLUDE
    
    #Second way, using the base container.
    bc = shader.GetDataInstance()
    bc.SetInt32(c4d.CHANLUM_SAMPLES,1)
    bc.SetFloat(c4d.CHANLUM_OFFSET,0.1)
    bc.SetFloat(c4d.CHANLUM_RADIUS,0.1)
    bc.SetInt32(c4d.CHANLUM_TYPE,c4d.CHANLUM_TYPE_NORMAL)
    bc.SetBool(c4d.CHANLUM_STOCASTIC,True)
    bc.SetBool(c4d.CHANLUM_GAUSSIAN,True)
    bc.SetBool(c4d.CHANLUM_SHADOWS,True)
    bc.SetInt32(c4d.CHANLUM_SEED,1)
    bc.SetInt32(c4d.CHANLUM_LIGHTS_MODE,c4d.CHANLUM_LIGHTS_MODE_INCLUDE)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../shader/description/xchanlum.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseShader *pShader = BaseShader::Alloc(Xchanlum);  
    
    //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;
    pShader->SetParameter(DescID(CHANLUM_SAMPLES),GeData(1),flags);
    pShader->SetParameter(DescID(CHANLUM_OFFSET),GeData(0.1),flags);
    pShader->SetParameter(DescID(CHANLUM_RADIUS),GeData(0.1),flags);
    pShader->SetParameter(DescID(CHANLUM_TYPE),GeData(CHANLUM_TYPE_NORMAL),flags);
    pShader->SetParameter(DescID(CHANLUM_STOCASTIC),GeData(true),flags);
    pShader->SetParameter(DescID(CHANLUM_GAUSSIAN),GeData(true),flags);
    pShader->SetParameter(DescID(CHANLUM_SHADOWS),GeData(true),flags);
    pShader->SetParameter(DescID(CHANLUM_SEED),GeData(1),flags);
    pShader->SetParameter(DescID(CHANLUM_LIGHTS_MODE),GeData(CHANLUM_LIGHTS_MODE_INCLUDE),flags);
    pShader->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pShader->GetDataInstance();
    bc->SetInt32(CHANLUM_SAMPLES,1);
    bc->SetFloat(CHANLUM_OFFSET,0.1);
    bc->SetFloat(CHANLUM_RADIUS,0.1);
    bc->SetInt32(CHANLUM_TYPE,CHANLUM_TYPE_NORMAL);
    bc->SetBool(CHANLUM_STOCASTIC,true);
    bc->SetBool(CHANLUM_GAUSSIAN,true);
    bc->SetBool(CHANLUM_SHADOWS,true);
    bc->SetInt32(CHANLUM_SEED,1);
    bc->SetInt32(CHANLUM_LIGHTS_MODE,CHANLUM_LIGHTS_MODE_INCLUDE);
    pShader->Message(MSG_UPDATE);                                                      
}