Ovolumefilter
Attributes
-
ENGLISH NAME : VolumeFilter
-
NAME : Ovolumefilter
-
INCLUDE : Obase
-
PATH : volumes/description/ovolumefilter.res
-
PLUGIN : volumes
-
MAXON online help (may not exist): OVOLUMEFILTER
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.Ovolumefilter)
doc.InsertObject(obj)
c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
#You can set parameters two different ways.
#First way
obj[c4d.ID_VOLUMEFILTER_STENGTH] = 0.1
obj[c4d.ID_VOLUMEFILTER_SDF_FILTER_TYPE] = c4d.ID_VOLUMEFILTER_SDF_FILTER_TYPE_SMOOTH
obj[c4d.ID_VOLUMEFILTER_FOG_FILTER_TYPE] = c4d.ID_VOLUMEFILTER_FOG_FILTER_TYPE_SMOOTH
obj[c4d.ID_VOLUMEFILTER_VECTOR_FILTER_TYPE] = c4d.ID_VOLUMEFILTER_VECTOR_FILTER_TYPE_SMOOTH
obj[c4d.ID_VOLUMEFILTER_SDF_SMOOTH_TYPE] = c4d.ID_VOLUMEFILTER_SDF_SMOOTH_TYPE_GAUSSIAN
obj[c4d.ID_VOLUMEFILTER_FOG_SMOOTH_TYPE] = c4d.ID_VOLUMEFILTER_FOG_SMOOTH_TYPE_GAUSSIAN
obj[c4d.ID_VOLUMEFILTER_RESHAPE_ROTATE_AXIS_MODE] = c4d.ID_VOLUMEFILTER_RESHAPE_ROTATE_AXIS_MODE_X
obj[c4d.ID_VOLUMEFILTER_RESHAPE_ROTATE_AXIS] = c4d.Vector(1.0,1.0,1.0)
obj[c4d.ID_VOLUMEFILTER_RESHAPE_ROTATE_ANGLE] = 0.1
obj[c4d.ID_VOLUMEFILTER_SDF_STENCILWIDTH] = 1
obj[c4d.ID_VOLUMEFILTER_SDF_REMAP_OLD_MIN] = 0.1
obj[c4d.ID_VOLUMEFILTER_SDF_REMAP_NEW_MIN] = 0.1
obj[c4d.ID_VOLUMEFILTER_SDF_REMAP_OLD_MAX] = 0.1
obj[c4d.ID_VOLUMEFILTER_SDF_REMAP_NEW_MAX] = 0.1
obj[c4d.ID_VOLUMEFILTER_FOG_INVERT_AUTOAXIS] = True
obj[c4d.ID_VOLUMEFILTER_FOG_INVERT_AXIS] = 0.1
obj[c4d.ID_VOLUMEFILTER_RESHAPE_OFFSET] = 0.1
obj[c4d.ID_VOLUMEFILTER_ITERATIONS] = 1
obj[c4d.ID_VOLUMEFILTER_SDF_FILTERACCURACY] = c4d.ID_VOLUMEFILTER_SDF_FILTERACCURACY_FIRST_BIAS
obj[c4d.ID_VOLUMEFILTER_SDF_RESIZE] = True
obj[c4d.ID_VOLUMEFILTER_SDF_RESIZE_HALFBAND] = 1
obj[c4d.ID_VOLUMEFILTER_RESHAPE_SCALE] = 0.1
obj[c4d.ID_VOLUMEFILTER_FOG_RESHAPE_ADD] = 0.1
obj[c4d.ID_VOLUMEFILTER_FOG_RESHAPE_MULTIPLY] = 0.1
#Second way, using the base container.
bc = obj.GetDataInstance()
bc.SetFloat(c4d.ID_VOLUMEFILTER_STENGTH,0.1)
bc.SetInt32(c4d.ID_VOLUMEFILTER_SDF_FILTER_TYPE,c4d.ID_VOLUMEFILTER_SDF_FILTER_TYPE_SMOOTH)
bc.SetInt32(c4d.ID_VOLUMEFILTER_FOG_FILTER_TYPE,c4d.ID_VOLUMEFILTER_FOG_FILTER_TYPE_SMOOTH)
bc.SetInt32(c4d.ID_VOLUMEFILTER_VECTOR_FILTER_TYPE,c4d.ID_VOLUMEFILTER_VECTOR_FILTER_TYPE_SMOOTH)
bc.SetInt32(c4d.ID_VOLUMEFILTER_SDF_SMOOTH_TYPE,c4d.ID_VOLUMEFILTER_SDF_SMOOTH_TYPE_GAUSSIAN)
bc.SetInt32(c4d.ID_VOLUMEFILTER_FOG_SMOOTH_TYPE,c4d.ID_VOLUMEFILTER_FOG_SMOOTH_TYPE_GAUSSIAN)
bc.SetInt32(c4d.ID_VOLUMEFILTER_RESHAPE_ROTATE_AXIS_MODE,c4d.ID_VOLUMEFILTER_RESHAPE_ROTATE_AXIS_MODE_X)
bc.SetVector(c4d.ID_VOLUMEFILTER_RESHAPE_ROTATE_AXIS, c4d.Vector(1.0,1.0,1.0)
bc.SetFloat(c4d.ID_VOLUMEFILTER_RESHAPE_ROTATE_ANGLE,0.1)
bc.SetInt32(c4d.ID_VOLUMEFILTER_SDF_STENCILWIDTH,1)
bc.SetFloat(c4d.ID_VOLUMEFILTER_SDF_REMAP_OLD_MIN,0.1)
bc.SetFloat(c4d.ID_VOLUMEFILTER_SDF_REMAP_NEW_MIN,0.1)
bc.SetFloat(c4d.ID_VOLUMEFILTER_SDF_REMAP_OLD_MAX,0.1)
bc.SetFloat(c4d.ID_VOLUMEFILTER_SDF_REMAP_NEW_MAX,0.1)
bc.SetBool(c4d.ID_VOLUMEFILTER_FOG_INVERT_AUTOAXIS,True)
bc.SetFloat(c4d.ID_VOLUMEFILTER_FOG_INVERT_AXIS,0.1)
bc.SetFloat(c4d.ID_VOLUMEFILTER_RESHAPE_OFFSET,0.1)
bc.SetInt32(c4d.ID_VOLUMEFILTER_ITERATIONS,1)
bc.SetInt32(c4d.ID_VOLUMEFILTER_SDF_FILTERACCURACY,c4d.ID_VOLUMEFILTER_SDF_FILTERACCURACY_FIRST_BIAS)
bc.SetBool(c4d.ID_VOLUMEFILTER_SDF_RESIZE,True)
bc.SetInt32(c4d.ID_VOLUMEFILTER_SDF_RESIZE_HALFBAND,1)
bc.SetFloat(c4d.ID_VOLUMEFILTER_RESHAPE_SCALE,0.1)
bc.SetFloat(c4d.ID_VOLUMEFILTER_FOG_RESHAPE_ADD,0.1)
bc.SetFloat(c4d.ID_VOLUMEFILTER_FOG_RESHAPE_MULTIPLY,0.1)
if __name__=='__main__':
main()
C++
#include "c4d.h"
#include "../volumes/description/ovolumefilter.h"
void SampleFunction()
{
BaseDocument *pDoc = GetActiveDocument();
BaseObject *pObject = BaseObject::Alloc(Ovolumefilter);
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(ID_VOLUMEFILTER_STENGTH),GeData(0.1),flags);
pObject->SetParameter(DescID(ID_VOLUMEFILTER_SDF_FILTER_TYPE),GeData(ID_VOLUMEFILTER_SDF_FILTER_TYPE_SMOOTH),flags);
pObject->SetParameter(DescID(ID_VOLUMEFILTER_FOG_FILTER_TYPE),GeData(ID_VOLUMEFILTER_FOG_FILTER_TYPE_SMOOTH),flags);
pObject->SetParameter(DescID(ID_VOLUMEFILTER_VECTOR_FILTER_TYPE),GeData(ID_VOLUMEFILTER_VECTOR_FILTER_TYPE_SMOOTH),flags);
pObject->SetParameter(DescID(ID_VOLUMEFILTER_SDF_SMOOTH_TYPE),GeData(ID_VOLUMEFILTER_SDF_SMOOTH_TYPE_GAUSSIAN),flags);
pObject->SetParameter(DescID(ID_VOLUMEFILTER_FOG_SMOOTH_TYPE),GeData(ID_VOLUMEFILTER_FOG_SMOOTH_TYPE_GAUSSIAN),flags);
pObject->SetParameter(DescID(ID_VOLUMEFILTER_RESHAPE_ROTATE_AXIS_MODE),GeData(ID_VOLUMEFILTER_RESHAPE_ROTATE_AXIS_MODE_X),flags);
pObject->SetParameter(DescID(ID_VOLUMEFILTER_RESHAPE_ROTATE_AXIS),GeData(Vector(1.0,1.0,1.0)),flags);
pObject->SetParameter(DescID(ID_VOLUMEFILTER_RESHAPE_ROTATE_ANGLE),GeData(0.1),flags);
pObject->SetParameter(DescID(ID_VOLUMEFILTER_SDF_STENCILWIDTH),GeData(1),flags);
pObject->SetParameter(DescID(ID_VOLUMEFILTER_SDF_REMAP_OLD_MIN),GeData(0.1),flags);
pObject->SetParameter(DescID(ID_VOLUMEFILTER_SDF_REMAP_NEW_MIN),GeData(0.1),flags);
pObject->SetParameter(DescID(ID_VOLUMEFILTER_SDF_REMAP_OLD_MAX),GeData(0.1),flags);
pObject->SetParameter(DescID(ID_VOLUMEFILTER_SDF_REMAP_NEW_MAX),GeData(0.1),flags);
pObject->SetParameter(DescID(ID_VOLUMEFILTER_FOG_INVERT_AUTOAXIS),GeData(true),flags);
pObject->SetParameter(DescID(ID_VOLUMEFILTER_FOG_INVERT_AXIS),GeData(0.1),flags);
pObject->SetParameter(DescID(ID_VOLUMEFILTER_RESHAPE_OFFSET),GeData(0.1),flags);
pObject->SetParameter(DescID(ID_VOLUMEFILTER_ITERATIONS),GeData(1),flags);
pObject->SetParameter(DescID(ID_VOLUMEFILTER_SDF_FILTERACCURACY),GeData(ID_VOLUMEFILTER_SDF_FILTERACCURACY_FIRST_BIAS),flags);
pObject->SetParameter(DescID(ID_VOLUMEFILTER_SDF_RESIZE),GeData(true),flags);
pObject->SetParameter(DescID(ID_VOLUMEFILTER_SDF_RESIZE_HALFBAND),GeData(1),flags);
pObject->SetParameter(DescID(ID_VOLUMEFILTER_RESHAPE_SCALE),GeData(0.1),flags);
pObject->SetParameter(DescID(ID_VOLUMEFILTER_FOG_RESHAPE_ADD),GeData(0.1),flags);
pObject->SetParameter(DescID(ID_VOLUMEFILTER_FOG_RESHAPE_MULTIPLY),GeData(0.1),flags);
pObject->Message(MSG_UPDATE);
//Second way, using the base container.
BaseContainer *bc = pObject->GetDataInstance();
bc->SetFloat(ID_VOLUMEFILTER_STENGTH,0.1);
bc->SetInt32(ID_VOLUMEFILTER_SDF_FILTER_TYPE,ID_VOLUMEFILTER_SDF_FILTER_TYPE_SMOOTH);
bc->SetInt32(ID_VOLUMEFILTER_FOG_FILTER_TYPE,ID_VOLUMEFILTER_FOG_FILTER_TYPE_SMOOTH);
bc->SetInt32(ID_VOLUMEFILTER_VECTOR_FILTER_TYPE,ID_VOLUMEFILTER_VECTOR_FILTER_TYPE_SMOOTH);
bc->SetInt32(ID_VOLUMEFILTER_SDF_SMOOTH_TYPE,ID_VOLUMEFILTER_SDF_SMOOTH_TYPE_GAUSSIAN);
bc->SetInt32(ID_VOLUMEFILTER_FOG_SMOOTH_TYPE,ID_VOLUMEFILTER_FOG_SMOOTH_TYPE_GAUSSIAN);
bc->SetInt32(ID_VOLUMEFILTER_RESHAPE_ROTATE_AXIS_MODE,ID_VOLUMEFILTER_RESHAPE_ROTATE_AXIS_MODE_X);
bc->SetVector(ID_VOLUMEFILTER_RESHAPE_ROTATE_AXIS, c4d.Vector(1.0,1.0,1.0);
bc->SetFloat(ID_VOLUMEFILTER_RESHAPE_ROTATE_ANGLE,0.1);
bc->SetInt32(ID_VOLUMEFILTER_SDF_STENCILWIDTH,1);
bc->SetFloat(ID_VOLUMEFILTER_SDF_REMAP_OLD_MIN,0.1);
bc->SetFloat(ID_VOLUMEFILTER_SDF_REMAP_NEW_MIN,0.1);
bc->SetFloat(ID_VOLUMEFILTER_SDF_REMAP_OLD_MAX,0.1);
bc->SetFloat(ID_VOLUMEFILTER_SDF_REMAP_NEW_MAX,0.1);
bc->SetBool(ID_VOLUMEFILTER_FOG_INVERT_AUTOAXIS,true);
bc->SetFloat(ID_VOLUMEFILTER_FOG_INVERT_AXIS,0.1);
bc->SetFloat(ID_VOLUMEFILTER_RESHAPE_OFFSET,0.1);
bc->SetInt32(ID_VOLUMEFILTER_ITERATIONS,1);
bc->SetInt32(ID_VOLUMEFILTER_SDF_FILTERACCURACY,ID_VOLUMEFILTER_SDF_FILTERACCURACY_FIRST_BIAS);
bc->SetBool(ID_VOLUMEFILTER_SDF_RESIZE,true);
bc->SetInt32(ID_VOLUMEFILTER_SDF_RESIZE_HALFBAND,1);
bc->SetFloat(ID_VOLUMEFILTER_RESHAPE_SCALE,0.1);
bc->SetFloat(ID_VOLUMEFILTER_FOG_RESHAPE_ADD,0.1);
bc->SetFloat(ID_VOLUMEFILTER_FOG_RESHAPE_MULTIPLY,0.1);
pObject->Message(MSG_UPDATE);
}