#include <lib_sculptbrush.h>
This interface lets apply the affects of a sculpting modifier to any polygon object.
It allows to use the same algorithms outside of the sculpting system itself and deform a polygon object using the same brush algorithms that the sculpt brushes use.
Public Member Functions | |
Bool | Init (PolygonObject *poly) |
void | Clear () |
BaseContainer | GetDefaultData () |
Int32 | GetModifierCount () |
Bool | GetModifierInfo (Int32 index, Int32 &modifierId, String &name) |
Bool | SetData (const BaseContainer &brushData, const BaseContainer &modifierData) |
Bool | ApplyModifier (Int32 modifierId, Int32 vertex, const BaseContainer &brushData, const BaseContainer &modifierData, Vector *pHitPoint=nullptr, Vector *pLastHitPoint=nullptr, Bool respectSelections=false) |
Static Public Member Functions | |
static SculptModifierInterface * | Alloc () |
static void | Free (SculptModifierInterface *&brush) |
Private Member Functions | |
SculptModifierInterface () | |
~SculptModifierInterface () | |
|
private |
|
private |
|
static |
Allocates a SculptModifierInterface object. Destroy the allocated SculptModifierInterface object with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.
|
static |
Destructs SculptModifierInterface objects allocated with Alloc(). Use AutoAlloc to automate the allocation and destruction based on scope.
[in,out] | brush | The SculptModifierInterface object to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards. |
Bool Init | ( | PolygonObject * | poly | ) |
Initializes the interface to apply modifiers to the given polygon object.
[in] | poly | The polygon object to apply modifiers to. |
void Clear | ( | ) |
Clears the interface. Frees up any internal data that was required to apply modifiers to the initialized polygon object.
BaseContainer GetDefaultData | ( | ) |
Gets the default brush data setting. These settings can be found in toolsculptbrushbase.h
Int32 GetModifierCount | ( | ) |
Gets the number of available modifiers that are currently registered and able to be used.
Gets the information about a modifier given its index.
[in] | index | The index into the list of available modifiers: 0 <= index < GetModifierCount() |
[out] | modifierId | Assigned the plugin ID of the modifier. |
[out] | name | Assigned the name of the modifier. |
Bool SetData | ( | const BaseContainer & | brushData, |
const BaseContainer & | modifierData | ||
) |
Sets the brush data and modifier data for the the next dab to be drawn.
Initializes any time consuming data before making repeated calls to ApplyModifier(). Operations that take time are things such as enabling stamps, changing a stamps texture, calculation of the falloff values etc.
[in] | brushData | The brush data container settings. By default just use what is returned from calling GetDefaultData(). |
[in] | modifierData | The container for the modifier itself. Each modifier is a BaseList2D node and could have its own settings. Refer to each modifiers BM file (BMknife.h as an example). |
Bool ApplyModifier | ( | Int32 | modifierId, |
Int32 | vertex, | ||
const BaseContainer & | brushData, | ||
const BaseContainer & | modifierData, | ||
Vector * | pHitPoint = nullptr , |
||
Vector * | pLastHitPoint = nullptr , |
||
Bool | respectSelections = false |
||
) |
Applies a modifier to the PolygonObject near the specified vertex.
[in] | modifierId | The plugin ID of the modifier to apply. This is retrieved from a call to GetModifierInfo(). |
[in] | vertex | The index of the vertex on the PolygonObject where to apply the modifier to. |
[in] | brushData | The brush data container settings. By default just use what is returned from calling GetDefaultData(); |
[in] | modifierData | The container for the modifier itself. Each modifier is a BaseList2D node and could have its own settings. Refer to each modifiers BM file (BMknife.h as an example). |
[in] | pHitPoint | The exact hit point on the surface of a polygon that is connected to the vertex. |
[in] | pLastHitPoint | The last hit point from the previous call to ApplyModifier(). This is used to determine the direction of the dab for modifiers such as the knife and pinch modifier. |
[in] | respectSelections | true to tell the modifier to respect any Polygon or Point selections on the PolygonObject. |