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 Xmg_multi

Xmg_multi

Attributes

  • ENGLISH NAME : MultiShader
  • NAME : Xmg_multi
  • INCLUDE : Mpreview
  • INCLUDE : Xbase
  • PATH : mograph/description/xmg_multi.res
  • PLUGIN : mograph
  • MAXON online help (may not exist): XMG_MULTI

Elements

ID UI Name Type Parameters Cycle
MGMULTISHADER_MODE Mode LONG  
MGMULTISHADER_MODE_INDEXRATIO IndexRatio
MGMULTISHADER_MODE_COLORBRIGHT ColorBrightness
MGMULTISHADER_MODE_COLORX ColorRed
MGMULTISHADER_MODE_COLORY ColorGreen
MGMULTISHADER_MODE_COLORZ ColorBlue
MGMULTISHADER_MODE_AVERAGECOL AverageColor(EuclideanColorDistance)
MGMULTISHADER_MODE_AVERAGECOL_HSV AverageColor(HueDifference)
MGMULTISHADER_BLENDCOLOR BlendColor REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
CUSTOMGUI REALSLIDER
MGMULTISHADER_BLENDCOLOR_MODE Mode LONG  
MGMULTISHADER_BLENDCOLOR_MODE_MULTIPLY Multiply
MGMULTISHADER_BLENDCOLOR_MODE_OVERLAY Overlay
MGMULTISHADER_BLENDCOLOR_MODE_COLOR Color
MGMULTISHADER_ADD Add BUTTON  
MGMULTISHADER_CLEAR Clear BUTTON  
MGMULTISHADER_CASTMOVIE ToLayers BUTTON  
MGMULTISHADER_ADDFOLDER AddfromFolder BUTTON  

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.Xmg_multi)
    
    #You can set parameters two different ways. 
    #First way              
    shader[c4d.MGMULTISHADER_MODE] = c4d.MGMULTISHADER_MODE_INDEXRATIO
    shader[c4d.MGMULTISHADER_BLENDCOLOR] = 0.1
    shader[c4d.MGMULTISHADER_BLENDCOLOR_MODE] = c4d.MGMULTISHADER_BLENDCOLOR_MODE_MULTIPLY
    
    #Second way, using the base container.
    bc = shader.GetDataInstance()
    bc.SetInt32(c4d.MGMULTISHADER_MODE,c4d.MGMULTISHADER_MODE_INDEXRATIO)
    bc.SetFloat(c4d.MGMULTISHADER_BLENDCOLOR,0.1)
    bc.SetInt32(c4d.MGMULTISHADER_BLENDCOLOR_MODE,c4d.MGMULTISHADER_BLENDCOLOR_MODE_MULTIPLY)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../mograph/description/xmg_multi.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseShader *pShader = BaseShader::Alloc(Xmg_multi);  
    
    //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(MGMULTISHADER_MODE),GeData(MGMULTISHADER_MODE_INDEXRATIO),flags);
    pShader->SetParameter(DescID(MGMULTISHADER_BLENDCOLOR),GeData(0.1),flags);
    pShader->SetParameter(DescID(MGMULTISHADER_BLENDCOLOR_MODE),GeData(MGMULTISHADER_BLENDCOLOR_MODE_MULTIPLY),flags);
    pShader->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pShader->GetDataInstance();
    bc->SetInt32(MGMULTISHADER_MODE,MGMULTISHADER_MODE_INDEXRATIO);
    bc->SetFloat(MGMULTISHADER_BLENDCOLOR,0.1);
    bc->SetInt32(MGMULTISHADER_BLENDCOLOR_MODE,MGMULTISHADER_BLENDCOLOR_MODE_MULTIPLY);
    pShader->Message(MSG_UPDATE);                                                      
}
             

Buttons

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

Python

c4d.CallButton(shader,c4d.MGMULTISHADER_ADD)
c4d.CallButton(shader,c4d.MGMULTISHADER_CLEAR)
c4d.CallButton(shader,c4d.MGMULTISHADER_CASTMOVIE)
c4d.CallButton(shader,c4d.MGMULTISHADER_ADDFOLDER)

C++

DescriptionCommand dc;
dc.id = DescID(MGMULTISHADER_ADD);             
pShader->Message(MSG_DESCRIPTION_COMMAND, &dc);

DescriptionCommand dc; dc.id = DescID(MGMULTISHADER_CLEAR); pShader->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(MGMULTISHADER_CASTMOVIE); pShader->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(MGMULTISHADER_ADDFOLDER); pShader->Message(MSG_DESCRIPTION_COMMAND, &dc);