Commit Graph

120055 Commits

Author SHA1 Message Date
YimingWu
dc45169acd Fix #128637: Gizmo line tool not snapping to exactly 45 degrees
Due to rounding errors in `wm_gesture_straightline_do_angle_snap`, it
could give out a snapped result that's meant to be 45 degrees but does
not have equal X/Y distances after converted to integer. Since 45
degrees can be used to make a equal length structure, it's best to make
sure that resulting X/Y values are the same if the angle is multiple of
45 degrees.

This fix would be effective for all tools that uses this "straight line
gizmo".

Pull Request: https://projects.blender.org/blender/blender/pulls/128683
2024-10-14 13:03:03 +08:00
YimingWu
4bbf0986d5 Fix #128637: Gizmo line tool not snapping to exactly 45 degrees
Due to rounding errors in `wm_gesture_straightline_do_angle_snap`, it
could give out a snapped result that's meant to be 45 degrees but does
not have equal X/Y distances after converted to integer. Since 45
degrees can be used to make a equal length structure, it's best to make
sure that resulting X/Y values are the same if the angle is multiple of
45 degrees.

This fix would be effective for all tools that uses this "straight line
gizmo".

Pull Request: https://projects.blender.org/blender/blender/pulls/128683
2024-10-14 07:01:45 +02:00
John Kiril Swenson
3d88019ae3 Merge branch 'blender-v4.3-release' 2024-10-13 22:30:53 -05:00
John Kiril Swenson
e3f9d210d1 Fix #128401: Issues when splitting connected strip
This patch fixes broken connections and effect strips which would arise
in some cases when trying to split connected strips with effects.

This happened in case an effect strip was being split -- first, its
effect chain would be added to a VectorSet of seqs, but then, only the
connected strips of the original seq (in this case the effect strip)
would be added to the VectorSet. Fix by iterating over the entire list
and adding connected strips.

Additionally:

- Add a final SEQ_iterator_set_expand() for SEQ_query_effect_chain() in
  case these connected strips had effects themselves.
- Move the seq_edit_split_operation_permitted() check after the entire
  chain is evaluated to avoid bugs w/ locked strips being editable
  before.

Pull Request: https://projects.blender.org/blender/blender/pulls/128670
2024-10-14 05:26:42 +02:00
Campbell Barton
bd299cad72 Cleanup: quiet unused argument warnings 2024-10-14 12:12:20 +11:00
Campbell Barton
f5e271b2ba Merge branch 'blender-v4.3-release' 2024-10-14 12:06:29 +11:00
Campbell Barton
77b523d317 Fix #128920: Crash calculating geometry nodes that use UV unwrap
Regression in [0], missing null check.

[0]: 788bc5158e
2024-10-14 11:46:34 +11:00
Richard Antalik
3b8d0abbbe Merge branch 'blender-v4.3-release' 2024-10-14 00:51:33 +02:00
John Kiril Swenson
72be365c6b Fix #126191: Both handle seqslide modal cancel
The issue was that if the seqslide was cancelled such that the
`new_frame` of the left handle was greater than its previous
right_handle (before the cancel), `SEQ_time_left_handle_frame_set()`
would clamp this value and so the left handle would not properly restore
itself.

Fix by updating both handles at once (right handle first) if both
handles are selected and the cancel jump travels in the right direction.

This also seems to fix the situation where strips w/ both handles
selected would be erroneously detected as overlapping when moving them
rapidly side to side.

Pull Request: https://projects.blender.org/blender/blender/pulls/128740
2024-10-14 00:49:01 +02:00
Harley Acheson
4a189532bf Merge branch 'blender-v4.3-release' 2024-10-13 11:25:45 -07:00
Harley Acheson
bdee3dfaa2 Fix #128906: Remove Docking Draw Callbacks After Deactivate
If we lose focus while splitting or docking we need to make sure that
the overlay drawing callbacks are stopped.

Pull Request: https://projects.blender.org/blender/blender/pulls/128957
2024-10-13 20:24:35 +02:00
Clément Foucault
191b347f58 Cleanup: GPU: Use function parameters instead of template 2024-10-12 14:21:51 +02:00
Clément Foucault
d9aad850b0 GPU: GLSL preprocess: Remove invalidly processed header
Add assert in the preprocessor that these file don't get
processed.
2024-10-12 14:21:51 +02:00
Campbell Barton
1bc3c24f45 Cleanup: use const args, variable 2024-10-12 22:48:35 +11:00
Campbell Barton
3350eeba62 Merge branch 'blender-v4.3-release' 2024-10-12 22:48:08 +11:00
Campbell Barton
15be0030f6 Cleanup: various non-functional C++ changes
- Avoid shadowing.
- Use default functions.
- Remove unused struct member from GpencilBatchCache.
2024-10-12 22:44:19 +11:00
YimingWu
57ca937a7c Fix #128714: GPv3: Don't erase behind the camera
If points are beind the camera, we don't really want to erase them. This
patch marks invalid coordinates thus preventing them from intersecting
with a eraser.

The reason for using a large value to indicate "invalid coordinate"s are:

- No need to further break down the way we process `src_to_dist` point matching array for `hard_eraser` `soft_eraser`, makes the entire logic much easier.
- No eraser is gonna be touching such a large coordinate of `1e20`.

Technically there's this case where if a segment crosses the near or far clipping plane (to handle this correctly, you'll need to split that segment into two at the clipping plane position and it increases complexity a lot), and then you will have undefined erasing behaviour, however the worse case is that the one segment was completely removed, and in such case I think it's acceptable.

Pull Request: https://projects.blender.org/blender/blender/pulls/128738
2024-10-12 13:24:58 +08:00
Sean Kim
6ff33b7e92 Merge branch 'blender-v4.3-release' 2024-10-11 15:25:07 -07:00
Pratik Borhade
bcf6524ca1 Fix #128601: Redoing move operation crash in sculpt mode
PBVH is null when redoing the move operation. To fix this,
update active object data from evaluated object before sending
undo_push.

Also fixed the crash in cache_init() after updating depsgraph

Pull Request: https://projects.blender.org/blender/blender/pulls/128625
2024-10-12 00:23:49 +02:00
Julian Eisel
d177388979 Sculpt/Paint: Tag brushes for unsaved changes for UI indication
Part of the brush assets project followups, see #116337.

Based on feedback, it seems important to indicate to the user when a brush has
unsaved changes.

There's no reliable updating mechanism we can use or hook into here, except for
RNA "update" callbacks. Brush data gets changed in many places in code, the only
way to do this seems manual tagging every time a brush property gets changed.
This PR introduces `BKE_brush_tag_unsaved_changes()` for this. I spent some time
going through all brush properties to ensure changes call the tagging function.

A known limitation with this will be that changes to dependencies won't be
indicated in the brush. E.g. Changing the texture attached to a brush won't make
the brush be indicated as changed.

The UI to indicate the changed brushes is being discussed still, see #128846.

Pull Request: https://projects.blender.org/blender/blender/pulls/128845
2024-10-11 22:08:14 +02:00
Harley Acheson
8675533448 Fix #128868: Hide Sharp Corners in Docking Split
While splitting areas the two parts are shown with rounded outlines,
but some of the underlying content can show through in the corners,
spoiling the effect. This PR just erases anything in those corners,
making it look cleaner and rounder.

Accidentally merged to main first with c3ea941273.
2024-10-11 12:31:23 -07:00
Harley Acheson
c3ea941273 Fix #128868: Hide Sharp Corners in Docking Split
While splitting areas the two parts are shown with rounded outlines,
but some of the underlying content can show through in the corners,
spoiling the effect. This PR just erases anything in those corners,
making it look cleaner and rounder.

Pull Request: https://projects.blender.org/blender/blender/pulls/128901
2024-10-11 20:57:54 +02:00
Clément Foucault
1c0247c871 Cleanup: GPU: Preprocessor: Use report callback on processing functions 2024-10-11 18:52:34 +02:00
Clément Foucault
2514e119cb Merge branch 'blender-v4.3-release'
# Conflicts:
#	source/blender/draw/intern/shaders/draw_view_info.hh
2024-10-11 18:30:11 +02:00
Bastien Montagne
19e51d5658 Fix RNA invalid cleanup/unregister debug message.
Print in `RNA_struct_free` would crash in ASAN builds because they can often
access memory (struct identifier) that is owned by Python/BPY, and
therefore already freed at exit time.
2024-10-11 18:19:55 +02:00
Clément Foucault
ac1069805c Fix: DRW: Broken multiview support with inverted scale object instances
If a `DrawGroup` contained both inverted and non-inverted scale
the command generate shader would output the `resource_id`
content at conflicting indices. This is because the number of
instances stored inside the `DrawGroup` are the original
count before multiview. Actually, only `start` was taking the
multi-view count into account.

We cannot modify the value on CPU otherwise it would increase
the instance count for each submission. So the fix is to
pass the view count to the command generate shader and
multiply the instance count where needed.

Fix #128085

Pull Request: https://projects.blender.org/blender/blender/pulls/128854
2024-10-11 18:09:57 +02:00
Clément Foucault
3764f53b1b Fix: EEVEE: Point lights with zero radius create in shadow artifact
This is likely caused by local_ray_up being degenerate with
very small radii. This is a temporary fix and should be revisited
later.

The issue is that the real fix is likely to have a higher
performance cost.

Fix #124636
2024-10-11 18:06:47 +02:00
Sybren A. Stüvel
f4f3158a10 Fix: Anim, restore missing automatic F-Curve groups
Restore the automatic F-Curve groups (like "Object Transforms"
when keying loc/rot/scale); 0a74768a98
removed a bit too much code.

Pull Request: https://projects.blender.org/blender/blender/pulls/128891
2024-10-11 17:52:01 +02:00
Campbell Barton
2aa8d3cb4a Merge branch 'blender-v4.3-release' 2024-10-12 00:29:25 +11:00
Campbell Barton
094f7235bb Cleanup: replace own Py_INCREF_RET with CPython's Py_NewRef
These are both simple functions that serve the same purpose.
Py_NewRef didn't exist when Py_INCREF_RET was added to Blender.
2024-10-12 00:20:55 +11:00
Omar Emara
30d3aef477 Compositor: Inline 2D threaded for utility
This patch inlines the 2D threaded for utility used by the compositor
for better performance.
2024-10-11 16:03:16 +03:00
Omar Emara
7f90c16d14 Refactor: Avoid processing arguments directly
Avoid processing function arguments directly and instead create
temporary variables for adjustments. This is done to make it easier to
maintain identical code to CPU.
2024-10-11 15:52:22 +03:00
Campbell Barton
85e29c4ac4 Refactor: simplify join triangles to quads heap-node lookups
- Replace blender::Map with an array to lookup heap-nodes by edge index.
- Only create the array when the topology influence is used.

These gives ~5-9% overall speedup to operator function.
2024-10-11 23:48:30 +11:00
Campbell Barton
80c33bae4a Merge branch 'blender-v4.3-release' 2024-10-11 23:43:03 +11:00
Campbell Barton
02670b1547 Cleanup: correct wording in comments 2024-10-11 23:39:58 +11:00
Campbell Barton
b3e3eaabf0 Cleanup: suppress unknown-warning-option for clang
Also note why the warning isn't valid.
2024-10-11 23:36:19 +11:00
Bastien Montagne
aecdb518db BPY: Add a debug utils to print Python backtrace from C++ code. 2024-10-11 14:17:50 +02:00
Clément Foucault
d8ccaa62fb Merge branch 'blender-v4.3-release'
# Conflicts:
#	tests/data
2024-10-11 14:11:58 +02:00
Jacques Lucke
e7fef63db4 Nodes: improve spacing for panels 2024-10-11 13:38:49 +02:00
Jacques Lucke
a239bfc4dd Refactor: Nodes: improve drawing of nodes based on node declaration
The main goal is to simplify adding support for nested node panels. The patch
makes use of the updated recursive node declarations introduced in
6ffc585fb8.

The main changes are:
* Rewritten node drawing in a way that makes ui design decisions like panel
  visibility and margins more explicit. Especially the handling of margins is
  much better now imo. Previously, it was very hard to change the margin for
  specific cases without accidentally breaking other situations. Now each
  possible case has an explicit margin. This needs a few more lines of code but
  is much easier to work with.
* Rewritten node drawing in panel (sidebar + material properties) using the new
  ways to iterate over the declaration.
* It's possible to add custom layouts at any point in the node declaration now.
  This also replaces the need for having a `draw_buttons` callback for panels.

Pull Request: https://projects.blender.org/blender/blender/pulls/128822
2024-10-11 12:20:58 +02:00
Aras Pranckevicius
bce1ba16ae VSE: Save float image proxies as EXRs to not lose range/precision
Building proxies for images was always saving them as JPG files.
However when input images are floating point (e.g. EXR files), this
loses both range and precision, making the resulting proxies
not really be useful for anything where you'd be using EXR files.

Change this to save float image proxies as EXR instead (FP16 data,
lossy DWAA compression). In my quick tests this does result in about
3x-4x larger proxy file size compared to JPG, however at 50% DWAA
quality that is still 10-30x smaller than original EXRs would be.

Changed proxy image loading to explicitly tell to load metadata. JPGs
were always loading it anyway, but EXRs only load when instructed to
do so.

Pull Request: https://projects.blender.org/blender/blender/pulls/128835
2024-10-11 12:13:14 +02:00
Clément Foucault
300ea9f083 GPU: GLSL: Strip comment at compile time
This speeds up the preprocessor and
will allow for faster load time.

# Conflicts:
#	source/blender/gpu/glsl_preprocess/glsl_preprocess.cc
2024-10-11 11:15:52 +02:00
Omar Emara
317cf37680 Compositor: Implement CPU domain realization
This patch implements the domain realization algorithm for the new CPU
compositor. Only nearest interpolation with no wrapping is implemented
at the moment.

A new sampling method was added to the result class and some relevant
methods were moved into inline functions.
2024-10-11 12:12:24 +03:00
Falk David
24019cc863 Fix: GPv3: Effects not showing in right modes
The object mode flags of the cache population for the effects
were outdated.

This fix makes sure the right flags are used.
2024-10-11 10:54:49 +02:00
Aras Pranckevicius
357eb41513 VSE: Faster float image preview drawing by avoiding float 32->16 bit conversions
Sequencer preview area drawing, when displaying float (EXR/HDR) final
image using GPU based display transform, was converting input float32
data to float16 data for the GPU texture, and the GPU was displaying
that float16 texture.

However this texture is displayed for just one frame, and the cost of
doing the conversion was pretty high. Just send incoming float32
data to the GPU instead.

Playback of EXR sequence at 2048x858 resolution, on
Ryzen 5950X / RTX 3080Ti: 28fps -> 70fps (time to do just the GL
texture upload: 28ms->3ms)

Pull Request: https://projects.blender.org/blender/blender/pulls/128829
2024-10-11 10:14:15 +02:00
Jeroen Bakker
8a6d469cfd Merge branch 'blender-v4.3-release' 2024-10-11 10:06:35 +02:00
Jeroen Bakker
483f96ce73 Fix #128407: EEVEE: Cannot allocate volume pool on Intel ARC/OpenGL
When using OpenGL on Intel ARC the driver reports a max 3d allowed size
of 2048. The volume probe will create a texture that doesn't fit in this
dimension when selecting a probe size of 512 or 1024 MB.

This PR will reshape the volume pool atlas texture until it found a shape
that is optimal and fit on the device. When reshaping selects a different
pool size a warning message will be displayed as it might change the
visual quality.

When reshaping the smallest row size will be selected in order
to improve the occupancy. Reshaping will only happens when a
different setting is set in the `Performance->Memory->Light Probes Volume Pool`.

NOTE: Needs to be backported to 4.2

Pull Request: https://projects.blender.org/blender/blender/pulls/128877
2024-10-11 10:05:56 +02:00
blastframe
70280e9d12 Fix: typo in shadow error message
The error message related to shadow updates in `eevee_shadow.cc`
currently contains a typo:
`"Error: Too many shadow updates, some shadow might be incorrect."`
This sentence should use the plural form of "shadows" to correctly
describe the context.

Fixing this typo ensures clarity and correctness in the error message,
providing developers and users with the appropriate feedback when
encountering shadow update issues.

Pull Request: https://projects.blender.org/blender/blender/pulls/128865
2024-10-11 09:41:31 +02:00
Campbell Barton
326c040aea Merge branch 'blender-v4.3-release' 2024-10-11 16:44:57 +11:00
Campbell Barton
b68ba3dae8 Fix #128839: "Apply Visual Geometry to Mesh" doesn't apply shape-keys
Technically a regression in [0] although it matches behavior prior
to v3.3 going back to 2.7x. The fix for #101883 [1] added a check
for the vertex number changing after the number was zeroed,
causing the shape key to be cleared in most cases.

While the handling of shape-keys in OBJECT_OT_convert wasn't well
defined - clearing the shape-key means in the evaluated coordinates
are always used so it is preferable.

Now the operator ensures the old (un-evaluated) shape-key isn't used.

[0]: 0791f53029
[1]: be32882e1c
2024-10-11 16:43:34 +11:00