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 XSLAProximal

XSLAProximal

Attributes

  • ENGLISH NAME : ProximalShader
  • NAME : XSLAProximal
  • INCLUDE : Mpreview
  • INCLUDE : Xbase
  • PATH : sla/description/xslaproximal.res
  • PLUGIN : sla
  • MAXON online help (may not exist): XSLAPROXIMAL

Elements

ID UI Name Type Parameters Cycle
SLA_PROXIMAL_OBJECTS Objects IN_EXCLUDE NUM_FLAGS
SLA_PROXIMAL_EXCLUDE_PARENT ExcludeParent BOOL  
SLA_PROXIMAL_INCLUDE_SUBOBJECTS IncludeSubobjects BOOL  
SLA_PROXIMAL_USE_VERTICES UseVertices BOOL  
SLA_PROXIMAL_USE_EDGES UseEdges BOOL  
SLA_PROXIMAL_POLYGON_RADIUS PolygonRadius BOOL  
SLA_PROXIMAL_FUNCTION Function LONG  
SLA_PROXIMAL_FUNCTION_LINEAR Linear
SLA_PROXIMAL_FUNCTION_SQUARE Square
SLA_PROXIMAL_FUNCTION_CUBIC Cubic
SLA_PROXIMAL_FUNCTION_STEP Step
SLA_PROXIMAL_FUNCTION_INVERSE Inverse
SLA_PROXIMAL_FUNCTION_INVERSE_SQUARE InverseSquare
SLA_PROXIMAL_FUNCTION_INVERSE_CUBIC InverseCubic
SLA_PROXIMAL_FUNCTION_SMOOTH Smooth
SLA_PROXIMAL_BLEND_MODE BlendMode LONG  
SLA_PROXIMAL_BLEND_MODE_LIGHTEN Lighten
SLA_PROXIMAL_BLEND_MODE_SCREEN Screen
SLA_PROXIMAL_BLEND_MODE_DIFFERENCE Difference
SLA_PROXIMAL_BLEND_MODE_EXCLUSION Exclusion
SLA_PROXIMAL_BLEND_MODE_ADD Add
SLA_PROXIMAL_START_DISTANCE StartDistance REAL
UNIT PERCENT
MIN 0
SLA_PROXIMAL_END_DISTANCE EndDistance REAL
UNIT PERCENT
MIN 0
SLA_PROXIMAL_INTENSITY Intensity REAL
UNIT PERCENT
MIN 0
STEP 0.01

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.Xproximal)
    
    #You can set parameters two different ways. 
    #First way              
    shader[c4d.SLA_PROXIMAL_EXCLUDE_PARENT] = True
    shader[c4d.SLA_PROXIMAL_INCLUDE_SUBOBJECTS] = True
    shader[c4d.SLA_PROXIMAL_USE_VERTICES] = True
    shader[c4d.SLA_PROXIMAL_USE_EDGES] = True
    shader[c4d.SLA_PROXIMAL_POLYGON_RADIUS] = True
    shader[c4d.SLA_PROXIMAL_FUNCTION] = c4d.SLA_PROXIMAL_FUNCTION_LINEAR
    shader[c4d.SLA_PROXIMAL_BLEND_MODE] = c4d.SLA_PROXIMAL_BLEND_MODE_LIGHTEN
    shader[c4d.SLA_PROXIMAL_START_DISTANCE] = 0.1
    shader[c4d.SLA_PROXIMAL_END_DISTANCE] = 0.1
    shader[c4d.SLA_PROXIMAL_INTENSITY] = 0.1
    
    #Second way, using the base container.
    bc = shader.GetDataInstance()
    bc.SetBool(c4d.SLA_PROXIMAL_EXCLUDE_PARENT,True)
    bc.SetBool(c4d.SLA_PROXIMAL_INCLUDE_SUBOBJECTS,True)
    bc.SetBool(c4d.SLA_PROXIMAL_USE_VERTICES,True)
    bc.SetBool(c4d.SLA_PROXIMAL_USE_EDGES,True)
    bc.SetBool(c4d.SLA_PROXIMAL_POLYGON_RADIUS,True)
    bc.SetInt32(c4d.SLA_PROXIMAL_FUNCTION,c4d.SLA_PROXIMAL_FUNCTION_LINEAR)
    bc.SetInt32(c4d.SLA_PROXIMAL_BLEND_MODE,c4d.SLA_PROXIMAL_BLEND_MODE_LIGHTEN)
    bc.SetFloat(c4d.SLA_PROXIMAL_START_DISTANCE,0.1)
    bc.SetFloat(c4d.SLA_PROXIMAL_END_DISTANCE,0.1)
    bc.SetFloat(c4d.SLA_PROXIMAL_INTENSITY,0.1)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../sla/description/xslaproximal.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseShader *pShader = BaseShader::Alloc(Xproximal);  
    
    //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_PROXIMAL_EXCLUDE_PARENT),GeData(true),flags);
    pShader->SetParameter(DescID(SLA_PROXIMAL_INCLUDE_SUBOBJECTS),GeData(true),flags);
    pShader->SetParameter(DescID(SLA_PROXIMAL_USE_VERTICES),GeData(true),flags);
    pShader->SetParameter(DescID(SLA_PROXIMAL_USE_EDGES),GeData(true),flags);
    pShader->SetParameter(DescID(SLA_PROXIMAL_POLYGON_RADIUS),GeData(true),flags);
    pShader->SetParameter(DescID(SLA_PROXIMAL_FUNCTION),GeData(SLA_PROXIMAL_FUNCTION_LINEAR),flags);
    pShader->SetParameter(DescID(SLA_PROXIMAL_BLEND_MODE),GeData(SLA_PROXIMAL_BLEND_MODE_LIGHTEN),flags);
    pShader->SetParameter(DescID(SLA_PROXIMAL_START_DISTANCE),GeData(0.1),flags);
    pShader->SetParameter(DescID(SLA_PROXIMAL_END_DISTANCE),GeData(0.1),flags);
    pShader->SetParameter(DescID(SLA_PROXIMAL_INTENSITY),GeData(0.1),flags);
    pShader->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pShader->GetDataInstance();
    bc->SetBool(SLA_PROXIMAL_EXCLUDE_PARENT,true);
    bc->SetBool(SLA_PROXIMAL_INCLUDE_SUBOBJECTS,true);
    bc->SetBool(SLA_PROXIMAL_USE_VERTICES,true);
    bc->SetBool(SLA_PROXIMAL_USE_EDGES,true);
    bc->SetBool(SLA_PROXIMAL_POLYGON_RADIUS,true);
    bc->SetInt32(SLA_PROXIMAL_FUNCTION,SLA_PROXIMAL_FUNCTION_LINEAR);
    bc->SetInt32(SLA_PROXIMAL_BLEND_MODE,SLA_PROXIMAL_BLEND_MODE_LIGHTEN);
    bc->SetFloat(SLA_PROXIMAL_START_DISTANCE,0.1);
    bc->SetFloat(SLA_PROXIMAL_END_DISTANCE,0.1);
    bc->SetFloat(SLA_PROXIMAL_INTENSITY,0.1);
    pShader->Message(MSG_UPDATE);                                                      
}