Commit Graph

117289 Commits

Author SHA1 Message Date
Hans Goudey
fd6df292f8 Fix #134448: Multi-object editing broken after recent fix
Caused by 638609752c.
Mistake in translation of C-style array management to Vector.
2025-02-12 11:34:36 -05:00
Clément Foucault
15437344ef Cleanup: DRW: Replace DRW_stats with GPU_debug
The former is not useful anymore and is being replaced
by the later.

Pull Request: https://projects.blender.org/blender/blender/pulls/134455
2025-02-12 17:14:48 +01:00
Philipp Oeser
c31f396d91 Merge branch 'blender-v4.4-release' 2025-02-12 17:12:50 +01:00
Philipp Oeser
01e5c6a595 Fix #134279: support boolean layers in bmesh API
Even though from an internal standpoint one could also just use INT
layers (if I understand correctly they are both handled as long?), we
can just support getting/setting bool layers in
the bmesh layer API as well (otherwise, it looks impossible to access
boolean attributes in bmesh).

Pull Request: https://projects.blender.org/blender/blender/pulls/134344
2025-02-12 17:12:24 +01:00
Hans Goudey
89b826b2fe Object: Prevent unnecessary depsgraph tags for no-op materials resize
When the object materials array is already the correct size these
functions don't do anything. Avoiding the depsgraph tags can avoid
unnecessary re-evaluations in cases like  sculpt mode where we
purposefully avoid adding tags elsewhere. Split from !133842.
2025-02-12 10:42:29 -05:00
Omar Emara
89e0472e49 Compositor: Use gpu::TexturePool instead of DRW pool
This patch removes the compositor texture pool implementation which
relies on the DRW texture pool, and replaces it with the new texture
pool implementation from the GPU module.

Since the GPU module texture pool does not rely on the global DST, we
can use it for both the viewport compositor engine and the GPU
compositor, so the virtual texture pool implementation is removed and
the GPU texture pool is used directly.

The viewport compositor engine does not need to reset the pool because
that is done by the draw manager. But the GPU compositor needs to reset
the pool every evaluation. The pool is deleted directly after rendering
using the render pipeline or through RE_FreeUnusedGPUResources for the
interactive compositor.

Pull Request: https://projects.blender.org/blender/blender/pulls/134437
2025-02-12 15:59:45 +01:00
Alaska
8ed69341d0 Shader: Expose light path "is volume scatter ray" in UI
This commit adds the "is volume scatter" output to the light path node
in the shader editor.

All the funcitonal code for this feature already exists in Cycles SVM
and OSL, but the output wasn't exposed on the node.

EEVEE does not support the feature, so it's output will
always be zero.

Pull Request: https://projects.blender.org/blender/blender/pulls/134343
2025-02-12 15:45:04 +01:00
Hans Goudey
d41e49933b Fix: Mismatched MEM_new/MEM_freeN after recent fix
638609752c
2025-02-12 09:31:02 -05:00
Bastien Montagne
8234484904 Merge branch 'blender-v4.4-release' 2025-02-12 14:43:06 +01:00
Bastien Montagne
5a8f0bbc03 Fix (unreported) more PointerRNA-embedding structs C-styled allocated. 2025-02-12 14:40:44 +01:00
Bastien Montagne
361fc5226e Merge branch 'blender-v4.4-release' 2025-02-12 14:09:46 +01:00
Bastien Montagne
551cb3c65b Fix (unreported) invalid calloc'ed data in fmodifier_ui.
This `panel->runtime->custom_data_ptr` is `MEM_delete`'d even, so that
was plainfully wrong allocation code.

Will crash in main/4.5 due to PointerRNA now requiring proper C++
construction/destruction.
2025-02-12 14:06:55 +01:00
Bastien Montagne
c898c5c575 Merge branch 'blender-v4.4-release' 2025-02-12 13:57:19 +01:00
Bastien Montagne
c46f19a6c2 BPY: Fix weak access to Main data from bpy.data API.
Use `self` parameter to retrieve the actual 'owner' Main.

Previous code was using G_MAIN, which _should_ be fine in current usage
context, but would for sure break if these functions were to be used
from e.g. a temp Main.

Pull Request: https://projects.blender.org/blender/blender/pulls/134440
2025-02-12 13:56:06 +01:00
RedMser
495d6ed88f Docs: Fix TimelineMarkers.new description
Likely copy-paste mistake in the docs for timeline markers.

Pull Request: https://projects.blender.org/blender/blender/pulls/134415
2025-02-12 13:48:47 +01:00
Campbell Barton
b4b3696d01 Merge branch 'blender-v4.4-release' 2025-02-12 22:39:37 +11:00
Campbell Barton
5638977db2 Docs: clarify reference ownership in bpy_rna.cc 2025-02-12 22:35:39 +11:00
Campbell Barton
8ff9f2b036 Fix assert with debug builds on exit when built as a Python module 2025-02-12 22:17:13 +11:00
Bastien Montagne
7d8dbfcc7b Merge branch 'blender-v4.4-release' 2025-02-12 11:41:43 +01:00
Bastien Montagne
7901dc8216 Refactor: bpy.data.batch_remove: use set instead of ID tags.
Cleaner and more future-proof. Also refactored slightly the code to make
it more readable.

And removed the 'experimental' warning in docs, this should have been
removed a long time ago.
2025-02-12 11:39:05 +01:00
Omar Emara
df69e6ab50 Merge branch 'blender-v4.4-release' 2025-02-12 11:54:29 +02:00
Omar Emara
25c4dd53dd Fix: Keying Screen and anti-aliasing produce bad results
The Keying Screen and the Anti-Aliasing nodes produce bad results in the
viewport compositor. This is because their cached resources are
allocated from the GPU texture pool, so they might get overwritten.

To fix this, we make sure those are not allocated from the texture pool.
2025-02-12 11:50:44 +02:00
Campbell Barton
67af60460e Merge branch 'blender-v4.4-release' 2025-02-12 13:21:18 +11:00
Campbell Barton
e96acd433d Docs: add code-comments to clarify bad-level include & developer only UI 2025-02-12 13:21:07 +11:00
Campbell Barton
f1e8dd366b CMake: support using LIBDIR while building against an external Python
Support a standard Blender build referencing Python outside of LIBDIR,
useful to build against Python with debugging options enabled.
2025-02-12 13:17:04 +11:00
Harley Acheson
24fe1f2d5c UI: Disabled Message Before Python in Tooltips
As discussed in our UI Module meeting, tooltips should show disabled
message before python path. Better connects the reason to the thing
being disabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/134426
2025-02-12 01:47:12 +01:00
Campbell Barton
07340e1093 Docs: add code-comments to clarify bad-level include & developer only UI 2025-02-12 10:59:16 +11:00
Aaron Carlisle
fe5e712edc Merge branch 'blender-v4.4-release' 2025-02-11 18:47:28 -05:00
Aaron Carlisle
4906d8bf85 Fix: new/free mismatch
See 06be295946
2025-02-11 18:45:31 -05:00
Harley Acheson
c663b78bcb Refactor: Tooltip Calculation of Sizing and Spacing
Refactor how tooltips are sized, items placed, margins calculated, etc.
Current code has some mistakes that we use kludges to compensate for,
and it doesn't properly consider the font size in calculating margins.
The result shown to users in normal circumstances (changing resolution
scale only) with this PR applied should look identical to current.
Small changes when the text style size is changed. However, this is
mostly to allow later adjustments to padding, which currently _breaks_
when changed.

Pull Request: https://projects.blender.org/blender/blender/pulls/134205
2025-02-12 00:09:02 +01:00
Harley Acheson
9e1d038b1e Merge branch 'blender-v4.4-release' 2025-02-11 14:32:02 -08:00
Gilberto.R
b5b786b34f Fix: UI: Close pie menu on window focus loss
Close open pie menus on window loss of focus, to prevent waiting for
the pie key release if it was released outside of focus.

Pull Request: https://projects.blender.org/blender/blender/pulls/134215
2025-02-11 23:30:31 +01:00
Sean Kim
a2b75c87c8 Merge branch 'blender-v4.4-release' 2025-02-11 14:10:10 -08:00
Sean Kim
312579ce82 Fix #134366: object.closest_point_on_mesh always returns no result
Introduced in 024d7d12e2

Pull Request: https://projects.blender.org/blender/blender/pulls/134377
2025-02-11 23:09:20 +01:00
Brecht Van Lommel
2c34786474 Merge branch 'blender-v4.4-release' 2025-02-11 20:43:17 +01:00
Brecht Van Lommel
89e3d0a688 Fix: MaterialX normal map node not exported
Space input was removed in MaterialX 1.39.

Pull Request: https://projects.blender.org/blender/blender/pulls/134411
2025-02-11 20:40:33 +01:00
Brecht Van Lommel
21da1aec16 Fix: MaterialX of gradient texture node is wrong
Node input names changes in MaterialX 1.39.

Pull Request: https://projects.blender.org/blender/blender/pulls/134411
2025-02-11 20:40:33 +01:00
Brecht Van Lommel
77a7c68c9d Fix: Hydra exoports incorrect dome light color
It would both set the dome light color and export a texture with that
same color, which would double up. It was also using the World.exposure
member which is not used anywhere else in Blender.

Pull Request: https://projects.blender.org/blender/blender/pulls/134411
2025-02-11 20:40:33 +01:00
Brecht Van Lommel
1d743e2082 Fix: USD exports icnorrect dome light color when not using nodes
Implement support for this.

Pull Request: https://projects.blender.org/blender/blender/pulls/134411
2025-02-11 20:40:33 +01:00
Maxime-Cots
bbab2aa328 Add default Plane shape to USD Importer
Implement the USD Plane Shape for import, mirroring what was done for
the others. See #134138

Additional tests will be added afterwards but a simple test is simply to
import the resulting file:
```python
from pxr import Usd, UsdGeom
stage = Usd.Stage.CreateNew('plane.usd')
xform_prim = UsdGeom.Xform.Define(stage, '/world')
plane_prim = UsdGeom.Plane.Define(stage, '/world/plane')
stage.GetRootLayer().Save()
```

Co-authored-by: Nig3l <nig3lpro@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/134275
2025-02-11 19:56:15 +01:00
Clément Foucault
db2610f2e4 DRW: Use new gpu::TexturePool inside TextureFromPool
Follow up to #134403.
2025-02-11 19:00:43 +01:00
Clément Foucault
6138ee64a9 GPU: TexturePool: Add texture pool functionality to the GPU module
This patch adds the texture pool functionality that was previously
only available in the DRW module to the GPU module.

This allows to not rely on global `DST` variable for the managment
of these temporary textures.

Moreover, this can be extended using dedicated GPU backend
specific behavior to reduce the amount of memory needed
to render.

The implementation is mostly copy pasted from the draw implementation
but with more documentation. Also it is simplified since the
`DRW_texture_pool_query` functionality is not needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/134403
2025-02-11 18:58:46 +01:00
Philipp Oeser
c042c67011 Fix #134395: "Intersect" selection mode not working for Grease Pencil
Intersect mode needs to set everything **outside** of the selection mask
to non-selected and leave the rest untouched.
We already had the comment to "un-set all elements not in the mask" but
that was actually unsetting **everything**.

In theory, we could also early out for `SEL_OP_AND` since the following
`apply_mask_as_` calls are not doing anything for `SEL_OP_AND` really
(but left the change to be minimal).

Pull Request: https://projects.blender.org/blender/blender/pulls/134400
2025-02-11 18:54:02 +01:00
Hans Goudey
638609752c Fix #134290: Multi-editing crash after recent refactor
Another case of C-style allocation of non-trivial objects hidden
with casting. To fix, give explicit member defaults to a few of
the UI interaction structs.
2025-02-11 12:41:18 -05:00
Jacques Lucke
4980dc5e29 Merge branch 'blender-v4.4-release' 2025-02-11 17:47:45 +01:00
Jacques Lucke
1cb2d991f9 Fix #134230: missed multi-threading opportunity when using repeat zone
In setups where only very few elements are processed at once, the lazy-threading
hints that come from `parallel_for` are not triggered. However, often it can
still be worth to use multi-threading in such cases. Therefore, we need to find
additional places where the lazy-threading hints are sent. There are many
possibilities and we probably have to add them step by step as we find .blend
files that show missing multi-threading.

In this patch I choose to send the hint at the beginning of evaluating a repeat
zone if it has 10 or more iterations. The exact number here is just a guess and
could be fine tuned over time if necessary.

A slightly modified version of the file in #134230 speeds up from ~1100ms to
~100ms with this change. The exact speedup changes quite a bit each run, but is
always between 5 and 20x, so it's quite noticable.

Pull Request: https://projects.blender.org/blender/blender/pulls/134408
2025-02-11 17:46:53 +01:00
Jacques Lucke
374604f188 Refactor: Core: simplify accessing ListBases in Main
This replaces the `set_listbasepointers` function with `BKE_main_lists_get`
which returns an array of `ListBase *`. This simplifies the caller a bit. In
some cases, it can be simplifed further by changing the order in which we iterate
over the listbase. For historical reasons, we iterate from the back to front in
most cases but sometimes the order does not matter. I did keep the iteration order
in this patch though, to avoid regressions.

Pull Request: https://projects.blender.org/blender/blender/pulls/134242
2025-02-11 17:46:07 +01:00
Jacques Lucke
d28cf7a469 Fix #134283: defer freeing tree/node/socket types
Currently, tree, node and socket types are always freed immediately when the
Python code unregisters them. This is problematic, because there may still be
references to those type pointers in evaluated data owned by potentially various
depsgraphs. It's not possible to change data in these depsgraphs, because they
may be independent from the original data and might be worked on by a separate
thread. So when the type pointers are freed directly, there will be a lot of
dangling pointers in evaluated copies. Since those are used to free the nodes,
there will be a crash when the depsgraph updates. In practice, this does not
happen that often, because typically custom node tree addons are not disabled
while in use. They still used to crash often, but only when Blender exits and
unregisters all types.

The solution is to just keep the typeinfo pointers alive and free them all at
the very end. This obviously has the downside that the list of pointers we need
to keep track of can grow endlessly, however in practice that doesn't really
happen under any normal circumstances.

I'm still getting some other crashes when enabling/disabling Sverchok while
testing, but not entirely reliably and also without this patch (the crash there
happens in RNA code). So some additional work will probably be needed later to
make this work properly in all cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/134360
2025-02-11 17:25:10 +01:00
Falk David
9438597b34 Fix: Grease Pencil: Remove invisible layers from evaluated data
Previously, all the layers were part of the evaluated state, even if
they were hidden.

Hidden layers should be treated as "disabled" meaning that we should
not evaluate them and/or render them at all.

This fixes this by removing hidden layers from the evaluated data before
layer adjustments and modifier evaluation starts.

As a consequence, hidden layers are no longer accessible in Geometry
Nodes. Technically, this is a breaking change. In the unlikely case that
a user relied on hidden layers to be evaluated within modifiers, they
need to make sure that the layer is visible.

Pull Request: https://projects.blender.org/blender/blender/pulls/133973
2025-02-11 16:49:51 +01:00
IREXTIA
43b3c62a54 UI: Improve save report message
Currently, all save operations show the same `Saved "Filed.blend"` message.

Improve wording to tell apart different save actions such as:

* Save As
* Save Copy
* Save Incremental

Pull Request: https://projects.blender.org/blender/blender/pulls/134114
2025-02-11 16:39:12 +01:00