Olight
Attributes
-
ENGLISH NAME : LightObject
-
NAME : Olight
-
INCLUDE : Obase
-
PATH : c4dplugin/description/olight.res
-
PLUGIN : c4dplugin
-
MAXON online help (may not exist): OLIGHT
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.Olight)
doc.InsertObject(obj)
c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
#You can set parameters two different ways.
#First way
obj[c4d.LIGHT_TEMPERATURE] = True
obj[c4d.LIGHT_TEMPERATURE_MAIN] = 0.1
obj[c4d.LIGHT_BRIGHTNESS] = 0.1
obj[c4d.LIGHT_TYPE] = c4d.LIGHT_TYPE_OMNI
obj[c4d.LIGHT_SHADOWTYPE] = c4d.LIGHT_SHADOWTYPE_NONE
obj[c4d.LIGHT_VLTYPE] = c4d.LIGHT_VLTYPE_NONE
obj[c4d.LIGHT_NOLIGHTRADIATION] = True
obj[c4d.LIGHT_SHOWILLUMINATION] = True
obj[c4d.LIGHT_DETAILS_AMBIENT] = True
obj[c4d.LIGHT_SHOWVISIBLELIGHT] = True
obj[c4d.LIGHT_DETAILS_DIFFUSE] = True
obj[c4d.LIGHT_SHOWCLIPPING] = True
obj[c4d.LIGHT_DETAILS_SPECULAR] = True
obj[c4d.LIGHT_DETAILS_SEPARATEPASS] = True
obj[c4d.LIGHT_DETAILS_GI] = True
obj[c4d.LIGHT_AFX] = True
obj[c4d.LIGHT_DETAILS_INNERCONE] = True
obj[c4d.LIGHT_DETAILS_INNERANGLE] = 0.1
obj[c4d.LIGHT_DETAILS_INNERRADIUS] = 0.1
obj[c4d.LIGHT_DETAILS_OUTERANGLE] = 0.1
obj[c4d.LIGHT_DETAILS_OUTERRADIUS] = 0.1
obj[c4d.LIGHT_DETAILS_ASPECTRATIO] = 0.1
obj[c4d.LIGHT_DETAILS_CONTRAST] = 0.1
obj[c4d.LIGHT_DETAILS_SHADOWCASTER] = True
obj[c4d.LIGHT_AREADETAILS_SHAPE] = c4d.LIGHT_AREADETAILS_SHAPE_DISC
obj[c4d.LIGHT_AREADETAILS_SIZEX] = 0.1
obj[c4d.LIGHT_AREADETAILS_SIZEY] = 0.1
obj[c4d.LIGHT_AREADETAILS_SIZEZ] = 0.1
obj[c4d.LIGHT_AREADETAILS_FALLOFF_ANGLE] = 0.1
obj[c4d.LIGHT_AREADETAILS_INFINITE_ANGLE] = 0.1
obj[c4d.LIGHT_AREADETAILS_SAMPLES] = 1
obj[c4d.LIGHT_AREADETAILS_ADDGRAIN] = True
obj[c4d.LIGHT_AREADETAILS_SHOWINRENDER] = True
obj[c4d.LIGHT_AREADETAILS_SHOWASSOLIDINVIEWPORT] = True
obj[c4d.LIGHT_AREADETAILS_SHOWINSPECULAR] = True
obj[c4d.LIGHT_AREADETAILS_SHOWINREFLECTION] = True
obj[c4d.LIGHT_AREADETAILS_BRIGHTNESS] = 0.1
obj[c4d.LIGHT_DETAILS_FALLOFF] = c4d.LIGHT_DETAILS_FALLOFF_NONE
obj[c4d.LIGHT_DETAILS_INNERDISTANCE] = 0.1
obj[c4d.LIGHT_DETAILS_OUTERDISTANCE] = 0.1
obj[c4d.LIGHT_DETAILS_COLFALLOFF] = True
obj[c4d.LIGHT_DETAILS_ONLYZ] = True
obj[c4d.LIGHT_DETAILS_USEINNERCOLOR] = True
obj[c4d.LIGHT_DETAILS_NEARCLIP] = True
obj[c4d.LIGHT_DETAILS_NEARFROM] = 0.1
obj[c4d.LIGHT_DETAILS_NEARTO] = 0.1
obj[c4d.LIGHT_DETAILS_FARCLIP] = True
obj[c4d.LIGHT_DETAILS_FARFROM] = 0.1
obj[c4d.LIGHT_DETAILS_FARTO] = 0.1
obj[c4d.LIGHT_VISIBILITY_USEFALLOFF] = True
obj[c4d.LIGHT_VISIBILITY_FALLOFF] = 0.1
obj[c4d.LIGHT_VISIBILITY_USEEDGEFALLOFF] = True
obj[c4d.LIGHT_VISIBILITY_EDGEFALLOFF] = 0.1
obj[c4d.LIGHT_VISIBILITY_COLOREDEDGEFALLOFF] = True
obj[c4d.LIGHT_VISIBILITY_INNERDISTANCE] = 0.1
obj[c4d.LIGHT_VISIBILITY_OUTERDISTANCE] = 0.1
obj[c4d.LIGHT_VISIBILITY_OUTERDISTANCEREL] = c4d.Vector(1.0,1.0,1.0)
obj[c4d.LIGHT_VISIBILITY_SAMPLEDISTANCE] = 0.1
obj[c4d.LIGHT_VISIBILITY_BRIGHTNESS] = 0.1
obj[c4d.LIGHT_VISIBILITY_DUST] = 0.1
obj[c4d.LIGHT_VISIBILITY_DITHERING] = 0.1
obj[c4d.LIGHT_VISIBILITY_CUSTOMCOLORS] = True
obj[c4d.LIGHT_VISIBILITY_ADDITIVE] = True
obj[c4d.LIGHT_VISIBILITY_ADAPTBRIGHTNESS] = True
obj[c4d.LIGHT_SHADOWTYPE_VIRTUAL] = c4d.LIGHT_SHADOWTYPE_NONE
obj[c4d.LIGHT_SHADOW_DENSITY] = 0.1
obj[c4d.LIGHT_SHADOW_TRANSPARENCY] = True
obj[c4d.LIGHT_SHADOW_CLIPINFLUENCE] = True
obj[c4d.LIGHT_SHADOW_MAPSIZE] = c4d.LIGHT_SHADOW_MAPSIZE_250
obj[c4d.LIGHT_SHADOW_MAPSIZEX] = 1
obj[c4d.LIGHT_SHADOW_MAPSIZEY] = 1
obj[c4d.LIGHT_SHADOW_SAMPLERADIUS] = 1
obj[c4d.LIGHT_SHADOW_SAMPLEBOOST] = c4d.LIGHT_SHADOW_SAMPLEBOOST_NONE
obj[c4d.LIGHT_SHADOW_ABSOLUTE] = True
obj[c4d.LIGHT_SHADOW_RELATIVEBIAS] = 0.1
obj[c4d.LIGHT_SHADOW_ABSOLUTEBIAS] = 0.1
obj[c4d.LIGHT_SHADOW_PARALLELWIDTH] = 0.1
obj[c4d.LIGHT_SHADOW_OUTLINE] = True
obj[c4d.LIGHT_SHADOW_HIGHQUALITY] = True
obj[c4d.LIGHT_SHADOW_USECONE] = True
obj[c4d.LIGHT_SHADOW_CONEANGLE] = 0.1
obj[c4d.LIGHT_SHADOW_SOFTCONE] = True
obj[c4d.LIGHT_SHADOW_AREAWIDTH] = 0.1
obj[c4d.LIGHT_SHADOW_ACCURACY] = 0.1
obj[c4d.LIGHT_SHADOW_MINSAMPLES] = 1
obj[c4d.LIGHT_SHADOW_MAXSAMPLES] = 1
obj[c4d.LIGHT_PHOTOMETRIC_UNITS] = True
obj[c4d.LIGHT_PHOTOMETRIC_INTENSITY] = 0.1
obj[c4d.LIGHT_PHOTOMETRIC_UNIT] = c4d.LIGHT_PHOTOMETRIC_UNIT_LUMEN
obj[c4d.LIGHT_PHOTOMETRIC_DATA] = True
obj[c4d.LIGHT_PHOTOMETRIC_FILE] = "c:\\SomeFile.txt"
obj[c4d.LIGHT_PHOTOMETRIC_SIZE] = True
obj[c4d.LIGHT_CAUSTIC_ENABLE] = True
obj[c4d.LIGHT_CAUSTIC_ENERGY] = 0.1
obj[c4d.LIGHT_CAUSTIC_PHOTONS] = 1
obj[c4d.LIGHT_VOLCAUSTIC_ENABLE] = True
obj[c4d.LIGHT_VOLCAUSTIC_ENERGY] = 0.1
obj[c4d.LIGHT_VOLCAUSTIC_PHOTONS] = 1
obj[c4d.LIGHT_VOLCAUSTIC_FALLOFF] = c4d.LIGHT_VOLCAUSTIC_FALLOFF_NONE
obj[c4d.LIGHT_VOLCAUSTIC_INNERDISTANCE] = 0.1
obj[c4d.LIGHT_VOLCAUSTIC_OUTERDISTANCE] = 0.1
obj[c4d.LIGHT_NOISETYPE] = c4d.LIGHT_NOISETYPE_NONE
obj[c4d.LIGHT_NOISE_TYPE] = c4d.LIGHT_NOISE_TYPE_NOISE
obj[c4d.LIGHT_NOISE_OCTAVES] = 1
obj[c4d.LIGHT_NOISE_VELOCITY] = 0.1
obj[c4d.LIGHT_NOISE_BRIGHTNESS] = 0.1
obj[c4d.LIGHT_NOISE_CONTRAST] = 0.1
obj[c4d.LIGHT_NOISE_LOCAL] = True
obj[c4d.LIGHT_NOISE_SCALE] = c4d.Vector(1.0,1.0,1.0)
obj[c4d.LIGHT_NOISE_SCALEILLUMINATION] = 0.1
obj[c4d.LIGHT_NOISE_WIND] = c4d.Vector(1.0,1.0,1.0)
obj[c4d.LIGHT_NOISE_WINDVELOCITY] = 0.1
obj[c4d.LIGHT_LENSEFFECTS_LENSGLOW] = c4d.LIGHT_LENSEFFECTS_LENSGLOW_INACTIVE
obj[c4d.LIGHT_LENSEFFECTS_GLOWSTRENGTH] = 0.1
obj[c4d.LIGHT_LENSEFFECTS_GLOWSV] = 0.1
obj[c4d.LIGHT_LENSEFFECTS_LENSREFL] = c4d.LIGHT_LENSEFFECTS_LENSREFL_INACTIVE
obj[c4d.LIGHT_LENSEFFECTS_REFLSTRENGTH] = 0.1
obj[c4d.LIGHT_LENSEFFECTS_REFLSV] = 0.1
obj[c4d.LIGHT_LENSEFFECTS_SCALE] = 0.1
obj[c4d.LIGHT_LENSEFFECTS_ROTATION] = 0.1
obj[c4d.LIGHT_LENSEFFECTS_REFERENCE] = 0.1
obj[c4d.LIGHT_LENSEFFECTS_USELIGHTPARAMETER] = True
obj[c4d.LIGHT_LENSEFFECTS_FADENEARBORDER] = True
obj[c4d.LIGHT_LENSEFFECTS_FADEBEHINDOBJECT] = True
obj[c4d.LIGHT_LENSEFFECTS_FADEAPPROACHINGOBJECT] = True
obj[c4d.LIGHT_LENSEFFECTS_SCALEGLOW] = True
obj[c4d.LIGHT_LENSEFFECTS_SCALEREFLEXES] = True
obj[c4d.LIGHT_EXCLUSION_MODE] = c4d.LIGHT_EXCLUSION_MODE_INCLUDE
obj[c4d.LIGHT_PYROCLUSTER_ILLUMINATION] = True
obj[c4d.LIGHT_PYROCLUSTER_SHADOW] = True
#Second way, using the base container.
bc = obj.GetDataInstance()
bc.SetBool(c4d.LIGHT_TEMPERATURE,True)
bc.SetFloat(c4d.LIGHT_TEMPERATURE_MAIN,0.1)
bc.SetFloat(c4d.LIGHT_BRIGHTNESS,0.1)
bc.SetInt32(c4d.LIGHT_TYPE,c4d.LIGHT_TYPE_OMNI)
bc.SetInt32(c4d.LIGHT_SHADOWTYPE,c4d.LIGHT_SHADOWTYPE_NONE)
bc.SetInt32(c4d.LIGHT_VLTYPE,c4d.LIGHT_VLTYPE_NONE)
bc.SetBool(c4d.LIGHT_NOLIGHTRADIATION,True)
bc.SetBool(c4d.LIGHT_SHOWILLUMINATION,True)
bc.SetBool(c4d.LIGHT_DETAILS_AMBIENT,True)
bc.SetBool(c4d.LIGHT_SHOWVISIBLELIGHT,True)
bc.SetBool(c4d.LIGHT_DETAILS_DIFFUSE,True)
bc.SetBool(c4d.LIGHT_SHOWCLIPPING,True)
bc.SetBool(c4d.LIGHT_DETAILS_SPECULAR,True)
bc.SetBool(c4d.LIGHT_DETAILS_SEPARATEPASS,True)
bc.SetBool(c4d.LIGHT_DETAILS_GI,True)
bc.SetBool(c4d.LIGHT_AFX,True)
bc.SetBool(c4d.LIGHT_DETAILS_INNERCONE,True)
bc.SetFloat(c4d.LIGHT_DETAILS_INNERANGLE,0.1)
bc.SetFloat(c4d.LIGHT_DETAILS_INNERRADIUS,0.1)
bc.SetFloat(c4d.LIGHT_DETAILS_OUTERANGLE,0.1)
bc.SetFloat(c4d.LIGHT_DETAILS_OUTERRADIUS,0.1)
bc.SetFloat(c4d.LIGHT_DETAILS_ASPECTRATIO,0.1)
bc.SetFloat(c4d.LIGHT_DETAILS_CONTRAST,0.1)
bc.SetBool(c4d.LIGHT_DETAILS_SHADOWCASTER,True)
bc.SetInt32(c4d.LIGHT_AREADETAILS_SHAPE,c4d.LIGHT_AREADETAILS_SHAPE_DISC)
bc.SetFloat(c4d.LIGHT_AREADETAILS_SIZEX,0.1)
bc.SetFloat(c4d.LIGHT_AREADETAILS_SIZEY,0.1)
bc.SetFloat(c4d.LIGHT_AREADETAILS_SIZEZ,0.1)
bc.SetFloat(c4d.LIGHT_AREADETAILS_FALLOFF_ANGLE,0.1)
bc.SetFloat(c4d.LIGHT_AREADETAILS_INFINITE_ANGLE,0.1)
bc.SetInt32(c4d.LIGHT_AREADETAILS_SAMPLES,1)
bc.SetBool(c4d.LIGHT_AREADETAILS_ADDGRAIN,True)
bc.SetBool(c4d.LIGHT_AREADETAILS_SHOWINRENDER,True)
bc.SetBool(c4d.LIGHT_AREADETAILS_SHOWASSOLIDINVIEWPORT,True)
bc.SetBool(c4d.LIGHT_AREADETAILS_SHOWINSPECULAR,True)
bc.SetBool(c4d.LIGHT_AREADETAILS_SHOWINREFLECTION,True)
bc.SetFloat(c4d.LIGHT_AREADETAILS_BRIGHTNESS,0.1)
bc.SetInt32(c4d.LIGHT_DETAILS_FALLOFF,c4d.LIGHT_DETAILS_FALLOFF_NONE)
bc.SetFloat(c4d.LIGHT_DETAILS_INNERDISTANCE,0.1)
bc.SetFloat(c4d.LIGHT_DETAILS_OUTERDISTANCE,0.1)
bc.SetBool(c4d.LIGHT_DETAILS_COLFALLOFF,True)
bc.SetBool(c4d.LIGHT_DETAILS_ONLYZ,True)
bc.SetBool(c4d.LIGHT_DETAILS_USEINNERCOLOR,True)
bc.SetBool(c4d.LIGHT_DETAILS_NEARCLIP,True)
bc.SetFloat(c4d.LIGHT_DETAILS_NEARFROM,0.1)
bc.SetFloat(c4d.LIGHT_DETAILS_NEARTO,0.1)
bc.SetBool(c4d.LIGHT_DETAILS_FARCLIP,True)
bc.SetFloat(c4d.LIGHT_DETAILS_FARFROM,0.1)
bc.SetFloat(c4d.LIGHT_DETAILS_FARTO,0.1)
bc.SetBool(c4d.LIGHT_VISIBILITY_USEFALLOFF,True)
bc.SetFloat(c4d.LIGHT_VISIBILITY_FALLOFF,0.1)
bc.SetBool(c4d.LIGHT_VISIBILITY_USEEDGEFALLOFF,True)
bc.SetFloat(c4d.LIGHT_VISIBILITY_EDGEFALLOFF,0.1)
bc.SetBool(c4d.LIGHT_VISIBILITY_COLOREDEDGEFALLOFF,True)
bc.SetFloat(c4d.LIGHT_VISIBILITY_INNERDISTANCE,0.1)
bc.SetFloat(c4d.LIGHT_VISIBILITY_OUTERDISTANCE,0.1)
bc.SetVector(c4d.LIGHT_VISIBILITY_OUTERDISTANCEREL, c4d.Vector(1.0,1.0,1.0)
bc.SetFloat(c4d.LIGHT_VISIBILITY_SAMPLEDISTANCE,0.1)
bc.SetFloat(c4d.LIGHT_VISIBILITY_BRIGHTNESS,0.1)
bc.SetFloat(c4d.LIGHT_VISIBILITY_DUST,0.1)
bc.SetFloat(c4d.LIGHT_VISIBILITY_DITHERING,0.1)
bc.SetBool(c4d.LIGHT_VISIBILITY_CUSTOMCOLORS,True)
bc.SetBool(c4d.LIGHT_VISIBILITY_ADDITIVE,True)
bc.SetBool(c4d.LIGHT_VISIBILITY_ADAPTBRIGHTNESS,True)
bc.SetInt32(c4d.LIGHT_SHADOWTYPE_VIRTUAL,c4d.LIGHT_SHADOWTYPE_NONE)
bc.SetFloat(c4d.LIGHT_SHADOW_DENSITY,0.1)
bc.SetBool(c4d.LIGHT_SHADOW_TRANSPARENCY,True)
bc.SetBool(c4d.LIGHT_SHADOW_CLIPINFLUENCE,True)
bc.SetInt32(c4d.LIGHT_SHADOW_MAPSIZE,c4d.LIGHT_SHADOW_MAPSIZE_250)
bc.SetInt32(c4d.LIGHT_SHADOW_MAPSIZEX,1)
bc.SetInt32(c4d.LIGHT_SHADOW_MAPSIZEY,1)
bc.SetInt32(c4d.LIGHT_SHADOW_SAMPLERADIUS,1)
bc.SetInt32(c4d.LIGHT_SHADOW_SAMPLEBOOST,c4d.LIGHT_SHADOW_SAMPLEBOOST_NONE)
bc.SetBool(c4d.LIGHT_SHADOW_ABSOLUTE,True)
bc.SetFloat(c4d.LIGHT_SHADOW_RELATIVEBIAS,0.1)
bc.SetFloat(c4d.LIGHT_SHADOW_ABSOLUTEBIAS,0.1)
bc.SetFloat(c4d.LIGHT_SHADOW_PARALLELWIDTH,0.1)
bc.SetBool(c4d.LIGHT_SHADOW_OUTLINE,True)
bc.SetBool(c4d.LIGHT_SHADOW_HIGHQUALITY,True)
bc.SetBool(c4d.LIGHT_SHADOW_USECONE,True)
bc.SetFloat(c4d.LIGHT_SHADOW_CONEANGLE,0.1)
bc.SetBool(c4d.LIGHT_SHADOW_SOFTCONE,True)
bc.SetFloat(c4d.LIGHT_SHADOW_AREAWIDTH,0.1)
bc.SetFloat(c4d.LIGHT_SHADOW_ACCURACY,0.1)
bc.SetInt32(c4d.LIGHT_SHADOW_MINSAMPLES,1)
bc.SetInt32(c4d.LIGHT_SHADOW_MAXSAMPLES,1)
bc.SetBool(c4d.LIGHT_PHOTOMETRIC_UNITS,True)
bc.SetFloat(c4d.LIGHT_PHOTOMETRIC_INTENSITY,0.1)
bc.SetInt32(c4d.LIGHT_PHOTOMETRIC_UNIT,c4d.LIGHT_PHOTOMETRIC_UNIT_LUMEN)
bc.SetBool(c4d.LIGHT_PHOTOMETRIC_DATA,True)
bc.SetFileName(c4d.LIGHT_PHOTOMETRIC_FILE,"c:\\SomeFile.txt")
bc.SetBool(c4d.LIGHT_PHOTOMETRIC_SIZE,True)
bc.SetBool(c4d.LIGHT_CAUSTIC_ENABLE,True)
bc.SetFloat(c4d.LIGHT_CAUSTIC_ENERGY,0.1)
bc.SetInt32(c4d.LIGHT_CAUSTIC_PHOTONS,1)
bc.SetBool(c4d.LIGHT_VOLCAUSTIC_ENABLE,True)
bc.SetFloat(c4d.LIGHT_VOLCAUSTIC_ENERGY,0.1)
bc.SetInt32(c4d.LIGHT_VOLCAUSTIC_PHOTONS,1)
bc.SetInt32(c4d.LIGHT_VOLCAUSTIC_FALLOFF,c4d.LIGHT_VOLCAUSTIC_FALLOFF_NONE)
bc.SetFloat(c4d.LIGHT_VOLCAUSTIC_INNERDISTANCE,0.1)
bc.SetFloat(c4d.LIGHT_VOLCAUSTIC_OUTERDISTANCE,0.1)
bc.SetInt32(c4d.LIGHT_NOISETYPE,c4d.LIGHT_NOISETYPE_NONE)
bc.SetInt32(c4d.LIGHT_NOISE_TYPE,c4d.LIGHT_NOISE_TYPE_NOISE)
bc.SetInt32(c4d.LIGHT_NOISE_OCTAVES,1)
bc.SetFloat(c4d.LIGHT_NOISE_VELOCITY,0.1)
bc.SetFloat(c4d.LIGHT_NOISE_BRIGHTNESS,0.1)
bc.SetFloat(c4d.LIGHT_NOISE_CONTRAST,0.1)
bc.SetBool(c4d.LIGHT_NOISE_LOCAL,True)
bc.SetVector(c4d.LIGHT_NOISE_SCALE, c4d.Vector(1.0,1.0,1.0)
bc.SetFloat(c4d.LIGHT_NOISE_SCALEILLUMINATION,0.1)
bc.SetVector(c4d.LIGHT_NOISE_WIND, c4d.Vector(1.0,1.0,1.0)
bc.SetFloat(c4d.LIGHT_NOISE_WINDVELOCITY,0.1)
bc.SetInt32(c4d.LIGHT_LENSEFFECTS_LENSGLOW,c4d.LIGHT_LENSEFFECTS_LENSGLOW_INACTIVE)
bc.SetFloat(c4d.LIGHT_LENSEFFECTS_GLOWSTRENGTH,0.1)
bc.SetFloat(c4d.LIGHT_LENSEFFECTS_GLOWSV,0.1)
bc.SetInt32(c4d.LIGHT_LENSEFFECTS_LENSREFL,c4d.LIGHT_LENSEFFECTS_LENSREFL_INACTIVE)
bc.SetFloat(c4d.LIGHT_LENSEFFECTS_REFLSTRENGTH,0.1)
bc.SetFloat(c4d.LIGHT_LENSEFFECTS_REFLSV,0.1)
bc.SetFloat(c4d.LIGHT_LENSEFFECTS_SCALE,0.1)
bc.SetFloat(c4d.LIGHT_LENSEFFECTS_ROTATION,0.1)
bc.SetFloat(c4d.LIGHT_LENSEFFECTS_REFERENCE,0.1)
bc.SetBool(c4d.LIGHT_LENSEFFECTS_USELIGHTPARAMETER,True)
bc.SetBool(c4d.LIGHT_LENSEFFECTS_FADENEARBORDER,True)
bc.SetBool(c4d.LIGHT_LENSEFFECTS_FADEBEHINDOBJECT,True)
bc.SetBool(c4d.LIGHT_LENSEFFECTS_FADEAPPROACHINGOBJECT,True)
bc.SetBool(c4d.LIGHT_LENSEFFECTS_SCALEGLOW,True)
bc.SetBool(c4d.LIGHT_LENSEFFECTS_SCALEREFLEXES,True)
bc.SetInt32(c4d.LIGHT_EXCLUSION_MODE,c4d.LIGHT_EXCLUSION_MODE_INCLUDE)
bc.SetBool(c4d.LIGHT_PYROCLUSTER_ILLUMINATION,True)
bc.SetBool(c4d.LIGHT_PYROCLUSTER_SHADOW,True)
if __name__=='__main__':
main()
C++
#include "c4d.h"
#include "../c4dplugin/description/olight.h"
void SampleFunction()
{
BaseDocument *pDoc = GetActiveDocument();
BaseObject *pObject = BaseObject::Alloc(Olight);
pDoc->InsertObject(pObject);
pDoc->StartUndo();
pDoc->AddUndo(UNDO_NEW,pObject);
pDoc->EndUndo();
EventAdd(EVENT_FORCEREDRAW);
//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;
pObject->SetParameter(DescID(LIGHT_TEMPERATURE),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_TEMPERATURE_MAIN),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_BRIGHTNESS),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_TYPE),GeData(LIGHT_TYPE_OMNI),flags);
pObject->SetParameter(DescID(LIGHT_SHADOWTYPE),GeData(LIGHT_SHADOWTYPE_NONE),flags);
pObject->SetParameter(DescID(LIGHT_VLTYPE),GeData(LIGHT_VLTYPE_NONE),flags);
pObject->SetParameter(DescID(LIGHT_NOLIGHTRADIATION),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_SHOWILLUMINATION),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_DETAILS_AMBIENT),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_SHOWVISIBLELIGHT),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_DETAILS_DIFFUSE),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_SHOWCLIPPING),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_DETAILS_SPECULAR),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_DETAILS_SEPARATEPASS),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_DETAILS_GI),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_AFX),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_DETAILS_INNERCONE),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_DETAILS_INNERANGLE),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_DETAILS_INNERRADIUS),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_DETAILS_OUTERANGLE),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_DETAILS_OUTERRADIUS),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_DETAILS_ASPECTRATIO),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_DETAILS_CONTRAST),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_DETAILS_SHADOWCASTER),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_AREADETAILS_SHAPE),GeData(LIGHT_AREADETAILS_SHAPE_DISC),flags);
pObject->SetParameter(DescID(LIGHT_AREADETAILS_SIZEX),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_AREADETAILS_SIZEY),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_AREADETAILS_SIZEZ),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_AREADETAILS_FALLOFF_ANGLE),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_AREADETAILS_INFINITE_ANGLE),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_AREADETAILS_SAMPLES),GeData(1),flags);
pObject->SetParameter(DescID(LIGHT_AREADETAILS_ADDGRAIN),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_AREADETAILS_SHOWINRENDER),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_AREADETAILS_SHOWASSOLIDINVIEWPORT),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_AREADETAILS_SHOWINSPECULAR),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_AREADETAILS_SHOWINREFLECTION),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_AREADETAILS_BRIGHTNESS),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_DETAILS_FALLOFF),GeData(LIGHT_DETAILS_FALLOFF_NONE),flags);
pObject->SetParameter(DescID(LIGHT_DETAILS_INNERDISTANCE),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_DETAILS_OUTERDISTANCE),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_DETAILS_COLFALLOFF),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_DETAILS_ONLYZ),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_DETAILS_USEINNERCOLOR),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_DETAILS_NEARCLIP),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_DETAILS_NEARFROM),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_DETAILS_NEARTO),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_DETAILS_FARCLIP),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_DETAILS_FARFROM),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_DETAILS_FARTO),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_VISIBILITY_USEFALLOFF),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_VISIBILITY_FALLOFF),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_VISIBILITY_USEEDGEFALLOFF),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_VISIBILITY_EDGEFALLOFF),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_VISIBILITY_COLOREDEDGEFALLOFF),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_VISIBILITY_INNERDISTANCE),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_VISIBILITY_OUTERDISTANCE),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_VISIBILITY_OUTERDISTANCEREL),GeData(Vector(1.0,1.0,1.0)),flags);
pObject->SetParameter(DescID(LIGHT_VISIBILITY_SAMPLEDISTANCE),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_VISIBILITY_BRIGHTNESS),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_VISIBILITY_DUST),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_VISIBILITY_DITHERING),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_VISIBILITY_CUSTOMCOLORS),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_VISIBILITY_ADDITIVE),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_VISIBILITY_ADAPTBRIGHTNESS),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_SHADOWTYPE_VIRTUAL),GeData(LIGHT_SHADOWTYPE_NONE),flags);
pObject->SetParameter(DescID(LIGHT_SHADOW_DENSITY),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_SHADOW_TRANSPARENCY),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_SHADOW_CLIPINFLUENCE),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_SHADOW_MAPSIZE),GeData(LIGHT_SHADOW_MAPSIZE_250),flags);
pObject->SetParameter(DescID(LIGHT_SHADOW_MAPSIZEX),GeData(1),flags);
pObject->SetParameter(DescID(LIGHT_SHADOW_MAPSIZEY),GeData(1),flags);
pObject->SetParameter(DescID(LIGHT_SHADOW_SAMPLERADIUS),GeData(1),flags);
pObject->SetParameter(DescID(LIGHT_SHADOW_SAMPLEBOOST),GeData(LIGHT_SHADOW_SAMPLEBOOST_NONE),flags);
pObject->SetParameter(DescID(LIGHT_SHADOW_ABSOLUTE),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_SHADOW_RELATIVEBIAS),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_SHADOW_ABSOLUTEBIAS),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_SHADOW_PARALLELWIDTH),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_SHADOW_OUTLINE),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_SHADOW_HIGHQUALITY),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_SHADOW_USECONE),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_SHADOW_CONEANGLE),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_SHADOW_SOFTCONE),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_SHADOW_AREAWIDTH),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_SHADOW_ACCURACY),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_SHADOW_MINSAMPLES),GeData(1),flags);
pObject->SetParameter(DescID(LIGHT_SHADOW_MAXSAMPLES),GeData(1),flags);
pObject->SetParameter(DescID(LIGHT_PHOTOMETRIC_UNITS),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_PHOTOMETRIC_INTENSITY),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_PHOTOMETRIC_UNIT),GeData(LIGHT_PHOTOMETRIC_UNIT_LUMEN),flags);
pObject->SetParameter(DescID(LIGHT_PHOTOMETRIC_DATA),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_PHOTOMETRIC_FILE),GeData(Filename("c:\\SomeFile.txt"),flags);
pObject->SetParameter(DescID(LIGHT_PHOTOMETRIC_SIZE),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_CAUSTIC_ENABLE),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_CAUSTIC_ENERGY),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_CAUSTIC_PHOTONS),GeData(1),flags);
pObject->SetParameter(DescID(LIGHT_VOLCAUSTIC_ENABLE),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_VOLCAUSTIC_ENERGY),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_VOLCAUSTIC_PHOTONS),GeData(1),flags);
pObject->SetParameter(DescID(LIGHT_VOLCAUSTIC_FALLOFF),GeData(LIGHT_VOLCAUSTIC_FALLOFF_NONE),flags);
pObject->SetParameter(DescID(LIGHT_VOLCAUSTIC_INNERDISTANCE),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_VOLCAUSTIC_OUTERDISTANCE),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_NOISETYPE),GeData(LIGHT_NOISETYPE_NONE),flags);
pObject->SetParameter(DescID(LIGHT_NOISE_TYPE),GeData(LIGHT_NOISE_TYPE_NOISE),flags);
pObject->SetParameter(DescID(LIGHT_NOISE_OCTAVES),GeData(1),flags);
pObject->SetParameter(DescID(LIGHT_NOISE_VELOCITY),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_NOISE_BRIGHTNESS),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_NOISE_CONTRAST),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_NOISE_LOCAL),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_NOISE_SCALE),GeData(Vector(1.0,1.0,1.0)),flags);
pObject->SetParameter(DescID(LIGHT_NOISE_SCALEILLUMINATION),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_NOISE_WIND),GeData(Vector(1.0,1.0,1.0)),flags);
pObject->SetParameter(DescID(LIGHT_NOISE_WINDVELOCITY),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_LENSEFFECTS_LENSGLOW),GeData(LIGHT_LENSEFFECTS_LENSGLOW_INACTIVE),flags);
pObject->SetParameter(DescID(LIGHT_LENSEFFECTS_GLOWSTRENGTH),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_LENSEFFECTS_GLOWSV),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_LENSEFFECTS_LENSREFL),GeData(LIGHT_LENSEFFECTS_LENSREFL_INACTIVE),flags);
pObject->SetParameter(DescID(LIGHT_LENSEFFECTS_REFLSTRENGTH),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_LENSEFFECTS_REFLSV),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_LENSEFFECTS_SCALE),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_LENSEFFECTS_ROTATION),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_LENSEFFECTS_REFERENCE),GeData(0.1),flags);
pObject->SetParameter(DescID(LIGHT_LENSEFFECTS_USELIGHTPARAMETER),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_LENSEFFECTS_FADENEARBORDER),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_LENSEFFECTS_FADEBEHINDOBJECT),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_LENSEFFECTS_FADEAPPROACHINGOBJECT),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_LENSEFFECTS_SCALEGLOW),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_LENSEFFECTS_SCALEREFLEXES),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_EXCLUSION_MODE),GeData(LIGHT_EXCLUSION_MODE_INCLUDE),flags);
pObject->SetParameter(DescID(LIGHT_PYROCLUSTER_ILLUMINATION),GeData(true),flags);
pObject->SetParameter(DescID(LIGHT_PYROCLUSTER_SHADOW),GeData(true),flags);
pObject->Message(MSG_UPDATE);
//Second way, using the base container.
BaseContainer *bc = pObject->GetDataInstance();
bc->SetBool(LIGHT_TEMPERATURE,true);
bc->SetFloat(LIGHT_TEMPERATURE_MAIN,0.1);
bc->SetFloat(LIGHT_BRIGHTNESS,0.1);
bc->SetInt32(LIGHT_TYPE,LIGHT_TYPE_OMNI);
bc->SetInt32(LIGHT_SHADOWTYPE,LIGHT_SHADOWTYPE_NONE);
bc->SetInt32(LIGHT_VLTYPE,LIGHT_VLTYPE_NONE);
bc->SetBool(LIGHT_NOLIGHTRADIATION,true);
bc->SetBool(LIGHT_SHOWILLUMINATION,true);
bc->SetBool(LIGHT_DETAILS_AMBIENT,true);
bc->SetBool(LIGHT_SHOWVISIBLELIGHT,true);
bc->SetBool(LIGHT_DETAILS_DIFFUSE,true);
bc->SetBool(LIGHT_SHOWCLIPPING,true);
bc->SetBool(LIGHT_DETAILS_SPECULAR,true);
bc->SetBool(LIGHT_DETAILS_SEPARATEPASS,true);
bc->SetBool(LIGHT_DETAILS_GI,true);
bc->SetBool(LIGHT_AFX,true);
bc->SetBool(LIGHT_DETAILS_INNERCONE,true);
bc->SetFloat(LIGHT_DETAILS_INNERANGLE,0.1);
bc->SetFloat(LIGHT_DETAILS_INNERRADIUS,0.1);
bc->SetFloat(LIGHT_DETAILS_OUTERANGLE,0.1);
bc->SetFloat(LIGHT_DETAILS_OUTERRADIUS,0.1);
bc->SetFloat(LIGHT_DETAILS_ASPECTRATIO,0.1);
bc->SetFloat(LIGHT_DETAILS_CONTRAST,0.1);
bc->SetBool(LIGHT_DETAILS_SHADOWCASTER,true);
bc->SetInt32(LIGHT_AREADETAILS_SHAPE,LIGHT_AREADETAILS_SHAPE_DISC);
bc->SetFloat(LIGHT_AREADETAILS_SIZEX,0.1);
bc->SetFloat(LIGHT_AREADETAILS_SIZEY,0.1);
bc->SetFloat(LIGHT_AREADETAILS_SIZEZ,0.1);
bc->SetFloat(LIGHT_AREADETAILS_FALLOFF_ANGLE,0.1);
bc->SetFloat(LIGHT_AREADETAILS_INFINITE_ANGLE,0.1);
bc->SetInt32(LIGHT_AREADETAILS_SAMPLES,1);
bc->SetBool(LIGHT_AREADETAILS_ADDGRAIN,true);
bc->SetBool(LIGHT_AREADETAILS_SHOWINRENDER,true);
bc->SetBool(LIGHT_AREADETAILS_SHOWASSOLIDINVIEWPORT,true);
bc->SetBool(LIGHT_AREADETAILS_SHOWINSPECULAR,true);
bc->SetBool(LIGHT_AREADETAILS_SHOWINREFLECTION,true);
bc->SetFloat(LIGHT_AREADETAILS_BRIGHTNESS,0.1);
bc->SetInt32(LIGHT_DETAILS_FALLOFF,LIGHT_DETAILS_FALLOFF_NONE);
bc->SetFloat(LIGHT_DETAILS_INNERDISTANCE,0.1);
bc->SetFloat(LIGHT_DETAILS_OUTERDISTANCE,0.1);
bc->SetBool(LIGHT_DETAILS_COLFALLOFF,true);
bc->SetBool(LIGHT_DETAILS_ONLYZ,true);
bc->SetBool(LIGHT_DETAILS_USEINNERCOLOR,true);
bc->SetBool(LIGHT_DETAILS_NEARCLIP,true);
bc->SetFloat(LIGHT_DETAILS_NEARFROM,0.1);
bc->SetFloat(LIGHT_DETAILS_NEARTO,0.1);
bc->SetBool(LIGHT_DETAILS_FARCLIP,true);
bc->SetFloat(LIGHT_DETAILS_FARFROM,0.1);
bc->SetFloat(LIGHT_DETAILS_FARTO,0.1);
bc->SetBool(LIGHT_VISIBILITY_USEFALLOFF,true);
bc->SetFloat(LIGHT_VISIBILITY_FALLOFF,0.1);
bc->SetBool(LIGHT_VISIBILITY_USEEDGEFALLOFF,true);
bc->SetFloat(LIGHT_VISIBILITY_EDGEFALLOFF,0.1);
bc->SetBool(LIGHT_VISIBILITY_COLOREDEDGEFALLOFF,true);
bc->SetFloat(LIGHT_VISIBILITY_INNERDISTANCE,0.1);
bc->SetFloat(LIGHT_VISIBILITY_OUTERDISTANCE,0.1);
bc->SetVector(LIGHT_VISIBILITY_OUTERDISTANCEREL, c4d.Vector(1.0,1.0,1.0);
bc->SetFloat(LIGHT_VISIBILITY_SAMPLEDISTANCE,0.1);
bc->SetFloat(LIGHT_VISIBILITY_BRIGHTNESS,0.1);
bc->SetFloat(LIGHT_VISIBILITY_DUST,0.1);
bc->SetFloat(LIGHT_VISIBILITY_DITHERING,0.1);
bc->SetBool(LIGHT_VISIBILITY_CUSTOMCOLORS,true);
bc->SetBool(LIGHT_VISIBILITY_ADDITIVE,true);
bc->SetBool(LIGHT_VISIBILITY_ADAPTBRIGHTNESS,true);
bc->SetInt32(LIGHT_SHADOWTYPE_VIRTUAL,LIGHT_SHADOWTYPE_NONE);
bc->SetFloat(LIGHT_SHADOW_DENSITY,0.1);
bc->SetBool(LIGHT_SHADOW_TRANSPARENCY,true);
bc->SetBool(LIGHT_SHADOW_CLIPINFLUENCE,true);
bc->SetInt32(LIGHT_SHADOW_MAPSIZE,LIGHT_SHADOW_MAPSIZE_250);
bc->SetInt32(LIGHT_SHADOW_MAPSIZEX,1);
bc->SetInt32(LIGHT_SHADOW_MAPSIZEY,1);
bc->SetInt32(LIGHT_SHADOW_SAMPLERADIUS,1);
bc->SetInt32(LIGHT_SHADOW_SAMPLEBOOST,LIGHT_SHADOW_SAMPLEBOOST_NONE);
bc->SetBool(LIGHT_SHADOW_ABSOLUTE,true);
bc->SetFloat(LIGHT_SHADOW_RELATIVEBIAS,0.1);
bc->SetFloat(LIGHT_SHADOW_ABSOLUTEBIAS,0.1);
bc->SetFloat(LIGHT_SHADOW_PARALLELWIDTH,0.1);
bc->SetBool(LIGHT_SHADOW_OUTLINE,true);
bc->SetBool(LIGHT_SHADOW_HIGHQUALITY,true);
bc->SetBool(LIGHT_SHADOW_USECONE,true);
bc->SetFloat(LIGHT_SHADOW_CONEANGLE,0.1);
bc->SetBool(LIGHT_SHADOW_SOFTCONE,true);
bc->SetFloat(LIGHT_SHADOW_AREAWIDTH,0.1);
bc->SetFloat(LIGHT_SHADOW_ACCURACY,0.1);
bc->SetInt32(LIGHT_SHADOW_MINSAMPLES,1);
bc->SetInt32(LIGHT_SHADOW_MAXSAMPLES,1);
bc->SetBool(LIGHT_PHOTOMETRIC_UNITS,true);
bc->SetFloat(LIGHT_PHOTOMETRIC_INTENSITY,0.1);
bc->SetInt32(LIGHT_PHOTOMETRIC_UNIT,LIGHT_PHOTOMETRIC_UNIT_LUMEN);
bc->SetBool(LIGHT_PHOTOMETRIC_DATA,true);
bc->SetFileName(LIGHT_PHOTOMETRIC_FILE,"c:\\SomeFile.txt");
bc->SetBool(LIGHT_PHOTOMETRIC_SIZE,true);
bc->SetBool(LIGHT_CAUSTIC_ENABLE,true);
bc->SetFloat(LIGHT_CAUSTIC_ENERGY,0.1);
bc->SetInt32(LIGHT_CAUSTIC_PHOTONS,1);
bc->SetBool(LIGHT_VOLCAUSTIC_ENABLE,true);
bc->SetFloat(LIGHT_VOLCAUSTIC_ENERGY,0.1);
bc->SetInt32(LIGHT_VOLCAUSTIC_PHOTONS,1);
bc->SetInt32(LIGHT_VOLCAUSTIC_FALLOFF,LIGHT_VOLCAUSTIC_FALLOFF_NONE);
bc->SetFloat(LIGHT_VOLCAUSTIC_INNERDISTANCE,0.1);
bc->SetFloat(LIGHT_VOLCAUSTIC_OUTERDISTANCE,0.1);
bc->SetInt32(LIGHT_NOISETYPE,LIGHT_NOISETYPE_NONE);
bc->SetInt32(LIGHT_NOISE_TYPE,LIGHT_NOISE_TYPE_NOISE);
bc->SetInt32(LIGHT_NOISE_OCTAVES,1);
bc->SetFloat(LIGHT_NOISE_VELOCITY,0.1);
bc->SetFloat(LIGHT_NOISE_BRIGHTNESS,0.1);
bc->SetFloat(LIGHT_NOISE_CONTRAST,0.1);
bc->SetBool(LIGHT_NOISE_LOCAL,true);
bc->SetVector(LIGHT_NOISE_SCALE, c4d.Vector(1.0,1.0,1.0);
bc->SetFloat(LIGHT_NOISE_SCALEILLUMINATION,0.1);
bc->SetVector(LIGHT_NOISE_WIND, c4d.Vector(1.0,1.0,1.0);
bc->SetFloat(LIGHT_NOISE_WINDVELOCITY,0.1);
bc->SetInt32(LIGHT_LENSEFFECTS_LENSGLOW,LIGHT_LENSEFFECTS_LENSGLOW_INACTIVE);
bc->SetFloat(LIGHT_LENSEFFECTS_GLOWSTRENGTH,0.1);
bc->SetFloat(LIGHT_LENSEFFECTS_GLOWSV,0.1);
bc->SetInt32(LIGHT_LENSEFFECTS_LENSREFL,LIGHT_LENSEFFECTS_LENSREFL_INACTIVE);
bc->SetFloat(LIGHT_LENSEFFECTS_REFLSTRENGTH,0.1);
bc->SetFloat(LIGHT_LENSEFFECTS_REFLSV,0.1);
bc->SetFloat(LIGHT_LENSEFFECTS_SCALE,0.1);
bc->SetFloat(LIGHT_LENSEFFECTS_ROTATION,0.1);
bc->SetFloat(LIGHT_LENSEFFECTS_REFERENCE,0.1);
bc->SetBool(LIGHT_LENSEFFECTS_USELIGHTPARAMETER,true);
bc->SetBool(LIGHT_LENSEFFECTS_FADENEARBORDER,true);
bc->SetBool(LIGHT_LENSEFFECTS_FADEBEHINDOBJECT,true);
bc->SetBool(LIGHT_LENSEFFECTS_FADEAPPROACHINGOBJECT,true);
bc->SetBool(LIGHT_LENSEFFECTS_SCALEGLOW,true);
bc->SetBool(LIGHT_LENSEFFECTS_SCALEREFLEXES,true);
bc->SetInt32(LIGHT_EXCLUSION_MODE,LIGHT_EXCLUSION_MODE_INCLUDE);
bc->SetBool(LIGHT_PYROCLUSTER_ILLUMINATION,true);
bc->SetBool(LIGHT_PYROCLUSTER_SHADOW,true);
pObject->Message(MSG_UPDATE);
}
Buttons
This node has buttons. Buttons can manually be executed by calling the following code
Python
c4d.CallButton(obj,c4d.LIGHT_PHOTOMETRIC_PREVIEW)
c4d.CallButton(obj,c4d.LIGHT_NOISE_PREVIEW)
c4d.CallButton(obj,c4d.LIGHT_LENSEFFECTS_PREVIEW)
c4d.CallButton(obj,c4d.LIGHT_LENSEFFECTS_REFL_EDIT)
C++
DescriptionCommand dc;
dc.id = DescID(LIGHT_PHOTOMETRIC_PREVIEW);
pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(LIGHT_NOISE_PREVIEW);
pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(LIGHT_LENSEFFECTS_PREVIEW);
pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(LIGHT_LENSEFFECTS_REFL_EDIT);
pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);
Gradients
This node has gradients. Gradients can manually be edited by calling the following code
Python
C++
#include "customgui_gradient.h"
LIGHT_DETAILS_GRADIENT
GeData data;
pObject->GetParameter(DescID(LIGHT_DETAILS_GRADIENT),data,DESCFLAGS_GET_PARAM_GET));
Gradient *pGradient = (Gradient*)data.GetCustomDataType(CUSTOMDATATYPE_GRADIENT);
if(pGradient)
{
//must be set before any knot is set
pGradient->SetData(GRADIENT_MODE, GeData(GRADIENTMODE_ALPHA));
GradientKnot k1, k2;
k1.col = Vector(0.0, 0.0, 1.0);
k1.pos = 0.0;
k2.col = 1.0;
k2.pos = 1.0;
pGradient->InsertKnot(k1);
pGradient->InsertKnot(k2);
}
pObject->SetParameter(DescID(LIGHT_DETAILS_GRADIENT),data,DESCFLAGS_SET_PARAM_SET));
LIGHT_VISIBILITY_GRADIENT
pObject->GetParameter(DescID(LIGHT_VISIBILITY_GRADIENT),data,DESCFLAGS_GET_PARAM_GET));