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 Thairrender

Thairrender

Attributes

  • ENGLISH NAME : Render
  • NAME : Thairrender
  • INCLUDE : Tbase
  • PATH : hair/description/thairrender.res
  • PLUGIN : hair
  • MAXON online help (may not exist): THAIRRENDER

Elements

ID UI Name Type Parameters Cycle
HAIR_RENDER_TAG_ENABLE Enable BOOL  
HAIR_RENDER_TAG_AUTOTIME AutoTime BOOL ANIM
HAIR_RENDER_TAG_START Start BASETIME ANIM
HAIR_RENDER_TAG_STOP Stop BASETIME ANIM
HAIR_RENDER_TAG_MODE Mode LONG  
HAIR_RENDER_TAG_MODE_POINTS Points
HAIR_RENDER_TAG_MODE_SURFACE Surface
HAIR_RENDER_TAG_MODE_LINE Line
HAIR_RENDER_TAG_MODE_INTERPOLATED Interpolated
HAIR_RENDER_TAG_MODE_POSITION Position
HAIR_RENDER_TAG_MODE_VELOCITY Velocity
HAIR_RENDER_TAG_MODE_TRAIL Trail
HAIR_RENDER_TAG_HAIRS AsFillHairs BOOL HIDDEN
HAIR_RENDER_TAG_LENGTH Length REAL
UNIT METER
MIN 0.0
HAIR_RENDER_TAG_SCALE Scale REAL
UNIT PERCENT
MIN 0.0
MAX 1000.0
HAIR_RENDER_TAG_COUNT Count LONG MIN
HAIR_RENDER_TAG_SEGMENTS Segments LONG
MIN 1
MAX 8192
HAIR_RENDER_TAG_RESTRICT Restrict LINK  
HAIR_RENDER_TAG_TRAIL_LIMIT Limit BOOL  
HAIR_RENDER_TAG_TRAIL Trail BASETIME MIN
HAIR_RENDER_TAG_DEATH OnDeath LONG DEFAULT
HAIR_RENDER_TAG_REMAIN Remain
HAIR_RENDER_TAG_REMOVE Remove
HAIR_RENDER_TAG_RUNOUT RunOut

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.Thairrender)
    doc.InsertObject(obj)
    c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
    
    #You can set parameters two different ways. 
    #First way              
    tag[c4d.HAIR_RENDER_TAG_ENABLE] = True
    tag[c4d.HAIR_RENDER_TAG_AUTOTIME] = True
    tag[c4d.HAIR_RENDER_TAG_MODE] = c4d.HAIR_RENDER_TAG_MODE_POINTS
    tag[c4d.HAIR_RENDER_TAG_HAIRS] = True
    tag[c4d.HAIR_RENDER_TAG_LENGTH] = 0.1
    tag[c4d.HAIR_RENDER_TAG_SCALE] = 0.1
    tag[c4d.HAIR_RENDER_TAG_COUNT] = 1
    tag[c4d.HAIR_RENDER_TAG_SEGMENTS] = 1
    tag[c4d.HAIR_RENDER_TAG_TRAIL_LIMIT] = True
    tag[c4d.HAIR_RENDER_TAG_DEATH] = c4d.HAIR_RENDER_TAG_REMAIN
    
    #Second way, using the base container.
    bc = tag.GetDataInstance()
    bc.SetBool(c4d.HAIR_RENDER_TAG_ENABLE,True)
    bc.SetBool(c4d.HAIR_RENDER_TAG_AUTOTIME,True)
    bc.SetInt32(c4d.HAIR_RENDER_TAG_MODE,c4d.HAIR_RENDER_TAG_MODE_POINTS)
    bc.SetBool(c4d.HAIR_RENDER_TAG_HAIRS,True)
    bc.SetFloat(c4d.HAIR_RENDER_TAG_LENGTH,0.1)
    bc.SetFloat(c4d.HAIR_RENDER_TAG_SCALE,0.1)
    bc.SetInt32(c4d.HAIR_RENDER_TAG_COUNT,1)
    bc.SetInt32(c4d.HAIR_RENDER_TAG_SEGMENTS,1)
    bc.SetBool(c4d.HAIR_RENDER_TAG_TRAIL_LIMIT,True)
    bc.SetInt32(c4d.HAIR_RENDER_TAG_DEATH,c4d.HAIR_RENDER_TAG_REMAIN)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../hair/description/thairrender.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(Thairrender);
    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_RENDER_TAG_ENABLE),GeData(true),flags);
    pTag->SetParameter(DescID(HAIR_RENDER_TAG_AUTOTIME),GeData(true),flags);
    pTag->SetParameter(DescID(HAIR_RENDER_TAG_MODE),GeData(HAIR_RENDER_TAG_MODE_POINTS),flags);
    pTag->SetParameter(DescID(HAIR_RENDER_TAG_HAIRS),GeData(true),flags);
    pTag->SetParameter(DescID(HAIR_RENDER_TAG_LENGTH),GeData(0.1),flags);
    pTag->SetParameter(DescID(HAIR_RENDER_TAG_SCALE),GeData(0.1),flags);
    pTag->SetParameter(DescID(HAIR_RENDER_TAG_COUNT),GeData(1),flags);
    pTag->SetParameter(DescID(HAIR_RENDER_TAG_SEGMENTS),GeData(1),flags);
    pTag->SetParameter(DescID(HAIR_RENDER_TAG_TRAIL_LIMIT),GeData(true),flags);
    pTag->SetParameter(DescID(HAIR_RENDER_TAG_DEATH),GeData(HAIR_RENDER_TAG_REMAIN),flags);
    pTag->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pTag->GetDataInstance();
    bc->SetBool(HAIR_RENDER_TAG_ENABLE,true);
    bc->SetBool(HAIR_RENDER_TAG_AUTOTIME,true);
    bc->SetInt32(HAIR_RENDER_TAG_MODE,HAIR_RENDER_TAG_MODE_POINTS);
    bc->SetBool(HAIR_RENDER_TAG_HAIRS,true);
    bc->SetFloat(HAIR_RENDER_TAG_LENGTH,0.1);
    bc->SetFloat(HAIR_RENDER_TAG_SCALE,0.1);
    bc->SetInt32(HAIR_RENDER_TAG_COUNT,1);
    bc->SetInt32(HAIR_RENDER_TAG_SEGMENTS,1);
    bc->SetBool(HAIR_RENDER_TAG_TRAIL_LIMIT,true);
    bc->SetInt32(HAIR_RENDER_TAG_DEATH,HAIR_RENDER_TAG_REMAIN);
    pTag->Message(MSG_UPDATE);                                                      
}