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 Xartshader

Xartshader

Attributes

  • ENGLISH NAME : ArtShader
  • NAME : Xartshader
  • INCLUDE : Mpreview
  • INCLUDE : Xbase
  • PATH : sketch/description/xartshader.res
  • PLUGIN : sketch
  • MAXON online help (may not exist): XARTSHADER

Elements

ID UI Name Type Parameters Cycle
ARTSHADER_TEXTURE Texture SHADERLINK  
ARTSHADER_BUMP UseBump BOOL  
ARTSHADER_SPACE Space LONG  
ARTSHADER_SPACE_WORLD World
ARTSHADER_SPACE_CAMERA Camera
ARTSHADER_SPACE_NORMAL Normal
ARTSHADER_SCALE Scale REAL
UNIT PERCENT
MIN 0.0
ARTSHADER_ROTATE Rotate REAL
UNIT DEGREE
MIN -360.0
MAX 360.0
ARTSHADER_SCALE_U ScaleU REAL
UNIT PERCENT
MIN 0.0
ARTSHADER_SCALE_V ScaleV REAL
UNIT PERCENT
MIN 0.0
ARTSHADER_SHADOW Shadows BOOL  
ARTSHADER_SHADOW_TEXTURE Texture SHADERLINK  
ARTSHADER_BACKFACE Backface BOOL  
ARTSHADER_BACKFACE_TEXTURE Texture 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.Xartshader)
    
    #You can set parameters two different ways. 
    #First way              
    shader[c4d.ARTSHADER_BUMP] = True
    shader[c4d.ARTSHADER_SPACE] = c4d.ARTSHADER_SPACE_WORLD
    shader[c4d.ARTSHADER_SCALE] = 0.1
    shader[c4d.ARTSHADER_ROTATE] = 0.1
    shader[c4d.ARTSHADER_SCALE_U] = 0.1
    shader[c4d.ARTSHADER_SCALE_V] = 0.1
    shader[c4d.ARTSHADER_SHADOW] = True
    shader[c4d.ARTSHADER_BACKFACE] = True
    
    #Second way, using the base container.
    bc = shader.GetDataInstance()
    bc.SetBool(c4d.ARTSHADER_BUMP,True)
    bc.SetInt32(c4d.ARTSHADER_SPACE,c4d.ARTSHADER_SPACE_WORLD)
    bc.SetFloat(c4d.ARTSHADER_SCALE,0.1)
    bc.SetFloat(c4d.ARTSHADER_ROTATE,0.1)
    bc.SetFloat(c4d.ARTSHADER_SCALE_U,0.1)
    bc.SetFloat(c4d.ARTSHADER_SCALE_V,0.1)
    bc.SetBool(c4d.ARTSHADER_SHADOW,True)
    bc.SetBool(c4d.ARTSHADER_BACKFACE,True)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../sketch/description/xartshader.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseShader *pShader = BaseShader::Alloc(Xartshader);  
    
    //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(ARTSHADER_BUMP),GeData(true),flags);
    pShader->SetParameter(DescID(ARTSHADER_SPACE),GeData(ARTSHADER_SPACE_WORLD),flags);
    pShader->SetParameter(DescID(ARTSHADER_SCALE),GeData(0.1),flags);
    pShader->SetParameter(DescID(ARTSHADER_ROTATE),GeData(0.1),flags);
    pShader->SetParameter(DescID(ARTSHADER_SCALE_U),GeData(0.1),flags);
    pShader->SetParameter(DescID(ARTSHADER_SCALE_V),GeData(0.1),flags);
    pShader->SetParameter(DescID(ARTSHADER_SHADOW),GeData(true),flags);
    pShader->SetParameter(DescID(ARTSHADER_BACKFACE),GeData(true),flags);
    pShader->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pShader->GetDataInstance();
    bc->SetBool(ARTSHADER_BUMP,true);
    bc->SetInt32(ARTSHADER_SPACE,ARTSHADER_SPACE_WORLD);
    bc->SetFloat(ARTSHADER_SCALE,0.1);
    bc->SetFloat(ARTSHADER_ROTATE,0.1);
    bc->SetFloat(ARTSHADER_SCALE_U,0.1);
    bc->SetFloat(ARTSHADER_SCALE_V,0.1);
    bc->SetBool(ARTSHADER_SHADOW,true);
    bc->SetBool(ARTSHADER_BACKFACE,true);
    pShader->Message(MSG_UPDATE);                                                      
}