Tcompositing
Attributes
-
ENGLISH NAME : CompositingTag
-
NAME : Tcompositing
-
INCLUDE : Tbase
-
PATH : c4dplugin/description/tcompositing.res
-
PLUGIN : c4dplugin
-
MAXON online help (may not exist): TCOMPOSITING
Elements
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.Tcompositing)
doc.InsertObject(obj)
c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
#You can set parameters two different ways.
#First way
tag[c4d.COMPOSITINGTAG_CASTSHADOW] = True
tag[c4d.COMPOSITINGTAG_RECEIVESHADOW] = True
tag[c4d.COMPOSITINGTAG_SELFSHADOW] = True
tag[c4d.COMPOSITINGTAG_SEENBYCAMERA] = True
tag[c4d.COMPOSITINGTAG_SEENBYRAYS] = True
tag[c4d.COMPOSITINGTAG_SEENBYGI] = True
tag[c4d.COMPOSITINGTAG_BACKGROUND] = True
tag[c4d.COMPOSITINGTAG_BACKGROUND_GI] = True
tag[c4d.COMPOSITINGTAG_SEENBYTRANSPARENCY] = True
tag[c4d.COMPOSITINGTAG_SEENBYREFRACTION] = True
tag[c4d.COMPOSITINGTAG_SEENBYREFLECTION] = True
tag[c4d.COMPOSITINGTAG_SEENBYAO] = True
tag[c4d.COMPOSITINGTAG_AAOVERWRITE] = True
tag[c4d.COMPOSITINGTAG_AAMINLEVEL] = c4d.COMPOSITINGTAG_AALEVEL_1
tag[c4d.COMPOSITINGTAG_AAMAXLEVEL] = c4d.COMPOSITINGTAG_AALEVEL_1
tag[c4d.COMPOSITINGTAG_AATHRESHOLD] = 0.1
tag[c4d.COMPOSITINGTAG_MATTEOBJECT] = True
tag[c4d.COMPOSITINGTAG_GIENABLED] = True
tag[c4d.COMPOSITINGTAG_GIINTENSITY] = 0.1
tag[c4d.COMPOSITINGTAG_GIQUALITY] = 0.1
tag[c4d.COMPOSITINGTAG_GIDENSITY] = 0.1
tag[c4d.COMPOSITINGTAG_GIQMC] = True
tag[c4d.COMPOSITINGTAG_GITRANSPARENCY] = True
tag[c4d.COMPOSITINGTAG_GIINTERPOLATION] = True
tag[c4d.COMPOSITINGTAG_EXCLUSION_MODE] = c4d.COMPOSITINGTAG_EXCLUSION_MODE_INCLUDE
tag[c4d.COMPOSITINGTAG_ENABLECHN0] = True
tag[c4d.COMPOSITINGTAG_IDCHN0] = 1
tag[c4d.COMPOSITINGTAG_ENABLECHN1] = True
tag[c4d.COMPOSITINGTAG_IDCHN1] = 1
tag[c4d.COMPOSITINGTAG_ENABLECHN2] = True
tag[c4d.COMPOSITINGTAG_IDCHN2] = 1
tag[c4d.COMPOSITINGTAG_ENABLECHN3] = True
tag[c4d.COMPOSITINGTAG_IDCHN3] = 1
tag[c4d.COMPOSITINGTAG_ENABLECHN4] = True
tag[c4d.COMPOSITINGTAG_IDCHN4] = 1
tag[c4d.COMPOSITINGTAG_ENABLECHN5] = True
tag[c4d.COMPOSITINGTAG_IDCHN5] = 1
tag[c4d.COMPOSITINGTAG_ENABLECHN6] = True
tag[c4d.COMPOSITINGTAG_IDCHN6] = 1
tag[c4d.COMPOSITINGTAG_ENABLECHN7] = True
tag[c4d.COMPOSITINGTAG_IDCHN7] = 1
tag[c4d.COMPOSITINGTAG_ENABLECHN8] = True
tag[c4d.COMPOSITINGTAG_IDCHN8] = 1
tag[c4d.COMPOSITINGTAG_ENABLECHN9] = True
tag[c4d.COMPOSITINGTAG_IDCHN9] = 1
tag[c4d.COMPOSITINGTAG_ENABLECHN10] = True
tag[c4d.COMPOSITINGTAG_IDCHN10] = 1
tag[c4d.COMPOSITINGTAG_ENABLECHN11] = True
tag[c4d.COMPOSITINGTAG_IDCHN11] = 1
tag[c4d.COMPOSITINGTAG_RPRSHADOWCATCHER] = True
tag[c4d.COMPOSITINGTAG_RPRLIGHTPORTAL] = True
#Second way, using the base container.
bc = tag.GetDataInstance()
bc.SetBool(c4d.COMPOSITINGTAG_CASTSHADOW,True)
bc.SetBool(c4d.COMPOSITINGTAG_RECEIVESHADOW,True)
bc.SetBool(c4d.COMPOSITINGTAG_SELFSHADOW,True)
bc.SetBool(c4d.COMPOSITINGTAG_SEENBYCAMERA,True)
bc.SetBool(c4d.COMPOSITINGTAG_SEENBYRAYS,True)
bc.SetBool(c4d.COMPOSITINGTAG_SEENBYGI,True)
bc.SetBool(c4d.COMPOSITINGTAG_BACKGROUND,True)
bc.SetBool(c4d.COMPOSITINGTAG_BACKGROUND_GI,True)
bc.SetBool(c4d.COMPOSITINGTAG_SEENBYTRANSPARENCY,True)
bc.SetBool(c4d.COMPOSITINGTAG_SEENBYREFRACTION,True)
bc.SetBool(c4d.COMPOSITINGTAG_SEENBYREFLECTION,True)
bc.SetBool(c4d.COMPOSITINGTAG_SEENBYAO,True)
bc.SetBool(c4d.COMPOSITINGTAG_AAOVERWRITE,True)
bc.SetInt32(c4d.COMPOSITINGTAG_AAMINLEVEL,c4d.COMPOSITINGTAG_AALEVEL_1)
bc.SetInt32(c4d.COMPOSITINGTAG_AAMAXLEVEL,c4d.COMPOSITINGTAG_AALEVEL_1)
bc.SetFloat(c4d.COMPOSITINGTAG_AATHRESHOLD,0.1)
bc.SetBool(c4d.COMPOSITINGTAG_MATTEOBJECT,True)
bc.SetBool(c4d.COMPOSITINGTAG_GIENABLED,True)
bc.SetFloat(c4d.COMPOSITINGTAG_GIINTENSITY,0.1)
bc.SetFloat(c4d.COMPOSITINGTAG_GIQUALITY,0.1)
bc.SetFloat(c4d.COMPOSITINGTAG_GIDENSITY,0.1)
bc.SetBool(c4d.COMPOSITINGTAG_GIQMC,True)
bc.SetBool(c4d.COMPOSITINGTAG_GITRANSPARENCY,True)
bc.SetBool(c4d.COMPOSITINGTAG_GIINTERPOLATION,True)
bc.SetInt32(c4d.COMPOSITINGTAG_EXCLUSION_MODE,c4d.COMPOSITINGTAG_EXCLUSION_MODE_INCLUDE)
bc.SetBool(c4d.COMPOSITINGTAG_ENABLECHN0,True)
bc.SetInt32(c4d.COMPOSITINGTAG_IDCHN0,1)
bc.SetBool(c4d.COMPOSITINGTAG_ENABLECHN1,True)
bc.SetInt32(c4d.COMPOSITINGTAG_IDCHN1,1)
bc.SetBool(c4d.COMPOSITINGTAG_ENABLECHN2,True)
bc.SetInt32(c4d.COMPOSITINGTAG_IDCHN2,1)
bc.SetBool(c4d.COMPOSITINGTAG_ENABLECHN3,True)
bc.SetInt32(c4d.COMPOSITINGTAG_IDCHN3,1)
bc.SetBool(c4d.COMPOSITINGTAG_ENABLECHN4,True)
bc.SetInt32(c4d.COMPOSITINGTAG_IDCHN4,1)
bc.SetBool(c4d.COMPOSITINGTAG_ENABLECHN5,True)
bc.SetInt32(c4d.COMPOSITINGTAG_IDCHN5,1)
bc.SetBool(c4d.COMPOSITINGTAG_ENABLECHN6,True)
bc.SetInt32(c4d.COMPOSITINGTAG_IDCHN6,1)
bc.SetBool(c4d.COMPOSITINGTAG_ENABLECHN7,True)
bc.SetInt32(c4d.COMPOSITINGTAG_IDCHN7,1)
bc.SetBool(c4d.COMPOSITINGTAG_ENABLECHN8,True)
bc.SetInt32(c4d.COMPOSITINGTAG_IDCHN8,1)
bc.SetBool(c4d.COMPOSITINGTAG_ENABLECHN9,True)
bc.SetInt32(c4d.COMPOSITINGTAG_IDCHN9,1)
bc.SetBool(c4d.COMPOSITINGTAG_ENABLECHN10,True)
bc.SetInt32(c4d.COMPOSITINGTAG_IDCHN10,1)
bc.SetBool(c4d.COMPOSITINGTAG_ENABLECHN11,True)
bc.SetInt32(c4d.COMPOSITINGTAG_IDCHN11,1)
bc.SetBool(c4d.COMPOSITINGTAG_RPRSHADOWCATCHER,True)
bc.SetBool(c4d.COMPOSITINGTAG_RPRLIGHTPORTAL,True)
if __name__=='__main__':
main()
C++
#include "c4d.h"
#include "../c4dplugin/description/tcompositing.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(Tcompositing);
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(COMPOSITINGTAG_CASTSHADOW),GeData(true),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_RECEIVESHADOW),GeData(true),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_SELFSHADOW),GeData(true),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_SEENBYCAMERA),GeData(true),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_SEENBYRAYS),GeData(true),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_SEENBYGI),GeData(true),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_BACKGROUND),GeData(true),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_BACKGROUND_GI),GeData(true),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_SEENBYTRANSPARENCY),GeData(true),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_SEENBYREFRACTION),GeData(true),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_SEENBYREFLECTION),GeData(true),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_SEENBYAO),GeData(true),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_AAOVERWRITE),GeData(true),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_AAMINLEVEL),GeData(COMPOSITINGTAG_AALEVEL_1),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_AAMAXLEVEL),GeData(COMPOSITINGTAG_AALEVEL_1),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_AATHRESHOLD),GeData(0.1),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_MATTEOBJECT),GeData(true),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_GIENABLED),GeData(true),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_GIINTENSITY),GeData(0.1),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_GIQUALITY),GeData(0.1),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_GIDENSITY),GeData(0.1),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_GIQMC),GeData(true),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_GITRANSPARENCY),GeData(true),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_GIINTERPOLATION),GeData(true),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_EXCLUSION_MODE),GeData(COMPOSITINGTAG_EXCLUSION_MODE_INCLUDE),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_ENABLECHN0),GeData(true),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_IDCHN0),GeData(1),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_ENABLECHN1),GeData(true),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_IDCHN1),GeData(1),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_ENABLECHN2),GeData(true),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_IDCHN2),GeData(1),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_ENABLECHN3),GeData(true),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_IDCHN3),GeData(1),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_ENABLECHN4),GeData(true),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_IDCHN4),GeData(1),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_ENABLECHN5),GeData(true),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_IDCHN5),GeData(1),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_ENABLECHN6),GeData(true),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_IDCHN6),GeData(1),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_ENABLECHN7),GeData(true),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_IDCHN7),GeData(1),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_ENABLECHN8),GeData(true),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_IDCHN8),GeData(1),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_ENABLECHN9),GeData(true),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_IDCHN9),GeData(1),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_ENABLECHN10),GeData(true),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_IDCHN10),GeData(1),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_ENABLECHN11),GeData(true),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_IDCHN11),GeData(1),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_RPRSHADOWCATCHER),GeData(true),flags);
pTag->SetParameter(DescID(COMPOSITINGTAG_RPRLIGHTPORTAL),GeData(true),flags);
pTag->Message(MSG_UPDATE);
//Second way, using the base container.
BaseContainer *bc = pTag->GetDataInstance();
bc->SetBool(COMPOSITINGTAG_CASTSHADOW,true);
bc->SetBool(COMPOSITINGTAG_RECEIVESHADOW,true);
bc->SetBool(COMPOSITINGTAG_SELFSHADOW,true);
bc->SetBool(COMPOSITINGTAG_SEENBYCAMERA,true);
bc->SetBool(COMPOSITINGTAG_SEENBYRAYS,true);
bc->SetBool(COMPOSITINGTAG_SEENBYGI,true);
bc->SetBool(COMPOSITINGTAG_BACKGROUND,true);
bc->SetBool(COMPOSITINGTAG_BACKGROUND_GI,true);
bc->SetBool(COMPOSITINGTAG_SEENBYTRANSPARENCY,true);
bc->SetBool(COMPOSITINGTAG_SEENBYREFRACTION,true);
bc->SetBool(COMPOSITINGTAG_SEENBYREFLECTION,true);
bc->SetBool(COMPOSITINGTAG_SEENBYAO,true);
bc->SetBool(COMPOSITINGTAG_AAOVERWRITE,true);
bc->SetInt32(COMPOSITINGTAG_AAMINLEVEL,COMPOSITINGTAG_AALEVEL_1);
bc->SetInt32(COMPOSITINGTAG_AAMAXLEVEL,COMPOSITINGTAG_AALEVEL_1);
bc->SetFloat(COMPOSITINGTAG_AATHRESHOLD,0.1);
bc->SetBool(COMPOSITINGTAG_MATTEOBJECT,true);
bc->SetBool(COMPOSITINGTAG_GIENABLED,true);
bc->SetFloat(COMPOSITINGTAG_GIINTENSITY,0.1);
bc->SetFloat(COMPOSITINGTAG_GIQUALITY,0.1);
bc->SetFloat(COMPOSITINGTAG_GIDENSITY,0.1);
bc->SetBool(COMPOSITINGTAG_GIQMC,true);
bc->SetBool(COMPOSITINGTAG_GITRANSPARENCY,true);
bc->SetBool(COMPOSITINGTAG_GIINTERPOLATION,true);
bc->SetInt32(COMPOSITINGTAG_EXCLUSION_MODE,COMPOSITINGTAG_EXCLUSION_MODE_INCLUDE);
bc->SetBool(COMPOSITINGTAG_ENABLECHN0,true);
bc->SetInt32(COMPOSITINGTAG_IDCHN0,1);
bc->SetBool(COMPOSITINGTAG_ENABLECHN1,true);
bc->SetInt32(COMPOSITINGTAG_IDCHN1,1);
bc->SetBool(COMPOSITINGTAG_ENABLECHN2,true);
bc->SetInt32(COMPOSITINGTAG_IDCHN2,1);
bc->SetBool(COMPOSITINGTAG_ENABLECHN3,true);
bc->SetInt32(COMPOSITINGTAG_IDCHN3,1);
bc->SetBool(COMPOSITINGTAG_ENABLECHN4,true);
bc->SetInt32(COMPOSITINGTAG_IDCHN4,1);
bc->SetBool(COMPOSITINGTAG_ENABLECHN5,true);
bc->SetInt32(COMPOSITINGTAG_IDCHN5,1);
bc->SetBool(COMPOSITINGTAG_ENABLECHN6,true);
bc->SetInt32(COMPOSITINGTAG_IDCHN6,1);
bc->SetBool(COMPOSITINGTAG_ENABLECHN7,true);
bc->SetInt32(COMPOSITINGTAG_IDCHN7,1);
bc->SetBool(COMPOSITINGTAG_ENABLECHN8,true);
bc->SetInt32(COMPOSITINGTAG_IDCHN8,1);
bc->SetBool(COMPOSITINGTAG_ENABLECHN9,true);
bc->SetInt32(COMPOSITINGTAG_IDCHN9,1);
bc->SetBool(COMPOSITINGTAG_ENABLECHN10,true);
bc->SetInt32(COMPOSITINGTAG_IDCHN10,1);
bc->SetBool(COMPOSITINGTAG_ENABLECHN11,true);
bc->SetInt32(COMPOSITINGTAG_IDCHN11,1);
bc->SetBool(COMPOSITINGTAG_RPRSHADOWCATCHER,true);
bc->SetBool(COMPOSITINGTAG_RPRLIGHTPORTAL,true);
pTag->Message(MSG_UPDATE);
}