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 Thairlight

Thairlight

Attributes

  • ENGLISH NAME : Light
  • NAME : Thairlight
  • INCLUDE : Tbase
  • PATH : hair/description/thairlight.res
  • PLUGIN : hair
  • MAXON online help (may not exist): THAIRLIGHT

Elements

ID UI Name Type Parameters Cycle
HAIR_LIGHT_TAG_INCLUDE Include BOOL  
HAIR_LIGHT_TAG_SHADOWS Shadows LONG  
HAIR_LIGHT_TAG_SHADOWS_NONE None
HAIR_LIGHT_TAG_SHADOWS_SOFT SoftShadows
HAIR_LIGHT_TAG_SHADOW_TRANS_ACCURACY Trans.Threshold REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
HIDDEN
HAIR_LIGHT_TAG_SHADOW_DIST_ACCURACY DepthThreshold REAL
UNIT METER
MIN 0.0
HIDDEN
HAIR_LIGHT_TAG_SHADOW_AA_LEVEL Antialiasing LONG HIDDEN
HAIR_LIGHT_TAG_SHADOW_AA_NONE None
HAIR_LIGHT_TAG_SHADOW_AA_LOW Low
HAIR_LIGHT_TAG_SHADOW_AA_MED Medium
HAIR_LIGHT_TAG_SHADOW_AA_HIGH High
HAIR_LIGHT_TAG_SHADOW_AA_BEST Best
HAIR_LIGHT_TAG_SHADOW_AA_USER User
HAIR_LIGHT_TAG_SHADOW_AA_USER_LEVEL Filter REAL
UNIT PERCENT
MIN 0.0
MAXSLIDER 100.0
CUSTOMGUI REALSLIDER
HIDDEN
HAIR_LIGHT_TAG_SHADOW_DENSITY Density REAL
UNIT PERCENT
MIN 0.0
MAXSLIDER 100.0
CUSTOMGUI REALSLIDER
HAIR_LIGHT_TAG_CAST_SHADOW CastDensity REAL
UNIT PERCENT
MIN 0.0
MAXSLIDER 100.0
CUSTOMGUI REALSLIDER
HAIR_LIGHT_TAG_SHADOW_SAMPLE_SIZE SampleSize LONG
MIN 0
MAX 512
HAIR_LIGHT_TAG_SHADOWS_MAP ShadowMap LONG  
HAIR_LIGHT_TAG_SHADOWS_MAP_250 250x250
HAIR_LIGHT_TAG_SHADOWS_MAP_500 500x500
HAIR_LIGHT_TAG_SHADOWS_MAP_750 750x750
HAIR_LIGHT_TAG_SHADOWS_MAP_1000 1000x1000
HAIR_LIGHT_TAG_SHADOWS_MAP_1250 1250x1250
HAIR_LIGHT_TAG_SHADOWS_MAP_1500 1500x1500
HAIR_LIGHT_TAG_SHADOWS_MAP_1750 1750x1750
HAIR_LIGHT_TAG_SHADOWS_MAP_2000 2000x2000
HAIR_LIGHT_TAG_SHADOWS_MAP_CUSTOM Custom
HAIR_LIGHT_TAG_MAP_SIZE Resolution LONG
MIN 64
MAX 16384
HAIR_LIGHT_TAG_SHADOW_WIDTH TracedWidth REAL
UNIT DEGREE
MIN 0.0
MAX 89.0
HIDDEN

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.Thairlight)
    doc.InsertObject(obj)
    c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
    
    #You can set parameters two different ways. 
    #First way              
    tag[c4d.HAIR_LIGHT_TAG_INCLUDE] = True
    tag[c4d.HAIR_LIGHT_TAG_SHADOWS] = c4d.HAIR_LIGHT_TAG_SHADOWS_NONE
    tag[c4d.HAIR_LIGHT_TAG_SHADOW_TRANS_ACCURACY] = 0.1
    tag[c4d.HAIR_LIGHT_TAG_SHADOW_DIST_ACCURACY] = 0.1
    tag[c4d.HAIR_LIGHT_TAG_SHADOW_AA_LEVEL] = c4d.HAIR_LIGHT_TAG_SHADOW_AA_NONE
    tag[c4d.HAIR_LIGHT_TAG_SHADOW_AA_USER_LEVEL] = 0.1
    tag[c4d.HAIR_LIGHT_TAG_SHADOW_DENSITY] = 0.1
    tag[c4d.HAIR_LIGHT_TAG_CAST_SHADOW] = 0.1
    tag[c4d.HAIR_LIGHT_TAG_SHADOW_SAMPLE_SIZE] = 1
    tag[c4d.HAIR_LIGHT_TAG_SHADOWS_MAP] = c4d.HAIR_LIGHT_TAG_SHADOWS_MAP_250
    tag[c4d.HAIR_LIGHT_TAG_MAP_SIZE] = 1
    tag[c4d.HAIR_LIGHT_TAG_SHADOW_WIDTH] = 0.1
    
    #Second way, using the base container.
    bc = tag.GetDataInstance()
    bc.SetBool(c4d.HAIR_LIGHT_TAG_INCLUDE,True)
    bc.SetInt32(c4d.HAIR_LIGHT_TAG_SHADOWS,c4d.HAIR_LIGHT_TAG_SHADOWS_NONE)
    bc.SetFloat(c4d.HAIR_LIGHT_TAG_SHADOW_TRANS_ACCURACY,0.1)
    bc.SetFloat(c4d.HAIR_LIGHT_TAG_SHADOW_DIST_ACCURACY,0.1)
    bc.SetInt32(c4d.HAIR_LIGHT_TAG_SHADOW_AA_LEVEL,c4d.HAIR_LIGHT_TAG_SHADOW_AA_NONE)
    bc.SetFloat(c4d.HAIR_LIGHT_TAG_SHADOW_AA_USER_LEVEL,0.1)
    bc.SetFloat(c4d.HAIR_LIGHT_TAG_SHADOW_DENSITY,0.1)
    bc.SetFloat(c4d.HAIR_LIGHT_TAG_CAST_SHADOW,0.1)
    bc.SetInt32(c4d.HAIR_LIGHT_TAG_SHADOW_SAMPLE_SIZE,1)
    bc.SetInt32(c4d.HAIR_LIGHT_TAG_SHADOWS_MAP,c4d.HAIR_LIGHT_TAG_SHADOWS_MAP_250)
    bc.SetInt32(c4d.HAIR_LIGHT_TAG_MAP_SIZE,1)
    bc.SetFloat(c4d.HAIR_LIGHT_TAG_SHADOW_WIDTH,0.1)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../hair/description/thairlight.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(Thairlight);
    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(HAIR_LIGHT_TAG_INCLUDE),GeData(true),flags);
    pTag->SetParameter(DescID(HAIR_LIGHT_TAG_SHADOWS),GeData(HAIR_LIGHT_TAG_SHADOWS_NONE),flags);
    pTag->SetParameter(DescID(HAIR_LIGHT_TAG_SHADOW_TRANS_ACCURACY),GeData(0.1),flags);
    pTag->SetParameter(DescID(HAIR_LIGHT_TAG_SHADOW_DIST_ACCURACY),GeData(0.1),flags);
    pTag->SetParameter(DescID(HAIR_LIGHT_TAG_SHADOW_AA_LEVEL),GeData(HAIR_LIGHT_TAG_SHADOW_AA_NONE),flags);
    pTag->SetParameter(DescID(HAIR_LIGHT_TAG_SHADOW_AA_USER_LEVEL),GeData(0.1),flags);
    pTag->SetParameter(DescID(HAIR_LIGHT_TAG_SHADOW_DENSITY),GeData(0.1),flags);
    pTag->SetParameter(DescID(HAIR_LIGHT_TAG_CAST_SHADOW),GeData(0.1),flags);
    pTag->SetParameter(DescID(HAIR_LIGHT_TAG_SHADOW_SAMPLE_SIZE),GeData(1),flags);
    pTag->SetParameter(DescID(HAIR_LIGHT_TAG_SHADOWS_MAP),GeData(HAIR_LIGHT_TAG_SHADOWS_MAP_250),flags);
    pTag->SetParameter(DescID(HAIR_LIGHT_TAG_MAP_SIZE),GeData(1),flags);
    pTag->SetParameter(DescID(HAIR_LIGHT_TAG_SHADOW_WIDTH),GeData(0.1),flags);
    pTag->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pTag->GetDataInstance();
    bc->SetBool(HAIR_LIGHT_TAG_INCLUDE,true);
    bc->SetInt32(HAIR_LIGHT_TAG_SHADOWS,HAIR_LIGHT_TAG_SHADOWS_NONE);
    bc->SetFloat(HAIR_LIGHT_TAG_SHADOW_TRANS_ACCURACY,0.1);
    bc->SetFloat(HAIR_LIGHT_TAG_SHADOW_DIST_ACCURACY,0.1);
    bc->SetInt32(HAIR_LIGHT_TAG_SHADOW_AA_LEVEL,HAIR_LIGHT_TAG_SHADOW_AA_NONE);
    bc->SetFloat(HAIR_LIGHT_TAG_SHADOW_AA_USER_LEVEL,0.1);
    bc->SetFloat(HAIR_LIGHT_TAG_SHADOW_DENSITY,0.1);
    bc->SetFloat(HAIR_LIGHT_TAG_CAST_SHADOW,0.1);
    bc->SetInt32(HAIR_LIGHT_TAG_SHADOW_SAMPLE_SIZE,1);
    bc->SetInt32(HAIR_LIGHT_TAG_SHADOWS_MAP,HAIR_LIGHT_TAG_SHADOWS_MAP_250);
    bc->SetInt32(HAIR_LIGHT_TAG_MAP_SIZE,1);
    bc->SetFloat(HAIR_LIGHT_TAG_SHADOW_WIDTH,0.1);
    pTag->Message(MSG_UPDATE);                                                      
}