About
A VoronoiFracture object represents a Voronoi Fracture MoGraph generator. The class provides safe access to the point sources referenced, owned and used by the generator. It is defined in the lib_voronoifracture.h
header file.
if (fractureObject == nullptr)
doc->InsertObject(fractureObject,
nullptr,
nullptr);
if (rigidBodyTag == nullptr)
if (sphere == nullptr)
doc->InsertObject(sphere, fractureObject,
nullptr);
if (pointGenerator == nullptr)
Definition: c4d_baseobject.h:248
static BaseObject * Alloc(Int32 type)
void InsertTag(BaseTag *tp, BaseTag *pred=nullptr)
Definition: c4d_basetag.h:52
static BaseTag * Alloc(Int32 type)
Bool SetParameter(const DescID &id, const GeData &t_data, DESCFLAGS_SET flags)
Bool Message(Int32 type, void *data=nullptr)
Definition: c4d_baselist.h:1582
Definition: lib_voronoifracture.h:26
BaseObject * AddPointGenerator(const Int32 type, const Int32 shaderType=NOTOK, Int32 *const index=nullptr)
static VoronoiFracture * Alloc()
#define NOTOK
Definition: ge_sys_math.h:263
maxon::Int32 Int32
Definition: ge_sys_math.h:56
#define MSG_MENUPREPARE
Allows tags, objects, shaders etc. to do some setup work when called from the menu....
Definition: c4d_baselist.h:404
#define Osphere
Sphere.
Definition: ge_prepass.h:1120
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:67
#define ConstDescID(...)
Definition: lib_description.h:594
@ ID_POINTCREATOR_CREATEDPOINTAMOUNT
Definition: opointcreator_panel.h:25
@ ID_POINTCREATOR_CREATORTYPE_DISTRIBUTION
Definition: opointcreator_panel.h:7
const char * doc
Definition: pyerrors.h:226
Represents a level within a DescID.
Definition: lib_description.h:298
Access
A VoronoiFracture object can be accessed like any other object.
if (
obj !=
nullptr &&
obj->IsInstanceOf(1036557))
{
}
String GetName() const
Definition: c4d_baselist.h:2543
Definition: c4d_string.h:41
static String IntToString(Int32 v)
Definition: c4d_string.h:497
PyObject * obj
Definition: complexobject.h:60
#define ApplicationOutput(formatString,...)
Definition: debugdiagnostics.h:204
Allocation/Deallocation
VoronoiFracture objects are created with the usual tools:
if (activeObject == nullptr)
if (fracture == nullptr)
doc->InsertObject(fracture,
nullptr,
nullptr);
doc->InsertObject(activeObject, fracture,
nullptr);
void Remove()
Definition: c4d_baselist.h:2066
Parameters
The IDs of the standard parameters of a VoronoiFracture object are defined in the omograph_fracturevoronoi.h
header file.
- Note
- The list of point sources must only be edited through the dedicated functions of the VoronoiFracture class (see below).
Sources
Both scene objects and dedicated point generator objects can be used to define the position of Voronoi points inside the mesh volume. The following functions allow to add, remove and edit these point sources. The type ID of point generator objects is Ovoronoipointgenerator.
Access Sources
The VoronoiFracture class provides functions to access the object and generator sources referenced in the "Sources" parameter.
{
}
Py_ssize_t i
Definition: abstract.h:645
BaseObject * GetSource(const Int32 index)
const Py_UNICODE * source
Definition: unicodeobject.h:54
Remove Sources
The VoronoiFracture class also provides functions to safely remove objects and generators from the "Sources" parameter.
{
}
BaseObject * GetSourceByType(const Int32 type, const Int32 startIndex=NOTOK, Int32 *const index=nullptr)
Bool RemoveSource(const Int32 index)
Py_ssize_t * index
Definition: abstract.h:374
#define Ovoronoipointgenerator
Voronoi Fracture internal Point generator.
Definition: ge_prepass.h:1170
Add Sources
Using the VoronoiFracture functions it is safe to add new sources and generators to the "Sources" parameter.
Point generators are represented by dedicated BaseObject elements that are owned by the VoronoiFracture object. To configure such a point generator one can simply edit the parameters of the corresponding BaseObject. The parameter IDs of these parameters are defined in opointcreator_panel.h
.
if (shaderSource == nullptr)
#define Xnoise
Noise.
Definition: ge_prepass.h:1359
@ ID_POINTCREATOR_CREATORTYPE_SHADER
Definition: opointcreator_panel.h:8
@ ID_POINTCREATOR_SHADERSAMPLEAMOUNT
Definition: opointcreator_panel.h:43
The VoronoiFracture object can also use external objects as sources of points:
The IDs for these settings are defined in tfracturevoronoi.h
.
if (cube == nullptr)
doc->InsertObject(cube,
nullptr,
nullptr);
if (settings == nullptr)
Definition: c4d_basecontainer.h:48
void SetInt32(Int32 id, Int32 l)
Definition: c4d_basecontainer.h:587
BaseContainer * GetSourceSettingsContainerForObject(BaseObject *object)
Bool AddSceneObject(BaseObject *object, Int32 *const index=nullptr)
#define Ocube
Cube.
Definition: ge_prepass.h:1119
@ ID_FRACTURETAG_POINTCREATIONTYPE
Definition: tfracturevoronoi.h:15
@ ID_FRACTURETAG_POLYS
Definition: tfracturevoronoi.h:18
Further Reading