#include <lib_sculptbrush.h>
详细描述
A data class for creating sculpt brush plugins.
使用
RegisterToolPlugin()
with
PLUGINFLAG_TOOL_SCULPTBRUSH
to register a sculpt brush plugin.
class
MySculptBrush :
public
SculptBrushToolData
{
public
:
MySculptBrush(
SculptBrushParams
*pParams) :
SculptBrushToolData
(pParams) { }
virtual
Int32
GetToolPluginId
();
// Return the unique ID for the plugin as obtained from www.plugincafe.com
virtual
const
String
GetResourceSymbol
();
// Return the name of for resource file for for brush.
static
Bool
MovePointFunc(
BrushDabData
*dab);
// This is the static implementation for the MovePointFunc
};
Bool
RegisterMyBrush()
{
SculptBrushParams
*pParams =
SculptBrushParams::Alloc
();
return
RegisterToolPlugin
(MY_BRUSH_ID,
"BrushName"
,
PLUGINFLAG_HIDEPLUGINMENU
|
PLUGINFLAG_TOOL_SCULPTBRUSH
|
PLUGINFLAG_TOOL_NO_OBJECTOUTLINE
,
nullptr
,
"MyBrushHelpText"
, NewObjClear(MySculptBrush, pParams));
}
ToolData/DescriptionToolData Overrides
|
virtual
Bool
|
InitTool
(
BaseDocument
*doc,
BaseContainer
&data,
BaseThread
*bt)
|
virtual void
|
FreeTool
(
BaseDocument
*doc,
BaseContainer
&data)
|
virtual void
|
InitDefaultSettings
(
BaseDocument
*doc,
BaseContainer
&data)
|
virtual
Bool
|
GetDEnabling
(
BaseDocument
*doc,
BaseContainer
&data, const
DescID
&id, const
GeData
&t_data,
DESCFLAGS_ENABLE
flags, const
BaseContainer
*itemdesc)
|
virtual
Bool
|
SetDParameter
(
BaseDocument
*doc,
BaseContainer
&data, const
DescID
&id, const
GeData
&t_data,
DESCFLAGS_SET
&flags)
|
virtual
Bool
|
GetDDescription
(
BaseDocument
*doc,
BaseContainer
&data,
描述
*description,
DESCFLAGS_DESC
&flags)
|
virtual
Bool
|
消息
(
BaseDocument
*doc,
BaseContainer
&data,
Int32
type, void *t_data)
|
virtual
Bool
|
TranslateDescID
(
BaseDocument
*doc,
BaseContainer
&data, const
DescID
&id,
DescID
&res_id,
C4DAtom
*&res_at)
|
virtual
Bool
|
GetCursorInfo
(
BaseDocument
*doc,
BaseContainer
&data,
BaseDraw
*bd,
Float
x,
Float
y,
BaseContainer
&bc)
|
virtual
Bool
|
MouseInput
(
BaseDocument
*doc,
BaseContainer
&data,
BaseDraw
*bd,
EditorWindow
*win, const
BaseContainer
&msg)
|
virtual
Bool
|
KeyboardInput
(
BaseDocument
*doc,
BaseContainer
&data,
BaseDraw
*bd,
EditorWindow
*win, const
BaseContainer
&msg)
|
virtual
TOOLDRAW
|
Draw
(
BaseDocument
*doc,
BaseContainer
&data,
BaseDraw
*bd,
BaseDrawHelp
*bh,
BaseThread
*bt,
TOOLDRAWFLAGS
flags)
|
virtual
Bool
|
GetDParameter
(
BaseDocument
*doc,
BaseContainer
&data, const
DescID
&id,
GeData
&t_data,
DESCFLAGS_GET
&flags)
|
virtual
Bool
|
DisplayControl
(
BaseDocument
*doc,
BaseObject
*op,
BaseObject
*chainstart,
BaseDraw
*bd,
BaseDrawHelp
*bh,
ControlDisplayStruct
&cds) const
|
virtual
Bool
|
InitDisplayControl
(
BaseDocument
*doc,
BaseContainer
&data,
BaseDraw
*bd, const
AtomArray
*active)
|
virtual void
|
FreeDisplayControl
(void)
|
virtual
Int32
|
GetState
(
BaseDocument
*doc)
|
Brushes Methods to Override
|
virtual void
|
StartStroke
(
Int32
strokeCount, const
BaseContainer
&data)
|
virtual void
|
StartStrokeInstance
(
Int32
strokeInstanceID)
|
virtual void
|
StartSymmetry
()
|
virtual void
|
StartStrokeInstanceDabs
(
Int32
strokeInstanceID)
|
virtual void
|
StartDab
(
Int32
strokeInstanceID)
|
virtual void
|
EndDab
(
Int32
strokeInstanceID)
|
virtual void
|
EndStrokeInstanceDabs
(
Int32
strokeInstanceID)
|
virtual void
|
EndSymmetry
()
|
virtual void
|
EndStrokeInstance
(
Int32
strokeInstanceID)
|
virtual void
|
EndStroke
()
|
virtual void
|
MouseData
(
Int32
strokeInstanceID, const
BaseContainer
&brushData, const
SculptMouseData
&md)
|
virtual void
|
OverwriteLoadedPresetSettings
(
BaseContainer
&data)
|
virtual void
|
PostInitDefaultSettings
(
BaseDocument
*doc,
BaseContainer
&data)
|
virtual
Bool
|
GetEnabling
(
Int32
id)
|
virtual
Bool
|
HandleFillTool
(
BaseDocument
*doc,
BaseContainer
&data,
BaseDraw
*bd,
EditorWindow
*win, const
BaseContainer
&msg)
|
virtual
Bool
|
HandleNonModelPickMode
(
BaseDocument
*doc,
BaseContainer
&data,
BaseDraw
*bd,
EditorWindow
*win, const
BaseContainer
&msg)
|
virtual
Bool
|
DrawNonModelPickMode
(
BaseDocument
*doc,
BaseContainer
&data,
BaseDraw
*bd,
BaseDrawHelp
*bh,
BaseThread
*bt,
TOOLDRAWFLAGS
flags)
|
virtual void
|
FloodSelectedLayer
(
SculptObject
*pSculpt,
SculptLayer
*pLayer, const
BaseContainer
&brushData,
Int32
function,
Bool
preview,
Float
*customStrength=nullptr, const
Vector32
*pVertexNormals=nullptr)
|
virtual void
|
FloodSelectedLayerWithChannel
(
SculptObject
*pSculpt,
SculptLayer
*pLayer, const
BaseContainer
&brushData,
Int32
function,
BaseChannel
*pChannel,
Bool
preview,
Float
*customStrength=nullptr, const
Vector32
*pVertexNormals=nullptr)
|
virtual void
|
FloodSelectedLayerWithBitmap
(
SculptObject
*pSculpt,
SculptLayer
*pLayer, const
BaseContainer
&brushData,
Int32
function,
BaseBitmap
*pBitmap,
Bool
preview,
Float
*customStrength=nullptr, const
Vector32
*pVertexNormals=nullptr)
|
virtual
Bool
|
HasDrawMode
(
Int32
mode)
|
Bool
|
Flood
(
BaseDocument
*doc,
BaseDraw
*bd, const
BaseContainer
&brushData,
Int32
button=
MDATA_SCULPTBRUSH_SETTINGS_FLOOD
)
|
Bool
|
FloodWithChannel
(
BaseDocument
*doc,
BaseDraw
*bd, const
BaseContainer
&brushData,
BaseChannel
*pChannel,
Int32
button=
MDATA_SCULPTBRUSH_SETTINGS_FLOOD
)
|
Bool
|
FloodWithBitmap
(
BaseDocument
*doc,
BaseDraw
*bd, const
BaseContainer
&brushData,
BaseBitmap
*pBitmap,
Int32
button=
MDATA_SCULPTBRUSH_SETTINGS_FLOOD
)
|
virtual
Bool
|
ApplyPythonDab
(
BrushDabData
*dab)
|
virtual
Bool
|
GetCustomData
(
Int32
strokeInstanceID,
SculptCustomData
*pCustom)
|
virtual void
|
UpdateSettingsAfterPresetLoad
(
BaseContainer
*data)
|
virtual void
|
UpdateStencilAfterPresetLoad
(
BaseContainer
*data)
|
构造函数 & 析构函数文档编制
◆
SculptBrushToolData()
Constructor.
◆
~SculptBrushToolData()
Destructor.
成员函数文档编制
◆
InitTool()
If this method is overridden then make sure to call directly
SculptBrushToolData::InitTool(doc, data, bt)
at the start and check that it returns
true
.
Reimplemented from
DescriptionToolData
.
◆
FreeTool()
If this method is overridden then make sure to call
SculptBrushToolData::FreeTool(doc, data)
at the end.
Reimplemented from
DescriptionToolData
.
◆
InitDefaultSettings()
If this method is overridden then make sure to call directly
SculptBrushToolData::InitDefaultSettings(doc, data)
at the start.
Reimplemented from
DescriptionToolData
.
◆
GetDEnabling()
If this method is overridden then make sure to call
SculptBrushToolData::GetDEnabling(doc, data, id, t_data, flags, itemdesc)
at the end.
Reimplemented from
DescriptionToolData
.
◆
SetDParameter()
If this method is overridden then make sure to call directly
SculptBrushToolData::SetDParameter(doc, data, id, t_data, flags)
at the start.
Reimplemented from
ToolData
.
◆
GetDDescription()
If this method is overridden then make sure to call directly
SculptBrushToolData::GetDDescription(doc, data, description, flags)
at the start.
Reimplemented from
DescriptionToolData
.
◆
Message()
If this method is overridden then make sure to call
SculptBrushToolData::Message(doc, data, type, t_data)
at the end.
Reimplemented from
DescriptionToolData
.
◆
TranslateDescID()
If this method is overridden then make sure to call directly
SculptBrushToolData::TranslateDescID(doc, data, type, t_data)
at the start and return if it is
true
.
Reimplemented from
DescriptionToolData
.
◆
GetCursorInfo()
If this method is overridden then make sure to call
SculptBrushToolData::GetCursorInfo(doc, data, x, y, bc)
at the end.
Reimplemented from
ToolData
.
◆
MouseInput()
If this method is overridden then make sure to call directly
SculptBrushToolData::MouseInput(doc, data, bd, win, msg)
at the end.
Reimplemented from
ToolData
.
◆
KeyboardInput()
If this method is overridden then make sure to call
SculptBrushToolData::KeyboardInput(doc, data, bd, win, msg)
at the end.
Reimplemented from
ToolData
.
◆
Draw()
If this method is overridden then make sure to call
SculptBrushToolData::Draw(doc, data, bd, bh, bt, flags)
at the end.
Reimplemented from
ToolData
.
◆
GetDParameter()
If this method is overridden then make sure to call
SculptBrushToolData::GetDParameter(doc, data, id, t_data, flags)
at the end.
Reimplemented from
ToolData
.
◆
DisplayControl()
If this method is overridden then make sure to call
SculptBrushToolData::DisplayControl(doc, op, chainstart, bd, bh, cds)
at the end.
Reimplemented from
ToolData
.
◆
InitDisplayControl()
If this method is overridden then make sure to call
SculptBrushToolData::InitDisplayControl(doc, data, bd, active)
at the end.
Reimplemented from
ToolData
.
◆
FreeDisplayControl()
virtual void FreeDisplayControl
|
(
|
void
|
|
)
|
|
|
virtual
|
If this method is overridden then make sure to call
SculptBrushToolData::FreeDisplayControl()
at the end.
Reimplemented from
ToolData
.
◆
GetState()
Indicates if the brush is active or not (grayed out in the interface).
If this method is overridden then make sure to call
SculptBrushToolData::GetState(doc)
at the end.
Reimplemented from
ToolData
.
◆
StartStroke()
Called once at the start of the stroke.
It passes the total number of instances of the brush that is to be drawn. The number of instances will change depending on the symmetry mirroring and radial settings.
Use this method to setup any data on the brush that might be accessed from within the
MovePointFunc
method via the
dab->GetBrush()
方法。
-
注意
-
This method will only be called if
SculptBrushParams::EnableBrushAccess
(
true
) has been set.
Calling order for brush stroke virtual methods:
-
StartStroke()
: Called once at the start of the stroke
-
StartStrokeInstance()
: Called for each instance of a stroke. Use this to initialize any data needed for the duration of the entire brush stroke.
-
StartSymmetry()
: Called once before all the instances are about to be drawn for a small mouse movement. This will be called
many
times during a stroke as the mouse moves over the model.
-
StartStrokeInstanceDabs()
: Called once before a bunch of consecutive dabs will be draw for a single instance (mirrored brush).
-
StartDab()
: Called for each dab that needs to be drawn between
2
mouse locations on the object for a single brush stroke instance
-
The static method
MovePointFunc
gets called to process the dab.
-
EndDab()
-
EndStrokeInstanceDabs()
-
EndSymmetry()
: Called once when all symmetrical strokes have finished.
-
EndStrokeInstance()
: Called for each instance of a stroke that was used.
-
EndStroke()
When multithreading is enabled for the brush then this method can be used to allocate data for each stroke instance.
Each instance or dab can then safely read from this data during a brush stroke. This will only be done once at mouse down.
-
参数
-
[in]
|
strokeCount
|
Number of instances of the brush that will be drawn.
|
[in]
|
data
|
The
BaseContainer
data for the brush.
|
◆
StartStrokeInstance()
virtual void StartStrokeInstance
|
(
|
Int32
|
strokeInstanceID
|
)
|
|
|
virtual
|
Called after
StartStroke()
. This is called once for each brush instance at the start of a stroke. The number of instances changes depending on the symmetry mirroring and radial settings.
Use this method to allocate any data accessed during a brush stroke, that may be specific for each individual instance.
Setup also any data on the brush that might be accessed from within the
MovePointFunc
method via the
dab->GetBrush()
方法。
When multithreading is enabled for the brush then this method can be used to initialize data for each stroke instance. This will only be done once at mouse down.
-
注意
-
This method will only be called if
SculptBrushParams::EnableBrushAccess
(
true
) has been set.
-
参数
-
[in]
|
strokeInstanceID
|
The ID of the brush instance being drawn.
|
◆
StartSymmetry()
virtual void StartSymmetry
|
(
|
|
)
|
|
|
virtual
|
Called directly before each individual brush instance is about to be handled.
Between
StartSymmetry()
and
EndSymmetry()
all the dabs for each instance are drawn from one mouse location on the surface of the model to another.
This method will be called every time the user moves the mouse over the object on the screen to indicate that a new batch of dabs is going to be drawn.
Use this method to setup any data on the brush that might be accessed from within the
MovePointFunc
method via the
dab->GetBrush()
方法。
When multithreading is enabled for the brush then this method can be used to reset any data required for each instance.
Between
StartSymmetry()
and
EndSymmetry()
the dabs could now be drawn out or order by different threads so no data should be allocated or changed between these
2
calls.
-
注意
-
This method will only be called if
SculptBrushParams::EnableBrushAccess
(
true
) has been set.
◆
StartStrokeInstanceDabs()
virtual void StartStrokeInstanceDabs
|
(
|
Int32
|
strokeInstanceID
|
)
|
|
|
virtual
|
Called before all the dabs for a single instance are about to be drawn.
After this call all the dabs for just one instance of the brush on the surface will interpolate between the
2
mouse locations on the object then draw all the dabs for that instance.
Use this method to setup any data on the brush that might be accessed from within the
MovePointFunc
method via the
dab->GetBrush()
方法。
When multithreading is enabled no data should be changed on the brush.
-
注意
-
This method will only be called if
SculptBrushParams::EnableBrushAccess
(
true
) has been set.
-
参数
-
[in]
|
strokeInstanceID
|
The ID of the brush instance being drawn.
|
◆
StartDab()
virtual void StartDab
|
(
|
Int32
|
strokeInstanceID
|
)
|
|
|
virtual
|
Called before the
MovePointFunc
method is called which will then process the dab.
Use this method to setup any data on the brush that might be accessed from within the
MovePointFunc
method via the
dab->GetBrush()
方法。
When multithreading is enabled no data should be changed on the brush.
-
注意
-
This method will only be called if
SculptBrushParams::EnableBrushAccess
(
true
) has been set.
-
参数
-
[in]
|
strokeInstanceID
|
The ID of the brush instance being drawn.
|
◆
EndDab()
virtual void EndDab
|
(
|
Int32
|
strokeInstanceID
|
)
|
|
|
virtual
|
Called after the
MovePointFunc
method is called.
-
注意
-
This method will only be called if
SculptBrushParams::EnableBrushAccess
(
true
) has been set.
-
参数
-
[in]
|
strokeInstanceID
|
The ID of the brush instance being drawn.
|
◆
EndStrokeInstanceDabs()
virtual void EndStrokeInstanceDabs
|
(
|
Int32
|
strokeInstanceID
|
)
|
|
|
virtual
|
Called after all the dabs have been drawn for a single instance of the brush.
-
注意
-
This method will only be called if
SculptBrushParams::EnableBrushAccess
(
true
) has been set.
-
参数
-
[in]
|
strokeInstanceID
|
The ID of the brush instance being drawn.
|
◆
EndSymmetry()
virtual void EndSymmetry
|
(
|
|
)
|
|
|
virtual
|
Called after all the dabs for all the instances have been drawn for a single mouse movement on screen.
If multithreading is enabled then reset any data for each instance from this method and be ready for the next set of dabs.
-
注意
-
This method will only be called if
SculptBrushParams::EnableBrushAccess
(
true
) has been set.
◆
EndStrokeInstance()
virtual void EndStrokeInstance
|
(
|
Int32
|
strokeInstanceID
|
)
|
|
|
virtual
|
Called on mouse up after a brush stroke. This method is called once for each instance.
Use this method to delete any temporary data that was allocated in the
StartStrokeInstance()
方法。
If multithreading is enabled then reset any data allocated for each brush instance from within this method.
-
注意
-
This method will only be called if
SculptBrushParams::EnableBrushAccess
(
true
) has been set.
-
参数
-
[in]
|
strokeInstanceID
|
The ID of the brush instance being drawn.
|
◆
EndStroke()
virtual void EndStroke
|
(
|
|
)
|
|
|
virtual
|
Called on mouse up after
EndStrokeInstance()
has been called for each instance.
If multithreading was enabled then free any data allocated for each brush instance.
-
注意
-
This method will only be called if
SculptBrushParams::EnableBrushAccess
(
true
) has been set.
◆
MouseData()
Constantly receives data about the object underneath the mouse. This method will get called when you move the cursor over an object on screen and happens when the mouse button is up or down.
-
注意
-
This method will only be called if
SculptBrushParams::EnableMouseData
(
true
) has been set.
-
由于
-
R17.032
-
参数
-
[in]
|
strokeInstanceID
|
The ID of the brush instance.
|
[in]
|
brushData
|
The
BaseContainer
data for the brush.
|
[in]
|
md
|
The
SculptMouseData
for the current position of the mouse on the surface of the object.
|
◆
OverwriteLoadedPresetSettings()
virtual void OverwriteLoadedPresetSettings
|
(
|
BaseContainer
&
|
data
|
)
|
|
|
virtual
|
Called after a preset has been loaded to allow the brush to disable or change any of the loaded settings if required.
-
参数
-
[in]
|
data
|
The container with the settings for the loaded brush.
|
◆
PostInitDefaultSettings()
Called after a brush is reset by the user (and set back to its defaults) to overwrite any of the standard brush settings.
-
参数
-
◆
GetEnabling()
Called by the sculpting system to check if a feature is enabled or not. It is similar to
GetDEnabling()
.
If this method is overridden then make sure to also check the return value of the base method by calling
SculptBrushToolData::GetEnabling(id)
at the end.
-
参数
-
[in]
|
id
|
The id of the UI element from the .res file.
|
◆
HandleFillTool()
Private
.
-
参数
-
[in]
|
doc
|
The current document.
|
[in]
|
data
|
The
BaseContainer
for the brush data.
|
[in]
|
bd
|
The
BaseDraw
the tool is being used in.
|
[in]
|
win
|
The Window the tool is being used in.
|
[in]
|
msg
|
The mouse/tablet message data.
|
-
返回
-
true
if successful, otherwise
false
.
◆
HandleNonModelPickMode()
Private
. Called to do something special when the first mouse click is not on the model.
-
参数
-
[in]
|
doc
|
The current document.
|
[in]
|
data
|
The
BaseContainer
for the brush data.
|
[in]
|
bd
|
The
BaseDraw
the tool is being used in.
|
[in]
|
win
|
The Window the tool is being used in.
|
[in]
|
msg
|
The mouse/tablet message data.
|
-
返回
-
true
if if handled, otherwise
false
.
In the case to only handle the mouse click and not the mouse drag, return
false
.
◆
DrawNonModelPickMode()
Private
.
-
参数
-
[in]
|
doc
|
The current document.
|
[in]
|
data
|
The
BaseContainer
for the brush data.
|
[in]
|
bd
|
The
BaseDraw
the tool is being used in.
|
[in]
|
bh
|
The
BaseDrawHelp
.
|
[in]
|
bt
|
The thread this method is being called from.
|
[in]
|
flags
|
The flags for this call.
|
-
返回
-
true
if successful, otherwise
false
.
◆
FloodSelectedLayer()
Called to allow flooding of the entire layer with a specific operation.
This method gets called by the default Flood button, which has the function id MDATA_SCULPTBRUSH_SETTINGS_FLOOD.
This is also called when the Interactive Flood slider is used. Add this slider to the brush by adding the same UI as the Inflate brush has (
toolsculptbrushinflate.res
).
设置
SculptBrushParams::SetFloodType()
defines what data is affected by the flood. This can be either
SCULPTBRUSHDATATYPE::POINT
or
SCULPTBRUSHDATATYPE::MASK
. Setting
SculptBrushParams::EnableFlood()
to
true
indicates that this method is available to be used, the Flood button will then be active in the UI.
-
参数
-
[in]
|
pSculpt
|
The
SculptObject
.
|
[in]
|
pLayer
|
The layer to flood.
|
[in]
|
brushData
|
The brushes
BaseContainer
data.
|
[in]
|
function
|
The ID of the function to apply. The default Flood button has the ID
MDATA_SCULPTBRUSH_SETTINGS_FLOOD
.
|
[in]
|
preview
|
true
when the flooding is part of an interactive process, e.g. when the user is moving a slider such as the Interactive Inflate option.
|
[in]
|
customStrength
|
If not
nullptr
then this contains a special strength value that should be used instead of the one from the brushData. This strength is used for interactive flooding along with the preview option.
|
[in]
|
pVertexNormals
|
If not
nullptr
then this contains the vertex normals on the current object. These can be used for interactive flooding along with the preview option.
|
◆
FloodSelectedLayerWithChannel()
Called to allow flooding of the entire layer, using a material channel, with a specific operation.
This method is called if the method
FloodWithChannel()
is invoked by the brush.
This is also called when the Interactive Flood slider is used. Add this slider to the brush by adding the same UI as the Inflate brush has (
toolsculptbrushinflate.res
).
设置
SculptBrushParams::SetFloodType()
will define what data is being affected by the flood. This can be either
SCULPTBRUSHDATATYPE::POINT
or
SCULPTBRUSHDATATYPE::MASK
. Setting
SculptBrushParams::EnableFlood()
to
true
indicates that this method is available to be used, the Flood button will then be active in the UI.
-
参数
-
[in]
|
pSculpt
|
The
SculptObject
.
|
[in]
|
pLayer
|
The layer to flood.
|
[in]
|
brushData
|
The brushes
BaseContainer
data.
|
[in]
|
function
|
The ID of the function to apply. The default Flood button has the ID
MDATA_SCULPTBRUSH_SETTINGS_FLOOD
.
|
[in]
|
pChannel
|
The
BaseChannel
to use when flooding.
|
[in]
|
preview
|
true
when the Flooding is part of an interactive process, e.g. when the user is moving a slider such as the Interactive Inflate option.
|
[in]
|
customStrength
|
If not
nullptr
then this contains a special strength value that should be used instead of the one from the brushData. This strength is used for interactive flooding along with the preview option.
|
[in]
|
pVertexNormals
|
If not
nullptr
then this contains the vertex normals on the current object. These can be used for interactive flooding along with the preview option.
|
◆
FloodSelectedLayerWithBitmap()
Called to allow flooding of the entire layer, using a bitmap, with a specific operation.
This method is called if the method
FloodWithBitmap()
is called by the brush.
This is also called when the Interactive Flood slider is used. Add this slider to the brush by adding the same UI as the Inflate brush has (
toolsculptbrushinflate.res
).
设置
SculptBrushParams::SetFloodType()
will define what data is being affected by the flood. This can be either
SCULPTBRUSHDATATYPE::POINT
or
SCULPTBRUSHDATATYPE::MASK
.
设置
SculptBrushParams::EnableFlood()
to
true
indicates that this method is available to be used, the Flood button will then be active in the UI.
-
参数
-
[in]
|
pSculpt
|
The
SculptObject
.
|
[in]
|
pLayer
|
The layer to flood.
|
[in]
|
brushData
|
The brushes
BaseContainer
data.
|
[in]
|
function
|
The ID of the function to apply. The default Flood button has the ID
MDATA_SCULPTBRUSH_SETTINGS_FLOOD
.
|
[in]
|
pBitmap
|
The
BaseBitmap
to use when flooding.
|
[in]
|
preview
|
true
when the Flooding is part of an interactive process, e.g. when the user is moving a slider such as the Interactive Inflate option.
|
[in]
|
customStrength
|
If not
nullptr
then this contains a special strength value that should be used instead of the one from the brushData. This strength is used for interactive flooding along with the preview option.
|
[in]
|
pVertexNormals
|
If not
nullptr
then this contains the vertex normals on the current object. These can be used for interactive flooding along with the preview option.
|
◆
HasDrawMode()
Called to let the system know what draw modes the brush supports.
The system will call this method to check if a draw mode is supported by the brush.
If the brush supports all the draw modes then it can just return
true
.
Otherwise specify which draw modes should be enabled by checking each of them.
-
参数
-
-
返回
-
true
if the Draw Mode is supported, otherwise
false
.
◆
Flood()
Floods the entire layer by calling virtual method
FloodSelectedLayer()
.
If the brush has different flooding methods (like blur, erase, sharpen etc.) then pass in a different flag for the
button
id.
FloodSelectedLayer()
is then called with this setting passed as the
function
参数。
-
注意
-
By default the button is set to the
MDATA_SCULPTBRUSH_SETTINGS_FLOOD
which is the standard Flood button that the brushes have.
If a different button is used then this method should be called from
Message()
when a button is pushed in the interface.
-
参数
-
[in]
|
doc
|
The current document.
|
[in]
|
bd
|
The viewport that should be used. Usually
doc->GetActiveBaseDraw()
.
|
[in]
|
brushData
|
The tools data container.
|
[in]
|
button
|
The ID of the button in the UI to use as the function parameter in the subsequent call to
FloodSelectedLayer()
.
|
-
返回
-
true
if successful, otherwise
false
.
◆
FloodWithChannel()
Floods the entire layer by calling virtual method
FloodSelectedLayerWithChannel()
.
If the brush has different flooding methods (like blur, erase, sharpen etc.) then pass in a different flag for the
button
id.
FloodSelectedLayerWithChannel is then called with this setting passed as the
function
参数。
-
注意
-
By default the button is set to the
MDATA_SCULPTBRUSH_SETTINGS_FLOOD
which is the standard Flood button that the brushes have.
If a different button is used then this method should be called from
Message()
when a button is pushed in the interface.
-
参数
-
[in]
|
doc
|
The current document.
|
[in]
|
bd
|
The viewport that should be used. Usually
doc->GetActiveBaseDraw()
.
|
[in]
|
brushData
|
The tools data container.
|
[in]
|
pChannel
|
The
BaseChannel
to use when flooding.
|
[in]
|
button
|
The ID of the button in the UI to use as the function parameter in the subsequent call to
FloodSelectedLayerWithChannel()
.
|
-
返回
-
true
if successful, otherwise
false
.
◆
FloodWithBitmap()
Floods the entire layer by calling virtual method
FloodSelectedLayerWithBitmap()
.
If the brush has different flooding methods (like blur, erase, sharpen etc.) then pass in a different flag for the
button
id.
FloodSelectedLayerWithBitmap()
is then called with this setting passed as the
function
参数。
-
注意
-
By default the button is set to the
MDATA_SCULPTBRUSH_SETTINGS_FLOOD
which is the standard Flood button that the brushes have.
If a different button is used then this method should be called from
Message()
when a button is pushed in the interface.
-
参数
-
[in]
|
doc
|
The current document.
|
[in]
|
bd
|
The viewport that should be used. Usually
doc->GetActiveBaseDraw()
.
|
[in]
|
brushData
|
The tools data container.
|
[in]
|
pBitmap
|
The
BaseBitmap
to use when flooding.
|
[in]
|
button
|
The ID of the button in the UI to use as the function parameter in the subsequent call to
FloodSelectedLayerWithBitmap()
.
|
-
返回
-
true
if successful, otherwise
false
.
◆
ApplyPythonDab()
Private
. Called by Python Brushes.
◆
GetCustomData()
若
SculptBrushParams::EnableCustomStamp
(
true
) 和
SculptBrushParams::EnableBrushAccess
(
true
) are both set then this method is called to allow to change the
BaseBitmap
used for the next dab.
This method is called before each individual dab is drawn. This allows to randomize the stamp image during a stroke. Simply set the
pCustom->pStamp
pointer to point to a
BaseBitmap
that is owned by the brush.
-
参数
-
[in]
|
strokeInstanceID
|
The ID of the brush instance.
|
[in,out]
|
pCustom
|
The custom data to set the
pStamp
bitmap pointer.
|
-
返回
-
true
if something changes since the last time it was called, otherwise
false
.
◆
UpdateSettingsAfterPresetLoad()
virtual void UpdateSettingsAfterPresetLoad
|
(
|
BaseContainer
*
|
data
|
)
|
|
|
virtual
|
Private
. After preset data has been loaded this method is called to adjust adjust any settings that are specific for the brush.
-
参数
-
[in]
|
data
|
The container for the sculpt brush tool.
|
◆
UpdateStencilAfterPresetLoad()
virtual void UpdateStencilAfterPresetLoad
|
(
|
BaseContainer
*
|
data
|
)
|
|
|
virtual
|
Private
. After preset data has been loaded this method is called to refresh the stencil for the brush.
-
参数
-
[in]
|
data
|
The container for the sculpt brush tool.
|
◆
EnableSpecialDrawGizmo()
void EnableSpecialDrawGizmo
|
(
|
|
)
|
|
Enables a flag so that the brush preview gets drawn.
◆
DisableSpecialDrawGizmo()
void DisableSpecialDrawGizmo
|
(
|
|
)
|
|
Clears the flag so that the drawing of the brush preview is not forced.
◆
SetMouseDrag()
void SetMouseDrag
|
(
|
Bool
|
value
|
)
|
|
Tells the brush when the mouse button is down.
-
注意
-
This method should be called from within
HandleFillTool()
to let the system know that the mouse is being polled for input.
-
参数
-
[in]
|
value
|
Set to
true
if the mouse is being polled. Set to
false
when finished.
|
◆
IsMouseDrag()
Checks if a mouse button is held down and being dragged.
-
返回
-
true
if a mouse button is down, otherwise
false
.
◆
CacheObjects()
Caches sculptable objects in the scene so the tool is ready to use on them.
This includes sculpt objects (those with a
SculptTag
) as well as the first selected
PolygonObject
(without a tag). Cache objects that are visible in the currently active viewport.
-
参数
-
[in]
|
doc
|
The document to check.
|
◆
GetSelectionCacheCount()
Int32
GetSelectionCacheCount
|
(
|
|
)
|
|
Gets the number of sculpt objects currently selected. This includes sculpt objects (those with a
SculptTag
) as well as other internal objects.
Checking if an object is of type
SCULPT_OBJECT_ID
allows the caller to cast to a
SculptObject
.
-
返回
-
The number of selected sculpt objects.
◆
GetSelectionCacheObject()
Gets a cached
SculptObject
.
-
参数
-
[in]
|
index
|
The index of the cached object.
|
-
返回
-
The cached Object. If its
GetType()==SCULPT_OBJECT_ID
then it is a
SculptObject
.
◆
GetBrushStrength()
Gets the strength of the brush.
This is useful when used in the Flood method to get the strength that the flood should apply.
-
参数
-
[in]
|
original
|
若
true
returns the value as defined in the UI.
若
False
returns an interpolated value between the current and the next sample point and then also adjusted according to any effector settings such as pen pressure.
|
-
返回
-
The strength value.
◆
InitZoomScale()
Initializes the scaling settings for each sculpt brush according to the distance the camera is from the
SculptObject
.
Updates the scaling information for each currently selected
SculptObject
in the scene.
-
警告
-
Plugin developers should never have to call this method. It is used internally when a sculpt tag is first applied to an object to ensure the selected brush works correctly.
-
参数
-
◆
HasModifier()
Checks if the brush has the
SculptBrushParams::EnableModifier
flag set to
true
.
-
返回
-
true
if the brush can use modifiers, otherwise
false
.
◆
HasRespectSelections()
Bool
HasRespectSelections
|
(
|
|
)
|
|
Checks if the brush has the
SculptBrushParams::EnableRespectSelections
flag set to
true
.
This should be checked in the
FloodSelectedLayer()
method to see if it should respect the current selection or not.
This can return
false
if overridden by the internal sculpting system to specifically ignore selections.
-
返回
-
true
if the brush should respect the current selection, otherwise
false
.
◆
WritePresetData()
Private
. Writes the brush preset data.
-
参数
-
-
返回
-
true
if successful, otherwise
false
.
◆
ReadPresetData()
Private
. Reads the brush preset data.
-
参数
-
[in]
|
hf
|
The
HyperFile
to write to.
|
[in]
|
level
|
The version of the plugin that the brush data was written with.
|
-
返回
-
true
if successful, otherwise
false
.
◆
WriteStampPresetData()
Private
. Writes the brush stamp preset data.
-
参数
-
-
返回
-
true
if successful, otherwise
false
.
◆
ReadStampPresetData()
Private
. Reads the brush stamp preset data.
-
参数
-
[in]
|
hf
|
The
HyperFile
to write to.
|
[in]
|
level
|
The version of the plugin that the stamp data was written with.
|
-
返回
-
true
if successful, otherwise
false
.
◆
WriteSplinePresetData()
Private
.
◆
ReadSplinePresetData()
Private
.
◆
GetStamp()
Gets the
BaseBitmap
that is being used for the stamp of the sculpt brush.
-
返回
-
The stamp that the brush is using.
◆
GetStencil()
Gets the
BaseBitmap
that is being used for the stencil of the sculpt brush.
-
返回
-
The stencil that the brush is using.
Member Data Documentation
◆
m_pParams
◆
m_pBrushBase
定义:
lib_sculptbrush.h:929
#define PLUGINFLAG_TOOL_SCULPTBRUSH
Tool is a sculpt brush.
定义:
c4d_tooldata.h:201
static SculptBrushParams * Alloc()
The brush data for an individual dab. This is passed into the method defined by the user in SculptBru...
定义:
lib_sculptbrush.h:349
#define PLUGINFLAG_TOOL_NO_OBJECTOUTLINE
Object outlines on selection not supported.
定义:
c4d_tooldata.h:202
maxon::Int32 Int32
定义:
ge_sys_math.h:58
#define PLUGINFLAG_HIDEPLUGINMENU
Hide the plugin's menu entry.
定义:
c4d_baseplugin.h:26
maxon::Bool Bool
定义:
ge_sys_math.h:53