#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:
{
INCLUDE toolsculptbrushbase;
}
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.
{
INCLUDE toolsculptbrushbase;
{
COLUMNS 3;
GROUP
{
COLUMNS 3;
{
CYCLE
{
}
}
}
STATICTEXT { JOINENDSCALE; }
STATICTEXT { JOINEND; }
}
}
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:
{
switch (id)
{
return true;
return true;
}
return false;
}
◆ SculptBrushParams()
◆ ~SculptBrushParams()
◆ Alloc()
◆ Free()
Destructs SculptBrushParams objects allocated with Alloc(). Use AutoAlloc to automate the allocation and destruction based on scope.
- Parameters
-
[in,out] | params | The SculptBrushParams object to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards. |
◆ EnableStencil()
void EnableStencil |
( |
Bool |
enable | ) |
|
Enables/disables stencils in the brush.
- Note
- Setting to false frees up some resource and computation time.
Setting to false also removes the tab from the brush interface.
- Parameters
-
[in] | enable | true if the brush uses stencils, false if not. Default is true. |
◆ EnableStamp()
void EnableStamp |
( |
Bool |
enable | ) |
|
Enables/disables stamps in the brush.
- Note
- Setting to false frees up some resource and computation time.
Setting to false also removes the tab from the brush interface.
- Parameters
-
[in] | enable | true if the brush uses stamps, false if not. Default is true. |
◆ EnableInvertCheckbox()
void EnableInvertCheckbox |
( |
Bool |
enable | ) |
|
Enables/disables the Invert checkbox in the brush.
- Note
- By default the invert checkbox is not part of the base .res file so add it manually:
- Parameters
-
[in] | enable | true if the brush uses the Invert checkbox, false if not. Default is false. |
◆ EnableBuildup()
void EnableBuildup |
( |
Bool |
enable | ) |
|
Enables/disables the Buildup slider in the brush.
- Note
- By default the Buildup slider is not part of the base .res file so to add it manually:
{
COLUMNS 3;
STATICTEXT { JOINENDSCALE; }
STATICTEXT { JOINEND; }
}
- Parameters
-
[in] | enable | true if the brush uses the Buildup slider, false if not. Default is false. |
◆ EnableNonModelPickMode()
void EnableNonModelPickMode |
( |
Bool |
enable | ) |
|
◆ EnableFlood()
void EnableFlood |
( |
Bool |
enable | ) |
|
Enables/disables the Flood function in the brush: SculptBrushToolData::FloodSelectedLayer is implemented.
- Note
- By default the Flood button is not part of the base .res file so add it manually:
{
COLUMNS 3;
STATICTEXT { JOINENDSCALE; }
STATICTEXT { JOINEND; }
}
- Parameters
-
◆ EnableMultiThreading()
void EnableMultiThreading |
( |
Bool |
enable | ) |
|
Enables/disables multithreading for the brush. Private.
- Warning
- Never enable multithreading!
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.
- Parameters
-
[in] | enable | true if the brush multithreaded, false if not. Default is false. |
◆ EnableBrushAccess()
void EnableBrushAccess |
( |
Bool |
enable | ) |
|
Enables/disables getting access to the brush via dab->GetBrush().
- Parameters
-
[in] | enable | true if access to the brush is needed, false if not. Default is false. |
◆ EnableToolSpecificSmooth()
void EnableToolSpecificSmooth |
( |
Bool |
enable | ) |
|
Enables/disables the brush own smooth operation that gets used when the Shift key is pressed.
- Note
- Check for this in the
MovePointFunc
method if (GetBrushOverride() & OVERRIDE::SMOOTHTOOL)
is true and then implement the custom smooth method. Otherwise it will use the Smooth Brush for smoothing.
- Parameters
-
[in] | enable | true if the brush handles smoothing, false if not. Default is false. |
◆ EnableModifier()
void EnableModifier |
( |
Bool |
enable | ) |
|
Tells the system that the brush can use modifiers from other brushes (display the Modifiers tab).
- Parameters
-
[in] | enable | true if the brush wants to be able to use modifiers from other brushes. |
◆ EnablePython()
void EnablePython |
( |
Bool |
enable | ) |
|
Enables/disables Python for the brush. Private.
- Warning
- Never enable for a C++ plugin! This is only ever used internally by Python brushes. When enabled it routes the calls to SculptBrushToolData::ApplyPythonDab.
All calls are only ever single threaded with no access to the brush data.
◆ EnableDrawDirection()
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.
- Parameters
-
[in] | enable | true to display the Draw Direction UI options. Disabled by default. |
◆ EnableCustomStamp()
void EnableCustomStamp |
( |
Bool |
enable | ) |
|
Enables/disables call to SculptBrushToolData::GetCustomData to change the stamp before a dab is drawn.
- Note
EnableBrushAccess(true)
must also be set.
- Parameters
-
[in] | enable | true if the brush has a custom stamp, false if not. Default is false. |
◆ EnableRespectSelections()
void EnableRespectSelections |
( |
Bool |
enable | ) |
|
Enables/disables the brush to respect Point and Polygon selections when in Point or Polygon mode respectively.
- Parameters
-
[in] | enable | true if the brush should respect selections, false if not. Default is false. |
◆ EnableFillToolIsolatedPointRemover()
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.
- Parameters
-
[in] | enable | true if the brush should remove isolated points, false if it should keep them. Default is true. |
◆ EnablePressureHUD()
void EnablePressureHUD |
( |
Bool |
enable | ) |
|
Enables/disables displaying the pressure value in the sculpting size/pressure HUD.
- Parameters
-
[in] | enable | true if the brush should display the pressure value, false if not. Default is true. |
◆ EnableMouseData()
void EnableMouseData |
( |
Bool |
enable | ) |
|
Enables/disables the callback for the MouseData method.
- Since
- R17.032
- Parameters
-
[in] | enable | true if you need the MouseData callback, false if not. Default is false. |
◆ EnableBackfaceSculpting()
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.
- Since
- R17.032
- Parameters
-
[in] | enable | true if the brush supports backface sculpting, false if not. Default is false. |
◆ SetFloodType()
Specifies what kind of data the Flood operation will change (points or mask).
- Parameters
-
◆ SetBrushMode()
Specifies the type of brush (grab or normal).
- Parameters
-
◆ SetFirstHitPointType()
Specifies what should happen when the user first clicks on model before dragging.
- Parameters
-
◆ SetUndoType()
Specifies what kind of data the brush changes and stores in the undo system (point or mask).
- Parameters
-
◆ SetPolygonObjectDirtyFlags()
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.
- Since
- R17.032
- Parameters
-
[in] | flags | The dirty flags to check. By default this is set to DIRTYFLAGS::ALL. |
◆ SetMovePointFunc()
A pointer to the static method that is called to modify the SculptObject.
The MovePointFunc
method must be implemented and passed like the following:
{
public:
virtual Int32 GetToolPluginId();
virtual const String GetResourceSymbol();
};
{
return true;
}
- Parameters
-
[in] | surfaceMovePointFunc | The static method to call for each brush dab. |
Definition: lib_sculptbrush.h:929
@ BOOL
Bool Boolean, one DescID.
@ NAME
String Get/Set. The layer name.
#define PLUGINFLAG_TOOL_SCULPTBRUSH
Tool is a sculpt brush.
Definition: c4d_tooldata.h:201
#define C4DMSG_PRIORITY
Called to query plugins about their loading time priority. Answer with SetPluginPriority(),...
Definition: c4d_plugin.h:38
static SculptBrushParams * Alloc()
@ CONTAINER
BaseContainer.
#define C4DPL_INIT_PRIORITY_MODULES
Base priority for modules.
Definition: c4d_plugin.h:55
Definition: c4d_string.h:38
#define SetPluginPriority(data, i)
Definition: c4d_plugin.h:198
The brush data for an individual dab. This is passed into the method defined by the user in SculptBru...
Definition: lib_sculptbrush.h:349
#define PLUGINFLAG_TOOL_NO_OBJECTOUTLINE
Object outlines on selection not supported.
Definition: c4d_tooldata.h:202
maxon::Int32 Int32
Definition: ge_sys_math.h:58
@ HIDE
Layer should be completely ignored from both calculation and GUI display, e.g. the linked object has ...
void SetMovePointFunc(Bool(*surfaceMovePointFunc)(BrushDabData *dab))
#define PLUGINFLAG_HIDEPLUGINMENU
Hide the plugin's menu entry.
Definition: c4d_baseplugin.h:26
Bool PluginMessage(Int32 id, void *data)
maxon::Bool Bool
Definition: ge_sys_math.h:53
GeResource g_resource
Global resources for Cinema 4D.
#define C4DPL_INIT_SYS
Initialize system.
Definition: c4d_plugin.h:28
@ CUSTOMGUI
Custom GUI. (CustomGuiData)