Sean Kim 6fb90e5303 Fix: Background paint strokes may not initialize certain settings
When a paint stroke is executed instead of processed via the modal
handler, prior to this commit, the `paint_brush_update` function was
not called. This method handles initialization of some temporary stroke
data inside `UnifiedPaintSettings`, which is used by dyntopo when
performing edge collapse.

This had the result of causing a divide by 0 with certain uninitalized
settings when using a brush with dyntopo enabled and calling the
operator from the python API (e.g. from unit testing), resulting in
nonsensical deformations.

There are a number of weak points with the current design:
* This issue was only exposed because of the refactor to the
  `UnifiedPaintSettings`, indicating that despite these values being
  runtime-only, they were still persisted in some cases in .blend files
* The data stored as individual stroke steps is not sufficient to
  reconstruct a paint stroke given a list of screen-space locations, and
  this data is populated outside of the common `stroke` callbacks.

Both of the above issues are wider reaching than this PR is intended to
fix.

This commit ensures that `paint_brush_update` is called in the `exec`
codepath and updates the related test image.

Pull Request: https://projects.blender.org/blender/blender/pulls/141314
2025-07-03 23:00:28 +02:00
2025-06-30 17:21:10 +10:00
2023-12-08 13:28:13 +11:00
2025-05-12 11:34:32 +02:00
2025-03-12 21:55:59 +11:00
2025-06-12 10:37:47 +02:00

Blender

Blender is the free and open source 3D creation suite. It supports the entirety of the 3D pipeline—modeling, rigging, animation, simulation, rendering, compositing, motion tracking and video editing.

Blender screenshot

Project Pages

Development

License

Blender as a whole is licensed under the GNU General Public License, Version 3. Individual files may have a different but compatible license.

See blender.org/about/license for details.

Description
No description provided
Readme 841 MiB
Languages
C++ 78%
Python 14.9%
C 2.9%
GLSL 1.9%
CMake 1.2%
Other 0.9%