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 xTerrainmask

xTerrainmask

Attributes

  • ENGLISH NAME : TerrainMask
  • NAME : xTerrainmask
  • INCLUDE : Mpreview
  • INCLUDE : Xbase
  • PATH : shader/description/xterrainmask.res
  • PLUGIN : shader
  • MAXON online help (may not exist): XTERRAINMASK

Elements

ID UI Name Type Parameters Cycle
XTMASK_GRADIENT Gradient GRADIENT
COLOR
ICC_BASEDOCUMENT
XTMASK_ALTITUDE_ENABLE EnableAltitudeMasking BOOL  
XTMASK_ALTITUDE_MIN MinAltitude REAL UNIT
XTMASK_ALTITUDE_MAX MaxAltitude REAL UNIT
XTMASK_ALTITUDE_SOFTEN_MIN SoftenMin REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
CUSTOMGUI REALSLIDER
XTMASK_ALTITUDE_SOFTEN_MAX SoftenMax REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
CUSTOMGUI REALSLIDER
XTMASK_ALTITUDE_NOISE_HEIGHT NoiseHeight REAL UNIT
XTMASK_ALTITUDE_NOISE_SCALE Scale REAL UNIT
XTMASK_SLOPE_ENABLE EnableSlopeMasking BOOL  
XTMASK_SLOPE_MIN MinSlope REAL
UNIT DEGREE
MIN 0.0
MAX 179.0
XTMASK_SLOPE_MAX MaxSlope REAL
UNIT DEGREE
MIN 1.0
MAX 180.0
XTMASK_SLOPE_SOFTEN_MIN SoftenMin REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
CUSTOMGUI REALSLIDER
XTMASK_SLOPE_SOFTEN_MAX SoftenMax REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
CUSTOMGUI REALSLIDER
XTMASK_SLOPE_USEBUMP UseBump BOOL  
XTMASK_SLOPE_DIRECTION Direction LONG  
XTMASK_DIRECTION_X2 -X
XTMASK_DIRECTION_X +X
XTMASK_DIRECTION_Y2 -Y
XTMASK_DIRECTION_Y +Y
XTMASK_DIRECTION_Z2 -Z
XTMASK_DIRECTION_Z +Z
XTMASK_DIRECTION_CUSTOM Custom
XTMASK_SLOPE_DIRECTION_CUSTOM CustomDirection VECTOR  
XTMASK_SLOPE_ALTERNATIVEBLENDING AlternativeBlending BOOL  
XTMASK_SLOPE_ALTERNATIVEBLENDING_HARDNESS Hardness REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
XTMASK_GLOBAL UseGlobalCoordinates BOOL  
XTMASK_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.XTerrainmask)
    
    #You can set parameters two different ways. 
    #First way              
    shader[c4d.XTMASK_ALTITUDE_ENABLE] = True
    shader[c4d.XTMASK_ALTITUDE_MIN] = 0.1
    shader[c4d.XTMASK_ALTITUDE_MAX] = 0.1
    shader[c4d.XTMASK_ALTITUDE_SOFTEN_MIN] = 0.1
    shader[c4d.XTMASK_ALTITUDE_SOFTEN_MAX] = 0.1
    shader[c4d.XTMASK_ALTITUDE_NOISE_HEIGHT] = 0.1
    shader[c4d.XTMASK_ALTITUDE_NOISE_SCALE] = 0.1
    shader[c4d.XTMASK_SLOPE_ENABLE] = True
    shader[c4d.XTMASK_SLOPE_MIN] = 0.1
    shader[c4d.XTMASK_SLOPE_MAX] = 0.1
    shader[c4d.XTMASK_SLOPE_SOFTEN_MIN] = 0.1
    shader[c4d.XTMASK_SLOPE_SOFTEN_MAX] = 0.1
    shader[c4d.XTMASK_SLOPE_USEBUMP] = True
    shader[c4d.XTMASK_SLOPE_DIRECTION] = c4d.XTMASK_DIRECTION_X2
    shader[c4d.XTMASK_SLOPE_DIRECTION_CUSTOM] = c4d.Vector(1.0,1.0,1.0)
    shader[c4d.XTMASK_SLOPE_ALTERNATIVEBLENDING] = True
    shader[c4d.XTMASK_SLOPE_ALTERNATIVEBLENDING_HARDNESS] = 0.1
    shader[c4d.XTMASK_GLOBAL] = True
    shader[c4d.XTMASK_INVERT] = True
    
    #Second way, using the base container.
    bc = shader.GetDataInstance()
    bc.SetBool(c4d.XTMASK_ALTITUDE_ENABLE,True)
    bc.SetFloat(c4d.XTMASK_ALTITUDE_MIN,0.1)
    bc.SetFloat(c4d.XTMASK_ALTITUDE_MAX,0.1)
    bc.SetFloat(c4d.XTMASK_ALTITUDE_SOFTEN_MIN,0.1)
    bc.SetFloat(c4d.XTMASK_ALTITUDE_SOFTEN_MAX,0.1)
    bc.SetFloat(c4d.XTMASK_ALTITUDE_NOISE_HEIGHT,0.1)
    bc.SetFloat(c4d.XTMASK_ALTITUDE_NOISE_SCALE,0.1)
    bc.SetBool(c4d.XTMASK_SLOPE_ENABLE,True)
    bc.SetFloat(c4d.XTMASK_SLOPE_MIN,0.1)
    bc.SetFloat(c4d.XTMASK_SLOPE_MAX,0.1)
    bc.SetFloat(c4d.XTMASK_SLOPE_SOFTEN_MIN,0.1)
    bc.SetFloat(c4d.XTMASK_SLOPE_SOFTEN_MAX,0.1)
    bc.SetBool(c4d.XTMASK_SLOPE_USEBUMP,True)
    bc.SetInt32(c4d.XTMASK_SLOPE_DIRECTION,c4d.XTMASK_DIRECTION_X2)
    bc.SetVector(c4d.XTMASK_SLOPE_DIRECTION_CUSTOM, c4d.Vector(1.0,1.0,1.0)
    bc.SetBool(c4d.XTMASK_SLOPE_ALTERNATIVEBLENDING,True)
    bc.SetFloat(c4d.XTMASK_SLOPE_ALTERNATIVEBLENDING_HARDNESS,0.1)
    bc.SetBool(c4d.XTMASK_GLOBAL,True)
    bc.SetBool(c4d.XTMASK_INVERT,True)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../shader/description/xterrainmask.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseShader *pShader = BaseShader::Alloc(XTerrainmask);  
    
    //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(XTMASK_ALTITUDE_ENABLE),GeData(true),flags);
    pShader->SetParameter(DescID(XTMASK_ALTITUDE_MIN),GeData(0.1),flags);
    pShader->SetParameter(DescID(XTMASK_ALTITUDE_MAX),GeData(0.1),flags);
    pShader->SetParameter(DescID(XTMASK_ALTITUDE_SOFTEN_MIN),GeData(0.1),flags);
    pShader->SetParameter(DescID(XTMASK_ALTITUDE_SOFTEN_MAX),GeData(0.1),flags);
    pShader->SetParameter(DescID(XTMASK_ALTITUDE_NOISE_HEIGHT),GeData(0.1),flags);
    pShader->SetParameter(DescID(XTMASK_ALTITUDE_NOISE_SCALE),GeData(0.1),flags);
    pShader->SetParameter(DescID(XTMASK_SLOPE_ENABLE),GeData(true),flags);
    pShader->SetParameter(DescID(XTMASK_SLOPE_MIN),GeData(0.1),flags);
    pShader->SetParameter(DescID(XTMASK_SLOPE_MAX),GeData(0.1),flags);
    pShader->SetParameter(DescID(XTMASK_SLOPE_SOFTEN_MIN),GeData(0.1),flags);
    pShader->SetParameter(DescID(XTMASK_SLOPE_SOFTEN_MAX),GeData(0.1),flags);
    pShader->SetParameter(DescID(XTMASK_SLOPE_USEBUMP),GeData(true),flags);
    pShader->SetParameter(DescID(XTMASK_SLOPE_DIRECTION),GeData(XTMASK_DIRECTION_X2),flags);
    pShader->SetParameter(DescID(XTMASK_SLOPE_DIRECTION_CUSTOM),GeData(Vector(1.0,1.0,1.0)),flags);
    pShader->SetParameter(DescID(XTMASK_SLOPE_ALTERNATIVEBLENDING),GeData(true),flags);
    pShader->SetParameter(DescID(XTMASK_SLOPE_ALTERNATIVEBLENDING_HARDNESS),GeData(0.1),flags);
    pShader->SetParameter(DescID(XTMASK_GLOBAL),GeData(true),flags);
    pShader->SetParameter(DescID(XTMASK_INVERT),GeData(true),flags);
    pShader->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pShader->GetDataInstance();
    bc->SetBool(XTMASK_ALTITUDE_ENABLE,true);
    bc->SetFloat(XTMASK_ALTITUDE_MIN,0.1);
    bc->SetFloat(XTMASK_ALTITUDE_MAX,0.1);
    bc->SetFloat(XTMASK_ALTITUDE_SOFTEN_MIN,0.1);
    bc->SetFloat(XTMASK_ALTITUDE_SOFTEN_MAX,0.1);
    bc->SetFloat(XTMASK_ALTITUDE_NOISE_HEIGHT,0.1);
    bc->SetFloat(XTMASK_ALTITUDE_NOISE_SCALE,0.1);
    bc->SetBool(XTMASK_SLOPE_ENABLE,true);
    bc->SetFloat(XTMASK_SLOPE_MIN,0.1);
    bc->SetFloat(XTMASK_SLOPE_MAX,0.1);
    bc->SetFloat(XTMASK_SLOPE_SOFTEN_MIN,0.1);
    bc->SetFloat(XTMASK_SLOPE_SOFTEN_MAX,0.1);
    bc->SetBool(XTMASK_SLOPE_USEBUMP,true);
    bc->SetInt32(XTMASK_SLOPE_DIRECTION,XTMASK_DIRECTION_X2);
    bc->SetVector(XTMASK_SLOPE_DIRECTION_CUSTOM, c4d.Vector(1.0,1.0,1.0);
    bc->SetBool(XTMASK_SLOPE_ALTERNATIVEBLENDING,true);
    bc->SetFloat(XTMASK_SLOPE_ALTERNATIVEBLENDING_HARDNESS,0.1);
    bc->SetBool(XTMASK_GLOBAL,true);
    bc->SetBool(XTMASK_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"
XTMASK_GRADIENT
GeData data; pShader->GetParameter(DescID(XTMASK_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(XTMASK_GRADIENT),data,DESCFLAGS_SET_PARAM_SET));