Commit Graph

120055 Commits

Author SHA1 Message Date
Hans Goudey
c4d3f25aae Fix #91271: Reset to Default broken for fluid cache file format
The default wasn't in the list of static enum items which means the
value was reset to 0 instead of the proper default. Even though the
list is dynamically generated, the possible enum items should be
part of the static list anyway.
2024-12-11 09:58:02 -05:00
Omar Emara
28f8f6ccc6 Cleanup: Reduce code duplication in Dilate node 2024-12-11 16:38:36 +02:00
Philipp Oeser
5e5f2d2048 Fix #131726: New Editors initialize Custom Normal Display size to zero
The property actually had a default, but defined via
`RNA_def_property_float_default` [**RNA** defaults handle highlevel (UI)
stuff like "Reset to Default", but is not in effect when creating new
data/editors].

For this to work, we now define the default in **DNA**

(Also corrects the mismatch in value in this particular case)

NOTE: other editors also handle "defaults" in `SpaceLink` creation functions
in their respective space_XXX.cc files, so that is another system to look at.

NOTE: there might be many more cases that could benefit from moving the
default from RNA (or `SpaceLink` creation functions) to DNA, or possibly even
doing this via other alternatives like supporting C++ in-class member initializers
in makesdna, goal is the same: having a single "source of truth".
But going over these will be for another time...

Pull Request: https://projects.blender.org/blender/blender/pulls/131735
2024-12-11 15:21:37 +01:00
Hans Goudey
60056e55fb Fix #131721: Bevel modifier weight attribute crash with curve object
Missing an object type check.
2024-12-11 09:11:34 -05:00
Clément Foucault
81a6cd40e3 Fix #131732: Selection: Selecting in wireframe shading is broken
In the process of fixing, add some convenience functions.
2024-12-11 14:20:20 +01:00
Julian Eisel
caf11a2b9f Fix #111463: Outliner use-after-free when deleting an override on a mesh
Pass the session UID to the identity comparison callback directly,
instead of passing the ID pointer and accessing the session UID inside
the function. This way the dangling ID pointer is avoided.

Makes use of the support for passing named integers via context, which
was added in the previous commit.

Pull Request: https://projects.blender.org/blender/blender/pulls/131676
2024-12-11 13:41:46 +01:00
Julian Eisel
f6a4d01703 UI: Allow passing named integers via context
Similar to 2fbf206491, but for integers (not strings). Essentially this
allows passing named integer values through UI abstractions in a clean
way.

I used 64 bit integers here, since space isn't an issue here, and it
fits common integer types (so we don't have to add APIs for multiple
integer types).

Planned to be used to fix #111463 (following commit).
2024-12-11 13:39:24 +01:00
Omar Emara
317be33e95 Fix: Memory leak in Keying node when only Edges output is used
The Keying node leaks memory when only the edges output is used. That's
because tweaked matte is computed in that case, but is never used nor
released because the other two outputs are not needed. To fix this,
release the tweaked matte if it is not used.
2024-12-11 12:18:18 +02:00
Richard Antalik
0aa653c05c Fix: VSE: Possible division by zero in retiming code
Strips with single frame content could be retimed, which would lead to
division by zero.

Check content length before adding retiming keys.

Pull Request: https://projects.blender.org/blender/blender/pulls/131725
2024-12-11 10:29:45 +01:00
Omar Emara
3e35d411be Fix: Compositor leaks memory in certain setups
The GPU and new CPU compositors leak memory when an output is connected
to multiple inputs inside the same pixel operation. That's because nodes
do not know that their multiple outgoing links are in fact going to the
same operation, so their initial reference count is more than the actual
reference count.

To fix this, we keep track of the reference count of pixel operation
inputs and release the inputs based on that reference count.
2024-12-11 10:45:48 +02:00
Clément Foucault
40b8ccefbe Fix: Overlay: Crash cause by grid enabled for nodetree areas 2024-12-11 09:40:14 +01:00
Richard Antalik
a4ca725d86 VSE: Improve retiming code readability
Add utility function to convert timeline frame to frame index.

This also fixes unreported incorrect math in
`SEQ_retiming_transition_key_frame_set()`.

Pull Request: https://projects.blender.org/blender/blender/pulls/131659
2024-12-11 08:47:53 +01:00
Campbell Barton
918398f0fa Cleanup: rename vfont_get_data -> vfont_data_ensure
Use the term "ensure" when data is created on demand.
2024-12-11 17:34:01 +11:00
Campbell Barton
27eece6d49 Cleanup: reduce repitition in curve font access 2024-12-11 17:33:04 +11:00
Campbell Barton
139498738a Cleanup: improve comments & typo in ui_tooltip_from_vfont 2024-12-11 17:32:54 +11:00
Campbell Barton
44970c918a Fix tool-tips for fonts with relative paths
Relative paths were not expanded and would show "File not found".
Expand relative paths & remove the file check for the built-in font.
2024-12-11 17:15:09 +11:00
Campbell Barton
560b6e2831 Cleanup: spelling (make check_spelling_*) 2024-12-11 11:23:51 +11:00
Campbell Barton
e0f6a067c0 Cleanup: quiet undeclared function warning 2024-12-11 11:23:51 +11:00
Sean Kim
f10f278914 Cleanup: Rename & move SCULPT_handles_colors_report
Pull Request: https://projects.blender.org/blender/blender/pulls/131709
2024-12-11 01:22:36 +01:00
Hans Goudey
84c7684871 Geometry Nodes: Propagate vertex groups in join / realize instances nodes
Currently the realize instances code (which is also used by the join
geometry node) always creates generic attributes instead of vertex
groups. The expectation was that vertex groups would be replaced
by some form of generic attribute sooner rather than later. However,
it's clear that won't happen for some time, and this issue causes users
a lot of trouble. This commit preserves the vertex groups through the
operation. Any attribute name that was a vertex group on any of the
input meshes will become a vertex group in the result.

In the code this is a simple change because the attribute writer
abstraction allows writing to vertex groups as if the were just like
other contiguous arrays. In the future we could optimize the code
specifically for vertex groups.

This resolves the "bug" part of #99197 where the nodes remove vertex
groups. However, this doesn't change the fact that generating
primitive meshes in geometry nodes won't create vertex groups.
In general the property editor settings on the original mesh have
no effect on meshes created from scratch in geometry nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/131692
2024-12-11 01:17:23 +01:00
Clément Foucault
f8da7ecfe1 Cleanup: DRW: Move DRW_SHADER_FREE_SAFE and DRW_UBO_FREE_SAFE to GPU 2024-12-11 00:43:32 +01:00
Clément Foucault
9bd1a92778 Cleanup: DRW: Remove unused code 2024-12-11 00:38:10 +01:00
Clément Foucault
0ad4696125 Cleanup: DRW: Remove remaining of DRWTexture API 2024-12-10 22:47:46 +01:00
Clément Foucault
ad5efd4a5c Cleanup: Compositor: Use texture pool API directly 2024-12-10 22:42:53 +01:00
Clément Foucault
37f9ec7235 Refactor: Grease Pencil: Remove legacy texture pool API usage 2024-12-10 22:26:16 +01:00
Hans Goudey
363bc88ee7 Cleanup: Remove unnecessary unique_ptr usage for Line Art runtime
There is no need for this to be a unique pointer, the set can just be
stored directly.

Pull Request: https://projects.blender.org/blender/blender/pulls/131632
2024-12-10 22:05:54 +01:00
Hans Goudey
7baa22b49d Cleanup: Correct usage of std::unique_ptr in Line Art code
`.release()` is technically fine but semantically wrong here. First,
release is meant to take ownership from the unique_ptr, meaning
at best it's "weird" to not do anything with the pointer afterwards.
Second, the runtime struct with the unique_ptr was just default
constructed, which means the unique_ptr will be empty anyway.
2024-12-10 22:05:53 +01:00
Hans Goudey
7c97088fb2 Cleanup: Use proper type instead of void for line art runtime struct 2024-12-10 22:05:53 +01:00
Hans Goudey
282dd0c5c0 Cleanup: Fix copyright year in MOD_lineart.hh 2024-12-10 22:05:53 +01:00
Hans Goudey
03fd5fc58e Cleanup: Various C++ cleanups in MOD_lineart.hh
- C++ headers shouldn't have everything inside of `extern "C"`
- `typedef` and `struct` keywords are unnecessary in C++
2024-12-10 22:05:53 +01:00
Hans Goudey
2fd3a633db Cleanup: Remove unnecessary name copy when removing attribute
BKE_defgroup_listbase_name_find has a StringRef argument nowadays.
2024-12-10 14:34:03 -05:00
Hans Goudey
d3fdfe013d Cleanup: Remove unnecessary anonymous attribute checks
These come from the time when anonymous attributes weren't
just names with a different prefix.
2024-12-10 14:34:03 -05:00
Harley Acheson
93e8c231aa Fix #88236: When Tabbing in Block Skip UI_HIDDEN
When pressing Tab to move to the next input in the same block (and
Alt-Tab to move backward), we currently skip buttons that have the
UI_BUT_DISABLED flag. This PR makes these operations also skip buttons
that have UI_HIDDEN. This makes tabbing work better in places like the
color picker where we show/hide the RGB and HSV buttons depending on
mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/131698
2024-12-10 20:13:28 +01:00
Jacques Lucke
14bb6cb62b Fix #129338: wrong tooltip for center option for text boxes
The tooltip used to say that the center is always the objects origin.
However, in the case of text-boxes, it's actually the center of the text box.

There might be valid use-cases to move the text box center to the
object's center, but it seems like the same can be achieved with offsets.
Also that would be a new feature that's out of scope of a bug report.

Pull Request: https://projects.blender.org/blender/blender/pulls/131693
2024-12-10 18:44:04 +01:00
Harley Acheson
2b7a968909 Fix #80356: UI Icon Alpha Should Not Affect Matcaps & Studio Lighting
Changing Icon Alpha in Preferences / Themes / User Interface / Styles /
Icon Alpha is meant to change the opacity of the UI icons. It should not
change the opacity of the previews of Matcaps and Studio lights as this
changes the color because of mixing with the background. This PR just
skips this icon type when changing the alpha for this preference.

Pull Request: https://projects.blender.org/blender/blender/pulls/131690
2024-12-10 18:19:28 +01:00
Clément Foucault
e29bda07b3 Fix #131633: GPU: Add Object Tool gizmo does not show correct bounds 2024-12-10 18:18:48 +01:00
Jacques Lucke
53ea147a51 Fix #131598: avoid relying on node tree update code being run before dependency graph is build
This avoids assuming that `BKE_ntree_update_main` has run on a node tree before
the depsgraph is build. The update code already finds the dependencies to
determine if a relations update is necessary or not. To avoid detecting these
dependencies again (which requires iterating over all the nested nodes), they
were cached on the node group so that they can be used when the depsgraph is
build.

However, since the update code does not run in all necessary cases yet
(#131598), this does not work currently. This patch fixes the situation by
removing the optimization of not having to find all dependencies again when the
depsgraph is build.

This optimization can be introduced again after we can be more sure that the
node tree update code runs whenever the node tree changes (which is what #131665
tries, but requires more discussion).

Pull Request: https://projects.blender.org/blender/blender/pulls/131685
2024-12-10 17:52:44 +01:00
Weizhen Huang
0b954d7777 Cleanup: make format 2024-12-10 17:51:29 +01:00
Jacques Lucke
585cd07899 Refactor: Blenloader: simplify writing libraries
This improves the `write_libraries` function in a couple of ways:
* No need to split the `bmain` which I find somewhat hard to reason about. I
  think it's good if `bmain` is as read-only as possible in this write-context.
  Instead a more explicit C++ data structure (`MultiValueMap<Library *, ID *>`)
  is used. I think this was the only place in write-code that used
  `blo_split_main`.
* Deduplication of the check that determines  whether a placeholder should be
  written for a specific ID.
* General cleanup to avoid unnecessarily deep nesting when iterating over IDs.

No functional changes are expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/131385
2024-12-10 17:43:09 +01:00
Clément Foucault
94b7035311 Fix: GPU: Broken compilation on Mac 2024-12-10 17:42:13 +01:00
Clément Foucault
5566e7f20e Fix: EEVEE: Material not always finish compiling when baking volume probes
Use the same workaround as for render.
Wrap the sync inside its own `custom_pipeline_wrapper` so that
we don't freeze the main thread when waiting for these 50ms.

Also remove the `manager->begin_sync()` and `manager->end_sync()`
as they are already present inside `render_sync`.

Pull Request: https://projects.blender.org/blender/blender/pulls/131678
2024-12-10 17:25:07 +01:00
Laurynas Duburas
8dcb76b6ad Fix #130688: Grease Pencil: Multiframe Editing not applying falloff for rotation & scale
Fixes rotation and scale in multi frame editing.

Pull Request: https://projects.blender.org/blender/blender/pulls/131634
2024-12-10 17:21:06 +01:00
YimingWu
7f8b811a42 Fix #131681: Grease Pencil: Build modifier concurrent mode div by zero
There could be strokes that have zero lengths (a dot), in this case a
NaN factor was given to the final build function, leading to invalid
index when accessing arrays. Now `get_stroke_factor` will return either
0.0f or 1.0f (depending on input factor) when stroke has zero total
length.

Pull Request: https://projects.blender.org/blender/blender/pulls/131683
2024-12-10 17:19:10 +01:00
Miguel Pozo
e24eadbb42 GPU: Add assert_framebuffer_shader_compatibility
Ensure all the framebuffer color attachments are written to.

Pull Request: https://projects.blender.org/blender/blender/pulls/130995
2024-12-10 17:13:06 +01:00
Jeroen Bakker
aee24fb6ba Vulkan: Updated NVIDIA/Linux driver support
NVIDIA driver before 550 doesn't work as expected on Linux. The issue is
known on the internet, but no real solutions are provided.

This change will limit the block list of older driver to the Linux
platform only. It has been reported that Windows these driver are
working and would enable older GPUs to work on Windows.

Ref #129160

Pull Request: https://projects.blender.org/blender/blender/pulls/131674
2024-12-10 15:37:38 +01:00
Omar Emara
98270a489b Compositor: Optimize constant size Bokeh Blur node
This patch optimizes the constant bokeh blur CPU implementation by
pre-computing the blur kernel from the bokeh kernel, and thus avoid
interpolation in the blur loop. Gives a 2x improvement.
2024-12-10 16:18:22 +02:00
Clément Foucault
7a889b21bc Fix #131587: Overlay: Crash switching workspaces
- Make sure to initialize the `State` struct.
- Make sure to consider space node as 2D for grid overlay.
2024-12-10 14:08:05 +01:00
Jeroen Bakker
8c0b2a00dc Revert "Vulkan: Add support for LocalSizeId execution model"
This reverts commit ccab973556.

This change has some issues with Vulkan Validation layers. Reverting it
until it is clear what the cause is.
2024-12-10 13:42:22 +01:00
Jacques Lucke
6bdf9232b0 Fix #131565: missing null check for socket type
This was probably accidentally broken by 7348e670b3.
2024-12-10 13:22:38 +01:00
Weizhen Huang
b67b0c2847 Fix: Overlay: Volume wireframe visible regardless of setting
guard the drawing behind `show_surface_wire`

Pull Request: https://projects.blender.org/blender/blender/pulls/131527
2024-12-10 13:07:21 +01:00