- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes

# BrushOperation Class Reference

This reference page is linked to from the following overview topics: Mudbox 2013, Sculpting and Brushes, Stamps and Stencils, Writing Brush Plug-ins, Writing Plug-ins.

Search for all occurrences

## Detailed Description

The BrushOperation class is the base class for brush functionality.

A plugin can implement its own operation class derived from BrushOperation, which will be available for the users in the tools tray. Note that if there is any change in the available operations (like a new plugin is installed with such functions) the settings directory has to be deleted. The implementations of this class must use the DECLARE_CLASS and IMPLEMENT_CLASS macros.

Examples:

  CurveBrush/CurveCreator.h.

Definition at line 261 of file brush.h.

`#include <brush.h>`

Inheritance diagram for BrushOperation:
[legend]

List of all members.

## Classes
struct | BrushBehavior
| Tool behaviour structure for storing alternate brushing modes. More...
## Public Types
enum | Direction { eDirNormal, eDirAveragedNormal, eDirVertexNormal, eDirForward, eDirRight, eDirX, eDirY, eDirZ, eDirCamera, eDirScreen, eDirXY, eDirXZ, eDirYZ }
| Values for the brush direction property. More...
enum | Modifier { eModNormal, eModAdditive, eModInverted, eModNoEffect }
| Values for the brush effect modifier. More...
enum | TriggerType { eTriggerPrimary, eTriggerSecondary, eTriggerTertiary }
| This value represents how the user triggered the brush. More...
enum | MaskType { eMaskAny = -1, eMaskStamp, eMaskStencil, eMaskTypeCount }
| Values for mask types that can be add to the brush effect as a multiplier. More...
enum | StampSizingMode { eStampSizingNone, eStampSizingRadius, eStampSizingDiameter }
| Values for stamp resizing mode. More...
## Public Member Functions
| BrushOperation (void)
| Constructor, do not use it directly.
virtual QString | StringID (const ClassDesc *pClass=0) const
| Returns the string id of the current brush operation.
virtual QString | DisplayName (void) const
| Returns the display name of the current brush operation.
virtual void | OnNodeEvent (const Attribute &cAttribute, NodeEventType eType)
| Overriding the node event.
virtual bool | IsScreenSpace (void) const
| Returns if the brush is in screen space.
virtual float | BrushSize (void) const
| Returns the size of the active brush.
virtual float | BrushStrength (void) const
| Returns the strength of the active brush.
virtual void | SetBrushSize (float fSize)
| Sets the size of the active brush.
virtual void | SetBrushStrength (float fStrength)
| Sets the strength of the active brush.
virtual float | EffectiveBrushSize (void) const
| Returns the size of the active brush including the scaling parameter.
virtual float | EffectiveBrushStrength (void) const
| Returns the strength of the active brush including the scaling parameter.
virtual float | BrushSizeBias (void) const
| Returns the size bias percentage.
virtual float | BrushStrengthBias (void) const
| Returns the strength bias percentage.
virtual float | MaxBrushSize (void) const
| Returns the maximal brush size.
virtual float | MaxBrushStrength (void) const
| Returns the maximal brush strength.
virtual bool | UsesStrokeSmoothing (void) const
| Returns true if the brush wants to use drawing curve.
virtual float | StrokeSmoothingDistance (void) const
| Returns the distance parameter for smoothing if the brush uses drawing curve.
virtual void | SetStrokeSmoothing (bool bEnable, float fDistance)
| Convenience function for setting Stroke smoothing parameters.
virtual bool | HasCustomCursor (void)
| Returns true if the brush wants to draw the cursor on it's own.
virtual bool | UsesSteadyStroke (void) const
| Returns true if the brush wants to use drawing curve.
virtual float | SteadyStrokeDistance (void) const
| Returns the distance parameter for smoothing if the brush uses drawing curve.
virtual void | SetSteadyStroke (bool bEnable, float fDistance)
| Convenience function for setting Stroke smoothing parameters.
virtual enum StampSizingMode | StampSizingMode (void) const
| Returns the current stamp sizing mode.
virtual void | SetStampSizingMode (enum StampSizingMode eMode)
| Sets the current stamp sizing mode.
virtual const NURBSCurve * | Falloff (void) const
| Returns the falloff curve.
virtual void | SetFalloff (NURBSCurve *pCurve)
| Sets the falloff curve.
virtual const Store< float > & | FalloffData (void) const
| Returns the current falloff table.
float | FalloffValue (float fValue) const
| Returns the falloff value in the specified curve position.
virtual bool | UsesFalloffBasedOnFacingAngle (void) const
| Returns true if Falloff based on Facing Angle is on.
virtual void | SetFalloffBasedOnFacingAngle (bool bEnable)
| Set Falloff based on Facing Angle.
virtual bool | UsesStampRandomize (void) const
| Returns true if Stamp Randomize is on.
virtual void | SetStampRandomize (bool bEnable)
| Set Falloff based on Facing Angle.
virtual bool | IsMaskEnabled (MaskType type=eMaskAny) const
| Returns true if the mask is turned on for the brush.
virtual const Image * | MaskImage (MaskType type=eMaskAny) const
| Returns the current mask image.
virtual Matrix | MaskMatrix (MaskType type=eMaskAny) const
| Returns the current matrix of the mask.
virtual bool | IsMaskInverted (MaskType type=eMaskAny) const
| Returns whether the value should be inverted or not (inversion means 1-x)
virtual float | MaskFactor (MaskType type=eMaskAny) const
| Returns the factor value, which should be multiplied to the mask value.
virtual bool | IsMaskTiled (MaskType type=eMaskAny) const
| Returns true if the mask shall tile, and false if all the values outside the mask should be treated as zero.
virtual QString | MaskName (MaskType type=eMaskAny) const
| Returns a string identifier which is unique for this mask.
virtual bool | MaskBuildUp (MaskType type=eMaskAny) const
| Returns true if the mask should be included in buildup or not.
virtual const Image * | MaskOpacityImage (MaskType type=eMaskAny) const
| Returns the effective area of the mask as an image. Use this to restrict the mask effect to certain pixels.
virtual float | MaskOffset (MaskType type=eMaskAny) const
| Returns the offset of the mask.
virtual void | OnMaskChanged (MaskType type=eMaskAny)
| Called by the kernel when the active stamp or stencil is changed on the UI. Override if you want to be notified when this happens.
virtual float | BuildUpRate (void) const
| Returns the current build up rate (between 0 and 1).
virtual bool | PatchesAtRelease (void) const
| Returns if the patchs should be applied at the end of stroke.
virtual bool | PressureControlsBrushSize (void) const
| Returns if the pressure affects brush size.
virtual bool | PressureControlsBrushStrength (void) const
| Returns if the pressure affects brush strength.
virtual bool | IsInverted (void) const
| Returns the mode if inverted or not.
virtual bool | IsOrientedToSurface (void) const
| Returns if the brush is aligned to the surface.
Direction | Direction (void) const
| Returns the direction type.
Vector | DirectionVector (unsigned int iVertexIndex) const
| Returns the direction which whould be used for the brush. If the returned value is a zero length vector, then the brush has to calculate its own averaged normal direction.
virtual void | SetDirectionVector (const Vector &vDirection) const
| When the current direction is calculated properly, the operation may want to call this routine to use the direction for the stamp transformation.
Vector | PreviousPatchPosition (void) const
| Return the local position of the previous patch in this stroke.
virtual void | BeginStroke (Mesh *pMesh, Modifier eModifier, TriggerType eTriggerType)
| Called when a new stroke is started.
virtual void | EndStroke (void)
| Called when a stroke is finished.
virtual void | MouseMove (float fXPosition, float fYPosition, float fXDelta, float fYDelta, AxisAlignedBoundingBox &cDirtyWorldArea, float fSize, float fPressure, float fStrength)
| Called when the mouse is moved during a stroke. The default implementation calls AddPatch(). Positions are in range [0,1].
virtual void | AddPatch (const SurfacePoint *pPoint, const Vector &vPatchCenter, float fSize, float fPressure, float fStrength, AxisAlignedBoundingBox &cDirtyWorldArea)
| Called when a new surface point has to be added to the stroke.
virtual void | Flood (Mesh *pTarget, float fStrength=1.0f, bool bFromCamera=false)
| Flood a mesh with the effect of the brush.
virtual void | SetInactive ()
| called when the brush is about to become non active.
virtual void | SetActiveConfiguration (BrushConfiguration *config)
| Changes to the configuration.
virtual void | SetActiveConfiguration (const QString &sName)
| Changes to the configuration.
virtual BrushConfiguration * | ActiveConfiguration (void) const
| Returns the active configuration.
const StampConfiguration & | StampConfig (void) const
| Returns the structure with stamp properties.
void | SetStampConfig (StampConfiguration &newConfig)
| Sets stamp configuration.
void | SetStamp (bool bEnable, const QString &sFileName="")
| Convenience method for enabling stamp and setting stamp image.
void | SetBrushSizeScale (float fScale)
| Set the scale amount of size according to the brush configuration.
void | SetBrushStrengthScale (float fScale)
| Set the scale amount of strength according to the brush configuration.
bool | UsesGlobalBrushSize (void) const
| Returns if the brush uses the global size.
Modifier | CurrentModifier (void) const
| Returns the current modifier of the brush.
const MirrorConfiguration & | MirrorConfig (void) const
| Returns the mirror configuration.
virtual void | SetMirrorConfig (MirrorConfiguration newConfig)
| Sets mirror configuration.
virtual bool | IsConfigurationInited (BrushConfiguration *config) const
| Returns if we already initialized the configuration with the default values.
virtual void | StoreConfiguration (BrushConfiguration *config)
| Saves the configuration state (the attribute values) into memory The parameter is the configuration index defined in the config declaration.
virtual void | RestoreConfiguration (BrushConfiguration *config)
| Reloads the configuration state from the saved buffer so it restores the same state when it was active last time.
virtual QString | OverlayIcon (void)
| Returns the file name to be displayed as an overlay icon above the cursor.
virtual QPointF | OverlayOffset (void)
| Returns an (x, y) offset relative to the mouse cursor where the icon should be displayed.
virtual bool | ExecuteAndInvert (void)
| For storing and restoring undo/redo data.
virtual void | Serialize (Stream &s)
| Serializing.
virtual BrushOperation & | operator= (const BrushOperation &op)
| Value assignment operator.
virtual bool | CanLockLayer (void) const
| Returns if using the brush will lock the active layer to the current subdivision level so it cannot be modified on other levels later.
virtual bool | CustomPicker (void)
| Brushes can implement their own picker and return true if they handle picking in their own.
virtual Node * | AttributeHolderNode (void)
| Returns the node that contains the displayed attribute list of the operation.
virtual void | SetFalloffIndex (int iIndex)
| Internal use only.
virtual int | FalloffIndex (void) const
| Internal use only.
virtual unsigned int | AlternateBehaviorCount (void) const
| Returns the number of possible alternate behaviors for the brush.
virtual const BrushBehavior & | AlternateBehavior (unsigned int iIndex) const
| Returns the given alternate behavior instance.
virtual bool | IsSnapToCurve (void) const
| Returns true if snap mouse to active curve.
virtual float | SnapDistance (void) const
| Returns the distance tolerance when snapping mouse to curves.
## Static Public Member Functions
static void | AddConfiguration (BrushConfiguration *config)
| Add a new configuration.
static unsigned int | ConfigurationCount (void)
| Returns the number of configurations.
static BrushConfiguration * | Configuration (unsigned int iIndex)
| Returns a configuration.
static void | SerializeConfigurationStates (Stream &s)
| Saves/loads the current states of the brushes to/from the given stream.
## Protected Attributes
abool | m_bScreenSpace
| ATTRIBUTES:
abool | m_bInverted
abool | m_bOrientToSurface
afloatr | m_fNormalBrushSize
afloatr | m_fNormalBrushStrength
afloatr | m_fScreenBrushSize
afloatr | m_fScreenBrushStrength
afloatr | m_fMaxBrushSize
afloatr | m_fMaxBrushStrength
afloatr | m_fBrushSizeBias
afloatr | m_fBrushStrengthBias
acheckablefloat | m_fStrokeSmoothing
acheckablefloat | m_fSteadyStroke
abool | m_bRememberSize
aenum | m_iDirection
astampcfg | m_cStampCfg
amirrorcfg | m_cMirrorCfg
aevent | m_cFlood
aevent | m_cFloodFromCamera
avoid | m_vPressure
acurveptr | m_cFalloff
aint | m_iFalloffIndex
aptr< NURBSCurve > | m_pFalloffCurve
AttributeCheckableFloatArray | m_aFalloffBasedonFacingAngle
aevent | m_cReset
Modifier | m_eModifier
TriggerType | m_eTriggerType
float | m_fBrushSizeScale
float | m_fBrushStrengthScale
BrushConfiguration * | m_pActiveConfiguration
BrushBehavior | m_cAlternateBehavior1
BrushBehavior | m_cAlternateBehavior2
acheckablefloat | m_fSnapToCurve

## Member Enumeration Documentation

enum Direction

Search for all occurrences

Values for the brush direction property.

See also:
  Direction()

Enumerator:

  eDirNormal | Search for all occurrences
  eDirAveragedNormal | Search for all occurrences
  eDirVertexNormal | Search for all occurrences
  eDirForward | Search for all occurrences
  eDirRight | Search for all occurrences
  eDirX | Search for all occurrences
  eDirY | Search for all occurrences
  eDirZ | Search for all occurrences
  eDirCamera | Search for all occurrences
  eDirScreen | Search for all occurrences
  eDirXY | Search for all occurrences
  eDirXZ | Search for all occurrences
  eDirYZ | Search for all occurrences

Definition at line 267 of file brush.h.

        {
            eDirNormal,
            eDirAveragedNormal,
            eDirVertexNormal,
            eDirForward,
            eDirRight,
            eDirX,
            eDirY,
            eDirZ,
            eDirCamera,
            eDirScreen,
            eDirXY,
            eDirXZ,
            eDirYZ
        };

enum Modifier

Search for all occurrences

Values for the brush effect modifier.

Enumerator:

  eModNormal | Search for all occurrences
  eModAdditive | Search for all occurrences
  eModInverted | Search for all occurrences
  eModNoEffect | Search for all occurrences

Definition at line 285 of file brush.h.

        {
            eModNormal,
            eModAdditive,
            eModInverted,
            eModNoEffect
        };

enum TriggerType

Search for all occurrences

This value represents how the user triggered the brush.

Enumerator:

  eTriggerPrimary | Search for all occurrences
  eTriggerSecondary | Search for all occurrences
  eTriggerTertiary | Search for all occurrences

Definition at line 294 of file brush.h.

        {
            eTriggerPrimary,    // primary button was used (by default left mouse button)
            eTriggerSecondary,  // secondary button was used (by default middle mouse button)
            eTriggerTertiary    // tertiary button was used (by default left+middle mouse button)
        };

enum MaskType

Search for all occurrences

Values for mask types that can be add to the brush effect as a multiplier.

Enumerator:

  eMaskAny | Search for all occurrences
  eMaskStamp | Search for all occurrences
  eMaskStencil | Search for all occurrences
  eMaskTypeCount | Search for all occurrences

Definition at line 302 of file brush.h.

        {
            eMaskAny = -1,
            eMaskStamp,
            eMaskStencil,
            eMaskTypeCount
        };

enum StampSizingMode

Search for all occurrences

Values for stamp resizing mode.

Using and returning these values a brush can inform the kernel to draw and drag a stamp image during the stroke using the first and the current pick points.

Enumerator:

  eStampSizingNone | No resizing at all. Search for all occurrences
  eStampSizingRadius | Stamp resized with the 2 points defining the radius (starting point is the center) Search for all occurrences
  eStampSizingDiameter | Stamp resized with the 2 points defining the diameter. Search for all occurrences

Definition at line 312 of file brush.h.

        {
            eStampSizingNone,
            eStampSizingRadius,
            eStampSizingDiameter
        };

## Constructor & Destructor Documentation

BrushOperation | ( | void |  | ) |

Constructor, do not use it directly.

## Member Function Documentation

virtual QString StringID | ( | const ClassDesc * | pClass = `0` | ) | const `[virtual]`

Search for all occurrences

Returns the string id of the current brush operation.

Reimplemented from Node.

virtual QString DisplayName | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns the display name of the current brush operation.

Reimplemented from Node.

virtual void OnNodeEvent | ( | const Attribute & | cAttribute,
|  | NodeEventType | eType
| ) |  | `[virtual]`

Search for all occurrences

Overriding the node event.

Reimplemented from Node.

virtual bool IsScreenSpace | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns if the brush is in screen space.

virtual float BrushSize | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns the size of the active brush.

virtual float BrushStrength | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns the strength of the active brush.

virtual void SetBrushSize | ( | float | fSize | ) | `[virtual]`

Search for all occurrences

Sets the size of the active brush.

virtual void SetBrushStrength | ( | float | fStrength | ) | `[virtual]`

Search for all occurrences

Sets the strength of the active brush.

virtual float EffectiveBrushSize | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns the size of the active brush including the scaling parameter.

virtual float EffectiveBrushStrength | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns the strength of the active brush including the scaling parameter.

virtual float BrushSizeBias | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns the size bias percentage.

virtual float BrushStrengthBias | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns the strength bias percentage.

virtual float MaxBrushSize | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns the maximal brush size.

virtual float MaxBrushStrength | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns the maximal brush strength.

virtual bool UsesStrokeSmoothing | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns true if the brush wants to use drawing curve.

virtual float StrokeSmoothingDistance | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns the distance parameter for smoothing if the brush uses drawing curve.

virtual void SetStrokeSmoothing | ( | bool | bEnable,
|  | float | fDistance
| ) |  | `[virtual]`

Search for all occurrences

Convenience function for setting Stroke smoothing parameters.

virtual bool HasCustomCursor | ( | void |  | ) | `[virtual]`

Search for all occurrences

Returns true if the brush wants to draw the cursor on it's own.

virtual bool UsesSteadyStroke | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns true if the brush wants to use drawing curve.

virtual float SteadyStrokeDistance | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns the distance parameter for smoothing if the brush uses drawing curve.

virtual void SetSteadyStroke | ( | bool | bEnable,
|  | float | fDistance
| ) |  | `[virtual]`

Search for all occurrences

Convenience function for setting Stroke smoothing parameters.

virtual enum StampSizingMode StampSizingMode | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns the current stamp sizing mode.

virtual void SetStampSizingMode | ( | enum StampSizingMode | eMode | ) | `[virtual]`

Search for all occurrences

Sets the current stamp sizing mode.

virtual const NURBSCurve* Falloff | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns the falloff curve.

virtual void SetFalloff | ( | NURBSCurve * | pCurve | ) | `[virtual]`

Search for all occurrences

Sets the falloff curve.

virtual const Store<float>& FalloffData | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns the current falloff table.

float FalloffValue | ( | float | fValue | ) | const `[inline]`

Search for all occurrences

Returns the falloff value in the specified curve position.

Definition at line 402 of file brush.h.

        {
            return FalloffData()[int(fValue*(FalloffData().ItemCount()-1))];
        };

virtual bool UsesFalloffBasedOnFacingAngle | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns true if Falloff based on Facing Angle is on.

virtual void SetFalloffBasedOnFacingAngle | ( | bool | bEnable | ) | `[virtual]`

Search for all occurrences

Set Falloff based on Facing Angle.

virtual bool UsesStampRandomize | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns true if Stamp Randomize is on.

virtual void SetStampRandomize | ( | bool | bEnable | ) | `[virtual]`

Search for all occurrences

Set Falloff based on Facing Angle.

virtual bool IsMaskEnabled | ( | MaskType | type = `eMaskAny` | ) | const `[virtual]`

Search for all occurrences

Returns true if the mask is turned on for the brush.

virtual const Image* MaskImage | ( | MaskType | type = `eMaskAny` | ) | const `[virtual]`

Search for all occurrences

Returns the current mask image.

virtual Matrix MaskMatrix | ( | MaskType | type = `eMaskAny` | ) | const `[virtual]`

Search for all occurrences

Returns the current matrix of the mask.

virtual bool IsMaskInverted | ( | MaskType | type = `eMaskAny` | ) | const `[virtual]`

Search for all occurrences

Returns whether the value should be inverted or not (inversion means 1-x)

virtual float MaskFactor | ( | MaskType | type = `eMaskAny` | ) | const `[virtual]`

Search for all occurrences

Returns the factor value, which should be multiplied to the mask value.

virtual bool IsMaskTiled | ( | MaskType | type = `eMaskAny` | ) | const `[virtual]`

Search for all occurrences

Returns true if the mask shall tile, and false if all the values outside the mask should be treated as zero.

virtual QString MaskName | ( | MaskType | type = `eMaskAny` | ) | const `[virtual]`

Search for all occurrences

Returns a string identifier which is unique for this mask.

virtual bool MaskBuildUp | ( | MaskType | type = `eMaskAny` | ) | const `[virtual]`

Search for all occurrences

Returns true if the mask should be included in buildup or not.

virtual const Image* MaskOpacityImage | ( | MaskType | type = `eMaskAny` | ) | const `[virtual]`

Search for all occurrences

Returns the effective area of the mask as an image. Use this to restrict the mask effect to certain pixels.

virtual float MaskOffset | ( | MaskType | type = `eMaskAny` | ) | const `[virtual]`

Search for all occurrences

Returns the offset of the mask.

virtual void OnMaskChanged | ( | MaskType | type = `eMaskAny` | ) | `[virtual]`

Search for all occurrences

Called by the kernel when the active stamp or stencil is changed on the UI. Override if you want to be notified when this happens.

virtual float BuildUpRate | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns the current build up rate (between 0 and 1).

virtual bool PatchesAtRelease | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns if the patchs should be applied at the end of stroke.

virtual bool PressureControlsBrushSize | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns if the pressure affects brush size.

virtual bool PressureControlsBrushStrength | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns if the pressure affects brush strength.

virtual bool IsInverted | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns the mode if inverted or not.

virtual bool IsOrientedToSurface | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns if the brush is aligned to the surface.

Direction Direction | ( | void |  | ) | const

Search for all occurrences

Returns the direction type.

Vector DirectionVector | ( | unsigned int | iVertexIndex | ) | const

Search for all occurrences

Returns the direction which whould be used for the brush. If the returned value is a zero length vector, then the brush has to calculate its own averaged normal direction.

virtual void SetDirectionVector | ( | const Vector & | vDirection | ) | const `[virtual]`

Search for all occurrences

When the current direction is calculated properly, the operation may want to call this routine to use the direction for the stamp transformation.

Vector PreviousPatchPosition | ( | void |  | ) | const

Search for all occurrences

Return the local position of the previous patch in this stroke.

virtual void BeginStroke | ( | Mesh * | pMesh,
|  | Modifier | eModifier,
|  | TriggerType | eTriggerType
| ) |  | `[virtual]`

Search for all occurrences

Called when a new stroke is started.

virtual void EndStroke | ( | void |  | ) | `[virtual]`

Search for all occurrences

Called when a stroke is finished.

virtual void MouseMove | ( | float | fXPosition,
|  | float | fYPosition,
|  | float | fXDelta,
|  | float | fYDelta,
|  | AxisAlignedBoundingBox & | cDirtyWorldArea,
|  | float | fSize,
|  | float | fPressure,
|  | float | fStrength
| ) |  | `[virtual]`

Search for all occurrences

Called when the mouse is moved during a stroke. The default implementation calls AddPatch(). Positions are in range [0,1].

virtual void AddPatch | ( | const SurfacePoint * | pPoint,
|  | const Vector & | vPatchCenter,
|  | float | fSize,
|  | float | fPressure,
|  | float | fStrength,
|  | AxisAlignedBoundingBox & | cDirtyWorldArea
| ) |  | `[virtual]`

Search for all occurrences

Called when a new surface point has to be added to the stroke.

virtual void Flood | ( | Mesh * | pTarget,
|  | float | fStrength = `1.0f`,
|  | bool | bFromCamera = `false`
| ) |  | `[virtual]`

Search for all occurrences

Flood a mesh with the effect of the brush.

virtual void SetInactive | ( |  | ) | `[virtual]`

Search for all occurrences

called when the brush is about to become non active.

virtual void SetActiveConfiguration | ( | BrushConfiguration * | config | ) | `[virtual]`

Search for all occurrences

Changes to the configuration.

virtual void SetActiveConfiguration | ( | const QString & | sName | ) | `[virtual]`

Search for all occurrences

Changes to the configuration.

virtual BrushConfiguration* ActiveConfiguration | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns the active configuration.

static void AddConfiguration | ( | BrushConfiguration * | config | ) | `[static]`

Search for all occurrences

Add a new configuration.

static unsigned int ConfigurationCount | ( | void |  | ) | `[static]`

Search for all occurrences

Returns the number of configurations.

static BrushConfiguration* Configuration | ( | unsigned int | iIndex | ) | `[static]`

Search for all occurrences

Returns a configuration.

const StampConfiguration& StampConfig | ( | void |  | ) | const

Search for all occurrences

Returns the structure with stamp properties.

void SetStampConfig | ( | StampConfiguration & | newConfig | ) |

Search for all occurrences

Sets stamp configuration.

void SetStamp | ( | bool | bEnable,
|  | const QString & | sFileName = `""`
| ) |  |

Search for all occurrences

Convenience method for enabling stamp and setting stamp image.

void SetBrushSizeScale | ( | float | fScale | ) |

Search for all occurrences

Set the scale amount of size according to the brush configuration.

void SetBrushStrengthScale | ( | float | fScale | ) |

Search for all occurrences

Set the scale amount of strength according to the brush configuration.

bool UsesGlobalBrushSize | ( | void |  | ) | const

Search for all occurrences

Returns if the brush uses the global size.

Modifier CurrentModifier | ( | void |  | ) | const

Search for all occurrences

Returns the current modifier of the brush.

This typically indicates if the user is pressing ctrl while making a brush stroke to invert the effect

const MirrorConfiguration& MirrorConfig | ( | void |  | ) | const

Search for all occurrences

Returns the mirror configuration.

virtual void SetMirrorConfig | ( | MirrorConfiguration | newConfig | ) | `[virtual]`

Search for all occurrences

Sets mirror configuration.

virtual bool IsConfigurationInited | ( | BrushConfiguration * | config | ) | const `[virtual]`

Search for all occurrences

Returns if we already initialized the configuration with the default values.

Can be used to check if the config is set for the first time so it needs some config-dependent initialization. The parameter is the configuration index defined in the config declaration.

virtual void StoreConfiguration | ( | BrushConfiguration * | config | ) | `[virtual]`

Search for all occurrences

Saves the configuration state (the attribute values) into memory The parameter is the configuration index defined in the config declaration.

virtual void RestoreConfiguration | ( | BrushConfiguration * | config | ) | `[virtual]`

Search for all occurrences

Reloads the configuration state from the saved buffer so it restores the same state when it was active last time.

The parameter is the configuration index defined in the config declaration.

static void SerializeConfigurationStates | ( | Stream & | s | ) | `[static]`

Search for all occurrences

Saves/loads the current states of the brushes to/from the given stream.

virtual QString OverlayIcon | ( | void |  | ) | `[virtual]`

Search for all occurrences

Returns the file name to be displayed as an overlay icon above the cursor.

virtual QPointF OverlayOffset | ( | void |  | ) | `[virtual]`

Search for all occurrences

Returns an (x, y) offset relative to the mouse cursor where the icon should be displayed.

virtual bool ExecuteAndInvert | ( | void |  | ) | `[virtual]`

Search for all occurrences

For storing and restoring undo/redo data.

Reimplemented from Operation.

virtual void Serialize | ( | Stream & | s | ) | `[virtual]`

Search for all occurrences

Serializing.

Reimplemented from Node.

virtual BrushOperation& operator= | ( | const BrushOperation & | op | ) | `[virtual]`

Value assignment operator.

virtual bool CanLockLayer | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns if using the brush will lock the active layer to the current subdivision level so it cannot be modified on other levels later.

virtual bool CustomPicker | ( | void |  | ) | `[virtual]`

Search for all occurrences

Brushes can implement their own picker and return true if they handle picking in their own.

Returning false would result the default process when clicking on a mesh.

virtual Node* AttributeHolderNode | ( | void |  | ) | `[virtual]`

Search for all occurrences

Returns the node that contains the displayed attribute list of the operation.

Mostly it is the operation itself but can return anything to allow custom attribute list.

virtual void SetFalloffIndex | ( | int | iIndex | ) | `[virtual]`

Search for all occurrences

Internal use only.

virtual int FalloffIndex | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Internal use only.

virtual unsigned int AlternateBehaviorCount | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns the number of possible alternate behaviors for the brush.

virtual const BrushBehavior& AlternateBehavior | ( | unsigned int | iIndex | ) | const `[virtual]`

Search for all occurrences

Returns the given alternate behavior instance.

virtual bool IsSnapToCurve | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns true if snap mouse to active curve.

virtual float SnapDistance | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns the distance tolerance when snapping mouse to curves.

## Member Data Documentation

abool m_bScreenSpace `[protected]`

Search for all occurrences

ATTRIBUTES:

Definition at line 571 of file brush.h.

abool m_bInverted `[protected]`

Search for all occurrences

Definition at line 572 of file brush.h.

abool m_bOrientToSurface `[protected]`

Search for all occurrences

Definition at line 573 of file brush.h.

afloatr m_fNormalBrushSize `[protected]`

Search for all occurrences

Definition at line 574 of file brush.h.

afloatr m_fNormalBrushStrength `[protected]`

Search for all occurrences

Definition at line 574 of file brush.h.

afloatr m_fScreenBrushSize `[protected]`

Search for all occurrences

Definition at line 575 of file brush.h.

afloatr m_fScreenBrushStrength `[protected]`

Search for all occurrences

Definition at line 575 of file brush.h.

afloatr m_fMaxBrushSize `[protected]`

Search for all occurrences

Definition at line 576 of file brush.h.

afloatr m_fMaxBrushStrength `[protected]`

Search for all occurrences

Definition at line 576 of file brush.h.

afloatr m_fBrushSizeBias `[protected]`

Search for all occurrences

Definition at line 577 of file brush.h.

afloatr m_fBrushStrengthBias `[protected]`

Search for all occurrences

Definition at line 577 of file brush.h.

acheckablefloat m_fStrokeSmoothing `[protected]`

Search for all occurrences

Definition at line 578 of file brush.h.

acheckablefloat m_fSteadyStroke `[protected]`

Search for all occurrences

Definition at line 579 of file brush.h.

abool m_bRememberSize `[protected]`

Search for all occurrences

Definition at line 580 of file brush.h.

aenum m_iDirection `[protected]`

Search for all occurrences

Definition at line 581 of file brush.h.

astampcfg m_cStampCfg `[protected]`

Search for all occurrences

Definition at line 582 of file brush.h.

amirrorcfg m_cMirrorCfg `[protected]`

Search for all occurrences

Definition at line 583 of file brush.h.

aevent m_cFlood `[protected]`

Search for all occurrences

Definition at line 584 of file brush.h.

aevent m_cFloodFromCamera `[protected]`

Search for all occurrences

Definition at line 585 of file brush.h.

avoid m_vPressure `[protected]`

Search for all occurrences

Definition at line 586 of file brush.h.

acurveptr m_cFalloff `[protected]`

Search for all occurrences

Definition at line 587 of file brush.h.

aint m_iFalloffIndex `[protected]`

Search for all occurrences

Definition at line 588 of file brush.h.

aptr<NURBSCurve> m_pFalloffCurve `[protected]`

Search for all occurrences

Definition at line 589 of file brush.h.

AttributeCheckableFloatArray m_aFalloffBasedonFacingAngle `[protected]`

Search for all occurrences

Definition at line 590 of file brush.h.

aevent m_cReset `[protected]`

Search for all occurrences

Definition at line 591 of file brush.h.

Modifier m_eModifier `[protected]`

Search for all occurrences

Definition at line 593 of file brush.h.

TriggerType m_eTriggerType `[protected]`

Search for all occurrences

Definition at line 594 of file brush.h.

float m_fBrushSizeScale `[protected]`

Search for all occurrences

Definition at line 595 of file brush.h.

float m_fBrushStrengthScale `[protected]`

Search for all occurrences

Definition at line 596 of file brush.h.

BrushConfiguration* m_pActiveConfiguration `[protected]`

Search for all occurrences

Definition at line 597 of file brush.h.

BrushBehavior m_cAlternateBehavior1 `[protected]`

Search for all occurrences

Definition at line 599 of file brush.h.

BrushBehavior m_cAlternateBehavior2 `[protected]`

Search for all occurrences

Definition at line 599 of file brush.h.

acheckablefloat m_fSnapToCurve `[protected]`

Search for all occurrences

Definition at line 601 of file brush.h.

The documentation for this class was generated from the following file:

- Mudbox/brush.h

BrushOperation BrushOperation BrushOperation BrushOperation BrushOperation BrushOperation BrushOperation BrushOperation BrushOperation BrushOperation
BrushOperation BrushOperation BrushOperation BrushOperation BrushOperation BrushOperation BrushOperation BrushOperation BrushOperation BrushOperation