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 Xthinfilm

Xthinfilm

Attributes

  • ENGLISH NAME :
  • NAME : Xthinfilm
  • INCLUDE : Mpreview
  • INCLUDE : Xbase
  • PATH : shader/description/xthinfilm.res
  • PLUGIN : shader
  • MAXON online help (may not exist): XTHINFILM

Elements

ID UI Name Type Parameters Cycle
THINFILMSHADER_LAYERCOLOR Color COLOR  
THINFILMSHADER_LAYERCOLOR_TEX_LINK Texture SHADERLINK  
THINFILMSHADER_LAYERMIXSTRENGTH MixStrength REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
MINSLIDER 0
MAXSLIDER 100
CUSTOMGUI REALSLIDER
THINFILMSHADER_AVERAGETHICKNESS Thickness(nm) REAL
STEP 1.0
MIN 0.0
MAX 5000.0
THINFILMSHADER_RELATIVETHICKNESS Variation(nm) REAL
STEP 1.0
MIN 0.0
MAX 5000.0
THINFILMSHADER_RELATIVECHANGE_TEX_LINK Texture SHADERLINK  
THINFILMSHADER_IOR_PRESET IORPreset LONG ANIM
THINFILMSHADER_IOR_PRESET_CUSTOM Custom
THINFILMSHADER_IOR_PRESET_BEER Beer
THINFILMSHADER_IOR_PRESET_DIAMOND Diamond
THINFILMSHADER_IOR_PRESET_EMERALD Emerald
THINFILMSHADER_IOR_PRESET_ETHANOL Ethanol
THINFILMSHADER_IOR_PRESET_GLASS Glass
THINFILMSHADER_IOR_PRESET_JADE Jade
THINFILMSHADER_IOR_PRESET_MILK Milk
THINFILMSHADER_IOR_PRESET_OIL_VEGETABLE Oil(Vegetable)
THINFILMSHADER_IOR_PRESET_PEARL Pearl
THINFILMSHADER_IOR_PRESET_PET PET
THINFILMSHADER_IOR_PRESET_PLEXIGLASS Plexiglas
THINFILMSHADER_IOR_PRESET_RUBY Ruby
THINFILMSHADER_IOR_PRESET_SAPPHIRE Sapphire
THINFILMSHADER_IOR_PRESET_WATER Water
THINFILMSHADER_IOR_PRESET_WATER_ICE Water(Ice)
THINFILMSHADER_IOR_PRESET_WHISKEY Whiskey
THINFILMSHADER_IOR IOR REAL
STEP 0.01
MIN 1.0
MAX 10.0
THINFILMSHADER_NUMSPECTRALSAMPLE SpectralSamples LONG
MIN 1
MAX 100

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.Xthinfilm)
    
    #You can set parameters two different ways. 
    #First way              
    shader[c4d.THINFILMSHADER_LAYERMIXSTRENGTH] = 0.1
    shader[c4d.THINFILMSHADER_AVERAGETHICKNESS] = 0.1
    shader[c4d.THINFILMSHADER_RELATIVETHICKNESS] = 0.1
    shader[c4d.THINFILMSHADER_IOR_PRESET] = c4d.THINFILMSHADER_IOR_PRESET_CUSTOM
    shader[c4d.THINFILMSHADER_IOR] = 0.1
    shader[c4d.THINFILMSHADER_NUMSPECTRALSAMPLE] = 1
    
    #Second way, using the base container.
    bc = shader.GetDataInstance()
    bc.SetFloat(c4d.THINFILMSHADER_LAYERMIXSTRENGTH,0.1)
    bc.SetFloat(c4d.THINFILMSHADER_AVERAGETHICKNESS,0.1)
    bc.SetFloat(c4d.THINFILMSHADER_RELATIVETHICKNESS,0.1)
    bc.SetInt32(c4d.THINFILMSHADER_IOR_PRESET,c4d.THINFILMSHADER_IOR_PRESET_CUSTOM)
    bc.SetFloat(c4d.THINFILMSHADER_IOR,0.1)
    bc.SetInt32(c4d.THINFILMSHADER_NUMSPECTRALSAMPLE,1)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../shader/description/xthinfilm.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseShader *pShader = BaseShader::Alloc(Xthinfilm);  
    
    //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(THINFILMSHADER_LAYERMIXSTRENGTH),GeData(0.1),flags);
    pShader->SetParameter(DescID(THINFILMSHADER_AVERAGETHICKNESS),GeData(0.1),flags);
    pShader->SetParameter(DescID(THINFILMSHADER_RELATIVETHICKNESS),GeData(0.1),flags);
    pShader->SetParameter(DescID(THINFILMSHADER_IOR_PRESET),GeData(THINFILMSHADER_IOR_PRESET_CUSTOM),flags);
    pShader->SetParameter(DescID(THINFILMSHADER_IOR),GeData(0.1),flags);
    pShader->SetParameter(DescID(THINFILMSHADER_NUMSPECTRALSAMPLE),GeData(1),flags);
    pShader->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pShader->GetDataInstance();
    bc->SetFloat(THINFILMSHADER_LAYERMIXSTRENGTH,0.1);
    bc->SetFloat(THINFILMSHADER_AVERAGETHICKNESS,0.1);
    bc->SetFloat(THINFILMSHADER_RELATIVETHICKNESS,0.1);
    bc->SetInt32(THINFILMSHADER_IOR_PRESET,THINFILMSHADER_IOR_PRESET_CUSTOM);
    bc->SetFloat(THINFILMSHADER_IOR,0.1);
    bc->SetInt32(THINFILMSHADER_NUMSPECTRALSAMPLE,1);
    pShader->Message(MSG_UPDATE);                                                      
}