Oexplosionfx
Attributes
-
ENGLISH NAME : ExplosionFXObject
-
NAME : Oexplosionfx
-
INCLUDE : Obase
-
PATH : objects/description/oexplosionfx.res
-
PLUGIN : objects
-
MAXON online help (may not exist): OEXPLOSIONFX
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.Oexplosionfx)
doc.InsertObject(obj)
c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
#You can set parameters two different ways.
#First way
obj[c4d.EXPLOSIONFX_TIME] = 0.1
obj[c4d.EXPLOSIONFX_THICKNESS] = 0.1
obj[c4d.EXPLOSIONFX_THICKNESS_RANDOM] = 0.1
obj[c4d.EXPLOSIONFX_DENSITY] = 0.1
obj[c4d.EXPLOSIONFX_DENSITY_RANDOM] = 0.1
obj[c4d.EXPLOSIONFX_CLUSTERKIND] = c4d.EXPLOSIONFX_CLUSTERKIND_POLYS
obj[c4d.EXPLOSIONFX_CLUSTER_NAME] = "Hello World"
obj[c4d.EXPLOSIONFX_CLUSTERFIX] = True
obj[c4d.EXPLOSIONFX_CLUSTER_MIN_POLYS] = 1
obj[c4d.EXPLOSIONFX_CLUSTER_MAX_POLYS] = 1
obj[c4d.EXPLOSIONFX_DISAPPEAR] = True
obj[c4d.EXPLOSIONFX_DISAPPEARKIND] = c4d.EXPLOSIONFX_DISAPPEARKIND_TIME
obj[c4d.EXPLOSIONFX_DISAPPEAR_START] = 0.1
obj[c4d.EXPLOSIONFX_DISAPPEAR_DELAY] = 0.1
obj[c4d.EXPLOSIONFX_EXPLOSTRENGTH] = 0.1
obj[c4d.EXPLOSIONFX_EXPLOSTRENGTH_FALLOFF] = 0.1
obj[c4d.EXPLOSIONFX_EXPLOSTRENGTH_RANDOM] = 0.1
obj[c4d.EXPLOSIONFX_EXPLODIRECTION] = c4d.EXPLOSIONFX_EXPLODIRECTION_ALL
obj[c4d.EXPLOSIONFX_LINEAR] = True
obj[c4d.EXPLOSIONFX_EXPLODIRECTION_RANDOM] = 0.1
obj[c4d.EXPLOSIONFX_EXPLOTIME] = 0.1
obj[c4d.EXPLOSIONFX_DSPEED] = 0.1
obj[c4d.EXPLOSIONFX_DSPEED_FALLOFF] = 0.1
obj[c4d.EXPLOSIONFX_DSPEED_RANDOM] = 0.1
obj[c4d.EXPLOSIONFX_DMAX_RANGE] = 0.1
obj[c4d.EXPLOSIONFX_DMAX_RANGE_RANDOM] = 0.1
obj[c4d.EXPLOSIONFX_GRAVITATION] = 0.1
obj[c4d.EXPLOSIONFX_GRAVITATION_RANDOM] = 0.1
obj[c4d.EXPLOSIONFX_GDIRECTION] = c4d.EXPLOSIONFX_GDIRECTION_NO
obj[c4d.EXPLOSIONFX_GMAX_RANGE] = 0.1
obj[c4d.EXPLOSIONFX_GMAX_RANGE_RANDOM] = 0.1
obj[c4d.EXPLOSIONFX_WSPEED] = 0.1
obj[c4d.EXPLOSIONFX_WSPEED_FALLOFF] = 0.1
obj[c4d.EXPLOSIONFX_WSPEED_RANDOM] = 0.1
obj[c4d.EXPLOSIONFX_ROTACHSE] = c4d.EXPLOSIONFX_ROTACHSE_C
obj[c4d.EXPLOSIONFX_ROTACHSE_RANDOM] = 0.1
obj[c4d.EXPLOSIONFX_WINDSPEED] = 0.1
obj[c4d.EXPLOSIONFX_WINDSPEED_RANDOM] = 0.1
obj[c4d.EXPLOSIONFX_WIRBELSPEED] = 0.1
obj[c4d.EXPLOSIONFX_WIRBELSPEED_RANDOM] = 0.1
#Second way, using the base container.
bc = obj.GetDataInstance()
bc.SetFloat(c4d.EXPLOSIONFX_TIME,0.1)
bc.SetFloat(c4d.EXPLOSIONFX_THICKNESS,0.1)
bc.SetFloat(c4d.EXPLOSIONFX_THICKNESS_RANDOM,0.1)
bc.SetFloat(c4d.EXPLOSIONFX_DENSITY,0.1)
bc.SetFloat(c4d.EXPLOSIONFX_DENSITY_RANDOM,0.1)
bc.SetInt32(c4d.EXPLOSIONFX_CLUSTERKIND,c4d.EXPLOSIONFX_CLUSTERKIND_POLYS)
bc.SetString(c4d.EXPLOSIONFX_CLUSTER_NAME,"Hello World")
bc.SetBool(c4d.EXPLOSIONFX_CLUSTERFIX,True)
bc.SetInt32(c4d.EXPLOSIONFX_CLUSTER_MIN_POLYS,1)
bc.SetInt32(c4d.EXPLOSIONFX_CLUSTER_MAX_POLYS,1)
bc.SetBool(c4d.EXPLOSIONFX_DISAPPEAR,True)
bc.SetInt32(c4d.EXPLOSIONFX_DISAPPEARKIND,c4d.EXPLOSIONFX_DISAPPEARKIND_TIME)
bc.SetFloat(c4d.EXPLOSIONFX_DISAPPEAR_START,0.1)
bc.SetFloat(c4d.EXPLOSIONFX_DISAPPEAR_DELAY,0.1)
bc.SetFloat(c4d.EXPLOSIONFX_EXPLOSTRENGTH,0.1)
bc.SetFloat(c4d.EXPLOSIONFX_EXPLOSTRENGTH_FALLOFF,0.1)
bc.SetFloat(c4d.EXPLOSIONFX_EXPLOSTRENGTH_RANDOM,0.1)
bc.SetInt32(c4d.EXPLOSIONFX_EXPLODIRECTION,c4d.EXPLOSIONFX_EXPLODIRECTION_ALL)
bc.SetBool(c4d.EXPLOSIONFX_LINEAR,True)
bc.SetFloat(c4d.EXPLOSIONFX_EXPLODIRECTION_RANDOM,0.1)
bc.SetFloat(c4d.EXPLOSIONFX_EXPLOTIME,0.1)
bc.SetFloat(c4d.EXPLOSIONFX_DSPEED,0.1)
bc.SetFloat(c4d.EXPLOSIONFX_DSPEED_FALLOFF,0.1)
bc.SetFloat(c4d.EXPLOSIONFX_DSPEED_RANDOM,0.1)
bc.SetFloat(c4d.EXPLOSIONFX_DMAX_RANGE,0.1)
bc.SetFloat(c4d.EXPLOSIONFX_DMAX_RANGE_RANDOM,0.1)
bc.SetFloat(c4d.EXPLOSIONFX_GRAVITATION,0.1)
bc.SetFloat(c4d.EXPLOSIONFX_GRAVITATION_RANDOM,0.1)
bc.SetInt32(c4d.EXPLOSIONFX_GDIRECTION,c4d.EXPLOSIONFX_GDIRECTION_NO)
bc.SetFloat(c4d.EXPLOSIONFX_GMAX_RANGE,0.1)
bc.SetFloat(c4d.EXPLOSIONFX_GMAX_RANGE_RANDOM,0.1)
bc.SetFloat(c4d.EXPLOSIONFX_WSPEED,0.1)
bc.SetFloat(c4d.EXPLOSIONFX_WSPEED_FALLOFF,0.1)
bc.SetFloat(c4d.EXPLOSIONFX_WSPEED_RANDOM,0.1)
bc.SetInt32(c4d.EXPLOSIONFX_ROTACHSE,c4d.EXPLOSIONFX_ROTACHSE_C)
bc.SetFloat(c4d.EXPLOSIONFX_ROTACHSE_RANDOM,0.1)
bc.SetFloat(c4d.EXPLOSIONFX_WINDSPEED,0.1)
bc.SetFloat(c4d.EXPLOSIONFX_WINDSPEED_RANDOM,0.1)
bc.SetFloat(c4d.EXPLOSIONFX_WIRBELSPEED,0.1)
bc.SetFloat(c4d.EXPLOSIONFX_WIRBELSPEED_RANDOM,0.1)
if __name__=='__main__':
main()
C++
#include "c4d.h"
#include "../objects/description/oexplosionfx.h"
void SampleFunction()
{
BaseDocument *pDoc = GetActiveDocument();
BaseObject *pObject = BaseObject::Alloc(Oexplosionfx);
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(EXPLOSIONFX_TIME),GeData(0.1),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_THICKNESS),GeData(0.1),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_THICKNESS_RANDOM),GeData(0.1),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_DENSITY),GeData(0.1),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_DENSITY_RANDOM),GeData(0.1),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_CLUSTERKIND),GeData(EXPLOSIONFX_CLUSTERKIND_POLYS),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_CLUSTER_NAME),GeData("Hello World"),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_CLUSTERFIX),GeData(true),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_CLUSTER_MIN_POLYS),GeData(1),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_CLUSTER_MAX_POLYS),GeData(1),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_DISAPPEAR),GeData(true),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_DISAPPEARKIND),GeData(EXPLOSIONFX_DISAPPEARKIND_TIME),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_DISAPPEAR_START),GeData(0.1),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_DISAPPEAR_DELAY),GeData(0.1),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_EXPLOSTRENGTH),GeData(0.1),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_EXPLOSTRENGTH_FALLOFF),GeData(0.1),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_EXPLOSTRENGTH_RANDOM),GeData(0.1),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_EXPLODIRECTION),GeData(EXPLOSIONFX_EXPLODIRECTION_ALL),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_LINEAR),GeData(true),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_EXPLODIRECTION_RANDOM),GeData(0.1),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_EXPLOTIME),GeData(0.1),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_DSPEED),GeData(0.1),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_DSPEED_FALLOFF),GeData(0.1),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_DSPEED_RANDOM),GeData(0.1),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_DMAX_RANGE),GeData(0.1),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_DMAX_RANGE_RANDOM),GeData(0.1),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_GRAVITATION),GeData(0.1),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_GRAVITATION_RANDOM),GeData(0.1),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_GDIRECTION),GeData(EXPLOSIONFX_GDIRECTION_NO),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_GMAX_RANGE),GeData(0.1),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_GMAX_RANGE_RANDOM),GeData(0.1),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_WSPEED),GeData(0.1),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_WSPEED_FALLOFF),GeData(0.1),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_WSPEED_RANDOM),GeData(0.1),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_ROTACHSE),GeData(EXPLOSIONFX_ROTACHSE_C),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_ROTACHSE_RANDOM),GeData(0.1),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_WINDSPEED),GeData(0.1),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_WINDSPEED_RANDOM),GeData(0.1),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_WIRBELSPEED),GeData(0.1),flags);
pObject->SetParameter(DescID(EXPLOSIONFX_WIRBELSPEED_RANDOM),GeData(0.1),flags);
pObject->Message(MSG_UPDATE);
//Second way, using the base container.
BaseContainer *bc = pObject->GetDataInstance();
bc->SetFloat(EXPLOSIONFX_TIME,0.1);
bc->SetFloat(EXPLOSIONFX_THICKNESS,0.1);
bc->SetFloat(EXPLOSIONFX_THICKNESS_RANDOM,0.1);
bc->SetFloat(EXPLOSIONFX_DENSITY,0.1);
bc->SetFloat(EXPLOSIONFX_DENSITY_RANDOM,0.1);
bc->SetInt32(EXPLOSIONFX_CLUSTERKIND,EXPLOSIONFX_CLUSTERKIND_POLYS);
bc->SetString(EXPLOSIONFX_CLUSTER_NAME,"Hello World");
bc->SetBool(EXPLOSIONFX_CLUSTERFIX,true);
bc->SetInt32(EXPLOSIONFX_CLUSTER_MIN_POLYS,1);
bc->SetInt32(EXPLOSIONFX_CLUSTER_MAX_POLYS,1);
bc->SetBool(EXPLOSIONFX_DISAPPEAR,true);
bc->SetInt32(EXPLOSIONFX_DISAPPEARKIND,EXPLOSIONFX_DISAPPEARKIND_TIME);
bc->SetFloat(EXPLOSIONFX_DISAPPEAR_START,0.1);
bc->SetFloat(EXPLOSIONFX_DISAPPEAR_DELAY,0.1);
bc->SetFloat(EXPLOSIONFX_EXPLOSTRENGTH,0.1);
bc->SetFloat(EXPLOSIONFX_EXPLOSTRENGTH_FALLOFF,0.1);
bc->SetFloat(EXPLOSIONFX_EXPLOSTRENGTH_RANDOM,0.1);
bc->SetInt32(EXPLOSIONFX_EXPLODIRECTION,EXPLOSIONFX_EXPLODIRECTION_ALL);
bc->SetBool(EXPLOSIONFX_LINEAR,true);
bc->SetFloat(EXPLOSIONFX_EXPLODIRECTION_RANDOM,0.1);
bc->SetFloat(EXPLOSIONFX_EXPLOTIME,0.1);
bc->SetFloat(EXPLOSIONFX_DSPEED,0.1);
bc->SetFloat(EXPLOSIONFX_DSPEED_FALLOFF,0.1);
bc->SetFloat(EXPLOSIONFX_DSPEED_RANDOM,0.1);
bc->SetFloat(EXPLOSIONFX_DMAX_RANGE,0.1);
bc->SetFloat(EXPLOSIONFX_DMAX_RANGE_RANDOM,0.1);
bc->SetFloat(EXPLOSIONFX_GRAVITATION,0.1);
bc->SetFloat(EXPLOSIONFX_GRAVITATION_RANDOM,0.1);
bc->SetInt32(EXPLOSIONFX_GDIRECTION,EXPLOSIONFX_GDIRECTION_NO);
bc->SetFloat(EXPLOSIONFX_GMAX_RANGE,0.1);
bc->SetFloat(EXPLOSIONFX_GMAX_RANGE_RANDOM,0.1);
bc->SetFloat(EXPLOSIONFX_WSPEED,0.1);
bc->SetFloat(EXPLOSIONFX_WSPEED_FALLOFF,0.1);
bc->SetFloat(EXPLOSIONFX_WSPEED_RANDOM,0.1);
bc->SetInt32(EXPLOSIONFX_ROTACHSE,EXPLOSIONFX_ROTACHSE_C);
bc->SetFloat(EXPLOSIONFX_ROTACHSE_RANDOM,0.1);
bc->SetFloat(EXPLOSIONFX_WINDSPEED,0.1);
bc->SetFloat(EXPLOSIONFX_WINDSPEED_RANDOM,0.1);
bc->SetFloat(EXPLOSIONFX_WIRBELSPEED,0.1);
bc->SetFloat(EXPLOSIONFX_WIRBELSPEED_RANDOM,0.1);
pObject->Message(MSG_UPDATE);
}