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 XSLAFusion

XSLAFusion

Attributes

  • ENGLISH NAME : FusionShader
  • NAME : XSLAFusion
  • INCLUDE : Mpreview
  • INCLUDE : Xbase
  • PATH : sla/description/xslafusion.res
  • PLUGIN : sla
  • MAXON online help (may not exist): XSLAFUSION

Elements

ID UI Name Type Parameters Cycle
SLA_FUSION_MODE Mode LONG  
SLA_FUSION_MODE_NORMAL Normal
SLA_FUSION_MODE_SEP_1
SLA_FUSION_MODE_MULTIPLY Multiply
SLA_FUSION_MODE_SCREEN Screen
SLA_FUSION_MODE_OVERLAY Overlay
SLA_FUSION_MODE_HARD_LIGHT HardLight
SLA_FUSION_MODE_SOFT_LIGHT SoftLight
SLA_FUSION_MODE_SEP_2
SLA_FUSION_MODE_DODGE Dodge
SLA_FUSION_MODE_BURN Burn
SLA_FUSION_MODE_SEP_3
SLA_FUSION_MODE_DARKEN Darken
SLA_FUSION_MODE_LIGHTEN Lighten
SLA_FUSION_MODE_ADD Add
SLA_FUSION_MODE_SUBTRACT Subtract
SLA_FUSION_MODE_DIFFERENCE Difference
SLA_FUSION_MODE_EXCLUSION Exclusion
SLA_FUSION_MODE_SEP_4
SLA_FUSION_MODE_HUE Hue
SLA_FUSION_MODE_SAT Saturation
SLA_FUSION_MODE_COLOR Color
SLA_FUSION_MODE_LUMINANCE Luminance
SLA_FUSION_MODE_SEP_5
SLA_FUSION_MODE_LEVR Levr
SLA_FUSION_BLEND Blend REAL
UNIT PERCENT
MIN 0
MAX 100
MINSLIDER 0
MAXSLIDER 100
CUSTOMGUI REALSLIDER
SLA_FUSION_USE_MASK UseMask BOOL  
SLA_FUSION_INVERT_MASK InvertMask BOOL  
SLA_FUSION_INVERT_OUTPUT InvertOutput BOOL  
SLA_FUSION_BLEND_CHANNEL BlendChannel SHADERLINK  
SLA_FUSION_MASK_CHANNEL MaskChannel SHADERLINK  
SLA_FUSION_BASE_CHANNEL BaseChannel SHADERLINK  

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.Xfusion)
    
    #You can set parameters two different ways. 
    #First way              
    shader[c4d.SLA_FUSION_MODE] = c4d.SLA_FUSION_MODE_NORMAL
    shader[c4d.SLA_FUSION_BLEND] = 0.1
    shader[c4d.SLA_FUSION_USE_MASK] = True
    shader[c4d.SLA_FUSION_INVERT_MASK] = True
    shader[c4d.SLA_FUSION_INVERT_OUTPUT] = True
    
    #Second way, using the base container.
    bc = shader.GetDataInstance()
    bc.SetInt32(c4d.SLA_FUSION_MODE,c4d.SLA_FUSION_MODE_NORMAL)
    bc.SetFloat(c4d.SLA_FUSION_BLEND,0.1)
    bc.SetBool(c4d.SLA_FUSION_USE_MASK,True)
    bc.SetBool(c4d.SLA_FUSION_INVERT_MASK,True)
    bc.SetBool(c4d.SLA_FUSION_INVERT_OUTPUT,True)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../sla/description/xslafusion.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseShader *pShader = BaseShader::Alloc(Xfusion);  
    
    //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(SLA_FUSION_MODE),GeData(SLA_FUSION_MODE_NORMAL),flags);
    pShader->SetParameter(DescID(SLA_FUSION_BLEND),GeData(0.1),flags);
    pShader->SetParameter(DescID(SLA_FUSION_USE_MASK),GeData(true),flags);
    pShader->SetParameter(DescID(SLA_FUSION_INVERT_MASK),GeData(true),flags);
    pShader->SetParameter(DescID(SLA_FUSION_INVERT_OUTPUT),GeData(true),flags);
    pShader->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pShader->GetDataInstance();
    bc->SetInt32(SLA_FUSION_MODE,SLA_FUSION_MODE_NORMAL);
    bc->SetFloat(SLA_FUSION_BLEND,0.1);
    bc->SetBool(SLA_FUSION_USE_MASK,true);
    bc->SetBool(SLA_FUSION_INVERT_MASK,true);
    bc->SetBool(SLA_FUSION_INVERT_OUTPUT,true);
    pShader->Message(MSG_UPDATE);                                                      
}