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 Xhatchingshader

Xhatchingshader

Attributes

  • ENGLISH NAME : HatchShader
  • NAME : Xhatchingshader
  • INCLUDE : Mpreview
  • INCLUDE : Xbase
  • PATH : sketch/description/xhatchingshader.res
  • PLUGIN : sketch
  • MAXON online help (may not exist): XHATCHINGSHADER

Elements

ID UI Name Type Parameters Cycle
HATCHINGSHADER_TEXTURE Texture SHADERLINK FIT_H
HATCHINGSHADER_TILE TileUV BOOL  
HATCHINGSHADER_ROTATIONAL RotationalUV BOOL  
HATCHINGSHADER_SCALE Scale REAL
UNIT PERCENT
MIN 0.0
HATCHINGSHADER_ROTATE RotateUV REAL
UNIT DEGREE
MIN -360.0
MAX 360.0
HATCHINGSHADER_OFFSET_U OffsetU REAL UNIT
HATCHINGSHADER_OFFSET_V OffsetV REAL UNIT
HATCHINGSHADER_DENSITY Density REAL
UNIT PERCENT
MIN 0.0
MAX 10000.0
HATCHINGSHADER_DENSITY_U DensityU REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
HATCHINGSHADER_DENSITY_V DensityV REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
HATCHINGSHADER_SCATTER_U ScatterU REAL
UNIT PERCENT
MIN 0.0
HATCHINGSHADER_SCATTER_V ScatterV REAL
UNIT PERCENT
MIN 0.0
HATCHINGSHADER_SPACE_U SpacingU REAL
UNIT PERCENT
MIN -100.0
HATCHINGSHADER_SPACE_U_VAR Variation REAL
UNIT PERCENT
MIN 0.0
HATCHINGSHADER_SPACE_V SpacingV REAL
UNIT PERCENT
MIN -100.0
HATCHINGSHADER_SPACE_V_VAR Variation REAL
UNIT PERCENT
MIN 0.0
HATCHINGSHADER_SCALE_U ScaleU REAL
UNIT PERCENT
MIN 0.0
HATCHINGSHADER_SCALE_U_VAR Variation REAL
UNIT PERCENT
MIN 0.0
HATCHINGSHADER_SCALE_V ScaleV REAL
UNIT PERCENT
MIN 0.0
HATCHINGSHADER_SCALE_V_VAR Variation REAL
UNIT PERCENT
MIN 0.0
HATCHINGSHADER_STOKE_ROTATE Rotate REAL
UNIT DEGREE
MIN 0.0
MAX 360.0
HATCHINGSHADER_CROSSED Crosses BOOL  
HATCHINGSHADER_CROSS_ROTATE CrossRotation REAL
UNIT DEGREE
MIN -360.0
MAX 360.0
HATCHINGSHADER_STROKE_COLOR DarkStrokeColor COLOR OPEN
HATCHINGSHADER_STROKELIGHT_COLOR LightStrokeColor COLOR OPEN
HATCHINGSHADER_BACK_COLOR BackgroundColor COLOR OPEN
HATCHINGSHADER_DARK_STROKES ShowDarkStrokes BOOL  
HATCHINGSHADER_LIGHT_STROKES ShowLightStrokes BOOL  
HATCHINGSHADER_LEVELS ShadeLevels LONG
MIN 1
MAX 20
HATCHINGSHADER_THRESHOLD Threshold REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
HATCHINGSHADER_SHADOW Shadows GRADIENT
ALPHA
ICC_BASEDOCUMENT
HATCHINGSHADER_DIFFUSE Diffuse GRADIENT
ALPHA
ICC_BASEDOCUMENT
HATCHINGSHADER_SPEC Specular GRADIENT
ALPHA
ICC_BASEDOCUMENT
HATCHINGSHADER_ILLUM Illumination GRADIENT
ALPHA
ICC_BASEDOCUMENT
HATCHINGSHADER_BUMP UseBump BOOL  
HATCHINGSHADER_CAMERA Camera BOOL  
HATCHINGSHADER_LIGHTS Lights BOOL  
HATCHINGSHADER_SPECULAR Specular BOOL  
HATCHINGSHADER_ILLUMINATION Illumination BOOL  
HATCHINGSHADER_SHADOWS Shadow BOOL  
HATCHINGSHADER_CONTRAST ModifiesContrast BOOL  
HATCHINGSHADER_INCEXC UseLights LONG  
HATCHINGSHADER_INCEXC_INCLUDE Include
HATCHINGSHADER_INCEXC_EXCLUDE Exclude
HATCHINGSHADER_INCEXC_LIGHTS Lights IN_EXCLUDE
NUM_FLAGS 0
INIT_STATE 0
SEND_SELCHNGMSG 1

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.Xhatchingshader)
    
    #You can set parameters two different ways. 
    #First way              
    shader[c4d.HATCHINGSHADER_TILE] = True
    shader[c4d.HATCHINGSHADER_ROTATIONAL] = True
    shader[c4d.HATCHINGSHADER_SCALE] = 0.1
    shader[c4d.HATCHINGSHADER_ROTATE] = 0.1
    shader[c4d.HATCHINGSHADER_OFFSET_U] = 0.1
    shader[c4d.HATCHINGSHADER_OFFSET_V] = 0.1
    shader[c4d.HATCHINGSHADER_DENSITY] = 0.1
    shader[c4d.HATCHINGSHADER_DENSITY_U] = 0.1
    shader[c4d.HATCHINGSHADER_DENSITY_V] = 0.1
    shader[c4d.HATCHINGSHADER_SCATTER_U] = 0.1
    shader[c4d.HATCHINGSHADER_SCATTER_V] = 0.1
    shader[c4d.HATCHINGSHADER_SPACE_U] = 0.1
    shader[c4d.HATCHINGSHADER_SPACE_U_VAR] = 0.1
    shader[c4d.HATCHINGSHADER_SPACE_V] = 0.1
    shader[c4d.HATCHINGSHADER_SPACE_V_VAR] = 0.1
    shader[c4d.HATCHINGSHADER_SCALE_U] = 0.1
    shader[c4d.HATCHINGSHADER_SCALE_U_VAR] = 0.1
    shader[c4d.HATCHINGSHADER_SCALE_V] = 0.1
    shader[c4d.HATCHINGSHADER_SCALE_V_VAR] = 0.1
    shader[c4d.HATCHINGSHADER_STOKE_ROTATE] = 0.1
    shader[c4d.HATCHINGSHADER_CROSSED] = True
    shader[c4d.HATCHINGSHADER_CROSS_ROTATE] = 0.1
    shader[c4d.HATCHINGSHADER_DARK_STROKES] = True
    shader[c4d.HATCHINGSHADER_LIGHT_STROKES] = True
    shader[c4d.HATCHINGSHADER_LEVELS] = 1
    shader[c4d.HATCHINGSHADER_THRESHOLD] = 0.1
    shader[c4d.HATCHINGSHADER_BUMP] = True
    shader[c4d.HATCHINGSHADER_CAMERA] = True
    shader[c4d.HATCHINGSHADER_LIGHTS] = True
    shader[c4d.HATCHINGSHADER_SPECULAR] = True
    shader[c4d.HATCHINGSHADER_ILLUMINATION] = True
    shader[c4d.HATCHINGSHADER_SHADOWS] = True
    shader[c4d.HATCHINGSHADER_CONTRAST] = True
    shader[c4d.HATCHINGSHADER_INCEXC] = c4d.HATCHINGSHADER_INCEXC_INCLUDE
    
    #Second way, using the base container.
    bc = shader.GetDataInstance()
    bc.SetBool(c4d.HATCHINGSHADER_TILE,True)
    bc.SetBool(c4d.HATCHINGSHADER_ROTATIONAL,True)
    bc.SetFloat(c4d.HATCHINGSHADER_SCALE,0.1)
    bc.SetFloat(c4d.HATCHINGSHADER_ROTATE,0.1)
    bc.SetFloat(c4d.HATCHINGSHADER_OFFSET_U,0.1)
    bc.SetFloat(c4d.HATCHINGSHADER_OFFSET_V,0.1)
    bc.SetFloat(c4d.HATCHINGSHADER_DENSITY,0.1)
    bc.SetFloat(c4d.HATCHINGSHADER_DENSITY_U,0.1)
    bc.SetFloat(c4d.HATCHINGSHADER_DENSITY_V,0.1)
    bc.SetFloat(c4d.HATCHINGSHADER_SCATTER_U,0.1)
    bc.SetFloat(c4d.HATCHINGSHADER_SCATTER_V,0.1)
    bc.SetFloat(c4d.HATCHINGSHADER_SPACE_U,0.1)
    bc.SetFloat(c4d.HATCHINGSHADER_SPACE_U_VAR,0.1)
    bc.SetFloat(c4d.HATCHINGSHADER_SPACE_V,0.1)
    bc.SetFloat(c4d.HATCHINGSHADER_SPACE_V_VAR,0.1)
    bc.SetFloat(c4d.HATCHINGSHADER_SCALE_U,0.1)
    bc.SetFloat(c4d.HATCHINGSHADER_SCALE_U_VAR,0.1)
    bc.SetFloat(c4d.HATCHINGSHADER_SCALE_V,0.1)
    bc.SetFloat(c4d.HATCHINGSHADER_SCALE_V_VAR,0.1)
    bc.SetFloat(c4d.HATCHINGSHADER_STOKE_ROTATE,0.1)
    bc.SetBool(c4d.HATCHINGSHADER_CROSSED,True)
    bc.SetFloat(c4d.HATCHINGSHADER_CROSS_ROTATE,0.1)
    bc.SetBool(c4d.HATCHINGSHADER_DARK_STROKES,True)
    bc.SetBool(c4d.HATCHINGSHADER_LIGHT_STROKES,True)
    bc.SetInt32(c4d.HATCHINGSHADER_LEVELS,1)
    bc.SetFloat(c4d.HATCHINGSHADER_THRESHOLD,0.1)
    bc.SetBool(c4d.HATCHINGSHADER_BUMP,True)
    bc.SetBool(c4d.HATCHINGSHADER_CAMERA,True)
    bc.SetBool(c4d.HATCHINGSHADER_LIGHTS,True)
    bc.SetBool(c4d.HATCHINGSHADER_SPECULAR,True)
    bc.SetBool(c4d.HATCHINGSHADER_ILLUMINATION,True)
    bc.SetBool(c4d.HATCHINGSHADER_SHADOWS,True)
    bc.SetBool(c4d.HATCHINGSHADER_CONTRAST,True)
    bc.SetInt32(c4d.HATCHINGSHADER_INCEXC,c4d.HATCHINGSHADER_INCEXC_INCLUDE)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../sketch/description/xhatchingshader.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseShader *pShader = BaseShader::Alloc(Xhatchingshader);  
    
    //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(HATCHINGSHADER_TILE),GeData(true),flags);
    pShader->SetParameter(DescID(HATCHINGSHADER_ROTATIONAL),GeData(true),flags);
    pShader->SetParameter(DescID(HATCHINGSHADER_SCALE),GeData(0.1),flags);
    pShader->SetParameter(DescID(HATCHINGSHADER_ROTATE),GeData(0.1),flags);
    pShader->SetParameter(DescID(HATCHINGSHADER_OFFSET_U),GeData(0.1),flags);
    pShader->SetParameter(DescID(HATCHINGSHADER_OFFSET_V),GeData(0.1),flags);
    pShader->SetParameter(DescID(HATCHINGSHADER_DENSITY),GeData(0.1),flags);
    pShader->SetParameter(DescID(HATCHINGSHADER_DENSITY_U),GeData(0.1),flags);
    pShader->SetParameter(DescID(HATCHINGSHADER_DENSITY_V),GeData(0.1),flags);
    pShader->SetParameter(DescID(HATCHINGSHADER_SCATTER_U),GeData(0.1),flags);
    pShader->SetParameter(DescID(HATCHINGSHADER_SCATTER_V),GeData(0.1),flags);
    pShader->SetParameter(DescID(HATCHINGSHADER_SPACE_U),GeData(0.1),flags);
    pShader->SetParameter(DescID(HATCHINGSHADER_SPACE_U_VAR),GeData(0.1),flags);
    pShader->SetParameter(DescID(HATCHINGSHADER_SPACE_V),GeData(0.1),flags);
    pShader->SetParameter(DescID(HATCHINGSHADER_SPACE_V_VAR),GeData(0.1),flags);
    pShader->SetParameter(DescID(HATCHINGSHADER_SCALE_U),GeData(0.1),flags);
    pShader->SetParameter(DescID(HATCHINGSHADER_SCALE_U_VAR),GeData(0.1),flags);
    pShader->SetParameter(DescID(HATCHINGSHADER_SCALE_V),GeData(0.1),flags);
    pShader->SetParameter(DescID(HATCHINGSHADER_SCALE_V_VAR),GeData(0.1),flags);
    pShader->SetParameter(DescID(HATCHINGSHADER_STOKE_ROTATE),GeData(0.1),flags);
    pShader->SetParameter(DescID(HATCHINGSHADER_CROSSED),GeData(true),flags);
    pShader->SetParameter(DescID(HATCHINGSHADER_CROSS_ROTATE),GeData(0.1),flags);
    pShader->SetParameter(DescID(HATCHINGSHADER_DARK_STROKES),GeData(true),flags);
    pShader->SetParameter(DescID(HATCHINGSHADER_LIGHT_STROKES),GeData(true),flags);
    pShader->SetParameter(DescID(HATCHINGSHADER_LEVELS),GeData(1),flags);
    pShader->SetParameter(DescID(HATCHINGSHADER_THRESHOLD),GeData(0.1),flags);
    pShader->SetParameter(DescID(HATCHINGSHADER_BUMP),GeData(true),flags);
    pShader->SetParameter(DescID(HATCHINGSHADER_CAMERA),GeData(true),flags);
    pShader->SetParameter(DescID(HATCHINGSHADER_LIGHTS),GeData(true),flags);
    pShader->SetParameter(DescID(HATCHINGSHADER_SPECULAR),GeData(true),flags);
    pShader->SetParameter(DescID(HATCHINGSHADER_ILLUMINATION),GeData(true),flags);
    pShader->SetParameter(DescID(HATCHINGSHADER_SHADOWS),GeData(true),flags);
    pShader->SetParameter(DescID(HATCHINGSHADER_CONTRAST),GeData(true),flags);
    pShader->SetParameter(DescID(HATCHINGSHADER_INCEXC),GeData(HATCHINGSHADER_INCEXC_INCLUDE),flags);
    pShader->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pShader->GetDataInstance();
    bc->SetBool(HATCHINGSHADER_TILE,true);
    bc->SetBool(HATCHINGSHADER_ROTATIONAL,true);
    bc->SetFloat(HATCHINGSHADER_SCALE,0.1);
    bc->SetFloat(HATCHINGSHADER_ROTATE,0.1);
    bc->SetFloat(HATCHINGSHADER_OFFSET_U,0.1);
    bc->SetFloat(HATCHINGSHADER_OFFSET_V,0.1);
    bc->SetFloat(HATCHINGSHADER_DENSITY,0.1);
    bc->SetFloat(HATCHINGSHADER_DENSITY_U,0.1);
    bc->SetFloat(HATCHINGSHADER_DENSITY_V,0.1);
    bc->SetFloat(HATCHINGSHADER_SCATTER_U,0.1);
    bc->SetFloat(HATCHINGSHADER_SCATTER_V,0.1);
    bc->SetFloat(HATCHINGSHADER_SPACE_U,0.1);
    bc->SetFloat(HATCHINGSHADER_SPACE_U_VAR,0.1);
    bc->SetFloat(HATCHINGSHADER_SPACE_V,0.1);
    bc->SetFloat(HATCHINGSHADER_SPACE_V_VAR,0.1);
    bc->SetFloat(HATCHINGSHADER_SCALE_U,0.1);
    bc->SetFloat(HATCHINGSHADER_SCALE_U_VAR,0.1);
    bc->SetFloat(HATCHINGSHADER_SCALE_V,0.1);
    bc->SetFloat(HATCHINGSHADER_SCALE_V_VAR,0.1);
    bc->SetFloat(HATCHINGSHADER_STOKE_ROTATE,0.1);
    bc->SetBool(HATCHINGSHADER_CROSSED,true);
    bc->SetFloat(HATCHINGSHADER_CROSS_ROTATE,0.1);
    bc->SetBool(HATCHINGSHADER_DARK_STROKES,true);
    bc->SetBool(HATCHINGSHADER_LIGHT_STROKES,true);
    bc->SetInt32(HATCHINGSHADER_LEVELS,1);
    bc->SetFloat(HATCHINGSHADER_THRESHOLD,0.1);
    bc->SetBool(HATCHINGSHADER_BUMP,true);
    bc->SetBool(HATCHINGSHADER_CAMERA,true);
    bc->SetBool(HATCHINGSHADER_LIGHTS,true);
    bc->SetBool(HATCHINGSHADER_SPECULAR,true);
    bc->SetBool(HATCHINGSHADER_ILLUMINATION,true);
    bc->SetBool(HATCHINGSHADER_SHADOWS,true);
    bc->SetBool(HATCHINGSHADER_CONTRAST,true);
    bc->SetInt32(HATCHINGSHADER_INCEXC,HATCHINGSHADER_INCEXC_INCLUDE);
    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"
HATCHINGSHADER_SHADOW
GeData data; pShader->GetParameter(DescID(HATCHINGSHADER_SHADOW),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(HATCHINGSHADER_SHADOW),data,DESCFLAGS_SET_PARAM_SET));
HATCHINGSHADER_DIFFUSE
pShader->GetParameter(DescID(HATCHINGSHADER_DIFFUSE),data,DESCFLAGS_GET_PARAM_GET));
HATCHINGSHADER_SPEC
pShader->GetParameter(DescID(HATCHINGSHADER_SPEC),data,DESCFLAGS_GET_PARAM_GET));
HATCHINGSHADER_ILLUM
pShader->GetParameter(DescID(HATCHINGSHADER_ILLUM),data,DESCFLAGS_GET_PARAM_GET));