BrushDabData
¶
New in version R16.021.
The brush data for an individual dab.
c4d.modules.sculpting.
BrushDabData
¶
BrushDabData.GetData()
BrushDabData.GetObject()
BrushDabData.GetPointData()
BrushDabData.GetPolyData()
BrushDabData.GetPolygonObject()
BrushDabData.GetBaseObject()
BrushDabData.GetPointCount()
BrushDabData.GetPolyCount()
BrushDabData.GetNeighbor()
BrushDabData.GetLayer()
BrushDabData.GetPoint()
BrushDabData.GetOriginalPoint()
BrushDabData.GetNormal()
BrushDabData.GetDrawDirectionNormal()
BrushDabData.GetBrushStrength()
BrushDabData.GetBrushRadius()
BrushDabData.GetMousePos3D()
BrushDabData.GetHitPoint()
BrushDabData.GetLastHitPoint()
BrushDabData.GetHitPolygon()
BrushDabData.GetEyePoint()
BrushDabData.IsMirroredDab()
BrushDabData.GetBrushOverride()
BrushDabData.GetBaseDraw()
BrushDabData.GetAveragePointAndNormal()
BrushDabData.GetMirrorPoint()
BrushDabData.ApplySmooth()
BrushDabData.GetVertexNormal()
BrushDabData.GetOriginalVertexNormal()
BrushDabData.GetFaceNormal()
BrushDabData.GetAutoScaleValue()
BrushDabData.GetBrushFalloff()
BrushDabData.GetBrushFalloffFromPos()
BrushDabData.OffsetPoint()
BrushDabData.IsPreviewDab()
BrushDabData.OffsetPreviewPoint()
BrushDabData.DirtyAllPoints()
BrushDabData.IsPointModified()
BrushDabData.GetStencilColor()
BrushDabData.GetStampColor()
BrushDabData.GetStencil()
BrushDabData.GetStamp()
BrushDabData.GetStrokeInstanceID()
BrushDabData.IsSculptObject()
BrushDabData.IsFillTool()
BrushDabData.IsBackface()
BrushDabData.
GetData
(
)
¶
Gets the settings data for the tool.
Return type: | c4d.BaseContainer |
---|---|
Returns: | The data. |
BrushDabData.
GetObject
(
)
¶
Gets the Sculpt Object that the dab is for.
Return type: | c4d.modules.sculpting.SculptObject |
---|---|
Returns: | The Sculpt Object. |
BrushDabData.
GetPointData
(
index
)
¶
Gets the point at index affected by the brush.
Parameters: | index ( int ) – The index of the point. |
---|---|
Raises: |
IndexError
– If the point
index
is out of range :
0<=index<
GetPointCount()
.
|
Return type: | dic{ pointIndex : int, distance : float} |
Returns: | The point data index and distance. |
BrushDabData.
GetPolyData
(
index
)
¶
Gets the polygon at index affected by the brush.
Parameters: | index ( int ) – The index of the polygon. |
---|---|
Raises: |
IndexError
– If the point
index
is out of range :
0<=index<
GetPolyCount()
.
|
Return type: | dic{ polyIndex : int, distance : float} |
Returns: | The polygon data index. |
BrushDabData.
GetPolygonObject
(
)
¶
Gets the Polygon Object for the Sculpt Object that is currently being displayed in the viewport.
Return type: | c4d.PolygonObject |
---|---|
Returns: | The Polygon Object. |
BrushDabData.
GetBaseObject
(
)
¶
Gets the original object that the Sculpt Tag is applied to. In the case where this there is no Sculpt Tag on then this will return the same as the call to
GetPolygonObject()
.
Return type: | c4d.PolygonObject |
---|---|
Returns: | The original object. |
BrushDabData.
GetPointCount
(
)
¶
Gets the number of points that are touched by the dab.
Return type: | int |
---|---|
Returns: | The number of points. |
BrushDabData.
GetPolyCount
(
)
¶
Gets the number of polygons that are touched by the dab.
Return type: | int |
---|---|
Returns: | The number of polygons. |
BrushDabData.
GetNeighbor
(
)
¶
Gets the neighbor information for the Sculpt Object if it is currently at level 0 .
Note
If the user is sculpting a regular unsubdivided Polygon Object then this will also return a neighbor information.
Return type: | c4d.utils.Neighbor |
---|---|
Returns: |
The Neighbor information if Sculpt Object is at level
0
(or if the user is sculpting on a regular
PolygonObject
), otherwise
None
.
|
BrushDabData.
GetLayer
(
)
¶
Retrieves the currently selected Layer for a subdivided
SculptObject
. If the user is sculpting a regular
PolygonObject
) then this will return
None
.
Return type: | c4d.modules.sculpting.SculptLayer |
---|---|
Returns: |
The currently selected layer in the LayerManager if it is a subdivided
SculptObject
, otherwise
None
.
|
BrushDabData.
GetPoint
(
index
)
¶
Parameters: | index ( int ) – The index of the point. |
---|---|
Raises: |
IndexError
– If the point
index
is out of range :
0<=index<
GetPointCount()
.
|
Return type: | c4d.Vector |
Returns: |
The point at
index
on the
PolygonObject
that is currently displayed in the viewport.
|
BrushDabData.
GetOriginalPoint
(
index
)
¶
Retrieves a copy of the point at index in its state before the brush stroke started.
Note
You can use this point 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.Parameters: | index ( int ) – The index of the point. |
---|---|
Raises: |
IndexError
– If the point
index
is out of range :
0<=index<
GetPointCount()
.
|
Return type: | c4d.Vector |
Returns: | The point at index of the PolygonObject at the state it was in when the user first pressed the left mouse button down. |
BrushDabData.
GetNormal
(
)
¶
Gets the normal at the current hitpoint for the dab. This is the average vertex normal of all the points that are affected by the dab.
Return type: | c4d.Vector |
---|---|
Returns: | The normal at the current hitpoint. |
BrushDabData.
GetDrawDirectionNormal
(
)
¶
SculptBrushParams.EnableDrawDirection()
to
True
, then this returns the direction selected by the user.
Otherwise it just returns the same vector as
GetNormal()
.
Return type: | c4d.Vector |
---|---|
Returns: | The Draw Direction normal. |
BrushDabData.
GetBrushStrength
(
)
¶
Gets the brush strength for the dab.
Warning
This strength is not the same as the strength in the
BaseContainer
data.
This also takes into account many other variables including tablet pressure to create the value.
Return type: | float |
---|---|
Returns: | The strength of the brush. |
BrushDabData.
GetBrushRadius
(
)
¶
Gets the brush radius for the dab. The size of the radius is in the Sculpt Object local space.
Warning
This is not the same as the brush size in the
BaseContainer
data.
This also takes into account other factors such as the distance from the camera and scale of the object and tablet values to determine the correct brush radius.
Return type: | float |
---|---|
Returns: | The radius of the brush. |
BrushDabData.
GetMousePos3D
(
)
¶
If the brush mode is SCULPTBRUSHMODE_GRAB then this method can be used to get the location of the mouse pointer in world space in the scene.
Return type: | c4d.Vector |
---|---|
Returns: |
The position of the mouse in world space if the brush mode is
SCULPTBRUSHMODE_GRAB
, otherwise it returns
c4d.Vector(0,0,0)
.
|
BrushDabData.
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.
Note
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.
Return type: | c4d.Vector |
---|---|
Returns: | The hitpoint on the surface. |
BrushDabData.
GetLastHitPoint
(
)
¶
Gets the hit point for the previous dab during the stroke.
Return type: | c4d.Vector |
---|---|
Returns: | The last hitpoint on the surface. |
BrushDabData.
GetHitPolygon
(
)
¶
New in version R17.032.
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.
Return type: | int |
---|---|
Returns: | The index of the polygon on hit the surface. |
BrushDabData.
GetEyePoint
(
)
¶
Return type: | c4d.Vector |
---|---|
Returns: |
The virtual mouse location in local space above the surface of the
SculptObject
.
|
BrushDabData.
IsMirroredDab
(
)
¶
Checks if this dab is for a mirrored brush stroke.
Return type: | bool |
---|---|
Returns: | True if it’s a mirrored dab or False if it’s the main brush stroke. |
BrushDabData.
GetBrushOverride
(
)
¶
Gets the override flags. This could be any combination of the OVERRIDE flags.
Return type: | int |
---|---|
Returns: | The overrides if there are any or 0 if there are none. |
BrushDabData.
GetBaseDraw
(
)
¶
Gets the
BaseDraw
that the user is currently drawing in.
Return type: | int |
---|---|
Returns: |
The
BaseDraw
.
|
BrushDabData.
GetAveragePointAndNormal
(
)
¶
Return type: |
dict{
averagePoint
:
Vector
,
normal
:
Vector
}
|
---|---|
Returns: | The average point and normal based on the Fixed Plane setting. |
BrushDabData.
GetMirrorPoint
(
point
,
isNormal
)
¶
Parameters: |
|
---|---|
Return type: | |
Returns: |
The mirrored point. |
BrushDabData.
ApplySmooth
(
)
¶
Applies an effect of the smooth brush to the current dab. Call this after you have modified the dab to smooth it out if needed.
BrushDabData.
GetVertexNormal
(
index
)
¶
Gets the vertex normal at index for the Sculpt Object.
Parameters: | index ( int ) – The index of the vertex. |
---|---|
Raises: |
IndexError
– If the vertex
index
is out of range :
0<=index<
GetPointCount()
.
|
Return type: | c4d.Vector |
Returns: | The vertex normal. |
BrushDabData.
GetOriginalVertexNormal
(
index
)
¶
New in version R17.048.
Gets the state of a vertex normal before the user started a brush stroke.
Parameters: | index ( int ) – The index of the vertex. |
---|---|
Return type: | c4d.Vector |
Returns: | The original vertex normal. |
BrushDabData.
GetFaceNormal
(
index
)
¶
New in version R17.032.
Gets the face normal at index for the SculptObject.
Parameters: | index ( int ) – The index of the face. |
---|---|
Return type: | c4d.Vector |
Returns: | The face normal. |
BrushDabData.
GetAutoScaleValue
(
noRadius
)
¶
Note
This can be used to convert a distance in object space with the value returned from
GetBrushRadius()
to help adjust
the algorithm for your brush since the value returned from
GetBrushRadius()
is also already adjusted using the same value.
Parameters: | noRadius ( bool ) – True means it will not take into account the radius of the object in its calculation and will only use the scale. |
---|---|
Return type: | float |
Returns: | The scale value with which to adjust your local space vector or distance value. |
BrushDabData.
GetBrushFalloff
(
index
[
,
customDistance=-1.0
]
)
¶
Parameters: |
|
---|---|
Return type: |
float |
Returns: |
The final falloff value that can be used to adjust the offset value. |
BrushDabData.
GetBrushFalloffFromPos
(
pos
)
¶
Returns the falloff value, defined by the falloff curve, based on the distance from pos to the hitpoint for the dab.
Parameters: | pos ( c4d.Vector ) – A point in 3D space to get the falloff for. |
---|---|
Return type: | float |
Returns: | The falloff value. |
BrushDabData.
OffsetPoint
(
index
,
offset
[
,
respectStrength=0
]
)
¶
Offsets the point on the layer by the given offset amount.
Note
This method should be used if
IsPreviewDab()
returns
False
, otherwise use
OffsetPreviewPoint()
instead.
Parameters: |
|
---|---|
Raises: |
IndexError
– If the point
index
is out of range :
0<=index<
|
BrushDabData.
IsPreviewDab
(
)
¶
Checks if this is a preview dab. Currently only DragDab and DragRect draw modes support preview brushes.
Return type: | bool |
---|---|
Returns: | True if it is a preview dab, otherwise False . |
BrushDabData.
OffsetPreviewPoint
(
index
,
offset
)
¶
IsPreviewDab()
returns
True
then you should apply your offset using this method. If it returns
False
then you should use
OffsetPreviewPoint()
instead.
This adds the offset to a temporary preview layer that is created when using the DragDab and DragRect draw modes.
Parameters: |
|
---|---|
Raises: |
IndexError
– If the point
index
is out of range :
0<=index<
|
BrushDabData.
DirtyAllPoints
(
flags
)
¶
Dirty all the points for this dab according to the flags.
Parameters: | flags ( int ) – See SCULPTBRUSHDATATYPE . |
---|
BrushDabData.
IsPointModified
(
index
)
¶
When using symmetry another mirrored brush may change the point. You can use this to check if another brush stroke has changed a point and if so then you can do something different for this current stroke.
Parameters: | index ( int ) – The index of the point. |
---|---|
Raises: |
IndexError
– If the point
index
is out of range :
0<=index<
GetPointCount()
.
|
Return type: | bool |
Returns: | True if the point was modified, otherwise False . |
BrushDabData.
GetStencilColor
(
point
,
mode
)
¶
Retrieves the grey value, color and coordinates of the stencil for a point in the Sculpt Object local space.
Parameters: |
|
---|---|
Raises: |
IndexError
– If the
point
index is out of range :
0<=index<
|
Return type: | |
Returns: |
The grey value, color and coords of the stencil. |
BrushDabData.
GetStampColor
(
point
,
distance
,
mode
)
¶
Retrieves the grey value, color and coordinates of the stamp for a point in the Sculpt Object local space.
Parameters: |
|
---|---|
Raises: |
IndexError
– If the
point
index is out of range :
0<=index<
|
Return type: | |
Returns: |
The grey value (adjusted by the stamps Gray Value), color and coordinates of the stamp. |
BrushDabData.
GetStencil
(
)
¶
Retreves the stencil bitmap used for this dab.
Return type: | c4d.bitmaps.BaseBitmap |
---|---|
Returns: | The bitmap for the stencil. |
BrushDabData.
GetStamp
(
)
¶
Retreves the stamp bitmap used for this dab.
Return type: | c4d.bitmaps.BaseBitmap |
---|---|
Returns: | The bitmap for the stamp. |
BrushDabData.
GetStrokeInstanceID
(
)
¶
Gets the ID of the stroke instance that this dab is being drawn for.
Return type: | int |
---|---|
Returns: | The stroke instance ID. |
BrushDabData.
IsSculptObject
(
)
¶
Checks if the object being touched is a
SculptObject
(i.e. has a
SculptTag
).
Return type: | bool |
---|---|
Returns: |
True
if the object being touched is a
SculptObject
, otherwise
False
.
|
BrushDabData.
IsFillTool
(
)
¶
Return type: | bool |
---|---|
Returns: | True if the current draw mode is fill, otherwise False . |
BrushDabData.
IsBackface
(
)
¶
New in version R17.032.
Returns True if the dab is being applied backfacing polygons.
Note
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.
Return type: | bool |
---|---|
Returns: | True if the dab is on backfacing polygons, otherwise False . |