Commit Graph

100546 Commits

Author SHA1 Message Date
Julian Eisel
9b246fc438 Merge branch 'blender-v3.6-release' 2023-06-19 16:40:10 +02:00
Julian Eisel
232e065a17 Fix #109053: File Append with recursions leads to crash
In this specific code path (recursive reading inside .blend files
containing assets), reading datablocks marked as asset would move
ownership over the asset metadata without indicating that in the source
that owned it previously. This would cause a double free attempt.
2023-06-19 16:39:37 +02:00
Brecht Van Lommel
4b4c95c402 Fix compositor node previews flickering when dragging sliders
Compositing jobs would get cancelled as you drag number sliders, and
would write back empty previews. Only sync previews for completed jobs.
2023-06-19 16:27:08 +02:00
Falk David
a6503f1dc9 Cleanup: Moving selection domain getter for GP
It was a bit odd having `ED_view3d_grease_pencil_selection_domain_get`
in the `ED_view3d.h` header.
Moving it to `ED_grease_pencil.h` makes more sense.
2023-06-19 16:22:48 +02:00
Sietse Brouwer
3432fc0b87 GPv3: Domain support for selection operators
This patch adds support for two of the three selection domains in the Edit Mode tool settings: point and stroke.

Affected selection operators: select all, lasso select, select pick, box select.

Pull Request: https://projects.blender.org/blender/blender/pulls/108970
2023-06-19 16:12:11 +02:00
Hans Goudey
c2db655d5e Merge branch 'blender-v3.6-release' 2023-06-19 09:55:12 -04:00
Sietse Brouwer
f758c4a6b1 Fix #108935: Auto-Normalize glitches in GPencil weight painting
There where glitches while weight painting in Grease Pencil with
auto-normalize enabled. This resulted in incorrect weights on vertices.
And sometimes a vertex group not deformed by bones was also affected
by auto-normalize (which should never happen).

This was due to:
- An erroneous line in the auto-normalize function which led to an
index out of bounds (and screwing up the vertex weights).
- An edge case where the active vertex group was de facto the only
group to be normalized.

Also in this patch:
- Removal of unreachable code
- Better names for the auto-normalize functions

Pull Request: https://projects.blender.org/blender/blender/pulls/109036
2023-06-19 15:49:57 +02:00
Jeroen Bakker
966afa70c7 Cleanup make format 2023-06-19 15:47:18 +02:00
Hans Goudey
30bf4c0945 Fix: Creating sharp_face attribute skipped with smooth set
There is an optimization to avoid creating the attribute if we only
set faces smooth. But since "use_smooth" and "sharp_face" are
inverted, the check for that case needs to be invertex compared
to other similar attribute setters.
2023-06-19 09:46:07 -04:00
Sybren A. Stüvel
8179a0da84 Animation: make FOREACH_PCHAN_SELECTED_IN_OBJECT_BEGIN C++ compatible
Add an explicit cast from `void *` to `bPoseChannel *` so that the macro
can be used in C++ code as well.
2023-06-19 15:21:40 +02:00
Lukas Tönne
550c61d34f Fix: Added missing header include for STRNCPY.
Test compile broken by 8bcad285de
2023-06-19 14:25:26 +02:00
Campbell Barton
8bcad285de Cleanup: remove strcpy usage 2023-06-19 20:40:49 +10:00
Harley Acheson
4a3b6bfeac UI: Show wait icon for file/asset browser previews while loading
Show File & Asset Browser items that are in progress with a "waiting"
icon. Reduces flickering and improves feedback for failed thumbnails.

Pull Request: https://projects.blender.org/blender/blender/pulls/108486
2023-06-19 12:24:44 +02:00
lolloz98
fb81740adc GPv3: Select random operator
Adds a "Select random" operator for the new Grease Pencil data type.

Resolves: #108933

Pull Request: https://projects.blender.org/blender/blender/pulls/109009
2023-06-19 12:14:52 +02:00
Sergey Sharybin
5881f6cc2a Fix compilation error with MSVC
Pull Request: https://projects.blender.org/blender/blender/pulls/109118
2023-06-19 10:32:26 +02:00
Campbell Barton
aef8381bf5 Merge branch 'blender-v3.6-release' 2023-06-19 12:40:37 +10:00
Campbell Barton
a6a32a8279 Quiet compiler warning from b68b66d29e 2023-06-19 12:36:18 +10:00
Campbell Barton
b68b66d29e Fix buffer overflow in AVI file writing
`strcpy` could overflow the destination buffer by 768 bytes,
use FILE_MAX for the filepath buffer size.

Also include the size in the functions signature to avoid similar
errors in the future.
2023-06-19 12:32:25 +10:00
Campbell Barton
cf29e011be Cleanup: remove all strcpy calls in source/blender/editors/
Replace with STRNCPY or BLI_strncpy, while many cases were safe,
translated source strings could cause buffer overflows, see: #108917.
2023-06-19 11:58:33 +10:00
Campbell Barton
fde76c8b4d Cleanup: prefer the term 'len' over 'size' for storing string lengths
The Python API uses the term size for string lengths for
PyUnicode_AsUTF8AndSize and related API's, causing Blender's return
arguments to use the term `size` too in some cases.

This is error prone since Blender includes space from the the null byte
when the term size is used (by convention).
2023-06-19 10:21:59 +10:00
Campbell Barton
0bcc52cf6c Cleanup: clarify variable naming for an_stringdec 2023-06-19 09:54:09 +10:00
Campbell Barton
137c656309 Merge branch 'blender-v3.6-release' 2023-06-19 09:48:15 +10:00
Campbell Barton
e1f7757a39 Merge branch 'blender-v3.6-release' 2023-06-19 09:43:12 +10:00
Campbell Barton
78f5d9d599 Fix buffer overflow in an_stringdec (ANIM_SEQUENCE type loading)
`strcpy` could overflow the destination buffer by 768 bytes.
Match the source/destination buffer sizes & use BLI_strncpy.
2023-06-19 09:41:11 +10:00
Campbell Barton
25aa510adb Fix potential buffer overflow in BLI_path_sequence_decode
Clamp the by the buffer destination size.
2023-06-19 09:39:27 +10:00
Philipp Oeser
cc5f666672 Merge branch 'blender-v3.6-release' 2023-06-18 12:23:56 +02:00
Philipp Oeser
9bba52debd Fix #108049: Nodes pasting can leave multiple active nodes
Clear active flag on pasted nodes (this is in line with how objects are
pasted).

Pull Request: https://projects.blender.org/blender/blender/pulls/108535
2023-06-18 12:22:15 +02:00
Hans Goudey
0b71a1f054 Cleanup: Move UI RNA files to C++
See #103343

Pull Request: https://projects.blender.org/blender/blender/pulls/109090
2023-06-18 01:39:21 +02:00
Iliya Katueshenock
4e7ee5d9ac Fix #108141: Group Insert operator creates invalid links
Just avoid creating links to outside the group. The original
version worked a little more accurately. But still she was just
making up links (because the inline version of the graph wasn't the same anyway).
For now, this is just a workaround to work around the
problem in the new behavior caused by fa3ca9afdb .

Pull Request: https://projects.blender.org/blender/blender/pulls/108332
2023-06-16 20:24:31 +02:00
Hans Goudey
a53eb4a560 Merge branch 'blender-v3.6-release' 2023-06-16 14:00:24 -04:00
Hans Goudey
a6931db38b Fix: Build error without OpenEXR
See d5781c2a61
2023-06-16 13:59:35 -04:00
Hans Goudey
3550eb3d46 Merge branch 'blender-v3.6-release' 2023-06-16 13:39:00 -04:00
Hans Goudey
17aaff69c6 Fix #109043: Mask modifier smooth option broken
Caused by two mistakes in 16fbadde36.
Fix the naming too, which was confusing and
non-standard before.
2023-06-16 13:38:00 -04:00
Brecht Van Lommel
7fe735ac99 Merge branch 'blender-v3.6-release' into main 2023-06-16 18:57:26 +02:00
Brecht Van Lommel
d5781c2a61 Fix #109048: RenderLayer.load_from_file does not support multilayer EXR
This was never implemented, only for the entire RenderResult.
2023-06-16 18:53:08 +02:00
Brecht Van Lommel
770616446b Fix #108966: multires UDIM bake progress bar exceeds 100% 2023-06-16 18:42:48 +02:00
Jacques Lucke
b3641dae16 Cleanup: deduplicate remap node pairing function
It's a bit unfortunate that the `node_map` in both cases has different
constness, so a conversion or `reinterpret_cast` is necessary. For now
a new temporary map is created as this is less error prone. That's not
ideal but better than the duplication from before.
2023-06-16 17:03:55 +02:00
Jeroen Bakker
579a9d2e1f Cleanup: Rename RNA Userdef DPI Update function
Function is also used to force a redraw for options that don't change the
dpi. Has been renamed to `rna_userdef_gpu_update`.

Pull Request: https://projects.blender.org/blender/blender/pulls/108881
2023-06-16 15:23:49 +02:00
Hans Goudey
05190a5a23 Fix: Add missing header used by recent backport fix
This was added in main by 2cfcb8b0b8, and used by
6a05e5161b which was cherry-picked from main
to the release branch.
2023-06-16 09:18:44 -04:00
Miguel Pozo
d7dac04193 GPU: Print both resources on ShaderCreateInfo::validate_merge failure
Print both names when two resource slots overlap.

Pull Request: https://projects.blender.org/blender/blender/pulls/109017
2023-06-16 15:13:31 +02:00
Brecht Van Lommel
04c5736064 Fix preview renders not immediately updating with color management changes
Draw with a GPU shader every time, instead of doing CPU side cached color
management.

Pull Request: https://projects.blender.org/blender/blender/pulls/109026
2023-06-16 14:39:30 +02:00
Hans Goudey
4cd2dca2d2 Merge branch 'blender-v3.6-release' 2023-06-16 08:23:47 -04:00
Hans Goudey
6a05e5161b Fix: Quadratic performance of simulation state frame lookup
Searching for a simulation state at a particular frame was implemented
with a linear loop. The timeline did that for every visible frame,
giving quadratic performance overall when zoomed out. Since the
states are already assumed to be sorted by frame, we can use binary
search instead giving logarithmic performance for each lookup instead.

In the test file from #108097, instead of dropping to 20-30 FPS
after about 4000 frames, I observed the original 70 FPS.

Pull Request: https://projects.blender.org/blender/blender/pulls/109037
2023-06-16 08:23:24 -04:00
Philipp Oeser
23eef18b65 Fix #109047: Screw modifier's smooth shading option does not work
Caused by 5876573e14

Seems like a copy/paste mistake in above commit, now corrected.

Pull Request: https://projects.blender.org/blender/blender/pulls/109052
2023-06-16 14:22:50 +02:00
Hans Goudey
261959cd9c Fix: Quadratic performance of simulation state frame lookup
Searching for a simulation state at a particular frame was implemented
with a linear loop. The timeline did that for every visible frame,
giving quadratic performance overall when zoomed out. Since the
states are already assumed to be sorted by frame, we can use binary
search instead giving logarithmic performance for each lookup instead.

In the test file from #108097, instead of dropping to 20-30 FPS
after about 4000 frames, I observed the original 70 FPS.

Pull Request: https://projects.blender.org/blender/blender/pulls/109037
2023-06-16 14:21:46 +02:00
Hans Goudey
6301775f48 Cleanup: Access geometry bounds more directly
More consistently return geometry bounds with the `Bounds` type that
holds the min and max in one variable. This simplifies some code and
reduces the need to initialize separate min and max variables first.
Meshes now use the same `bounds_min_max()` function as curves and
point clouds, though the wrapper mesh isn't affected yet.

The motivation is to make some of the changes for #96968 simpler.
2023-06-16 08:14:25 -04:00
Hans Goudey
2c7daa34b5 Cleanup: Remove unnecessary DispList bounds call
The object types that this covered now evaluate to curves
or a mesh, which are retrieved in the two earlier cases.
2023-06-16 08:14:25 -04:00
Julian Eisel
79eebf8aad UI: Add assert for single active view item
No user visible changes expected.

Adds an assert to check that only one item returns true in its
`should_be_active()` method. This can help find some errors.
2023-06-16 14:08:20 +02:00
Julian Eisel
1d4fac0cda Fix tree-view item ignoring custom matches() method override
No user visible change expected (this isn't used in existing code yet).

Users of the tree-view API should be able to write their own `matches()`
method to compare tree-view elements after tree reconstruction. Part of
the tree-view matching process wouldn't use this though, and use the
`matches_single()` method instead, causing issues like multiple items
sharing the same state. This was initially done for an optimization
(the default `matches()` compares parents as well, which seems redundant
here), but it backfires and actually isn't needed. The default
`matches()` only compares the parents when `matches_single()` returns
true anyway, so the redundancy is really minor and not a performance
concern.
2023-06-16 12:37:32 +02:00
Dalai Felinto
0e812eebcc Merge remote-tracking branch 'origin/blender-v3.6-release' 2023-06-16 12:19:04 +02:00