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 Thairmaterial

Thairmaterial

Attributes

  • ENGLISH NAME : HairMaterial
  • NAME : Thairmaterial
  • INCLUDE : Tbase
  • PATH : hair/description/thairmaterial.res
  • PLUGIN : hair
  • MAXON online help (may not exist): THAIRMATERIAL

Elements

ID UI Name Type Parameters Cycle
HAIRMATERIAL_TAG_LINK Material LINK  
HAIRMATERIAL_TAG_USE_AVAILABLE UseAvailable BOOL  
HAIRMATERIAL_TAG_REMOVE_AVAILABLE RemoveAvailable BOOL  
HAIRMATERIAL_TAG_USE Use LONG  
HAIRMATERIAL_TAG_USE_ALL All
HAIRMATERIAL_TAG_USE_PERCENT Percent
HAIRMATERIAL_TAG_USE_CLUMPS Clumps
HAIRMATERIAL_TAG_USE_SELECTION Selection
HAIRMATERIAL_TAG_USE_SHADER Texture
HAIRMATERIAL_TAG_BLEND Blend LONG  
HAIRMATERIAL_TAG_BLENDMODE_AVERAGE Average
HAIRMATERIAL_TAG_BLENDMODE_NORMAL Normal
HAIRMATERIAL_TAG_BLENDMODE_MULTIPLY Multiply
HAIRMATERIAL_TAG_BLENDMODE_SCREEN Screen
HAIRMATERIAL_TAG_BLENDMODE_DARKEN Darken
HAIRMATERIAL_TAG_BLENDMODE_LIGHT Lighten
HAIRMATERIAL_TAG_BLENDMODE_DIFFERENCE Difference
HAIRMATERIAL_TAG_BLENDMODE_NEGATIVE Negative
HAIRMATERIAL_TAG_BLENDMODE_EXCLUSION Exclusion
HAIRMATERIAL_TAG_BLENDMODE_OVERLAY Overlay
HAIRMATERIAL_TAG_BLENDMODE_HARDLIGHT HardLight
HAIRMATERIAL_TAG_BLENDMODE_SOFTLIGHT SoftLight
HAIRMATERIAL_TAG_BLENDMODE_DODGE Dodge
HAIRMATERIAL_TAG_BLENDMODE_BURN Burn
HAIRMATERIAL_TAG_BLENDMODE_REFLECT Reflect
HAIRMATERIAL_TAG_BLENDMODE_GLOW Glow
HAIRMATERIAL_TAG_BLENDMODE_FREEZE Freeze
HAIRMATERIAL_TAG_BLENDMODE_HEAT Heat
HAIRMATERIAL_TAG_BLENDMODE_ADD Add
HAIRMATERIAL_TAG_BLENDMODE_SUB Subtract
HAIRMATERIAL_TAG_BLENDMODE_STAMP Stamp
HAIRMATERIAL_TAG_BLENDMODE_XOR Xor
HAIRMATERIAL_TAG_BLENDMODE_HUE Hue
HAIRMATERIAL_TAG_BLENDMODE_SATURATION Saturation
HAIRMATERIAL_TAG_BLENDMODE_LUMINANCE Luminance
HAIRMATERIAL_TAG_BLENDMODE_RED Red
HAIRMATERIAL_TAG_BLENDMODE_GREEN Green
HAIRMATERIAL_TAG_BLENDMODE_BLUE Blue
HAIRMATERIAL_TAG_BLENDMODE_OVERWRITE Overwrite
HAIRMATERIAL_TAG_BLENDMODE_LEVR Levr
HAIRMATERIAL_TAG_USE_MIX Mix REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
CUSTOMGUI REALSLIDER
HAIRMATERIAL_TAG_SMOOTH_MIX SmoothMix BOOL  
HAIRMATERIAL_TAG_USE_LEVEL Amount REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
CUSTOMGUI REALSLIDER
HAIRMATERIAL_TAG_SELECTED_LINK Selection LINK  
HAIRMATERIAL_TAG_SHADER Texture SHADERLINK  
HAIRMATERIAL_TAG_CLUMP_RADIUS Radius REAL
UNIT METER
MIN 0.0
HAIRMATERIAL_TAG_CLUMP_RADIUS_VAR Variation REAL
UNIT METER
MIN 0.0
HAIRMATERIAL_TAG_CLUMP_MAX Limit LONG MIN
HAIRMATERIAL_TAG_THRESHOLD Start REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
CUSTOMGUI REALSLIDER
HAIRMATERIAL_TAG_THRESHOLD_END End REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
CUSTOMGUI REALSLIDER
HAIRMATERIAL_TAG_HAIR_UVS HairUVs LONG  
HAIRMATERIAL_TAG_HAIR_UVS_SYMMETRICAL Symmetrical
HAIRMATERIAL_TAG_HAIR_UVS_FLAT Flat
HAIRMATERIAL_TAG_HAIR_UVS_FEATHER Feather

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():
    obj = c4d.BaseObject(c4d.Osphere)
    tag = obj.MakeTag(c4d.Thairmaterial)
    doc.InsertObject(obj)
    c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
    
    #You can set parameters two different ways. 
    #First way              
    tag[c4d.HAIRMATERIAL_TAG_USE_AVAILABLE] = True
    tag[c4d.HAIRMATERIAL_TAG_REMOVE_AVAILABLE] = True
    tag[c4d.HAIRMATERIAL_TAG_USE] = c4d.HAIRMATERIAL_TAG_USE_ALL
    tag[c4d.HAIRMATERIAL_TAG_BLEND] = c4d.HAIRMATERIAL_TAG_BLENDMODE_AVERAGE
    tag[c4d.HAIRMATERIAL_TAG_USE_MIX] = 0.1
    tag[c4d.HAIRMATERIAL_TAG_SMOOTH_MIX] = True
    tag[c4d.HAIRMATERIAL_TAG_USE_LEVEL] = 0.1
    tag[c4d.HAIRMATERIAL_TAG_CLUMP_RADIUS] = 0.1
    tag[c4d.HAIRMATERIAL_TAG_CLUMP_RADIUS_VAR] = 0.1
    tag[c4d.HAIRMATERIAL_TAG_CLUMP_MAX] = 1
    tag[c4d.HAIRMATERIAL_TAG_THRESHOLD] = 0.1
    tag[c4d.HAIRMATERIAL_TAG_THRESHOLD_END] = 0.1
    tag[c4d.HAIRMATERIAL_TAG_HAIR_UVS] = c4d.HAIRMATERIAL_TAG_HAIR_UVS_SYMMETRICAL
    
    #Second way, using the base container.
    bc = tag.GetDataInstance()
    bc.SetBool(c4d.HAIRMATERIAL_TAG_USE_AVAILABLE,True)
    bc.SetBool(c4d.HAIRMATERIAL_TAG_REMOVE_AVAILABLE,True)
    bc.SetInt32(c4d.HAIRMATERIAL_TAG_USE,c4d.HAIRMATERIAL_TAG_USE_ALL)
    bc.SetInt32(c4d.HAIRMATERIAL_TAG_BLEND,c4d.HAIRMATERIAL_TAG_BLENDMODE_AVERAGE)
    bc.SetFloat(c4d.HAIRMATERIAL_TAG_USE_MIX,0.1)
    bc.SetBool(c4d.HAIRMATERIAL_TAG_SMOOTH_MIX,True)
    bc.SetFloat(c4d.HAIRMATERIAL_TAG_USE_LEVEL,0.1)
    bc.SetFloat(c4d.HAIRMATERIAL_TAG_CLUMP_RADIUS,0.1)
    bc.SetFloat(c4d.HAIRMATERIAL_TAG_CLUMP_RADIUS_VAR,0.1)
    bc.SetInt32(c4d.HAIRMATERIAL_TAG_CLUMP_MAX,1)
    bc.SetFloat(c4d.HAIRMATERIAL_TAG_THRESHOLD,0.1)
    bc.SetFloat(c4d.HAIRMATERIAL_TAG_THRESHOLD_END,0.1)
    bc.SetInt32(c4d.HAIRMATERIAL_TAG_HAIR_UVS,c4d.HAIRMATERIAL_TAG_HAIR_UVS_SYMMETRICAL)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../hair/description/thairmaterial.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseObject *pObject = BaseObject::Alloc(Osphere);
    pDoc->InsertObject(pObject);
    pDoc->StartUndo();
    pDoc->AddUndo(UNDOTYPE_NEW,pObject);
    pDoc->EndUndo();
    pDoc->StartUndo();
    BaseTag *pTag = pObject->MakeTag(Thairmaterial);
    pDoc->AddUndo(UNDOTYPE_NEW,pTag);
    pDoc->EndUndo();
    pObject->Message(MSG_UPDATE);
    
    //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;
    pTag->SetParameter(DescID(HAIRMATERIAL_TAG_USE_AVAILABLE),GeData(true),flags);
    pTag->SetParameter(DescID(HAIRMATERIAL_TAG_REMOVE_AVAILABLE),GeData(true),flags);
    pTag->SetParameter(DescID(HAIRMATERIAL_TAG_USE),GeData(HAIRMATERIAL_TAG_USE_ALL),flags);
    pTag->SetParameter(DescID(HAIRMATERIAL_TAG_BLEND),GeData(HAIRMATERIAL_TAG_BLENDMODE_AVERAGE),flags);
    pTag->SetParameter(DescID(HAIRMATERIAL_TAG_USE_MIX),GeData(0.1),flags);
    pTag->SetParameter(DescID(HAIRMATERIAL_TAG_SMOOTH_MIX),GeData(true),flags);
    pTag->SetParameter(DescID(HAIRMATERIAL_TAG_USE_LEVEL),GeData(0.1),flags);
    pTag->SetParameter(DescID(HAIRMATERIAL_TAG_CLUMP_RADIUS),GeData(0.1),flags);
    pTag->SetParameter(DescID(HAIRMATERIAL_TAG_CLUMP_RADIUS_VAR),GeData(0.1),flags);
    pTag->SetParameter(DescID(HAIRMATERIAL_TAG_CLUMP_MAX),GeData(1),flags);
    pTag->SetParameter(DescID(HAIRMATERIAL_TAG_THRESHOLD),GeData(0.1),flags);
    pTag->SetParameter(DescID(HAIRMATERIAL_TAG_THRESHOLD_END),GeData(0.1),flags);
    pTag->SetParameter(DescID(HAIRMATERIAL_TAG_HAIR_UVS),GeData(HAIRMATERIAL_TAG_HAIR_UVS_SYMMETRICAL),flags);
    pTag->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pTag->GetDataInstance();
    bc->SetBool(HAIRMATERIAL_TAG_USE_AVAILABLE,true);
    bc->SetBool(HAIRMATERIAL_TAG_REMOVE_AVAILABLE,true);
    bc->SetInt32(HAIRMATERIAL_TAG_USE,HAIRMATERIAL_TAG_USE_ALL);
    bc->SetInt32(HAIRMATERIAL_TAG_BLEND,HAIRMATERIAL_TAG_BLENDMODE_AVERAGE);
    bc->SetFloat(HAIRMATERIAL_TAG_USE_MIX,0.1);
    bc->SetBool(HAIRMATERIAL_TAG_SMOOTH_MIX,true);
    bc->SetFloat(HAIRMATERIAL_TAG_USE_LEVEL,0.1);
    bc->SetFloat(HAIRMATERIAL_TAG_CLUMP_RADIUS,0.1);
    bc->SetFloat(HAIRMATERIAL_TAG_CLUMP_RADIUS_VAR,0.1);
    bc->SetInt32(HAIRMATERIAL_TAG_CLUMP_MAX,1);
    bc->SetFloat(HAIRMATERIAL_TAG_THRESHOLD,0.1);
    bc->SetFloat(HAIRMATERIAL_TAG_THRESHOLD_END,0.1);
    bc->SetInt32(HAIRMATERIAL_TAG_HAIR_UVS,HAIRMATERIAL_TAG_HAIR_UVS_SYMMETRICAL);
    pTag->Message(MSG_UPDATE);                                                      
}