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 xwood

xwood

Attributes

  • ENGLISH NAME : Wood
  • NAME : xwood
  • INCLUDE : Mpreview
  • INCLUDE : Xbase
  • PATH : shader/description/xwood.res
  • PLUGIN : shader
  • MAXON online help (may not exist): XWOOD

Elements

ID UI Name Type Parameters Cycle
WOODSHADER_COLOR_PRESET Type LONG ANIM
WOODSHADER_COLOR_PRESET_CUSTOM Custom
WOODSHADER_COLOR_PRESET_WALNUT Walnut
WOODSHADER_COLOR_PRESET_MAHAGONY Mahogany
WOODSHADER_COLOR_PRESET_JACARANDA Jacaranda
WOODSHADER_COLOR_PRESET_PINEWOOD Pinewood
WOODSHADER_COLOR Color GRADIENT ICC_BASEDOCUMENT
WOODSHADER_SCALE Scale REAL
UNIT PERCENT
STEP 1.0
MIN 0.0
WOODSHADER_STRETCH Stretch REAL
MIN 0.0
STEP 0.1
WOODSHADER_RING_SCALE RingScale REAL
UNIT PERCENT
STEP 1.0
MIN 0.0
WOODSHADER_GRAINY Grainy REAL
UNIT PERCENT
STEP 1.0
MIN 0.0
WOODSHADER_GRAIN_SCALE GrainScale REAL
UNIT PERCENT
STEP 1.0
MIN 0.0
WOODSHADER_WAVY Wavy REAL
UNIT PERCENT
STEP 1.0
MIN 0.0
WOODSHADER_WAVY_SCALE WavyScale REAL
UNIT PERCENT
STEP 0.1
MIN 0.0
WOODSHADER_SHIFT Shift REAL
STEP 0.1
MIN 0.0
WOODSHADER_RINGMODE AnnualRings BOOL  
WOODSHADER_RING_WAVY WavyRings REAL
UNIT PERCENT
STEP 0.1
MIN 0.0
WOODSHADER_RING_WAVY_SCALE WavyRingsScale VECTOR
UNIT PERCENT
STEP 0.1
MIN 0.0
WOODSHADER_SIMPLE_TYPE Type LONG ANIM
WOODSHADER_SIMPLE_TYPE_CUSTOM Custom
WOODSHADER_SIMPLE_TYPE_WALNUT Walnut
WOODSHADER_SIMPLE_TYPE_MAHOGANY Mahogany
WOODSHADER_SIMPLE_TYPE_JACARANDA Jacaranda
WOODSHADER_SIMPLE_TYPE_PINEWOOD Pinewood
WOODSHADER_SIMPLE_COLOR Color GRADIENT ICC_BASEDOCUMENT
WOODSHADER_SIMPLE_SCALE Frequency VECTOR
MIN 0.0
STEP 0.01
WOODSHADER_SIMPLE_TURBULENCE Turbulence REAL
UNIT PERCENT
MIN 0.0
MAX 300.0
WOODSHADER_LEGACY Legacy 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.Xwood)
    
    #You can set parameters two different ways. 
    #First way              
    shader[c4d.WOODSHADER_COLOR_PRESET] = c4d.WOODSHADER_COLOR_PRESET_CUSTOM
    shader[c4d.WOODSHADER_SCALE] = 0.1
    shader[c4d.WOODSHADER_STRETCH] = 0.1
    shader[c4d.WOODSHADER_RING_SCALE] = 0.1
    shader[c4d.WOODSHADER_GRAINY] = 0.1
    shader[c4d.WOODSHADER_GRAIN_SCALE] = 0.1
    shader[c4d.WOODSHADER_WAVY] = 0.1
    shader[c4d.WOODSHADER_WAVY_SCALE] = 0.1
    shader[c4d.WOODSHADER_SHIFT] = 0.1
    shader[c4d.WOODSHADER_RINGMODE] = True
    shader[c4d.WOODSHADER_RING_WAVY] = 0.1
    shader[c4d.WOODSHADER_RING_WAVY_SCALE] = c4d.Vector(1.0,1.0,1.0)
    shader[c4d.WOODSHADER_SIMPLE_TYPE] = c4d.WOODSHADER_SIMPLE_TYPE_CUSTOM
    shader[c4d.WOODSHADER_SIMPLE_SCALE] = c4d.Vector(1.0,1.0,1.0)
    shader[c4d.WOODSHADER_SIMPLE_TURBULENCE] = 0.1
    shader[c4d.WOODSHADER_LEGACY] = True
    
    #Second way, using the base container.
    bc = shader.GetDataInstance()
    bc.SetInt32(c4d.WOODSHADER_COLOR_PRESET,c4d.WOODSHADER_COLOR_PRESET_CUSTOM)
    bc.SetFloat(c4d.WOODSHADER_SCALE,0.1)
    bc.SetFloat(c4d.WOODSHADER_STRETCH,0.1)
    bc.SetFloat(c4d.WOODSHADER_RING_SCALE,0.1)
    bc.SetFloat(c4d.WOODSHADER_GRAINY,0.1)
    bc.SetFloat(c4d.WOODSHADER_GRAIN_SCALE,0.1)
    bc.SetFloat(c4d.WOODSHADER_WAVY,0.1)
    bc.SetFloat(c4d.WOODSHADER_WAVY_SCALE,0.1)
    bc.SetFloat(c4d.WOODSHADER_SHIFT,0.1)
    bc.SetBool(c4d.WOODSHADER_RINGMODE,True)
    bc.SetFloat(c4d.WOODSHADER_RING_WAVY,0.1)
    bc.SetVector(c4d.WOODSHADER_RING_WAVY_SCALE, c4d.Vector(1.0,1.0,1.0)
    bc.SetInt32(c4d.WOODSHADER_SIMPLE_TYPE,c4d.WOODSHADER_SIMPLE_TYPE_CUSTOM)
    bc.SetVector(c4d.WOODSHADER_SIMPLE_SCALE, c4d.Vector(1.0,1.0,1.0)
    bc.SetFloat(c4d.WOODSHADER_SIMPLE_TURBULENCE,0.1)
    bc.SetBool(c4d.WOODSHADER_LEGACY,True)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../shader/description/xwood.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseShader *pShader = BaseShader::Alloc(Xwood);  
    
    //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(WOODSHADER_COLOR_PRESET),GeData(WOODSHADER_COLOR_PRESET_CUSTOM),flags);
    pShader->SetParameter(DescID(WOODSHADER_SCALE),GeData(0.1),flags);
    pShader->SetParameter(DescID(WOODSHADER_STRETCH),GeData(0.1),flags);
    pShader->SetParameter(DescID(WOODSHADER_RING_SCALE),GeData(0.1),flags);
    pShader->SetParameter(DescID(WOODSHADER_GRAINY),GeData(0.1),flags);
    pShader->SetParameter(DescID(WOODSHADER_GRAIN_SCALE),GeData(0.1),flags);
    pShader->SetParameter(DescID(WOODSHADER_WAVY),GeData(0.1),flags);
    pShader->SetParameter(DescID(WOODSHADER_WAVY_SCALE),GeData(0.1),flags);
    pShader->SetParameter(DescID(WOODSHADER_SHIFT),GeData(0.1),flags);
    pShader->SetParameter(DescID(WOODSHADER_RINGMODE),GeData(true),flags);
    pShader->SetParameter(DescID(WOODSHADER_RING_WAVY),GeData(0.1),flags);
    pShader->SetParameter(DescID(WOODSHADER_RING_WAVY_SCALE),GeData(Vector(1.0,1.0,1.0)),flags);
    pShader->SetParameter(DescID(WOODSHADER_SIMPLE_TYPE),GeData(WOODSHADER_SIMPLE_TYPE_CUSTOM),flags);
    pShader->SetParameter(DescID(WOODSHADER_SIMPLE_SCALE),GeData(Vector(1.0,1.0,1.0)),flags);
    pShader->SetParameter(DescID(WOODSHADER_SIMPLE_TURBULENCE),GeData(0.1),flags);
    pShader->SetParameter(DescID(WOODSHADER_LEGACY),GeData(true),flags);
    pShader->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pShader->GetDataInstance();
    bc->SetInt32(WOODSHADER_COLOR_PRESET,WOODSHADER_COLOR_PRESET_CUSTOM);
    bc->SetFloat(WOODSHADER_SCALE,0.1);
    bc->SetFloat(WOODSHADER_STRETCH,0.1);
    bc->SetFloat(WOODSHADER_RING_SCALE,0.1);
    bc->SetFloat(WOODSHADER_GRAINY,0.1);
    bc->SetFloat(WOODSHADER_GRAIN_SCALE,0.1);
    bc->SetFloat(WOODSHADER_WAVY,0.1);
    bc->SetFloat(WOODSHADER_WAVY_SCALE,0.1);
    bc->SetFloat(WOODSHADER_SHIFT,0.1);
    bc->SetBool(WOODSHADER_RINGMODE,true);
    bc->SetFloat(WOODSHADER_RING_WAVY,0.1);
    bc->SetVector(WOODSHADER_RING_WAVY_SCALE, c4d.Vector(1.0,1.0,1.0);
    bc->SetInt32(WOODSHADER_SIMPLE_TYPE,WOODSHADER_SIMPLE_TYPE_CUSTOM);
    bc->SetVector(WOODSHADER_SIMPLE_SCALE, c4d.Vector(1.0,1.0,1.0);
    bc->SetFloat(WOODSHADER_SIMPLE_TURBULENCE,0.1);
    bc->SetBool(WOODSHADER_LEGACY,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"
WOODSHADER_COLOR
GeData data; pShader->GetParameter(DescID(WOODSHADER_COLOR),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(WOODSHADER_COLOR),data,DESCFLAGS_SET_PARAM_SET));
WOODSHADER_SIMPLE_COLOR
pShader->GetParameter(DescID(WOODSHADER_SIMPLE_COLOR),data,DESCFLAGS_GET_PARAM_GET));