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 Txlight

Txlight

Attributes

  • ENGLISH NAME : LightTag
  • NAME : Txlight
  • INCLUDE : Tbase
  • PATH : res/description/txlight.res
  • PLUGIN : X-Particles
  • MAXON online help (may not exist): TXLIGHT

Elements

ID UI Name Type Parameters Cycle
ID_XP_TAG_LIGHT_USE Include BOOL  
ID_XP_TAG_LIGHT_SHADOWS Shadows BOOL  
ID_XP_TAG_LIGHT_SHADOW_DENSITY Density REAL
UNIT PERCENT
MIN 0.0
MAXSLIDER 100.0
CUSTOMGUI REALSLIDER
ID_XP_TAG_LIGHT_SHADOW_SAMPLE Sample LONG MIN
ID_XP_TAG_LIGHT_SHADOW_RES Resolution LONG  
ID_XP_TAG_LIGHT_SHADOW_RES_250 250x250
ID_XP_TAG_LIGHT_SHADOW_RES_500 500x500
ID_XP_TAG_LIGHT_SHADOW_RES_750 750x750
ID_XP_TAG_LIGHT_SHADOW_RES_1000 1000x1000
ID_XP_TAG_LIGHT_SHADOW_RES_1250 1250x1250
ID_XP_TAG_LIGHT_SHADOW_RES_1500 1500x1500
ID_XP_TAG_LIGHT_SHADOW_RES_1750 1750x1750
ID_XP_TAG_LIGHT_SHADOW_RES_2000 2000x2000
ID_XP_TAG_LIGHT_SHADOW_RES_CUSTOM Custom
ID_XP_TAG_LIGHT_SHADOW_CUSTOM Custom LONG MIN
ID_XP_TAG_LIGHT_HELP_BUTTON BITMAPBUTTON  
ID_XP_TAG_LIGHT_VIDMAN_BUTTON BITMAPBUTTON  
ID_XP_TAG_LIGHT_RESET ResettoDefaults BUTTON  
ID_XP_TAG_LIGHT_SAVE_PRESET SavePreset... BUTTON  
ID_XP_TAG_LIGHT_LOAD_PRESET LoadPreset... BUTTON  

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.Txlight)
    doc.InsertObject(obj)
    c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
    
    #You can set parameters two different ways. 
    #First way              
    tag[c4d.ID_XP_TAG_LIGHT_USE] = True
    tag[c4d.ID_XP_TAG_LIGHT_SHADOWS] = True
    tag[c4d.ID_XP_TAG_LIGHT_SHADOW_DENSITY] = 0.1
    tag[c4d.ID_XP_TAG_LIGHT_SHADOW_SAMPLE] = 1
    tag[c4d.ID_XP_TAG_LIGHT_SHADOW_RES] = c4d.ID_XP_TAG_LIGHT_SHADOW_RES_250
    tag[c4d.ID_XP_TAG_LIGHT_SHADOW_CUSTOM] = 1
    
    #Second way, using the base container.
    bc = tag.GetDataInstance()
    bc.SetBool(c4d.ID_XP_TAG_LIGHT_USE,True)
    bc.SetBool(c4d.ID_XP_TAG_LIGHT_SHADOWS,True)
    bc.SetFloat(c4d.ID_XP_TAG_LIGHT_SHADOW_DENSITY,0.1)
    bc.SetInt32(c4d.ID_XP_TAG_LIGHT_SHADOW_SAMPLE,1)
    bc.SetInt32(c4d.ID_XP_TAG_LIGHT_SHADOW_RES,c4d.ID_XP_TAG_LIGHT_SHADOW_RES_250)
    bc.SetInt32(c4d.ID_XP_TAG_LIGHT_SHADOW_CUSTOM,1)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../res/description/txlight.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(Txlight);
    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(ID_XP_TAG_LIGHT_USE),GeData(true),flags);
    pTag->SetParameter(DescID(ID_XP_TAG_LIGHT_SHADOWS),GeData(true),flags);
    pTag->SetParameter(DescID(ID_XP_TAG_LIGHT_SHADOW_DENSITY),GeData(0.1),flags);
    pTag->SetParameter(DescID(ID_XP_TAG_LIGHT_SHADOW_SAMPLE),GeData(1),flags);
    pTag->SetParameter(DescID(ID_XP_TAG_LIGHT_SHADOW_RES),GeData(ID_XP_TAG_LIGHT_SHADOW_RES_250),flags);
    pTag->SetParameter(DescID(ID_XP_TAG_LIGHT_SHADOW_CUSTOM),GeData(1),flags);
    pTag->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pTag->GetDataInstance();
    bc->SetBool(ID_XP_TAG_LIGHT_USE,true);
    bc->SetBool(ID_XP_TAG_LIGHT_SHADOWS,true);
    bc->SetFloat(ID_XP_TAG_LIGHT_SHADOW_DENSITY,0.1);
    bc->SetInt32(ID_XP_TAG_LIGHT_SHADOW_SAMPLE,1);
    bc->SetInt32(ID_XP_TAG_LIGHT_SHADOW_RES,ID_XP_TAG_LIGHT_SHADOW_RES_250);
    bc->SetInt32(ID_XP_TAG_LIGHT_SHADOW_CUSTOM,1);
    pTag->Message(MSG_UPDATE);                                                      
}
             

Buttons

This node has buttons. Buttons can manually be executed by calling the following code

Python

c4d.CallButton(tag,c4d.ID_XP_TAG_LIGHT_HELP_BUTTON)
c4d.CallButton(tag,c4d.ID_XP_TAG_LIGHT_VIDMAN_BUTTON)
c4d.CallButton(tag,c4d.ID_XP_TAG_LIGHT_RESET)
c4d.CallButton(tag,c4d.ID_XP_TAG_LIGHT_SAVE_PRESET)
c4d.CallButton(tag,c4d.ID_XP_TAG_LIGHT_LOAD_PRESET)

C++

DescriptionCommand dc;
dc.id = DescID(ID_XP_TAG_LIGHT_HELP_BUTTON);             
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);

DescriptionCommand dc; dc.id = DescID(ID_XP_TAG_LIGHT_VIDMAN_BUTTON); pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(ID_XP_TAG_LIGHT_RESET); pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(ID_XP_TAG_LIGHT_SAVE_PRESET); pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(ID_XP_TAG_LIGHT_LOAD_PRESET); pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);