#include <lib_sculptbrush.h>
The parameters to pass in when registering a sculpt brush.
By default the .res file includes the tabs for Stamps and Stencils and the options for Size, Pressure, Steady Stroke, Spacing and the Draw Modes.
If any of these options are need then hide them in the .res file by adding the following lines to the top of it:
By Default the Draw Modes that are available are Freehand, Line, Lasso Fill, Polygon Fill and Rectangle Fill.
To remove any of these or add more, customize the list. Here is an example below where support is added for all the different modes, including DragDab and DragRect.
Just remove any from this list to suit the brush. By default Freehand is set, so if the Draw Mode is hidden the brush will still work.
Also make sure the priority for any sculpting plugins are set correctly. Sculpt brush plugins need to be loaded after the main sculpting plugin.
To ensure this set the priority in PluginMessage(Int32 id, void *data) as shown below:
Private Member Functions | |
SculptBrushParams () | |
~SculptBrushParams () | |
Alloc/Free | |
static SculptBrushParams * | Alloc () |
static void | Free (SculptBrushParams *¶ms) |
Enable Methods | |
void | EnableStencil (Bool enable) |
void | EnableStamp (Bool enable) |
void | EnableInvertCheckbox (Bool enable) |
void | EnableBuildup (Bool enable) |
void | EnableNonModelPickMode (Bool enable) |
void | EnableFlood (Bool enable) |
void | EnableMultiThreading (Bool enable) |
void | EnableBrushAccess (Bool enable) |
void | EnableToolSpecificSmooth (Bool enable) |
void | EnableModifier (Bool enable) |
void | EnablePython (Bool enable) |
void | EnableDrawDirection (Bool enable) |
void | EnableCustomStamp (Bool enable) |
void | EnableRespectSelections (Bool enable) |
void | EnableFillToolIsolatedPointRemover (Bool enable) |
void | EnablePressureHUD (Bool enable) |
void | EnableMouseData (Bool enable) |
void | EnableBackfaceSculpting (Bool enable) |
Set Methods | |
void | SetFloodType (SCULPTBRUSHDATATYPE type) |
void | SetBrushMode (SCULPTBRUSHMODE mode) |
void | SetFirstHitPointType (FIRSTHITPPOINTTYPE type) |
void | SetUndoType (SCULPTBRUSHDATATYPE type) |
void | SetPolygonObjectDirtyFlags (DIRTYFLAGS flags) |
void | SetMovePointFunc (Bool(*surfaceMovePointFunc)(BrushDabData *dab)) |
|
private |
|
private |
|
static |
Allocates a SculptBrushParams object. Destroy the allocated SculptBrushParams object with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.
|
static |
Destructs SculptBrushParams objects allocated with Alloc(). Use AutoAlloc to automate the allocation and destruction based on scope.
[in,out] | params | The SculptBrushParams object to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards. |
void EnableStencil | ( | Bool | enable | ) |
Enables/disables stencils in the brush.
[in] | enable | true if the brush uses stencils, false if not. Default is true. |
void EnableStamp | ( | Bool | enable | ) |
Enables/disables stamps in the brush.
[in] | enable | true if the brush uses stamps, false if not. Default is true. |
void EnableInvertCheckbox | ( | Bool | enable | ) |
Enables/disables the Invert checkbox in the brush.
[in] | enable | true if the brush uses the Invert checkbox, false if not. Default is false. |
void EnableBuildup | ( | Bool | enable | ) |
Enables/disables the Buildup slider in the brush.
[in] | enable | true if the brush uses the Buildup slider, false if not. Default is false. |
void EnableNonModelPickMode | ( | Bool | enable | ) |
Enables/disables non model pick mode, i.e. the brush do anything if the user clicks-off of a model: SculptBrushToolData::HandleNonModelPickMode and SculptBrushToolData::DrawNonModelPickMode are implemented.
[in] | enable | true if SculptBrushToolData::HandleNonModelPickMode and SculptBrushToolData::DrawNonModelPickMode are implemented, false if not. Default is false. |
void EnableFlood | ( | Bool | enable | ) |
Enables/disables the Flood function in the brush: SculptBrushToolData::FloodSelectedLayer is implemented.
[in] | enable | true if SculptBrushToolData::FloodSelectedLayer is implemented, false if not. Default is false. |
void EnableMultiThreading | ( | Bool | enable | ) |
Enables/disables multithreading for the brush. Private.
Tells the system that the brush can be multithreaded. If true then the dabs are distributed over multiple threads and are drawn in any order.
Any calls to the MovePointFunc
could now be for any stroke instance and could be out of order and from different threads.
[in] | enable | true if the brush multithreaded, false if not. Default is false. |
void EnableBrushAccess | ( | Bool | enable | ) |
Enables/disables getting access to the brush via dab->GetBrush().
[in] | enable | true if access to the brush is needed, false if not. Default is false. |
void EnableToolSpecificSmooth | ( | Bool | enable | ) |
Enables/disables the brush own smooth operation that gets used when the Shift key is pressed.
MovePointFunc
method if (GetBrushOverride() & OVERRIDE::SMOOTHTOOL)
is true and then implement the custom smooth method. Otherwise it will use the Smooth Brush for smoothing. [in] | enable | true if the brush handles smoothing, false if not. Default is false. |
void EnableModifier | ( | Bool | enable | ) |
Tells the system that the brush can use modifiers from other brushes (display the Modifiers tab).
[in] | enable | true if the brush wants to be able to use modifiers from other brushes. |
void EnablePython | ( | Bool | enable | ) |
Enables/disables Python for the brush. Private.
void EnableDrawDirection | ( | Bool | enable | ) |
When enabled the Draw Direction UI will appear in the Settings tab.
Calls can then be made to GetDrawDirectionNormal() to get the direction of the normal based on the currently selected Draw Direction.
[in] | enable | true to display the Draw Direction UI options. Disabled by default. |
void EnableCustomStamp | ( | Bool | enable | ) |
Enables/disables call to SculptBrushToolData::GetCustomData to change the stamp before a dab is drawn.
EnableBrushAccess(true)
must also be set. [in] | enable | true if the brush has a custom stamp, false if not. Default is false. |
void EnableRespectSelections | ( | Bool | enable | ) |
Enables/disables the brush to respect Point and Polygon selections when in Point or Polygon mode respectively.
[in] | enable | true if the brush should respect selections, false if not. Default is false. |
void EnableFillToolIsolatedPointRemover | ( | Bool | enable | ) |
Enables/disables the Fill algorithm to remove any isolated points. That is any points that are selected but have no neighboring selections.
This can happen on high resolution meshes due to the nature of the hit detection against screen space pixels defined by the fill tools.
By setting to false it keeps any isolated points that are selected. This is true by default so isolated points are removed before being sent to the MovePointFunc
function.
[in] | enable | true if the brush should remove isolated points, false if it should keep them. Default is true. |
void EnablePressureHUD | ( | Bool | enable | ) |
Enables/disables displaying the pressure value in the sculpting size/pressure HUD.
[in] | enable | true if the brush should display the pressure value, false if not. Default is true. |
void EnableMouseData | ( | Bool | enable | ) |
Enables/disables the callback for the MouseData method.
[in] | enable | true if you need the MouseData callback, false if not. Default is false. |
void EnableBackfaceSculpting | ( | Bool | enable | ) |
Tells the system that this brush supports backface sculpting and that the Backface option should be displayed in the brushes settings.
[in] | enable | true if the brush supports backface sculpting, false if not. Default is false. |
void SetFloodType | ( | SCULPTBRUSHDATATYPE | type | ) |
Specifies what kind of data the Flood operation will change (points or mask).
[in] | type | The flood data type. Default is SCULPTBRUSHDATATYPE::POINT. |
void SetBrushMode | ( | SCULPTBRUSHMODE | mode | ) |
Specifies the type of brush (grab or normal).
[in] | mode | The brush mode. Default is SCULPTBRUSHMODE::NORMAL. |
void SetFirstHitPointType | ( | FIRSTHITPPOINTTYPE | type | ) |
Specifies what should happen when the user first clicks on model before dragging.
[in] | type | The first hit point type. Default is FIRSTHITPPOINTTYPE::SELECTED. |
void SetUndoType | ( | SCULPTBRUSHDATATYPE | type | ) |
Specifies what kind of data the brush changes and stores in the undo system (point or mask).
[in] | type | The brush data type. Default is SCULPTBRUSHDATATYPE::POINT. |
void SetPolygonObjectDirtyFlags | ( | DIRTYFLAGS | flags | ) |
Sets which flags should be checked to do a rebuild of the collision structure for a PolygonObject.
These flags are used to check against the PolygonObjects dirty flags when a stroke is about to be done on a PolygonObject.
If the flags being checked are dirty since the last check then the collision cache structure for the object will be rebuilt.
This can be used in cases such as the Select Brush where you are not directly moving the points of the model during a stroke.
So you can set all the flags except the DIRTYFLAGS::SELECT (using something like (DIRTYFLAGS::ALL & ~DIRTYFLAGSSELECT) to ensure that the object is not recalculated when just the select flags are changed.
In all other cases the object will be rebuilt.
[in] | flags | The dirty flags to check. By default this is set to DIRTYFLAGS::ALL. |
void SetMovePointFunc | ( | Bool(*)(BrushDabData *dab) | surfaceMovePointFunc | ) |
A pointer to the static method that is called to modify the SculptObject.
The MovePointFunc
method must be implemented and passed like the following:
[in] | surfaceMovePointFunc | The static method to call for each brush dab. |