Oereeffector
Attributes
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.Oereeffector)
doc.InsertObject(obj)
c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
#You can set parameters two different ways.
#First way
obj[c4d.MGREEFFECTOR_STRENGTH] = 0.1
obj[c4d.MGREEFFECTOR_SELECTION] = "Hello World"
obj[c4d.MGREEFFECTOR_POSITION] = True
obj[c4d.MGREEFFECTOR_POSITION_STRENGTH] = 0.1
obj[c4d.MGREEFFECTOR_POSITION_X] = True
obj[c4d.MGREEFFECTOR_POSITION_STRENGTH_X] = 0.1
obj[c4d.MGREEFFECTOR_POSITION_Y] = True
obj[c4d.MGREEFFECTOR_POSITION_STRENGTH_Y] = 0.1
obj[c4d.MGREEFFECTOR_POSITION_Z] = True
obj[c4d.MGREEFFECTOR_POSITION_STRENGTH_Z] = 0.1
obj[c4d.MGREEFFECTOR_SCALE] = True
obj[c4d.MGREEFFECTOR_SCALE_STRENGTH] = 0.1
obj[c4d.MGREEFFECTOR_SCALE_X] = True
obj[c4d.MGREEFFECTOR_SCALE_STRENGTH_X] = 0.1
obj[c4d.MGREEFFECTOR_SCALE_Y] = True
obj[c4d.MGREEFFECTOR_SCALE_STRENGTH_Y] = 0.1
obj[c4d.MGREEFFECTOR_SCALE_Z] = True
obj[c4d.MGREEFFECTOR_SCALE_STRENGTH_Z] = 0.1
obj[c4d.MGREEFFECTOR_ROTATION] = True
obj[c4d.MGREEFFECTOR_ROTATION_STRENGTH] = 0.1
obj[c4d.MGREEFFECTOR_ROTATION_H] = True
obj[c4d.MGREEFFECTOR_ROTATION_STRENGTH_H] = 0.1
obj[c4d.MGREEFFECTOR_ROTATION_P] = True
obj[c4d.MGREEFFECTOR_ROTATION_STRENGTH_P] = 0.1
obj[c4d.MGREEFFECTOR_ROTATION_B] = True
obj[c4d.MGREEFFECTOR_ROTATION_STRENGTH_B] = 0.1
obj[c4d.MGREEFFECTOR_COLOR] = True
obj[c4d.MGREEFFECTOR_COLOR_STRENGTH] = 0.1
obj[c4d.MGREEFFECTOR_COLOR_R] = True
obj[c4d.MGREEFFECTOR_COLOR_STRENGTH_R] = 0.1
obj[c4d.MGREEFFECTOR_COLOR_G] = True
obj[c4d.MGREEFFECTOR_COLOR_STRENGTH_G] = 0.1
obj[c4d.MGREEFFECTOR_COLOR_B] = True
obj[c4d.MGREEFFECTOR_COLOR_STRENGTH_B] = 0.1
obj[c4d.MGREEFFECTOR_WEIGHT] = True
obj[c4d.MGREEFFECTOR_WEIGHT_STRENGTH] = 0.1
obj[c4d.MGREEFFECTOR_CLONE] = True
obj[c4d.MGREEFFECTOR_CLONE_STRENGTH] = 0.1
obj[c4d.MGREEFFECTOR_TIME] = True
obj[c4d.MGREEFFECTOR_TIME_STRENGTH] = 0.1
obj[c4d.MGREEFFECTOR_U] = True
obj[c4d.MGREEFFECTOR_U_STRENGTH] = 0.1
obj[c4d.MGREEFFECTOR_V] = True
obj[c4d.MGREEFFECTOR_V_STRENGTH] = 0.1
obj[c4d.MGREEFFECTOR_VISIBILITY] = True
obj[c4d.MGREEFFECTOR_VISIBILITY_STRENGTH] = 0.1
#Second way, using the base container.
bc = obj.GetDataInstance()
bc.SetFloat(c4d.MGREEFFECTOR_STRENGTH,0.1)
bc.SetString(c4d.MGREEFFECTOR_SELECTION,"Hello World")
bc.SetBool(c4d.MGREEFFECTOR_POSITION,True)
bc.SetFloat(c4d.MGREEFFECTOR_POSITION_STRENGTH,0.1)
bc.SetBool(c4d.MGREEFFECTOR_POSITION_X,True)
bc.SetFloat(c4d.MGREEFFECTOR_POSITION_STRENGTH_X,0.1)
bc.SetBool(c4d.MGREEFFECTOR_POSITION_Y,True)
bc.SetFloat(c4d.MGREEFFECTOR_POSITION_STRENGTH_Y,0.1)
bc.SetBool(c4d.MGREEFFECTOR_POSITION_Z,True)
bc.SetFloat(c4d.MGREEFFECTOR_POSITION_STRENGTH_Z,0.1)
bc.SetBool(c4d.MGREEFFECTOR_SCALE,True)
bc.SetFloat(c4d.MGREEFFECTOR_SCALE_STRENGTH,0.1)
bc.SetBool(c4d.MGREEFFECTOR_SCALE_X,True)
bc.SetFloat(c4d.MGREEFFECTOR_SCALE_STRENGTH_X,0.1)
bc.SetBool(c4d.MGREEFFECTOR_SCALE_Y,True)
bc.SetFloat(c4d.MGREEFFECTOR_SCALE_STRENGTH_Y,0.1)
bc.SetBool(c4d.MGREEFFECTOR_SCALE_Z,True)
bc.SetFloat(c4d.MGREEFFECTOR_SCALE_STRENGTH_Z,0.1)
bc.SetBool(c4d.MGREEFFECTOR_ROTATION,True)
bc.SetFloat(c4d.MGREEFFECTOR_ROTATION_STRENGTH,0.1)
bc.SetBool(c4d.MGREEFFECTOR_ROTATION_H,True)
bc.SetFloat(c4d.MGREEFFECTOR_ROTATION_STRENGTH_H,0.1)
bc.SetBool(c4d.MGREEFFECTOR_ROTATION_P,True)
bc.SetFloat(c4d.MGREEFFECTOR_ROTATION_STRENGTH_P,0.1)
bc.SetBool(c4d.MGREEFFECTOR_ROTATION_B,True)
bc.SetFloat(c4d.MGREEFFECTOR_ROTATION_STRENGTH_B,0.1)
bc.SetBool(c4d.MGREEFFECTOR_COLOR,True)
bc.SetFloat(c4d.MGREEFFECTOR_COLOR_STRENGTH,0.1)
bc.SetBool(c4d.MGREEFFECTOR_COLOR_R,True)
bc.SetFloat(c4d.MGREEFFECTOR_COLOR_STRENGTH_R,0.1)
bc.SetBool(c4d.MGREEFFECTOR_COLOR_G,True)
bc.SetFloat(c4d.MGREEFFECTOR_COLOR_STRENGTH_G,0.1)
bc.SetBool(c4d.MGREEFFECTOR_COLOR_B,True)
bc.SetFloat(c4d.MGREEFFECTOR_COLOR_STRENGTH_B,0.1)
bc.SetBool(c4d.MGREEFFECTOR_WEIGHT,True)
bc.SetFloat(c4d.MGREEFFECTOR_WEIGHT_STRENGTH,0.1)
bc.SetBool(c4d.MGREEFFECTOR_CLONE,True)
bc.SetFloat(c4d.MGREEFFECTOR_CLONE_STRENGTH,0.1)
bc.SetBool(c4d.MGREEFFECTOR_TIME,True)
bc.SetFloat(c4d.MGREEFFECTOR_TIME_STRENGTH,0.1)
bc.SetBool(c4d.MGREEFFECTOR_U,True)
bc.SetFloat(c4d.MGREEFFECTOR_U_STRENGTH,0.1)
bc.SetBool(c4d.MGREEFFECTOR_V,True)
bc.SetFloat(c4d.MGREEFFECTOR_V_STRENGTH,0.1)
bc.SetBool(c4d.MGREEFFECTOR_VISIBILITY,True)
bc.SetFloat(c4d.MGREEFFECTOR_VISIBILITY_STRENGTH,0.1)
if __name__=='__main__':
main()
C++
#include "c4d.h"
#include "../mograph/description/oereeffector.h"
void SampleFunction()
{
BaseDocument *pDoc = GetActiveDocument();
BaseObject *pObject = BaseObject::Alloc(Oereeffector);
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(MGREEFFECTOR_STRENGTH),GeData(0.1),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_SELECTION),GeData("Hello World"),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_POSITION),GeData(true),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_POSITION_STRENGTH),GeData(0.1),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_POSITION_X),GeData(true),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_POSITION_STRENGTH_X),GeData(0.1),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_POSITION_Y),GeData(true),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_POSITION_STRENGTH_Y),GeData(0.1),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_POSITION_Z),GeData(true),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_POSITION_STRENGTH_Z),GeData(0.1),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_SCALE),GeData(true),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_SCALE_STRENGTH),GeData(0.1),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_SCALE_X),GeData(true),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_SCALE_STRENGTH_X),GeData(0.1),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_SCALE_Y),GeData(true),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_SCALE_STRENGTH_Y),GeData(0.1),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_SCALE_Z),GeData(true),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_SCALE_STRENGTH_Z),GeData(0.1),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_ROTATION),GeData(true),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_ROTATION_STRENGTH),GeData(0.1),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_ROTATION_H),GeData(true),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_ROTATION_STRENGTH_H),GeData(0.1),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_ROTATION_P),GeData(true),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_ROTATION_STRENGTH_P),GeData(0.1),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_ROTATION_B),GeData(true),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_ROTATION_STRENGTH_B),GeData(0.1),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_COLOR),GeData(true),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_COLOR_STRENGTH),GeData(0.1),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_COLOR_R),GeData(true),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_COLOR_STRENGTH_R),GeData(0.1),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_COLOR_G),GeData(true),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_COLOR_STRENGTH_G),GeData(0.1),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_COLOR_B),GeData(true),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_COLOR_STRENGTH_B),GeData(0.1),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_WEIGHT),GeData(true),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_WEIGHT_STRENGTH),GeData(0.1),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_CLONE),GeData(true),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_CLONE_STRENGTH),GeData(0.1),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_TIME),GeData(true),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_TIME_STRENGTH),GeData(0.1),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_U),GeData(true),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_U_STRENGTH),GeData(0.1),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_V),GeData(true),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_V_STRENGTH),GeData(0.1),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_VISIBILITY),GeData(true),flags);
pObject->SetParameter(DescID(MGREEFFECTOR_VISIBILITY_STRENGTH),GeData(0.1),flags);
pObject->Message(MSG_UPDATE);
//Second way, using the base container.
BaseContainer *bc = pObject->GetDataInstance();
bc->SetFloat(MGREEFFECTOR_STRENGTH,0.1);
bc->SetString(MGREEFFECTOR_SELECTION,"Hello World");
bc->SetBool(MGREEFFECTOR_POSITION,true);
bc->SetFloat(MGREEFFECTOR_POSITION_STRENGTH,0.1);
bc->SetBool(MGREEFFECTOR_POSITION_X,true);
bc->SetFloat(MGREEFFECTOR_POSITION_STRENGTH_X,0.1);
bc->SetBool(MGREEFFECTOR_POSITION_Y,true);
bc->SetFloat(MGREEFFECTOR_POSITION_STRENGTH_Y,0.1);
bc->SetBool(MGREEFFECTOR_POSITION_Z,true);
bc->SetFloat(MGREEFFECTOR_POSITION_STRENGTH_Z,0.1);
bc->SetBool(MGREEFFECTOR_SCALE,true);
bc->SetFloat(MGREEFFECTOR_SCALE_STRENGTH,0.1);
bc->SetBool(MGREEFFECTOR_SCALE_X,true);
bc->SetFloat(MGREEFFECTOR_SCALE_STRENGTH_X,0.1);
bc->SetBool(MGREEFFECTOR_SCALE_Y,true);
bc->SetFloat(MGREEFFECTOR_SCALE_STRENGTH_Y,0.1);
bc->SetBool(MGREEFFECTOR_SCALE_Z,true);
bc->SetFloat(MGREEFFECTOR_SCALE_STRENGTH_Z,0.1);
bc->SetBool(MGREEFFECTOR_ROTATION,true);
bc->SetFloat(MGREEFFECTOR_ROTATION_STRENGTH,0.1);
bc->SetBool(MGREEFFECTOR_ROTATION_H,true);
bc->SetFloat(MGREEFFECTOR_ROTATION_STRENGTH_H,0.1);
bc->SetBool(MGREEFFECTOR_ROTATION_P,true);
bc->SetFloat(MGREEFFECTOR_ROTATION_STRENGTH_P,0.1);
bc->SetBool(MGREEFFECTOR_ROTATION_B,true);
bc->SetFloat(MGREEFFECTOR_ROTATION_STRENGTH_B,0.1);
bc->SetBool(MGREEFFECTOR_COLOR,true);
bc->SetFloat(MGREEFFECTOR_COLOR_STRENGTH,0.1);
bc->SetBool(MGREEFFECTOR_COLOR_R,true);
bc->SetFloat(MGREEFFECTOR_COLOR_STRENGTH_R,0.1);
bc->SetBool(MGREEFFECTOR_COLOR_G,true);
bc->SetFloat(MGREEFFECTOR_COLOR_STRENGTH_G,0.1);
bc->SetBool(MGREEFFECTOR_COLOR_B,true);
bc->SetFloat(MGREEFFECTOR_COLOR_STRENGTH_B,0.1);
bc->SetBool(MGREEFFECTOR_WEIGHT,true);
bc->SetFloat(MGREEFFECTOR_WEIGHT_STRENGTH,0.1);
bc->SetBool(MGREEFFECTOR_CLONE,true);
bc->SetFloat(MGREEFFECTOR_CLONE_STRENGTH,0.1);
bc->SetBool(MGREEFFECTOR_TIME,true);
bc->SetFloat(MGREEFFECTOR_TIME_STRENGTH,0.1);
bc->SetBool(MGREEFFECTOR_U,true);
bc->SetFloat(MGREEFFECTOR_U_STRENGTH,0.1);
bc->SetBool(MGREEFFECTOR_V,true);
bc->SetFloat(MGREEFFECTOR_V_STRENGTH,0.1);
bc->SetBool(MGREEFFECTOR_VISIBILITY,true);
bc->SetFloat(MGREEFFECTOR_VISIBILITY_STRENGTH,0.1);
pObject->Message(MSG_UPDATE);
}