Commit Graph

114227 Commits

Author SHA1 Message Date
Campbell Barton
ba77368455 Cleanup: disambiguate variable naming relating to selection
- Both "hit_resullt" & "hitresult" were used in the same functions
  with different meanings. Rename `hitresult` to `select_id`,
  a convention already widely used.

- Armature selection shadowed "result", using it to store two kinds
  of selection results, use "hit_result" for GPUSelectResult.
2024-10-19 10:16:27 +11:00
Sean Kim
8da0cfa000 Merge branch 'blender-v4.3-release' 2024-10-18 16:15:22 -07:00
Sean Kim
15be5b7708 Fix #129204: Multires normal automasking broken for certain brushes
Introduced in a4c9c01f31

Pull Request: https://projects.blender.org/blender/blender/pulls/129236
2024-10-19 01:14:00 +02:00
Hans Goudey
7d09dce25a Merge branch 'blender-v4.3-release' 2024-10-18 16:54:55 -04:00
Hans Goudey
c98da9d971 Fix #128656: Dynamic topology undo bugs when mixing memfile undo
Caused by 889b142924
which added the early return for the BMesh case.
2024-10-18 16:47:23 -04:00
Hans Goudey
fb2085050d Merge branch 'blender-v4.3-release' 2024-10-18 16:25:45 -04:00
Hans Goudey
8bb30e2c72 Fix: Build error after recent sculpt fix
Missing from 9f3cb8b74e.
2024-10-18 15:59:36 -04:00
Sean Kim
d4237f68d5 Merge branch 'blender-v4.3-release' 2024-10-18 12:49:45 -07:00
Sean Kim
ffa4f6eaba Fix #129085: Face set from Masked operator doesnt work with Multires
When the operator was ported away from the old PBVHVertRef
implementation, the corresponding Multires mask elements were never
accessed correctly.

Pull Request: https://projects.blender.org/blender/blender/pulls/129137
2024-10-18 21:46:36 +02:00
Sean Kim
34d8535a4e Merge branch 'blender-v4.3-release' 2024-10-18 11:21:38 -07:00
Hans Goudey
9f3cb8b74e Fix: Potential nested threading issue with thread local storage
We would have to use task isolation here because of the use of
`EnumerableThreadSpecific`. Anyway, nested threading isn't
helpful because of the relatively small node sizes.

Pull Request: https://projects.blender.org/blender/blender/pulls/129222
2024-10-18 20:04:31 +02:00
Scott-Dubinsky
b785484917 Fix: Extra return in node tools data-block handling
Pull Request: https://projects.blender.org/blender/blender/pulls/128457
2024-10-18 20:03:32 +02:00
Germano Cavalcante
784739499e Merge branch 'blender-v4.3-release' 2024-10-18 14:56:12 -03:00
Germano Cavalcante
97816b3936 Fix #129161: Snap Toggle turning on after confirming with 'Set Snap Base'
A smaller enum value was passed to ENUM_OPERATORS, causing bitwise-not
issues.
2024-10-18 14:29:11 -03:00
Falk David
df3796a668 Fix: GPv3: Interpolation tool doesn't fail if no frame mapping is found
The `find_curve_mapping_from_index` function could fail if no
`interval` was returned from `find_frames_interval`, but this error
was not handled by the caller. This meant that
`InterpolateOpData::from_operator` could create empty
`InterpolationPairs` for every layer. In this case, the operator would
not do any interpolation, but it would still create a keyframe.

The operator shouldn't try to interpolate when there are no mappings
found.

The fix makes `find_curve_mapping_from_index` return `true`
when it succeeds. Then it checks if any mappings have been found
and if none were found returns `nullptr` from `InterpolateOpData::from_operator`.
The operators can then check if the `InterpolateOpData` exists
and otherwise exit.

Pull Request: https://projects.blender.org/blender/blender/pulls/129212
2024-10-18 19:24:23 +02:00
Falk David
d61c08453d Merge branch 'blender-v4.3-release' 2024-10-18 18:11:20 +02:00
Falk David
1906446716 Fix: GPv3: Newly added objects don't have the Use Lights setting set
The issue was that the code checked for the `OB_GPENCIL_LEGACY`
type instead of `OB_GREASE_PENCIL`.
2024-10-18 18:09:10 +02:00
Thomas Dinges
6a1fa73b18 Merge branch 'blender-v4.3-release' 2024-10-18 17:20:04 +02:00
Omar Emara
fdb3dc0377 Fix: Crash when changing compositor device
Blender crashes when changing the compositor execution device. That's
because cached resources that were originally computed for CPU are now
being used for GPU and vice versa, which can be unexpected in code that
uses them.

To fix this, we free and recreate the entire compositor context when the
execution device or precision change, because it is much easier and
safer to recreate everything as opposed to trying to update the
necessary resources.
2024-10-18 16:58:35 +03:00
Pratik Borhade
74129b648b Fix #129142: GPv3: gesture select tools selecting only right handles
When selection type is set/and for gesture selection tools, Instead of
current attribute, all three selection attributes (`.selection`, `left_handle`,
`right_handle`) are reset in every iteration of for loop.

Pull Request: https://projects.blender.org/blender/blender/pulls/129147
2024-10-18 15:32:53 +02:00
Bastien Montagne
ad943c1cf3 Cleanup: Remove unused forward function declaration. 2024-10-18 15:27:21 +02:00
Charles S
49bfcbc06d Fix: Replace MEM_freeN / MEM_delete mismatch in blurkernel
Discovered via an abort when using the blur brush.

Pull Request: https://projects.blender.org/blender/blender/pulls/128956
2024-10-18 15:20:32 +02:00
Julian Eisel
041d3e4436 Fix: Missing version bump after previous release branch merge
3a708a27f9 and c8e75c03c3 include a version bump in the release branch.
The main branch should also get a version bump so the same versioning
code runs for files saved with main.
2024-10-18 14:47:01 +02:00
Julian Eisel
070a84580e Merge branch 'blender-v4.3-release' 2024-10-18 14:44:56 +02:00
Julian Eisel
c8e75c03c3 Grease Pencil: Enable available catalogs by default in asset shelf
In grease pencil draw mode, enable the Draw, Erase and Utilities
catalogs by default for the asset shelf, meaning they will show up as
tabs in the shelf. For grease pencil sculpt mode it's the Contrast,
Transform and Utilities mode (consistent with mesh sculpt mode).

This makes the assets of the corresponding types easily available, even
without requiring the "Filter Brushes by Tool" asset shelf option
enabled. It also makes the catalogs and the contained brushes more
discoverable as an organization helper.

These catalogs were added in 09bd5a5777.
2024-10-18 14:42:51 +02:00
Julian Eisel
3a708a27f9 Sculpt/Paint: Disable asset shelf filtering by tool by default
Disables the "Filter Brushes by Tool" toggle of the brush asset shelf
options by default.

After further feedback, we want to keep this option disabled by default.
It's useful to be able to access all brushes from the asset shelf,
regardless of what the active tool is. In many cases you'd see the asset
shelf with only one brush, which wastes space and isn't a good look
design quality wise. The following commit will also enable some more
asset catalogs by default which should be useful for filtering brushes,
and reduce the need for filtering by active tool.

So all things considered, while having this option is useful, it can
remain disabled by default.
2024-10-18 14:16:58 +02:00
Jacques Lucke
c428765b28 Merge branch 'blender-v4.3-release' 2024-10-18 12:38:34 +02:00
Jacques Lucke
30c3d17bb6 Fix #129190: invalid runtime data in lineart modifier after load 2024-10-18 12:38:00 +02:00
Falk David
078f16a8d5 Fix: GPv3: Interpolation not working with no selection
The interpolation tool in edit mode would create an empty keyframe if nothing in the
`from_drawing` and `to_drawing` was selected. This is not how the tool behaved in GPv2
so this is unexpected.

The fix  checks that if `only_selected` is used, there also is a selection in both of the
drawings in the pair, and otherwise fallback to interpolating all the strokes.
This is consistent with how the tool worked in 4.2.

Pull Request: https://projects.blender.org/blender/blender/pulls/129206
2024-10-18 11:38:46 +02:00
Campbell Barton
d9f38fca5f PyAPI: support Python 3.13
- `_PySet_NextEntry` has been removed, use generic iterator access
  which will has some additional overhead as it needs to create
  an iterator to access the values.

- Add v3.13 compatibility defines to account for renaming:
  _PyObject_LookupAttr -> PyObject_GetOptionalAttr
  _PyLong_AsInt -> PyLong_AsInt

- Unfortunately use of Python's internal API needs to be used to
  inspect op-codes in `bpy_driver.cc`.

Testing GLTF/FBX IO there isn't any significant performance impact
from these changes.

Resolves #123871.
2024-10-18 17:22:09 +11:00
John Kiril Swenson
9da2589f5a Merge branch 'blender-v4.3-release' 2024-10-17 22:56:07 -05:00
John Kiril Swenson
d5d81c5078 VSE: Switch to box select default for timeline
PR #128051 made some improvements to code by cleaning up properties and
simplifying logic.

However, the default tool in most spaces is box select. By switching to
box select default, there should be more front-facing consistency across
spaces while still retaining near-identical behavior.

This patch would fix the small bug listed in #128671 while keeping the
simplified code benefits from #128051.

Also:
- Move selection keymap items up in the Sequencer (Global) keymap so it
  is more visible (similar to Node Editor ordering).
- Split `side_of_frame` property for ctrl press keymap item into a
  separate keymap item on ctrl click for both LCS and RCS to avoid
  clashing with ctrl+drag for box selects in RCS.

Pull Request: https://projects.blender.org/blender/blender/pulls/129028
2024-10-18 05:50:09 +02:00
Harley Acheson
eec04f32eb Merge branch 'blender-v4.3-release' 2024-10-17 19:30:08 -07:00
Harley Acheson
cf2d3d0867 Fix: Docking Called from Shortcut Without Status Bar
When starting a docking operation from an assigned shortcut, the source
area will be incorrect if the Status Bar is not currently being shown.
This PR just adds defaults that are never valid window coordinates.

Pull Request: https://projects.blender.org/blender/blender/pulls/129187
2024-10-18 04:28:33 +02:00
Campbell Barton
89311be66e Merge branch 'blender-v4.3-release' 2024-10-18 10:27:15 +11:00
Campbell Barton
c072d42f6b Fix #129177: name 'bpy' is not defined at exit
Own regression in 1e55d034a1.
2024-10-18 09:37:34 +11:00
Arye Ramaty
116a55e46e Fix #128997: wrong evaluation of outputs in the Index of Nearest node
Pull Request: https://projects.blender.org/blender/blender/pulls/128998
2024-10-17 23:47:13 +02:00
Sean Kim
faef1afb90 Merge branch 'blender-v4.3-release' 2024-10-17 14:14:26 -07:00
Sean Kim
e01713be7c Fix #129135: Automasking topology doesn't work with certain brushes
Introduced in 915be63b01

Also fixes an unreported similar issue with BMesh

Pull Request: https://projects.blender.org/blender/blender/pulls/129139
2024-10-17 23:12:20 +02:00
Jesse Yurkovich
5c65ad4b1b Cleanup: use non-void return types for BKE_*_add functions
Many of the functions were already using proper types. This changes the
others still using `void *` to return their proper types directly.

Pull Request: https://projects.blender.org/blender/blender/pulls/128980
2024-10-17 21:05:18 +02:00
Sybren A. Stüvel
56e6eb6d6d Fix merge issue
Remove an `#endif` that was accidentally merged from
`blender-v4.3-release` to `main`.
2024-10-17 19:12:20 +02:00
Falk David
72aca040e3 Merge branch 'blender-v4.3-release' 2024-10-17 18:35:19 +02:00
Falk David
0a560582b5 Fix: GPv3: Python: Missing parent_group property on layer groups
This property was available for `layers` but was missed for layer groups.
Adds a `parent_group` property for layer groups that returns the
parent group if the group is inside another group.
For groups that are inside the root, returns `None`.

Pull Request: https://projects.blender.org/blender/blender/pulls/129168
2024-10-17 18:34:19 +02:00
Clément Foucault
a4ef779abe Fix: Overlay-Next: Assert caused by unreleased texture 2024-10-17 18:23:45 +02:00
Bastien Montagne
1e55d034a1 Fix massive amount of memleaks on exit in BPY.
Essentially, our current code would not properly remove (dereference)
its python objects matching various RNA data created during execution.

Some cases are fairly trivial to understand (like the lack of handling
of unregstering for our 'startup' operators and UI), other were more
subtle (like unregistered PropertyGroups who would remove/free their RNA
struct definition, without releasing first the potential matching python
object).

Co-authored-by: Campbell Barton <campbell@blender.org>

Pull Request: https://projects.blender.org/blender/blender/pulls/128899
2024-10-17 18:05:31 +02:00
Falk David
649dfb8abc Refactor: GPv3: Use int3 for triangle data type
These were `uint3` before, but they should just be `int3`s.
Also uses `array_utils::copy_group_to_group` with new cpptype `int3`.

Pull Request: https://projects.blender.org/blender/blender/pulls/129166
2024-10-17 17:21:15 +02:00
Jacques Lucke
ca2058ab04 Fix #129128: broken data-block search for short names
If ifdef for `WITH_ANIM_BAKLAVA` accidentally removed the `else { ... }` branch
around `name = RNA_struct_name_get_alloc(...)`. For data-block names,
`BKE_id_full_name_ui_prefix_get` is used above which adds 3 extra letters before
the data-block name. This are removed again by the bug. Later code removes them
again leaving potentially an empty string.

Pull Request: https://projects.blender.org/blender/blender/pulls/129153
2024-10-17 16:59:35 +02:00
Falk David
d68a79e084 Merge branch 'blender-v4.3-release' 2024-10-17 16:43:11 +02:00
Falk David
c539ea792c Fix: GPv3: Reduce draw tool performance regression
During the painting operation, the `GreasePencilDrawing` is updated in-place.
Previously, we simply tagged the whole drawing for a topology update.
This meant that the triangulation and curve normals were recomputed
for (pretty much) every new input sample.

Since the draw tool only creates one new stroke, we can copy the
triangulation of all the other strokes and only recompute the triangulation
of the newly drawn stroke(s).

First, a new `triangle_offsets_cache` is added that is lazily computed.
The computation for this should be pretty cheap.
Then, a new function `Drawing::tag_topology_changed(const IndexMask &curves_to_update)`
is added. This function takes an index mask of curves and only updates
their triangle cache. The cache for the other curves is copied.

In a test file with around 400k points, recomputing the triangle cache
(every input sample) took around 45ms. This meant that there was a noticable
drop in frame rate. With this patch, the time for each sample goes down to
less than 0.1ms. The frame rate feels much better.

But, drawing a longer and longer stroke still makes this time go up,
because the triangulation for the single stroke becomes more and
more expensive. This will have to be improved further.

Part of #124149.

Pull Request: https://projects.blender.org/blender/blender/pulls/129115
2024-10-17 15:28:44 +02:00
Omar Emara
8a33962357 Compositor: Support passes in new CPU compositor
This patch adds support for passes in the new CPU compositor. This
involves rewriting the get_input_texture method into a get_pass methods
that returns a result as opposed to a texture. The result wraps the
cached GPU texture or image buffer depending on the execution device.

The Render Layers node was implemented for CPU execution and a new
utility constructor for the result class was added to determine type and
precision based on GPU texture format. The fallback depth pass that was
retrieved from the viewport frame buffer was removed, as it was a hack
that can no longer be supported due to the use of stencil format.

Pull Request: https://projects.blender.org/blender/blender/pulls/129154
2024-10-17 15:04:25 +02:00