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 XSLAFresnel

XSLAFresnel

Attributes

  • ENGLISH NAME : FresnelShader
  • NAME : XSLAFresnel
  • INCLUDE : Mpreview
  • INCLUDE : Xbase
  • PATH : sla/description/xslafresnel.res
  • PLUGIN : sla
  • MAXON online help (may not exist): XSLAFRESNEL

Elements

ID UI Name Type Parameters Cycle
SLA_FRESNEL_USE_BUMP UseBump BOOL  
SLA_FRESNEL_RENDER Render LONG  
SLA_FRESNEL_RENDER_FRONT_ONLY FrontOnly
SLA_FRESNEL_RENDER_FRONT_TRANS FrontTrans
SLA_FRESNEL_RENDER_BACK_ONLY BackOnly
SLA_FRESNEL_RENDER_BACK_TRANS BackTrans
SLA_FRESNEL_RENDER_FRONT_BACK FrontandBack
SLA_FRESNEL_GRADIENT Gradient GRADIENT ICC_BASEDOCUMENT
SLA_FRESNEL_PHY_ENABLE Physical BOOL  
SLA_FRESNEL_PHY_IOR IOR REAL
UNIT REAL
MIN 1.0
STEP 0.01
SLA_FRESNEL_PHY_IOR_PRESET Preset LONG  
SLA_FRESNEL_PHY_IOR_PRESET_CUSTOM Custom
SLA_FRESNEL_PHY_IOR_PRESET_ASPHALT Asphalt
SLA_FRESNEL_PHY_IOR_PRESET_BEER Beer
SLA_FRESNEL_PHY_IOR_PRESET_BRONZE Bronze
SLA_FRESNEL_PHY_IOR_PRESET_COPPER Copper
SLA_FRESNEL_PHY_IOR_PRESET_DIAMOND Diamond
SLA_FRESNEL_PHY_IOR_PRESET_EMERALD Emerald
SLA_FRESNEL_PHY_IOR_PRESET_ETHANOL EthylAlcohol
SLA_FRESNEL_PHY_IOR_PRESET_GLASS Glass(Crown)
SLA_FRESNEL_PHY_IOR_PRESET_HEAVYFLINTGLASS Glass(HeavyFlint)
SLA_FRESNEL_PHY_IOR_PRESET_IRON Iron
SLA_FRESNEL_PHY_IOR_PRESET_JADE Jade
SLA_FRESNEL_PHY_IOR_PRESET_MILK Milk
SLA_FRESNEL_PHY_IOR_PRESET_MOONSTONE Moonstone,Albite
SLA_FRESNEL_PHY_IOR_PRESET_OIL_VEGETABLE VegetableOil(50\u00B0C)
SLA_FRESNEL_PHY_IOR_PRESET_OPAL Opal
SLA_FRESNEL_PHY_IOR_PRESET_PEARL Pearl
SLA_FRESNEL_PHY_IOR_PRESET_PLASTIC Plastic
SLA_FRESNEL_PHY_IOR_PRESET_PET Plastic(PET)
SLA_FRESNEL_PHY_IOR_PRESET_PLEXIGLASS Plexiglass
SLA_FRESNEL_PHY_IOR_PRESET_RUBBER Rubber(natural)
SLA_FRESNEL_PHY_IOR_PRESET_RUBY Ruby
SLA_FRESNEL_PHY_IOR_PRESET_SALT Salt
SLA_FRESNEL_PHY_IOR_PRESET_SAPPHIRE Sapphire
SLA_FRESNEL_PHY_IOR_PRESET_TEFLON Teflon
SLA_FRESNEL_PHY_IOR_PRESET_TITANIUM Titanium
SLA_FRESNEL_PHY_IOR_PRESET_TOPAZ Topaz
SLA_FRESNEL_PHY_IOR_PRESET_WATER Water(20\u00B0C)
SLA_FRESNEL_PHY_IOR_PRESET_WATER_ICE Water(Ice)
SLA_FRESNEL_PHY_IOR_PRESET_WHISKEY Whiskey
SLA_FRESNEL_PHY_IOR_PRESET_WOOD Wood
SLA_FRESNEL_PHY_INVERT Invert BOOL  

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.Xfresnel)
    
    #You can set parameters two different ways. 
    #First way              
    shader[c4d.SLA_FRESNEL_USE_BUMP] = True
    shader[c4d.SLA_FRESNEL_RENDER] = c4d.SLA_FRESNEL_RENDER_FRONT_ONLY
    shader[c4d.SLA_FRESNEL_PHY_ENABLE] = True
    shader[c4d.SLA_FRESNEL_PHY_IOR] = 0.1
    shader[c4d.SLA_FRESNEL_PHY_IOR_PRESET] = c4d.SLA_FRESNEL_PHY_IOR_PRESET_CUSTOM
    shader[c4d.SLA_FRESNEL_PHY_INVERT] = True
    
    #Second way, using the base container.
    bc = shader.GetDataInstance()
    bc.SetBool(c4d.SLA_FRESNEL_USE_BUMP,True)
    bc.SetInt32(c4d.SLA_FRESNEL_RENDER,c4d.SLA_FRESNEL_RENDER_FRONT_ONLY)
    bc.SetBool(c4d.SLA_FRESNEL_PHY_ENABLE,True)
    bc.SetFloat(c4d.SLA_FRESNEL_PHY_IOR,0.1)
    bc.SetInt32(c4d.SLA_FRESNEL_PHY_IOR_PRESET,c4d.SLA_FRESNEL_PHY_IOR_PRESET_CUSTOM)
    bc.SetBool(c4d.SLA_FRESNEL_PHY_INVERT,True)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../sla/description/xslafresnel.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseShader *pShader = BaseShader::Alloc(Xfresnel);  
    
    //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_FRESNEL_USE_BUMP),GeData(true),flags);
    pShader->SetParameter(DescID(SLA_FRESNEL_RENDER),GeData(SLA_FRESNEL_RENDER_FRONT_ONLY),flags);
    pShader->SetParameter(DescID(SLA_FRESNEL_PHY_ENABLE),GeData(true),flags);
    pShader->SetParameter(DescID(SLA_FRESNEL_PHY_IOR),GeData(0.1),flags);
    pShader->SetParameter(DescID(SLA_FRESNEL_PHY_IOR_PRESET),GeData(SLA_FRESNEL_PHY_IOR_PRESET_CUSTOM),flags);
    pShader->SetParameter(DescID(SLA_FRESNEL_PHY_INVERT),GeData(true),flags);
    pShader->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pShader->GetDataInstance();
    bc->SetBool(SLA_FRESNEL_USE_BUMP,true);
    bc->SetInt32(SLA_FRESNEL_RENDER,SLA_FRESNEL_RENDER_FRONT_ONLY);
    bc->SetBool(SLA_FRESNEL_PHY_ENABLE,true);
    bc->SetFloat(SLA_FRESNEL_PHY_IOR,0.1);
    bc->SetInt32(SLA_FRESNEL_PHY_IOR_PRESET,SLA_FRESNEL_PHY_IOR_PRESET_CUSTOM);
    bc->SetBool(SLA_FRESNEL_PHY_INVERT,true);
    pShader->Message(MSG_UPDATE);                                                      
}
             

Gradients

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

Python


C++

           
#include "customgui_gradient.h"
SLA_FRESNEL_GRADIENT
GeData data; pShader->GetParameter(DescID(SLA_FRESNEL_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); } pShader->SetParameter(DescID(SLA_FRESNEL_GRADIENT),data,DESCFLAGS_SET_PARAM_SET));