BrushDabData Class Reference 雕刻

| Library » Sculpt Brush

#include <lib_sculptbrush.h>

详细描述

The brush data for an individual dab. This is passed into the method defined by the user in SculptBrushParams::SetMovePointFunc .

公共成员函数

const BaseContainer GetData ()
const SculptObject GetObject ()
const BrushPointData GetPointData ()
const BrushPolyData GetPolyData ()
PolygonObject GetPolygonObject ()
PolygonObject GetBaseObject ()
Int32   GetPointCount ()
Int32   GetPolyCount ()
Neighbor GetNeighbor ()
SculptLayer GetLayer ()
const 向量 GetPoints ()
const Vector32 GetOriginalPoints ()
向量   GetNormal ()
向量   GetDrawDirectionNormal ()
Float   GetBrushStrength ()
Float   GetBrushRadius ()
向量   GetMousePos3D ()
向量   GetHitPoint ()
向量   GetLastHitPoint ()
Int32   GetHitPolygon ()
向量   GetEyePoint ()
Bool   IsMirroredDab ()
OVERRIDE   GetBrushOverride ()
BaseDraw GetBaseDraw ()
void  GetAveragePointAndNormal ( 向量 &averagePoint, 向量 &normal)
void  ApplySmooth ()
const Vector32 GetVertexNormals ()
const Vector32 GetOriginalVertexNormals ()
const Vector32 GetFaceNormals ()
Float   GetAutoScaleValue ( Bool noRadius)
Float   GetBrushFalloff ( Int32 index, Vector32 *pRetStencilColor=nullptr, Float *pCustomDistance=nullptr)
Float   GetBrushFalloffFromPos (const 向量 &pos)
void  OffsetPoint ( Int32 index, const 向量 &offset, Vector32 *pVertexColor=nullptr, SCULPTOFFSETFLAGS flags= SCULPTOFFSETFLAGS::NONE )
Bool   IsPreviewDab ()
void  OffsetPreviewPoint ( Int32 index, const 向量 &offset, SCULPTOFFSETFLAGS flags= SCULPTOFFSETFLAGS::NONE )
void  DirtyAllPoints ( SCULPTBRUSHDATATYPE type)
Bool   IsPointModified ( Int32 index)
Float   GetStencilColor (const 向量 &point, Vector32 *pRetColor=nullptr, Vector32 *pRetCoords=nullptr, SAMPLEMODE mode= SAMPLEMODE::TAKEONEPIXEL )
Float   GetStampColor (const 向量 &point, Float distanceFromHitPoint, Vector32 *pRetColor=nullptr, Vector32 *pRetCoords=nullptr, SAMPLEMODE mode= SAMPLEMODE::TAKEONEPIXEL )
const BaseBitmap GetStencil ()
const BaseBitmap GetStamp ()
SculptBrushToolData GetBrush ()
Int32   GetStrokeInstanceID ()
Bool   IsSculptObject ()
向量   GetMirrorPoint (const 向量 &point, Bool isNormal)
Float32 GetMaskCache ()
Float32   PointPolysAverage ( Int32 vertex, Float32 *values)
向量   PointPolysAverage ( Int32 vertex, 向量 *values)
Bool   IsPointInFillArea (const 向量 &p)
Bool   IsBackface ()

私有成员函数

  BrushDabData ()
  ~BrushDabData ()

构造函数 & 析构函数文档编制

◆  BrushDabData()

BrushDabData () private

◆  ~BrushDabData()

~ BrushDabData () private

成员函数文档编制

◆  GetData()

const BaseContainer * GetData ( )

Gets the settings data for the brush.

返回
The container for the brush.

◆  GetObject()

const SculptObject * GetObject ( )

Gets the sculpt object that the dab is for.

返回
The sculpt object.

◆  GetPointData()

const BrushPointData * GetPointData ( )

Gets the list of points that are affected by the brush.

注意
Call GetPointCount() to get the number of points in the returned array.
返回
The list of points.

◆  GetPolyData()

const BrushPolyData * GetPolyData ( )

Gets the list of the polygons that are affected by the brush.

注意
Call GetPolyCount() to get the number of polygons in the returned array.
返回
The list of polygons.

◆  GetPolygonObject()

PolygonObject * GetPolygonObject ( )

Gets the PolygonObject SculptObject that is currently being displayed in the viewport.

返回
The polygon object.

◆  GetBaseObject()

PolygonObject * GetBaseObject ( )

Gets the original object that the SculptTag is applied to.

注意
In the case where this there is no SculptTag on then this will return the same as the call to GetPolygonObject() .
返回
The PolygonObject .

◆  GetPointCount()

Int32 GetPointCount ( )

Gets the number of points that are touched by the dab.

注意
This is the number of points in the array returned from GetPointData() .
返回
The number of points.

◆  GetPolyCount()

Int32 GetPolyCount ( )

Gets the number of polygons that are touched by the dab.

注意
this is the number of polygons in the array returned from GetPolyData() .
返回
The number of polygons.

◆  GetNeighbor()

Neighbor * GetNeighbor ( )

Gets the Neighbor information for the SculptObject if it is currently at level 0 .

注意
If the user is sculpting a regular unsubdivided PolygonObject then this also returns a valid pointer.
返回
The Neighbor information if SculptObject is at level 0 or if the user is sculpting on a regular PolygonObject , otherwise nullptr .

◆  GetLayer()

SculptLayer * GetLayer ( )

Gets the currently selected Layer for a subdivided SculptObject .

注意
If the user is sculpting a regular PolygonObject then this returns nullptr .
返回
The currently selected layer in the Layer Manager if it is a subdivided SculptObject , otherwise nullptr .

◆  GetPoints()

const 向量 * GetPoints ( )

Retrieves the live points that are modified on the surface during a brush stroke.
These points may already have been modified by previous brush dabs during the current brush stroke.

返回
The points on the PolygonObject that is currently displayed in the viewport.

◆  GetOriginalPoints()

const Vector32 * GetOriginalPoints ( )

Retrieves a copy of the points in their state before the brush stroke started.
Use these points to compare where the surface was before the user started sculpting.

注意
As an example this data is used by the grab tool to correctly offset the points based on their original location on the surface at the first mouse click.
返回
The points on the PolygonObject at the state it was in when the user first pressed the left mouse button down.

◆  GetNormal()

向量 GetNormal ( )

Gets the normal at the current hit point for the dab.
This is the average vertex normal of all the points that are affected by the dab.

返回
The normal at the current hit point.

◆  GetDrawDirectionNormal()

向量 GetDrawDirectionNormal ( )

If the brush supports the Draw Direction, i.e. the user has set SculptBrushParams::EnableDrawDirection ( true ),
then this returns the direction selected by the user, otherwise it just returns the same vector as GetNormal() .

返回
The Draw Direction normal.

◆  GetBrushStrength()

Float GetBrushStrength ( )

Gets the brush strength for the dab.

注意
This strength is not the same as the strength in the container returned by GetData() .
This also takes into account many other variables including tablet pressure to create the value.
返回
The strength of the brush.

◆  GetBrushRadius()

Float GetBrushRadius ( )

Gets the brush radius for the dab.

注意
This is not the same as the brush size in the container returned by GetData() .
. This also takes into account other factors such as the distance from the camera, scale of the object and tablet values to determine the correct brush radius.
返回
The radius of the brush. The size of the radius is in the sculpt objects local space.

◆  GetMousePos3D()

向量 GetMousePos3D ( )

If the brush mode is ref SCULPTBRUSHMODE::GRAB then this method can be used to get the location of the mouse pointer in world space in the scene.

返回
If the brush mode is SCULPTBRUSHMODE::GRAB returns the position of the mouse in world space, otherwise Vector(0,0,0) .

◆  GetHitPoint()

向量 GetHitPoint ( )

Gets the point on the surface of the SculptObject where the dab is going to be placed. This is the center of the dab.

注意
If the mode is set to SCULPTBRUSHMODE::GRAB then this always returns the initial hit point that occurred when the user first pressed the left mouse button down.
返回
The hit point on the surface.

◆  GetLastHitPoint()

向量 GetLastHitPoint ( )

Gets the hit point for the previous dab during the stroke.

返回
The hit point on the surface.

◆  GetHitPolygon()

Int32 GetHitPolygon ( )

Gets the index of the polygon on the surface of the SculptObject where the dab is going to be placed. This is the center of the dab.

注意
If the mode is set to SCULPTBRUSHMODE::GRAB then this always returns the initial hit polygon that occurred when the user first pressed the left mouse button down.
由于
R17.032
返回
The index of the polygon on hit the surface.

◆  GetEyePoint()

向量 GetEyePoint ( )

Gets the location of the mouse in local space above the model.

注意
This point is created by interpolating between previous and next real mouse hit point on the surface of the SculptObject .
This is then projected down onto the surface of the model to get the real hit point for the interpolated value.
返回
The virtual mouse location in local space above the surface of the SculptObject .

◆  IsMirroredDab()

Bool IsMirroredDab ( )

Checks if the dab is for a mirrored brush stroke.

返回
true it is a mirrored dab or false if it is the main brush stroke.

◆  GetBrushOverride()

OVERRIDE GetBrushOverride ( )

Gets the override flags. This can be any combination of the OVERRIDE flags.

返回
The brush override flags if there are any or 0 if there are none: OVERRIDE

◆  GetBaseDraw()

BaseDraw * GetBaseDraw ( )

Gets the view that the user is currently drawing in.

返回
The view.

◆  GetAveragePointAndNormal()

void GetAveragePointAndNormal ( 向量 averagePoint ,
向量 normal  
)

Gets the average point and normal.
The returned values depend on what the fixed plane ( MDATA_SCULPTBRUSH_SETTINGS_FIXEDPLANE ) setting is for the brush:

◆  ApplySmooth()

void ApplySmooth ( )

Applies an effect of the smooth brush to the current dab.

注意
Call this after modification of the dab to smooth it out.

◆  GetVertexNormals()

const Vector32 * GetVertexNormals ( )

Gets the vertex normals for the SculptObject .

注意
The number of vertex normals is equal to the number of points on the PolygonObject returned from GetPolygonObject() .
返回
The vertex normals for the SculptObject .

◆  GetOriginalVertexNormals()

const Vector32 * GetOriginalVertexNormals ( )

Gets the state of the vertex normals before the user started a brush stroke.

注意
The number of vertex normals is equal to the number of points on the PolygonObject returned from GetPolygonObject() .
由于
R17.032
返回
The vertex normals for the SculptObject .

◆  GetFaceNormals()

const Vector32 * GetFaceNormals ( )

Gets the face normals for the SculptObject .

注意
The number of face normals is equal to the number of polygons on the PolygonObject returned from GetPolygonObject() .
由于
R17.032
返回
The face normals for the SculptObject .

◆  GetAutoScaleValue()

Float GetAutoScaleValue ( Bool   noRadius )

Gets a value which represents the scale of the SculptObject .

注意
This value can be used to convert a distance in object space with the value returned from GetBrushRadius() to help adjust the algorithm for the brush
since the value returned from GetBrushRadius() is also already adjusted using the same value.
参数
[in] noRadius true means it does not take into account the radius of the object in its calculation and only uses the scale.
返回
The scale value with which to adjust the local space vector or distance value.

◆  GetBrushFalloff()

Float GetBrushFalloff ( Int32   index ,
Vector32 pRetStencilColor = nullptr ,
Float pCustomDistance = nullptr  
)

Retrieves the brush falloff for the brush point at index .
The falloff is already adjusted by using the values from the stamp and stencil so it can be used directly to adjust the strength of an offset to add to the layer.

参数
[in] index The index of the point on the SculptObject .
This index can be found for the current point using BrushPointData.pointIndex .
[out] pRetStencilColor Assigned the color of the stencil. This saves an additional call to GetStencilColor() .
[in] pCustomDistance The custom distance to use.
Internally this method uses the distance that the point is from the hit point in its calculation ( BrushPointData::distance ).
Pass a value instead to use custom distance.
返回
The final falloff value that can be used to adjust the offset value.

◆  GetBrushFalloffFromPos()

Float GetBrushFalloffFromPos ( const 向量 pos )

Retrieves the falloff value, defined by the falloff curve, based on the distance from input pos to the hit point for the dab.

参数
[in] pos A point in 3D space to get the falloff for.
返回
The falloff value.

◆  OffsetPoint()

void OffsetPoint ( Int32   index ,
const 向量 offset ,
Vector32 pVertexColor = nullptr ,
SCULPTOFFSETFLAGS   flags = SCULPTOFFSETFLAGS::NONE  
)

Offsets the brush point at index point on the layer by the given offset amount.

注意
This method should be used only if IsPreviewDab() returns false , otherwise use OffsetPreviewPoint() 方法。
参数
[in] index The index of the point on the SculptObject .
This index can be found for the current point using BrushPointData.pointIndex .
[in] offset The vector to offset the point by.
[in] pVertexColor Private . Used internally.
[in] flags The flags to let use or ignore settings such as the layers mask or strength when offsetting the point: SCULPTOFFSETFLAGS By setting the SCULPTOFFSETFLAGS::IGNOREMASK flag it will ignore whatever the mask checkbox state is for the layer
Otherwise it uses this state to determine if it should use the mask.

◆  IsPreviewDab()

Bool IsPreviewDab ( )

Checks if the dab is a preview dab.

注意
Currently only DragRect and DragDab support preview brushes.
返回
true if if it is a preview dab, otherwise false .

◆  OffsetPreviewPoint()

void OffsetPreviewPoint ( Int32   index ,
const 向量 offset ,
SCULPTOFFSETFLAGS   flags = SCULPTOFFSETFLAGS::NONE  
)

IsPreviewDab() returns true then apply the offset using this method.
This adds the offset to a temporary preview layer that is created when using the DragDab and DragRect draw modes.

注意
This method should be used only if IsPreviewDab() returns true , otherwise use OffsetPoint() 方法。
参数
[in] index The index of the point on the SculptObject .
This index can be found for the current point using BrushPointData.pointIndex .
[in] offset The vector to offset the point by.
[in] flags The flags to let use or ignore settings such as the layers mask or strength when offsetting the point: SCULPTOFFSETFLAGS
By setting the SCULPTOFFSETFLAGS::IGNOREMASK flag it ignores whatever the mask checkbox state is for the layer.
Otherwise it uses this state to determine if it should use the mask.

◆  DirtyAllPoints()

void DirtyAllPoints ( SCULPTBRUSHDATATYPE   type )

Makes dirty all the points for the dab according to the SCULPTBRUSHDATATYPE .

参数
[in] type The type to use for the brush data to make dirty.

◆  IsPointModified()

Bool IsPointModified ( Int32   index )

Checks if another brush stroke has changed a point.

注意
When using Symmetry, another mirrored brush may change the point.
参数
[in] index The index of the point on the SculptObject .
This index can be found for the current point using BrushPointData.pointIndex .
返回
true if the point was modified, otherwise false .

◆  GetStencilColor()

Float GetStencilColor ( const 向量 point ,
Vector32 pRetColor = nullptr ,
Vector32 pRetCoords = nullptr ,
SAMPLEMODE   mode = SAMPLEMODE::TAKEONEPIXEL  
)

Retrieves the color and gray values of the stencil for a point in the SculptObject local space.

参数
[in] point A point on the surface of the SculptObject for which to get a color for.
[out] pRetColor Assigned the color of the stencil.
[out] pRetCoords Assigned the returned coordinates of the pixel on the stencil bitmap.
[in] mode The sample mode used to sample the stencil texture: SAMPLEMODE
返回
The gray scale value of the stencil, which has been adjusted by the stencil gray value.

◆  GetStampColor()

Float GetStampColor ( const 向量 point ,
Float   distanceFromHitPoint ,
Vector32 pRetColor = nullptr ,
Vector32 pRetCoords = nullptr ,
SAMPLEMODE   mode = SAMPLEMODE::TAKEONEPIXEL  
)

Retrieves the color and gray values of the stamp for a point in the SculptObject local space.

参数
[in] point A point in the SculptObject coordinate system which is used to sample the stamp on the current dab.
[in] distanceFromHitPoint Can be either the BrushPointData.distance value, the length of the vector (hit point - point) or a custom distance value.
This is used to get the correct falloff for the point.
[out] pRetColor Assigned the color of the stamp.
[out] pRetCoords Assigned the coordinates of the pixel on the stamp bitmap.
[in] mode The sample mode used to sample the stencil texture: SAMPLEMODE
返回
The gray scale value of the stamp, which has been adjusted by the stamp gray value.

◆  GetStencil()

const BaseBitmap * GetStencil ( )

Get the stencil used for the dab.

返回
The bitmap for the stencil.

◆  GetStamp()

const BaseBitmap * GetStamp ( )

Gets the stamp used for the dab.

返回
The bitmap for the stamp.

◆  GetBrush()

SculptBrushToolData * GetBrush ( )

Gets the Brush being used. This only returns the brush if SculptBrushParams::EnableBrushAccess(true) has been set.

警告
If this is called by a Modifier then it returns nullptr . Always check to make sure the returned pointer is not a nullptr .
返回
A pointer to the brush tool data.

◆  GetStrokeInstanceID()

Int32 GetStrokeInstanceID ( )

Gets the ID of the stroke instance that the dab is being drawn for.

返回
The stroke instance ID.

◆  IsSculptObject()

Bool IsSculptObject ( )

Checks if the object being touched is a SculptObject (i.e. it has a SculptTag ).

返回
trueIfOtherwiseFalse{it is a SculptObject }

◆  GetMirrorPoint()

向量 GetMirrorPoint ( const 向量 point ,
Bool   isNormal  
)

Gets the mirrored point (or Normal) from the objects space to the correct location for the current dab.

警告
This should only be used to get the symmetrically mirrored point for a point.
In most cases this method would never be used because the brush system automatically handles symmetrical points.
参数
[in] point The input point, or normal, to mirror.
[in] isNormal Set to true point is a normal, the point is then only rotated and not offseted.
返回
The mirrored point.

◆  GetMaskCache()

Float32 * GetMaskCache ( )

Gets the current mask values for the PolygonObject .

注意
The number of points returned is equal to the number of points on the PolygonObject .
返回
The mask values.

◆  PointPolysAverage() [1/2]

Float32 PointPolysAverage ( Int32   vertex ,
Float32 values  
)

Averages out the values for a vertex on the PolygonObject .

参数
[in] vertex The vertex number on the PolygonObject to get the average value for.
[out] values The values to average out. This must contains the same number of values as there are points on the PolygonObject .
返回
The mask values.

◆  PointPolysAverage() [2/2]

向量 PointPolysAverage ( Int32   vertex ,
向量 values  
)

Averages out the values for a vertex on the PolygonObject .

参数
[in] vertex The vertex number on the PolygonObject to get the average value for.
[in] values The values to average out. This must contains the same number of values as there are points on the PolygonObject .
返回
The mask values.

◆  IsPointInFillArea()

Bool IsPointInFillArea ( const 向量 p )

Checks if a point is within the drawn fill area.

注意
This method is useful in Fill brush tools.
参数
[in] p A point in local space to check.
返回
true if if the point is within the fill area, otherwise false .

◆  IsBackface()

Bool IsBackface ( )

返回 true if this dab is being applied backfacing polygons.

注意
Backface polygons will only be sculpted on if the brush has its BackFaceSculpting option enabled and the Backface option is also checked by the user.
由于
R17.032
返回
True if the dab is on backfacing polygons.