Commit Graph

113752 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
Campbell Barton
6fe7203d1a Cleanup: suppress dangling-reference warning 2024-10-11 11:24:39 +11:00
Sean Kim
5c855bd6bf Fix: Sculpt: Reduce clay strips z-axis influence
This commit changes the Clay Strips brush in the following ways:
* Removes hardcoded displacement and scaling of brush matrix
* Applies a falloff to the factor based on the distance to the point in
  the brush-local z-axis

This change has the effect of reducing the brush influence on nearby or
other back-facing planes, reducing overall unwanted deformations.

Pull Request: https://projects.blender.org/blender/blender/pulls/128775
2024-10-10 22:49:12 +02:00
Sean Kim
57c4e9dd2c Fix #128820: Mask filter behaves incorrectly with hidden faces
The usage of `hide::node_visible_verts` in this function does not work
as intended, as the resulting span is misaligned with the sliced
per-node mask data. To fix this issue, this commit adds a similar helper
function to copy all hidden vert data and applies changes to all of the
node vertices.

Pull Request: https://projects.blender.org/blender/blender/pulls/128828
2024-10-10 22:40:38 +02:00
Clément Foucault
bc3fdc3293 Fix: EEVEE: Object wihtout volume probe visibility don't cast shadow
Object without lightprobe visibility should still
cast shadows during baking. They should only not
bounce indirect lighting.

This is more visible now that shadow linking is supported.

Fix #128812
2024-10-10 16:25:59 +02:00
Clément Foucault
b78354152e Revert "Fix #128407: EEVEE: Cannot allocate volume pool on Intel ARC/OpenGL"
Reverted as it breaks render test on some configs (AMD+Mesa+Linux).
This reverts commit 7d5712be9b.
2024-10-10 16:20:44 +02:00
Julian Eisel
10ef436c8f UI: Include asset description in asset shelf tooltip
Tooltips for assets in the asset shelf now don't only display the name,
but also the description saved in the asset's metadata. This is what we
usually do when assets are displayed, for example in the asset browser
or in add menus. Here it was just a small bit of polish that was never
done.
2024-10-10 16:10:34 +02:00
Sybren A. Stüvel
d261a881b1 Anim: change Action.id_root RNA definition to be more like v4.2
Change the `Action.id_root` RNA definition such that
`Action.bl_rna.properties["id_root"].enum_items` returns all valid
values for that property. This was the Blender 4.2 (and older) behaviour
as well.

The only difference now is that v4.3 adds a new `UNSPECIFIED` enum item,
which is not a valid ID type, but is a valid value for `Action.id_root`.

Some more context:

In Blender 4.2 the `Action.id_root` property was a hard-coded list of
all ID types. To add the `UNSPECIFIED` item in v4.3, this was replaced
by an 'items' callback. The way Blender deals with this by default is
such that querying `Action.bl_rna.properties["id_root"].enum_items`
returns its hard-coded default list, and not the result of that 'items'
callback function.

For Action Slots (which will be released in v4.4 but are already in the
sources as experimental feature), there is a similar property that is
implemented in a way such that its `.enum_items` always returns the
proper list. This commit updates the `Action.id_root` RNA property
definition so that it shares code with `ActionSlot.id_root`, fixing the
reported issue.

Note that the `ActionSlot` type is not exposed to RNA in Blender 4.3,
it's just some internal code that is now shared.

Pull Request: https://projects.blender.org/blender/blender/pulls/128834
2024-10-10 14:33:33 +02:00
Philipp Oeser
da9cf98324 Fix: assert parenting a legacy curve to an armature
The armature modifier calls `BKE_armature_deform_coords_with_mesh` (and
thus `BKE_id_defgroup_list_get`) for legacy curves as well, these are
only "riggable" via envelope weights though (this situation could be
made a bit clearer when parenting -- which is for another commit
though).

So to avoid the (rightful) assert in `BKE_id_defgroup_list_get`, only
call it in case vertex groups are supported (and possibly used later on
-- which is never the case for legacy curves).

Note: this was reported in chat by @LazyDodo because the CurveArmature
test was failing in debug

Pull Request: https://projects.blender.org/blender/blender/pulls/128792
2024-10-10 13:53:51 +02:00
Jacques Lucke
f2352efe55 Fix: wrong return type
This only resulted in an assert in debug builds.
2024-10-10 13:26:07 +02:00
Jeroen Bakker
9bcba25bc2 Fix #128282: EEVEE: Unable to compile displacement
When using vertex displacement EEVEE didn't compile the generated
functions into the vertex shader. This could result in errors when
compiling materials.

**Notes**

- Should be back-ported to Blender 4.2

Pull Request: https://projects.blender.org/blender/blender/pulls/128525
2024-10-10 12:16:28 +02:00
Jeroen Bakker
7d5712be9b 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`.

Pull Request: https://projects.blender.org/blender/blender/pulls/128518
2024-10-10 11:28:09 +02:00
Anthony Roberts
ef58d4ae26 Windows: Switch to ProcessorNameString for CPU identification on ARM64
This probably should always have been the value used, really.

Now, instead of reporting `Qualcomm Technologies Inc`, it reports the more informative `Snapdragon(R) X Elite - X1E78100 - Qualcomm(R) Oryon(TM) CPU` on a Thinkpad T14s Gen6 device.

Pull Request: https://projects.blender.org/blender/blender/pulls/128808
2024-10-10 10:37:17 +02:00
Campbell Barton
f666902d17 Fix error in snap-grid check
Correct check from 75ffda39b2.
2024-10-10 12:17:40 +11:00
Germano Cavalcante
75ffda39b2 Fix #126665: Reintroduce 'Absolute Grid Snap' (now 'Absolute Increment Snap')
The 'Absolute Grid Snap' feature remains useful even alongside
'Snap to Grid', so this option is being reintroduced, partially
reverting commit f0479e915f.

Pull Request: https://projects.blender.org/blender/blender/pulls/128135
2024-10-09 22:52:28 +02:00
notrudyyy
9da1b8a74b Fix #128473: New node insertion on link search connects to main socket
Fixes an issue with the new node insertion feature where, after a link drag search,
the main input of the new node is connected to, regardless of which one was chosen.

Pull Request: https://projects.blender.org/blender/blender/pulls/128640
2024-10-09 22:18:13 +02:00
Harley Acheson
cb26e5a169 Fix: Improve Blurry Text 3DView Drag Name
Like #128623 this improved the blurry text shown when dragging an
object into a 3DView.

Pull Request: https://projects.blender.org/blender/blender/pulls/128809
2024-10-09 19:31:11 +02:00
Julian Eisel
2499299ff2 Fix: Empty grease pencil brush libraries linked on startup
Second part to fix #128420.

On startup, the Blender File Outliner mode would show empty libraries
linked, pointing to the brush essentials files. This was because some
grease pencil versioning code would call
`BKE_paint_ensure_from_paintmode()`, which would link in the default
brushes. Then a bit later, brush assets versioning code would remove
local brushes from the default starup file, so the library link became
empty.

Initializing paint data shouldn't necessarily include importing default
brushes. In an earlier version I made this optional with a boolean, but
it's easy enough to separate out entirely.

Now `BKE_paint_ensure()` just initializes paint data, and
`BKE_paint_brushes_ensure()` has to be called to ensure that active
brushes are available.

Pull Request: https://projects.blender.org/blender/blender/pulls/128801
2024-10-09 16:13:01 +02:00
Julian Eisel
eac897bb38 Fix: No default brush set for vertex paint mode
Name of the default brush to use was wrong, so it wouldn't be found.
2024-10-09 14:52:33 +02:00
nutti
1d07ec7bc9 PyAPI: add specific BMLayerCollection element type to doc-strings
Ref: !125851
2024-10-09 22:58:17 +11:00
Campbell Barton
233cf07866 Cleanup: remove unused functions 2024-10-09 22:29:16 +11:00
Philipp Oeser
738dc431eb Fix: Sequencecache modifier opening a file mem allocation mismatch
Oversight in 9506fed905

This would give: "Attempt to use C-style MEM_freeN on a pointer created
with CPP-style MEM_new" (and crash in my local builds)

(noticed while cecking on #128746)

Pull Request: https://projects.blender.org/blender/blender/pulls/128755
2024-10-09 13:01:42 +02:00
Lukas Tönne
12b4ac87ea Fix #128789: GPv3: Context property missing nullptr check
`grease_pencil` context property has to check for valid active object.
Added in 70c7fb6da2

Pull Request: https://projects.blender.org/blender/blender/pulls/128791
2024-10-09 12:22:51 +02:00
Lukas Tönne
5c57e24fea Cleanup: GPv3: Remove unused BKE functions from GPv2
Removes unused GPv2 functions in blenkernel.

Notes:
-  Functions for layer masks are still in use, but annotations never
  have layer masks in the first place. Would be good to remove the data
  structures so we can remove the functions too.
- Some multi-frame edit functions are also still nominally used, but
multi-frame editing is not an active feature for annotations. This
  should also be removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/128709
2024-10-09 10:27:45 +02:00
nutti
933fb1978f PyAPI: correct types in doc-strings
Ref !116245
2024-10-09 15:45:23 +11:00
Germano Cavalcante
0ac66493c0 Fix: Error in previous commit: Snap to grid not updating size while navigating
`t->snap` varies per operator and does not update.
2024-10-08 23:29:57 -03:00
Germano Cavalcante
56c98046a5 Fix #122635: Precision mode not working with Snap to Grid
This introduces partial functionality of Precision mode to 'Snap to
Grid'.

However, it behaves differently from 'Absolute Grid Snap', as it lacks
smooth mouse movement.

Precision mode is now available specifically for Transform operations.
2024-10-08 22:17:36 -03:00
Germano Cavalcante
ae37656478 Fix #128764: Moving keys in the animation editors enables the 3D view's snap toggle
The issue occurred because the code block that read the snap flag was
out of sync with the code block that saved the flag.

The solution was to centralize snap flag handling in the
`transform_snap_flag_from_spacetype_ptr()` function. This function
retrieves the appropriate snap flag and property based on the editor
type, eliminating the need for repetitive conditional checks and
ensuring that the correct snap flag is set for each editor.
2024-10-08 19:17:51 -03:00
Weizhen Huang
52f2bb53b9 Fix #128654: EEVEE: improve precision of cubic solver in light LTC
by rescaling the polynomial coefficients and bringing them to the same
magnitude.

Pull Request: https://projects.blender.org/blender/blender/pulls/128753
2024-10-08 21:45:51 +02:00
Harley Acheson
dc6e021472 Fix #128616: Allow Docking to work from Menu shortcut
Allow Docking to work correctly if using a shortcut to the area header
context menu item. There is no longer a need to set the source or
target area locations.

Pull Request: https://projects.blender.org/blender/blender/pulls/128730
2024-10-08 21:37:54 +02:00
Harley Acheson
00dca5acec Fix #128112: Improve Display of Drag Overlays
Use zero offset for drag items to remove blurriness.

Pull Request: https://projects.blender.org/blender/blender/pulls/128623
2024-10-08 20:44:05 +02:00
Miguel Pozo
07bbe03ffa Fix: EEVEE: DoF slight focus
The ring distance was still computed wrong after #127880
2024-10-08 19:34:17 +02:00
Bastien Montagne
dbadc1c71c Fix part of #128420: invalid handling of full orphaned libraries in management code.
Reset the 'hierarchy index' runtime `temp_index` value for all library IDs.
This prevent the assert to be triggered when trying to rebuild libraries
hierarchy and there are some orphaned (i.e. not used by anything) library IDs
around.
2024-10-08 17:02:51 +02:00
Sybren A. Stüvel
0ae641c4ef Anim: fix null pointer access in 'Push-Down to NLA' operator
After pushing down the Action to the NLA, it needs to be tagged for
reevaluation. The code was using `adt->action->id` for this, but since
the nature of the operator is that it un-assigns the Action itself, that
would always be a null pointer.

Pull Request: https://projects.blender.org/blender/blender/pulls/128707
2024-10-08 15:19:34 +02:00
Falk David
92b4c853db Fix: Python: Incorrect default curve_type when calling drawing.add_strokes()
The API did not initialize the `curve_type` for the newly created strokes resulting in unwanted behavior.

Set the curve type to the expected default: `POLY`.
2024-10-08 12:37:10 +02:00
Falk David
35c2461130 Fix: Build warnings missing include
Caused by a57206dd59.
Missed to remove the line that included the legacy
folder.
2024-10-08 11:37:58 +02:00