Files
test/source/blender
Philipp Oeser 09cb2be159 Fix #124444: Painting from python ignores certain brush features
The reported issue was that Texture Mask mapping behaves wrong (wrong
coordinates -- seemed as if it was always using `Tiled` mapping), but
the issue actually spawns to more brush features (the coordinates were
wrong not only for mask mapping but for the actual texture mapping, too,
next to randomness and offsets/angles being ignored, jitter was also not
working at all).

On the code side, for the reported issue, we can observe that
`BKE_brush_sample_masktex` relies on `UnifiedPaintSettings`
`mask_tex_mouse` to be set. Other stuff mentioned above also ends up in
`UnifiedPaintSettings`.

In regular painting (has its own modal), this gets updated in
`paint_brush_stroke_add_step` by calling `paint_brush_update` before
adding another step. This is not called when doing painting from python
(here the modal handling happens in py, usually
`bpy.ops.paint.image_paint`is executed immediately for each mousemove).

Jitter is also doing stuff in `paint_brush_stroke_add_step` -- equally
ignored from above py workflow.

So to resolve, now make sure we are calling the necessary stuff in
`paint_exec` as well.

NOTE: There was a similar case in
9aa20a0979, where we could simply move
part of the necessary code from `paint_brush_update` to
`paint_stroke_new`

NOTE: `Rake` is still ignored, depends on previous positions, cannot be
supported

Pull Request: https://projects.blender.org/blender/blender/pulls/124582
2024-07-26 08:36:13 +02:00
..
2024-07-25 19:12:41 +02:00