Commit Graph

100531 Commits

Author SHA1 Message Date
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
Dalai Felinto
57c3c68ffb Cleanup: make format 2023-06-16 12:18:40 +02:00
Sybren A. Stüvel
66f34c5156 NLA: fix crash after conversion to C++
Fix a crash introduced in dd648b5942.

This is caused by replacing a C designated initialisation with a simple
attribute assignment in C++. The C code would initialise all fields to
zero by default, whereas the C++ code leaves them untouched and thus at
a random value.
2023-06-16 11:57:26 +02:00
Julian Eisel
6868a9503f Fix UI view item without drag support still consuming drag event
UI view items that don't support dragging should pass on the mouse
event.
2023-06-16 11:56:22 +02:00
Julian Eisel
e76d2a241c Fix missing mouse hover highlight for UI view items in menus
The hover highlight is done with some special handling that wasn't
called for buttons in menus. There's actually no case where this happens
in the main branch but it's needed for #104831.
2023-06-16 11:49:04 +02:00
Julian Eisel
962fca47d9 UI: Draw tree-view hover highlight even when emboss is disabled
No user visible changes expected.

It makes sense to disable embossing for drawing the tree view (so it
doesn't have to be disabled for every item individually), but then the
mouse hover highlight should still work.
2023-06-16 11:42:11 +02:00
Julian Eisel
6e5559ab4a Fix UI tree-view item collapsing not working in popups
Tree-views are currently not used in popups in the main branch, but will
be with #104831 merged.
2023-06-16 11:34:01 +02:00
Jacques Lucke
5869e88f94 Nodes: improve node zone analysis
The makes the zone analysis result a bit more well defined.
For example, `child_nodes` now never contains nodes that belong
to child zones.

Also, one can now easily access the set of top level nodes and zones.
2023-06-16 10:53:11 +02:00
Jacques Lucke
201a442750 Functions: improve default debug names in lazy function graph executor 2023-06-16 10:53:11 +02:00
Jacques Lucke
445db4bed0 Cleanup: add missing file entry in cmakelists 2023-06-16 10:53:11 +02:00
Jacques Lucke
ef26519880 Nodes: add utilities to access all node links and toposort index 2023-06-16 10:53:11 +02:00
Sergey Sharybin
4a0468c1ed Fix #109019: Crash when creating a new collection for light linking
A wrong DNA struct was used for writing light linking data.

Pull Request: https://projects.blender.org/blender/blender/pulls/109049
2023-06-16 10:33:01 +02:00
Lukas Tönne
e32f85c03e Cleanup: Removed unused variables in bNodePanel
The flag in bNodePanel is anticipated to store settings such as whether
a panel is open or closed by default. It's not currently used, so for
now the flag is removed.

The next_panel_identifier in bNodeTree is also not needed any more. It
was used to set a unique identifier for each panel, which isn't needed.

Added comments to remaining fields in bNodePanel.

Pull Request: https://projects.blender.org/blender/blender/pulls/109028
2023-06-16 10:12:21 +02:00
Lukas Tönne
406a1f9bce Fix #108263: Show warning when cache baking wants to overwrite data
Modifiers can use the same bake directory now. If multiple modifiers
using conflicting paths are baked at the same time there is now an
error popup.

Modifiers can also bake to directories that already contain data
(including their own). To give users a heads-up there is now a
confirmation popup in that case. It only comes up once per bake operator
invoke to strike a balance between silently overwriting data and not
being too obnoxious when users want to rebake the same simulation many
times.

Pull Request: https://projects.blender.org/blender/blender/pulls/108288
2023-06-16 10:10:20 +02:00
Campbell Barton
9b1e518d4a Cleanup: quiet Clang compiler warnings 2023-06-16 13:52:31 +10:00
Campbell Barton
0103736005 Cleanup: rename string to filepath, remove local path separator define 2023-06-16 13:51:41 +10:00