Commit Graph

108129 Commits

Author SHA1 Message Date
Hans Goudey
fc06dc31d8 Cleanup: Sort forward declaration lists, remove duplicate 2024-03-27 20:19:23 -04:00
Hans Goudey
0bde788d63 Cleanup: Use "All" asset library to simplify node link drag search
The "All" library didn't exist internally when this code was first
written. The "skip_local" check that complicated this isn't necessary
because we don't add local node groups that aren't assets anyway.
2024-03-27 20:19:23 -04:00
Campbell Barton
ed5cca4021 Cleanup: quiet missing-declarations warnings 2024-03-28 08:48:03 +11:00
Campbell Barton
cd0b0a9272 CMake: remove non-existing include directory
As of [0] this is no longer created.

[0]: f5f7024040c168f3003f33d2a909c1fb1e600100
2024-03-28 08:48:02 +11:00
Harley Acheson
c433a90138 UI: Minimum Width for Large Confirmation Dialogs
We currently have a single minimum width value for confirmation
dialogs, but we need to set this based on which of the two sizes it
is. Otherwise the larger confirmations with icon look too squished
when the content is shorter.

Pull Request: https://projects.blender.org/blender/blender/pulls/119978
2024-03-27 22:28:00 +01:00
Habib Gahbiche
8377f5d0fb Fix: Compositor GPU backdrop not updating when image transform operators are applied
How to reproduce:
- Have image editor and GPU compositor backdrop enabled and showing the same image
- In image editor, apply operator flip horizontally
- Notice how image editor gets updated but compositor backdrop doesn't

Fixes backdrop for GPU compositor for the following operations:
- image -> transform -> Flip horizontally
- image -> transform -> Flip vertically
- image -> transform -> Rotate 90° clockwise
- image -> transform -> Rotate 90° counter-clockwise
- image -> transform -> Rotate 180°

Pull Request: https://projects.blender.org/blender/blender/pulls/119819
2024-03-27 21:42:47 +01:00
Habib Gahbiche
e1a0b6cd9e Fix compositor backdrop not updating for image invert operator
How to reproduce:
- Have image editor and GPU compositor backdrop enabled and showing the same image
- In image editor, apply inver image colors operator
- Notice how image editor gets updated but compositor backdrop doesn't

Fixes backdrop updates for GPU compositor for the following operators:
- Image -> Invert -> Invert image colors
- Image -> Invert -> Invert red channel
- Image -> Invert -> Invert green channel
- Image -> Invert -> Invert blue channel
- Image -> Invert -> Invert alpha channel

Pull Request: https://projects.blender.org/blender/blender/pulls/119820
2024-03-27 21:41:25 +01:00
Jonas Holzman
75a9cbed24 UI: Improvements to Revert File Operator Confirmation Popup
Larger, more informative confirmation when reverting the current file
to saved version. Title of "Revert to the Saved File", content of
"Any unsaved changes will be lost." and button text of "Revert".

Pull Request: https://projects.blender.org/blender/blender/pulls/119758
2024-03-27 18:39:09 +01:00
Hans Goudey
10bc136a1a Fix #119935: Attribute set operator support for 2D integer vector lost
Also fix the poll to properly check for the remaining unsupported types.
Don't add back Quaternion support, since that's arguably less useful,
and we might want different ways to set those values compared to
just entering WXYZ.
2024-03-27 13:14:02 -04:00
Brecht Van Lommel
8682ad1908 Fix: Memory leak and race condition with particle effector RNG
Store RNG on per thread data, instead of the effector itself which may
be used by multiple objects evaluated in different threads.

This has been causing the blendfile_versioning test to fail randomly.
Thanks Ray and Aras for helping track this down.

Pull Request: https://projects.blender.org/blender/blender/pulls/119967
2024-03-27 18:06:31 +01:00
Harley Acheson
1984f08250 Fix #119846: EEVEE-Next: Rendering Infinite Samples
When rendering images, and not in the interactive viewport, do not
use infinite samples. Follow the  behavior of Legacy EEVEE.

Pull Request: https://projects.blender.org/blender/blender/pulls/119893
2024-03-27 16:16:34 +01:00
Germano Cavalcante
3031146097 Fix #119957: Crash when using 'angle constraint' Relative in Knife tool
Most likely caused by 6d491da0be

In that commit, `knife_pos_data_clear` started to clear (set `-1`) the
value of the current object (which is expected).

However, `knife_snap_angle_relative` relies on the current object to
transform the face normal to global space.

This is weak and error prone since the face is obtained from the
function itself.

The code could be optimized and reuse the face identified in
`knife_snap_curr`, but for now just identify the face object.
2024-03-27 10:55:38 -03:00
Sergey Sharybin
896b552672 Fix: Unable to change ID property type to Boolean
Caused by 0cdd429b44c.

Steps to reproduce:
- Add a custom property to the default Cube object
- Open property editor
- Change type to Boolean
- Apply the changes

Observe that the property is still Int.

On a code side the issue is caused by the change in the idp_from_PyBool()
which used to return property of type IDP_BOOLEAN before the change, but
IDP_INT after the change.

Pull Request: https://projects.blender.org/blender/blender/pulls/119962
2024-03-27 13:43:00 +01:00
Germano Cavalcante
f0479e915f Transform: Implement Snap to Grid mode
Addresses two improvements to `Snap to Grid` as suggested in #73993:
- Make 'Absolute Grid Snapping' a new Snap Mode
- Snap to Grid in Non-Side View performed at ground level

Implementation details:

- Snap to Grid has no cursor symbol, unless we are in `Set Snap Base`
  mode. Similar to the previous 'Absolute Grid Snap' behavior.
- In Non-Side view, Snap to Grid is performed at ground level.
- If `Snap Base` is `Closest`, Snap to Grid uses the transform pivot
  point instead. Similar to the previous 'Absolute Grid Snap' behavior.
- The "Absolute Grid Snap" option has been removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/116109
2024-03-27 13:17:24 +01:00
Pratik Borhade
b3fe97414a Fix: Sculpt paint crash after converting active color attribute
Painting after converting active color attribute in sculpt mode causes crash.
Fix is same as 3641b4b884ab4b117cab3c800d16b2ac5263a7a1 with some cleanup

Pull Request: https://projects.blender.org/blender/blender/pulls/119780
2024-03-27 12:28:16 +01:00
Omar Emara
0709c07d04 Cleanup: Use actual class instead of base class
Use the TranslateCanvasOperation class in the declaration instead of its
TranslateOperation class. This is just to clarify the code when reading
it.
2024-03-27 12:54:42 +02:00
Omar Emara
4d9678c483 Fix: Sun Beams node is off by half a pixel
The Sun Beams node is off by half a pixel. That's because we add a half
pixel offset to the initial coordinates, but then sample the texture
with the half pixel. To fix thus, use the texture_bilinear_extend
utility to sample the image, which takes care of the half pixel offset.
2024-03-27 12:49:21 +02:00
Sergey Sharybin
e9dc9ef9a2 Fix #119936: Crash selecting in mask editor
Regression since 7a2d04a5c43.

Mask evaluation is part of parameters component, and there is no explicit
tags other than copy-on-eval for masks in a lot of cases.

Restore the previous graph topology for the link from copy-on-eval to the
parameters components of mask ID.

Potential candidate for 4.1.1.

Pull Request: https://projects.blender.org/blender/blender/pulls/119956
2024-03-27 11:00:55 +01:00
Omar Emara
5ae5614d1e Fix: Chroma Key differs from reference implementation
The GPU compositor Chroma Key node differs from the reference
implementation. This is caused by a typo, where the acceptance angle was
halved after computing tangent instead of before computing it.
2024-03-27 11:10:49 +02:00
Omar Emara
9aa63aa1e8 Fix: Lens Distortion node is off by half a pixel
The Lens Distortion node is off by half a pixel because their normalized
coordinates were at the pixel corners as opposed to their centers, where
this patch changes the behavior to the latter.
2024-03-27 09:04:34 +02:00
Omar Emara
aa208d3d18 Fix: Plane Deform nodes are off by half a pixel
The Plane Track and Corner Pin nodes are off by half a pixel because
their mask is computed at the pixel corners as opposed to their center,
where this patch changes the behavior to the latter.
2024-03-27 08:54:04 +02:00
Omar Emara
7113692206 Fix: Directional Blur node is off by half a pixel
The Directional Blur node is off by half a pixel because it transforms
the pixels at their corner as opposed to their center, where this patch
changes the behavior to the latter.
2024-03-27 08:50:44 +02:00
Omar Emara
6df333a3c7 Fix: Movie Distort node is off by half a pixel
The Movie Distort node is off by half a pixel because it evaluates the
distortion at the corner of pixels as opposed to their center, where
this patch changes the behavior to the latter.
2024-03-27 08:47:07 +02:00
Jonas Holzman
913acaf395 Fix #86325: tilted viewport orientation in default startup
Since v2.5 Blenders viewport view has been tilted by around ~0.8
degrees to the right, resolve this using a lookup table to update
the the defaults.

Ref !113751
2024-03-27 17:13:02 +11:00
Campbell Barton
e078112a53 Fix notifiers from window events using the wrong window
The active window in the context may not match the window where GHOST
events are generated. Notifiers for new windows would always be ignored
with the context's window set to null for example.

Noticed while investigating #119871.
2024-03-27 15:04:03 +11:00
Campbell Barton
2a25340da4 Cleanup: quiet missing-declarations warnings 2024-03-27 14:53:58 +11:00
Hans Goudey
7f25242089 Cleanup: Move object mode switching declarations to proper modules
Keep each function's declaration in the header file associated with its
module. Arguably mode switching should be more organized, but for now
it's better to just declare functions in more predictable places.
2024-03-26 23:45:43 -04:00
Hans Goudey
436c0a773e Cleanup: Remove object vgroup functions to proper header
These functions were declared in the editors/mesh module but
defined in the editors/object module. This commit moves them to
a separate header associated with the object editors module.
2024-03-26 23:45:43 -04:00
Hans Goudey
148940ad15 Cleanup: Remove unnecessary keywords from newly C++ headers
Pull Request: https://projects.blender.org/blender/blender/pulls/119943
2024-03-27 02:45:30 +01:00
Hans Goudey
b8b745ae1e Cleanup: Move remaining editors internal headers to C++ 2024-03-27 02:45:27 +01:00
Hans Goudey
acd1b0b7f9 Refactor: Use C++ Vector for RNA/context collection retrieval
Previously retrieving a collection from the context like "selected_ids"
would give a linked list of allocated items. Now it returns a vector of
RNA pointers. Though the number of items is typically fairly small,
using contiguous memory and avoiding many small allocations are
typical performance improvements that could still be beneficial
when there are many items. Iteration also becomes much simpler.

Pull Request: https://projects.blender.org/blender/blender/pulls/119939
2024-03-27 00:47:39 +01:00
Campbell Barton
3416fe6e1e License headers: add SPDX headers 2024-03-27 10:31:24 +11:00
Campbell Barton
40ab214c0a Cleanup: spelling in comments 2024-03-27 10:25:31 +11:00
Campbell Barton
d6c4433451 Cleanup: remove declarations for removed functions 2024-03-27 10:23:53 +11:00
Campbell Barton
3f594f7b2f Cleanup: consistent naming for EditMesh::looptris elements
Use the term `ltri` everywhere.
2024-03-27 10:09:12 +11:00
Campbell Barton
2220696d25 BMesh: avoid copying by value for BMLoop triangles
Caused by [0] which made BMLoop[3] variables & arguments copy by value.

[0]: 3805974b6fa8e15ae4409f597747bc7beee51fa3
2024-03-27 10:09:10 +11:00
Hans Goudey
f2c5cae3d8 Cleanup: Remove unused RNA function call functions
These functions appear to have been unused for the last 15 years.
They are quite complex with the var_args handling, and may get in
the way of some other cleanups in the area.
2024-03-26 18:12:21 -04:00
Hans Goudey
e1c54d5a24 Fix: Windows build error after recent cleanup commit 2024-03-26 16:20:40 -04:00
Hans Goudey
cd76d06f95 Cleanup: Use boolean instead of int 2024-03-26 16:04:03 -04:00
Hans Goudey
c72d6100ba Cleanup: Remove unrelated change added in previous commit
WIP change unrelated to anything else. Sorry for the noise!
2024-03-26 16:00:00 -04:00
Hans Goudey
48e4576162 Cleanup: Remove unnecessary keywords from C++ headers 2024-03-26 15:58:39 -04:00
Hans Goudey
265bfdb019 Cleanup: Resolve allocation size warning in Hook modifier RNA
GCC seems to complain about a possible signed to unsigned conversion
in combination with allocation and copying here.
2024-03-26 15:43:12 -04:00
Hans Goudey
0cdd429b44 Cleanup: Use newer API for creating IDProperties in most places
There are still a few places that are more complicated where the replacement
to `IDP_New` isn't obvious, but this commit replaces most uses of the ugly
`IDPropertyTemplate` usage.
2024-03-26 15:39:39 -04:00
Hans Goudey
e0567eadbd Cleanup: Use FunctionRef for IDProperty iteration callback
Avoid the need for a seaprate user_data argument.
2024-03-26 15:39:39 -04:00
Clément Foucault
2a600b4a83 EEVEE-Next: Shadow: Limit view per shadow map projection
This limits the number of tilemaps per LOD that can be fed to avoid the
easy to hit "Too many shadow updates" (#119757).

This allows for a max 64 tilemaps to be updated at once at their lowest
requested LOD (so ~10.6667 point lights if every faces of the punctual
shadow map is needed, but likely more in practice).

Unfortunately this is still quite low and will surely be hit quite soon
with directional shadow added to it. One idea to workaround this would
be to time slice the update of some lights, but this opens a whole can
of worms that I'm not ready to open for now so I created #119890 for
future reference.

Some notes, most lights seems to request around 3 LODs. It might help
to allow requesting at least 2 LODs if we are rendering since volumes
might want lower LOD available for volumes.

I added a very simplistic heuristic that also lowers the max tilemaps
when transforming, animation playback or navigating the 3D view to
improve the responsiveness of the engine. Note that this doesn't
only lowers the resolution to the minimum requested one. So it should
be good enough in most cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/119889
2024-03-26 20:33:31 +01:00
Sean Kim
627ec2666b Cleanup: Add doxygen and restructure paint_hide.cc
This PR restructures the flow of `paint_hide.cc` and groups the
existing functions into newly added doxygen blocks.

Pull Request: https://projects.blender.org/blender/blender/pulls/119929
2024-03-26 20:19:54 +01:00
Guillermo Venegas
8b6a21c122 IO: Use FileHandlers in the View 3d
Use File Handlers to handle file drag-n-drop in the View 3d. Drop-boxes
still remain since they handle Texture ID drag-n-drop.

This will add-ons to handle drag-n-drop for images and movies while
still providing access to Blender's native support since File Handlers
let users choose which to invoke if there's multiple configured.

Pull Request: https://projects.blender.org/blender/blender/pulls/117728
2024-03-26 20:01:08 +01:00
Sean Kim
5a1bab39d2 Cleanup: Remove modal definition for PAINT_OT_visibility_invert
This PR removes the modal callback for `PAINT_OT_visibility_invert`.
It does not use the provided data, nor is the `modal` function
invoked by a corresponding `invoke`.

Pull Request: https://projects.blender.org/blender/blender/pulls/119930
2024-03-26 19:43:06 +01:00
Hans Goudey
efee753e8f Cleanup: Move BKE_idprop.h to C++ 2024-03-26 13:07:04 -04:00
Hans Goudey
f41ab9abc1 Cleanup: Combine BKE_idprop C and C++ headers
In preparation for moving the whole BKE_idprop.h to C++.
To keep the git history intact we remove the newer smaller file.
2024-03-26 13:07:04 -04:00