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 xrain

xrain

Attributes

  • ENGLISH NAME : WeatheringShader
  • NAME : xrain
  • INCLUDE : Mpreview
  • INCLUDE : Xbase
  • PATH : shader/description/xrain.res
  • PLUGIN : shader
  • MAXON online help (may not exist): XRAIN

Elements

ID UI Name Type Parameters Cycle
XRAIN_SHADERLINK Texture SHADERLINK  
XRAIN_DIRECTION Direction LONG  
XRAIN_DIRECTION_U1 +U(up)
XRAIN_DIRECTION_U2 -U(down)
XRAIN_DIRECTION_V1 +V(right)
XRAIN_DIRECTION_V2 -V(left)
XRAIN_INTENSITY Intensity REAL
UNIT PERCENT
STEP 1.0
MIN 0.0
MAX 5000.0
MINSLIDER 0.0
MAXSLIDER 200.0
XRAIN_SAMPLES Smoothness LONG
MIN 4
MAX 1024
XRAIN_WEIGHTED Weighting LONG  
XRAIN_WEIGHTED_NONE None
XRAIN_WEIGHTED_1 Bright
XRAIN_WEIGHTED_2 Dark
XRAIN_CLAMP ClampUVcoords BOOL  
XRAIN_WEIGHTSHADER_LINK IntensityShader SHADERLINK  
XRAIN_WEIGHTSHADER_INTENSITY Strength REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
CUSTOMGUI REALSLIDER

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.Xrain)
    
    #You can set parameters two different ways. 
    #First way              
    shader[c4d.XRAIN_DIRECTION] = c4d.XRAIN_DIRECTION_U1
    shader[c4d.XRAIN_INTENSITY] = 0.1
    shader[c4d.XRAIN_SAMPLES] = 1
    shader[c4d.XRAIN_WEIGHTED] = c4d.XRAIN_WEIGHTED_NONE
    shader[c4d.XRAIN_CLAMP] = True
    shader[c4d.XRAIN_WEIGHTSHADER_INTENSITY] = 0.1
    
    #Second way, using the base container.
    bc = shader.GetDataInstance()
    bc.SetInt32(c4d.XRAIN_DIRECTION,c4d.XRAIN_DIRECTION_U1)
    bc.SetFloat(c4d.XRAIN_INTENSITY,0.1)
    bc.SetInt32(c4d.XRAIN_SAMPLES,1)
    bc.SetInt32(c4d.XRAIN_WEIGHTED,c4d.XRAIN_WEIGHTED_NONE)
    bc.SetBool(c4d.XRAIN_CLAMP,True)
    bc.SetFloat(c4d.XRAIN_WEIGHTSHADER_INTENSITY,0.1)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../shader/description/xrain.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseShader *pShader = BaseShader::Alloc(Xrain);  
    
    //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(XRAIN_DIRECTION),GeData(XRAIN_DIRECTION_U1),flags);
    pShader->SetParameter(DescID(XRAIN_INTENSITY),GeData(0.1),flags);
    pShader->SetParameter(DescID(XRAIN_SAMPLES),GeData(1),flags);
    pShader->SetParameter(DescID(XRAIN_WEIGHTED),GeData(XRAIN_WEIGHTED_NONE),flags);
    pShader->SetParameter(DescID(XRAIN_CLAMP),GeData(true),flags);
    pShader->SetParameter(DescID(XRAIN_WEIGHTSHADER_INTENSITY),GeData(0.1),flags);
    pShader->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pShader->GetDataInstance();
    bc->SetInt32(XRAIN_DIRECTION,XRAIN_DIRECTION_U1);
    bc->SetFloat(XRAIN_INTENSITY,0.1);
    bc->SetInt32(XRAIN_SAMPLES,1);
    bc->SetInt32(XRAIN_WEIGHTED,XRAIN_WEIGHTED_NONE);
    bc->SetBool(XRAIN_CLAMP,true);
    bc->SetFloat(XRAIN_WEIGHTSHADER_INTENSITY,0.1);
    pShader->Message(MSG_UPDATE);                                                      
}