c4d.modules.sculpting.SculptBrushParams

class c4d.modules.sculpting.SculptBrushParams

The parameters to pass in when registering a Sculpting Brush.

New in version R16.021.

Methods Signatures

SculptBrushParams.EnableStencil(self, enable)

Does the brush use stencils?

SculptBrushParams.EnableStamp(self, enable)

Does the brush use stamps?

SculptBrushParams.EnableInvertCheckbox(self, enable)

Does the brush use the invert checkbox?

SculptBrushParams.EnableBuildup(self, enable)

Does the brush use the buildup slider?

SculptBrushParams.EnableNonModelPickMode(self, enable)

Does the brush do anything if the user clicks off of a model?

SculptBrushParams.EnableFlood(self, enable)

Does the brush have a Flood function?

SculptBrushParams.EnableToolSpecificSmooth(self, enable)

Does the brush have its own smooth operation that gets used when you press the shift key?

SculptBrushParams.EnableModifier(self, enable)

Tells the system that this brush can use modifiers from other brushes (display the modifiers tab).

SculptBrushParams.EnableDrawDirection(self, enable)

When enabled the Draw Direction UI will appear in the settings tab.

SculptBrushParams.EnableRespectSelections(self, enable)

When enabled will tell the brush to respect Point and Polygon selections when in Point or Polygon mode respectively.

SculptBrushParams.EnableFillToolIsolatedPointRemover(self, enable)

When this is enabled it will tell the Fill algorithm to remove any isolated points. That is any points that are selected but have no neighboring selections.

SculptBrushParams.EnablePressureHUD(self, enable)

When enabled will display the pressure value in the sculpting size/pressure HUD.

SculptBrushParams.EnableBackfaceSculpting(self, enable)

Tells the system that this brush supports backface sculpting and that the backface option should be displayed in the brushes settings.

SculptBrushParams.EnableMouseData(self, enable)

Enables/disables the callback for the SculptBrushToolData.MouseData() method.

SculptBrushParams.SetFloodType(self, type)

Specifies what kind of data the flood operation will change (points or mask).

SculptBrushParams.SetBrushMode(self, mode)

Specifies what type of brush this is (grab or normal).

SculptBrushParams.SetFirstHitPointType(self, type)

Specifies what should happen when the user first clicks on model before dragging.

SculptBrushParams.SetUndoType(self, type)

Specifies what kind of data the brush will be changing and storing in the undo system (point or mask).

SculptBrushParams.SetPolygonObjectDirtyFlags(self, type)

Sets which flags should be checked to do a rebuild of the collision structure for a PolygonObject.

Methods Documentation

SculptBrushParams.EnableStencil(self, enable)
Does the brush use stencils?
Settings this to False will let the brush know that you are not going to be using stencils. This will free up some resource and computation time.
Note that setting to False will also remove the tab from the brush interface.
Parameters

enable (bool) –

True if the brush uses stencils, otherwise False.
Default is True.

SculptBrushParams.EnableStamp(self, enable)
Does the brush use stamps?
Setting this to False will let the brush know that you are not going to be using stamps. This will free up some resource and computation time.
Note that setting to False will also remove the tab from the brush interface.
Parameters

enable (bool) – True if the brush uses stamps, otherwise False. Default is True.

SculptBrushParams.EnableInvertCheckbox(self, enable)
Does the brush use the invert checkbox?
Lets the system know if you are using the invert checkbox or not.
Note that by default the invert checkbox is not part of the base .res file so you will need to add it yourself to your own brushes .res file.
To do this just add the following data to your .res file exactly as shown:
GROUP MDATA_SCULPTBRUSH_SETTINGS_GROUP
{
    COLUMNS 3;
    BOOL MDATA_SCULPTBRUSH_SETTINGS_INVERT { }
    STATICTEXT { DUMMY; }
    STATICTEXT { DUMMY; }
}
Parameters

enable (bool) –

True if the brush uses the invert checkbox, otherwise False.
Default is False.

SculptBrushParams.EnableBuildup(self, enable)
Does the brush use the buildup slider?
Lets the system know if you are using the buildup slider or not.
Note that by default the buildup slider is not part of the base .res file so you will need to add it yourself to your own brushes .res file.
To do this just add the following data to your .res file exactly as shown:
GROUP MDATA_SCULPTBRUSH_SETTINGS_GROUP
{
    COLUMNS 3;
    REAL MDATA_SCULPTBRUSH_SETTINGS_BUILDUP { MIN 1; MAX 100; MINSLIDER 1; MAXSLIDER 100; CUSTOMGUI REALSLIDER; FIT_H; SCALE_H; }
    STATICTEXT { JOINENDSCALE; }
    STATICTEXT { JOINEND; }
}
Parameters

enable (bool) –

True if the brush uses the buildup slider, otherwise False.
Default is False.

SculptBrushParams.EnableNonModelPickMode(self, enable)
Does the brush do anything if the user clicks off of a model?
I.e. have you implemented SculptBrushToolData.HandleNonModelPickMode and :meth:`SculptBrushToolData.DrawNonModelPickMode()?
Private.
Parameters

enable (bool) –

Default is False.

SculptBrushParams.EnableFlood(self, enable)
Does the brush have a Flood function?
I.e. have you implemented FloodSelectedLayer.
Note that by default the Flood button is not part of the base .res file so you will need to add it yourself to your own brushes .res file.
To do this just add the following data to your .res file exactly as shown:
GROUP MDATA_SCULPTBRUSH_SETTINGS_GROUP
{
    COLUMNS 3;
    BUTTON MDATA_SCULPTBRUSH_SETTINGS_FLOOD{ }
    STATICTEXT { JOINENDSCALE; }
    STATICTEXT { JOINEND; }
}
Parameters

enable (bool) –

True if the brush has implemented a Flood function, otherwise False.
Default is False.

SculptBrushParams.EnableToolSpecificSmooth(self, enable)
Does the brush have its own smooth operation that gets used when you press the shift key?
You can check for this in the SculptBrushToolData.ApplyDab() method by checking if (GetBrushOverride() & OVERRIDE_SMOOTHTOOL) is True and then you can implement your own smooth method.
Otherwise it will use the Smooth Brush for smoothing.
Parameters

enable (bool) – True if you are handling smoothing yourself, otherwise False. Default is False.

SculptBrushParams.EnableModifier(self, enable)

Tells the system that this brush can use modifiers from other brushes (display the modifiers tab).

Parameters

enable (bool) – Set to True if you want this brush to be able to use modifiers from other brushes.

SculptBrushParams.EnableDrawDirection(self, enable)
When enabled the Draw Direction UI will appear in the settings tab.
Calls can then be made to BrushDabData.GetDrawDirectionNormal() to get the direction of the normal based on the currently selected Draw Direction.
Parameters

enable (bool) – Set to True to display the Draw Direction UI. Disabled by default.

SculptBrushParams.EnableRespectSelections(self, enable)

When enabled will tell the brush to respect Point and Polygon selections when in Point or Polygon mode respectively.

Parameters

enable (bool) –

True if the brush should respect selections, otherwise False.
Default is False.

SculptBrushParams.EnableFillToolIsolatedPointRemover(self, enable)
When this is enabled it will tell 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 this to False it will keep any isolated points that are selected.
This is set to True by default so isolated points are removed before being sent to the SculptBrushToolData.ApplyDab() function.
Parameters

enable (bool) –

True if the brush should remove isolated points, False if it should keep them.
Default is True.

SculptBrushParams.EnablePressureHUD(self, enable)

When enabled will display the pressure value in the sculpting size/pressure HUD.

Parameters

enable (bool) –

True if the brush should dispay the pressure value, otherwise False.
Default is True.

SculptBrushParams.EnableBackfaceSculpting(self, enable)

Tells the system that this brush supports backface sculpting and that the backface option should be displayed in the brushes settings.

New in version R17.032.

Parameters

enable (bool) –

True if the brush supports backface sculpting, otherwise False.
Default is False.

SculptBrushParams.EnableMouseData(self, enable)

Enables/disables the callback for the SculptBrushToolData.MouseData() method.

New in version R17.048.

Parameters

enable (bool) –

True if the brush needs the SculptBrushToolData.MouseData() callback, otherwise False.
Default is True.

SculptBrushParams.SetFloodType(self, type)

Specifies what kind of data the flood operation will change (points or mask).

Parameters

type (int) – The flood data type. Default is SCULPTBRUSHDATATYPE_POINT.

SculptBrushParams.SetBrushMode(self, mode)

Specifies what type of brush this is (grab or normal).

Parameters

mode (int) – The brush mode. Default is SCULPTBRUSHMODE_NORMAL.

SculptBrushParams.SetFirstHitPointType(self, type)

Specifies what should happen when the user first clicks on model before dragging.

Parameters

type (int) – The first hitpoint type. Default is FIRSTHITPPOINTTYPE_SELECTED.

SculptBrushParams.SetUndoType(self, type)

Specifies what kind of data the brush will be changing and storing in the undo system (point or mask).

Parameters

type (int) – The brush data type. Default is SCULPTBRUSHDATATYPE_POINT.

SculptBrushParams.SetPolygonObjectDirtyFlags(self, type)
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 & ~DIRTYFLAGS_SELECT - to ensure that the object is not recalculated when just the select flags are changed.
In all other cases the object will be rebuilt.

New in version R17.032.

Parameters

type (int) –

The dirty flags to check:

DIRTYFLAGS_NONE

None.

DIRTYFLAGS_MATRIX

Matrix changed.

DIRTYFLAGS_DATA

Container changed.

DIRTYFLAGS_SELECT

Checks all valid selections of the object, e.g. points, edge, polys.

DIRTYFLAGS_CACHE

Checks if the cache of an object has been changed (rebuilt).

DIRTYFLAGS_CHILDREN

Checks if the children are dirty.

DIRTYFLAGS_DESCRIPTION

Description changed.

DIRTYFLAGS_SELECTION_OBJECTS

For BaseDocument, object selections have changed.

DIRTYFLAGS_SELECTION_TAGS

For BaseDocument, tag selections have changed.

DIRTYFLAGS_SELECTION_MATERIALS

For BaseDocument, material selections have changed.

DIRTYFLAGS_ALL

Check all dirty flags.