MyPaint.Brush¶
Fields¶
None
Methods¶
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class MyPaint.Brush¶
The MyPaint brush engine class.
- classmethod new()¶
- Return type:
Create a new MyPaint brush engine instance. Initial reference count is 1. Release references using mypaint_brush_unref()
- classmethod new_with_buckets(num_smudge_buckets)¶
- Parameters:
num_smudge_buckets (
int
) –- Return type:
- from_defaults()¶
- get_base_value(id)¶
- Parameters:
id (
MyPaint.BrushSetting
) –- Return type:
Get the base value of a brush setting.
- get_inputs_used_n(id)¶
- Parameters:
id (
MyPaint.BrushSetting
) –- Return type:
Returns how many inputs are used for the dynamics of a
MyPaint.BrushSetting
- get_mapping_n(id, input)¶
- Parameters:
id (
MyPaint.BrushSetting
) –input (
MyPaint.BrushInput
) –
- Return type:
Get the number of points used for the dynamics mapping between a
MyPaint.BrushInput
andMyPaint.BrushSetting
.
- get_mapping_point(id, input, index)¶
- Parameters:
id (
MyPaint.BrushSetting
) –input (
MyPaint.BrushInput
) –index (
int
) –
- Returns:
- x:
Location to return the X value
- y:
Location to return the Y value
- Return type:
Get a X,Y point of a dynamics mapping.
- get_state(i)¶
- Parameters:
i (
MyPaint.BrushState
) –- Return type:
Get an internal brush engine state. Normally used for debugging, but can be used to implement record & replay functionality.
- get_total_stroke_painting_time()¶
- Return type:
Return the total amount of painting time for the current stroke.
- is_constant(id)¶
- Parameters:
id (
MyPaint.BrushSetting
) –- Return type:
Returns
True
if the brush has no dynamics for the givenMyPaint.BrushSetting
- new_stroke()¶
Start a new stroke.
- reset()¶
Reset the current brush engine state. Used when the next
MyPaint.Brush.stroke_to
() call is not related to the current state. Note that the reset request is queued and changes in state will only happen on next stroke_to()
- set_base_value(id, value)¶
- Parameters:
id (
MyPaint.BrushSetting
) –value (
float
) –
Set the base value of a brush setting.
- set_mapping_n(id, input, n)¶
- Parameters:
id (
MyPaint.BrushSetting
) –input (
MyPaint.BrushInput
) –n (
int
) –
Set the number of points used for the dynamics mapping between a
MyPaint.BrushInput
andMyPaint.BrushSetting
.
- set_mapping_point(id, input, index, x, y)¶
- Parameters:
id (
MyPaint.BrushSetting
) –input (
MyPaint.BrushInput
) –index (
int
) –x (
float
) –y (
float
) –
Set a X,Y point of a dynamics mapping. The index must be within the number of points set using
MyPaint.Brush.set_mapping_n
()
- set_print_inputs(enabled)¶
- Parameters:
enabled (
bool
) –
Enable/Disable printing of brush engine inputs on stderr. Intended for debugging only.
- set_state(i, value)¶
- Parameters:
i (
MyPaint.BrushState
) –value (
float
) –
Set an internal brush engine state. Normally used for debugging, but can be used to implement record & replay functionality.
- stroke_to(surface, x, y, pressure, xtilt, ytilt, dtime)¶
- Parameters:
- Returns:
non-0 if the stroke is finished or empty, else 0.
- Return type:
Should be called once for each motion event.