Commit Graph

146155 Commits

Author SHA1 Message Date
Nika Kutsniashvili
55de54557c UI: Show object data name in 3D Viewport text overlay
Helps identify the active mesh/armature data, useful for instances or
when dealing with multiple data-blocks per object, as in the Keymesh
add-on.

More details and screenshots in the pull request.

Pull Request: https://projects.blender.org/blender/blender/pulls/133403
2025-02-05 17:05:15 +01:00
Weizhen Huang
b0e3cd14ff Cleanup: Compiler warning
use reference type `BL::ID &` to prevent copying
2025-02-05 16:28:14 +01:00
Bastien Montagne
45f231141d Core: Add info about chain of ancestors (owner data) of a PointerRNA.
The general idea is to store an array of (type, data) pointers of all
PointerRNA ancestors of the current one.

This will help solving cases in our code where the owner (or sometimes
even the owner of the owner) of a random PointerRNA needs to be
accessed. Current solution mainly relies on linear search from the owner
ID, which is sub-optimal at best, and may not even be possible in case a
same data is shared between different owners.

This lead to refactoring quite a bit of existing PointerRNA creation code.

At a high level (i.e. expected usages outside of RNA internals):
* Add `RNA_pointer_create_with_parent` and
  `RNA_pointer_create_id_subdata` to create RNA pointers with
  ancestors info.
* `RNA_id_pointer_create` and `RNA_main_pointer_create` remain
  unchanged, as they should never have ancestors currently.
* Add `RNA_pointer_create_from_ancestor` to re-create a RNA pointer
  from the nth ancestor of another PointerRNA.
* Add basic python API to access this new ancestors data.
* Update internal RNA/bpy code to handle ancestors generation in most
  common generic cases.
  - The most verbose change here is for collection code, as the owner of the
    collection property is now passed around, to allow collection items to get
    a valid ancestors chain.

Internally:
* `PointerRNA` now has an array of `AncestorPointerRNA` data to store
  the ancestors.
* `PointerRNA` now has constructors that take care of setting its data for
  most usual cases, including handling of the ancestor array data.
* Pointer type refining has been fully factorized into a small utils,
  `rna_pointer_refine`, that is now used from all code doing that operation.
* `rna_pointer_inherit_refine` has been replaced by
  `rna_pointer_create_with_ancestors` as the core function taking care of
  creating pointers with valid ancestors info.
  - Its usage outside of `rna_access` has been essentially reduced to custom
    collection lookup callbacks.

Implements #122431.

--------------

Some notes:
* The goal of this commit is _not_ to fully cover all cases creating
  PointerRNA that should also store the ancestors' chain info. It only
  tackles the most generic code paths (in bpyrna and RNA itself mainly).
  The remaining 'missing cases' can be tackle later, as needs be.
* Performances seem to be only marginally affected currently.
* Currently `AncestorPointerRNA` only stores PointerRNA-like data.
  This will help `StructPathFunc` callbacks to more efficiently generate
  an RNA paths when calling e.g. `RNA_path_from_ID_to_property`, but will
  not be enough info to build these paths without these callbacks. And some
  cases may still remain fuzzy. We'd have to add thinks like a `PropertyRNA`
  pointer, and for RNA collection ones, an index and string identifier, to store
  a complete unambiguous 'RNA path' info. This is probably not needed, nor
  worth the extra processing and memory footprint,  for now.

Pull Request: https://projects.blender.org/blender/blender/pulls/122427
2025-02-05 15:45:04 +01:00
Philipp Oeser
585b709b1a Merge branch 'blender-v4.4-release' 2025-02-05 15:17:28 +01:00
Philipp Oeser
b7ce997574 Fix #134104: Curves: handles miss recalc after snapping/randomize/warp
actually mentioned in !133548 already but forgot to include

Pull Request: https://projects.blender.org/blender/blender/pulls/134105
2025-02-05 15:14:13 +01:00
Philipp Oeser
eecf5787c1 Fix #119932: Weight paint loop selection fails when bones are rotated
Previous approach was using non-evaluated meshes to find the closest edge from a face index retrieved from the selection buffer.
This can fail though if the mesh is deformed or even altered to not have the same indices anymore (e.g. generating/masking modifiers).

In order to make this work, added `ED_mesh_pick_edge` which switches the selection context to edges directly
and picks from those. No need to map anything back and forth between original and evaluated, the selection buffer contains the original indices already.

Further logic (following the face loop) is untouched (and happens on the original geometry which is fine)

Should go into 4.2 LTS as well

Pull Request: https://projects.blender.org/blender/blender/pulls/132803
2025-02-05 15:13:48 +01:00
Nikita Sirgienko
e6c1eb59cb Merge branch 'blender-v4.4-release' 2025-02-05 15:13:28 +01:00
Nikita Sirgienko
bee534eea5 Build: Upgrade Intel Graphics Compiler to 2.1.14 on Linux
This corresponds the latest rolling 2448.13 release:
https://dgpu-docs.intel.com/releases/packages.html?release=Rolling+2448.13&os=Ubuntu+24.04

Graphics compiler upgrades require increasing the minimum required
driver (compute-runtime) version to the corresponding one to guarantee
compatibility, which is XX.XX.31740.15 in this release, so we bump this
requirement accordingly.

Co-authored-by: Xavier Hallade <me@ph0b.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/134051
2025-02-05 15:00:04 +01:00
Clément Foucault
12a00be442 Merge branch 'blender-v4.4-release' 2025-02-05 14:26:37 +01:00
Clément Foucault
7a98a459ef Fix #134011: Overlay: Loose wires object color in selection not visible
The changes from 29356e2bf7
fixed a readability issue with loose wire not being as prominent as
regular surface wireframe.

But also added a regression where the object color wireframe mode
made the object color imperceivable when the object is selected.

This commit fixes the issue by setting the facing factor to 0.5 for
loose wires. This way, both the theme color and object color wireframe
more are blended enough to be distinguishable and still retain the
object color hint.
2025-02-05 14:25:46 +01:00
Hans Goudey
75606530e3 Merge branch 'blender-v4.4-release' 2025-02-05 08:20:24 -05:00
Hans Goudey
b5e5d4b335 Fix #134108: Set attribute operator crash with multiple objects
Caused by 0089a90625.
2025-02-05 08:19:01 -05:00
Jacques Lucke
9f64a965f0 Merge branch 'blender-v4.4-release' 2025-02-05 14:14:15 +01:00
Jacques Lucke
4fd236dc32 Fix #134111: sockets are incorrectly grayed out after random node
The issue was that the code did not handle input sockets that are fields
implicitly correctly. It just retrieved a single from them, instead of
treating them as having an unknown value.
2025-02-05 14:09:48 +01:00
Weizhen Huang
0bcb861c60 Merge branch 'blender-v4.4-release' 2025-02-05 13:41:44 +01:00
Weizhen Huang
d2db9927ed Fix #86648: reduce ray differentials size for bump mapping
Use sub-pixel differentials for bump mapping helps with reducing
artifacts when objects are moving or when textures have high frequency
details.

Currently we scale it by 0.1 because it seems to work good in practice,
we can adjust the value in the future if it turns out to be impractical.

Ref: #122892

Pull Request: https://projects.blender.org/blender/blender/pulls/133991
2025-02-05 13:39:27 +01:00
Weizhen Huang
f4e4f19af2 Cleanup: Cycles: improve comments and variable names of bump-related functions
- Rename dx/dy -> dfdx/dfdy to match the actual computed quantity
- Add template functions to compute dfdx/dfdy on triangles for sharing
  among different data types
- Add documentation to some functions
- Some code shuffling that makes it easier to scale dfdx/dfdy in the
  future
- Some other trivial changes
2025-02-05 13:39:27 +01:00
Alaska
1daa98ee78 Merge branch 'blender-v4.4-release' 2025-02-06 01:35:42 +13:00
Julian Eisel
442b523b28 Merge branch 'blender-v4.4-release' 2025-02-05 12:50:21 +01:00
Julian Eisel
2d90ab9eca Fix: Deadlock when generating asset catalog tree after file-load
Partial fix for #130007.

The catalog tree mutex would be set in `catalog_tree()` and
`invalidate_catalog_tree()`. The former could end up adding catalogs and thus
calling `invalidate_catalog_tree()`, which would attempt to set a mutex that the
caller set already. This seems like a good use-case for `std::recursive_mutex`.

would make sure there's a catalog for each catalog path by calling
`create_missing_catalogs()`
2025-02-05 12:50:09 +01:00
Julian Eisel
50f7666785 Fix: Deadlock when generating asset catalog tree after file-load
Partial fix for #130007.

The catalog tree mutex would be set in `catalog_tree()` and
`invalidate_catalog_tree()`. The former could end up adding catalogs and thus
calling `invalidate_catalog_tree()`, which would attempt to set a mutex that the
caller set already. This seems like a good use-case for `std::recursive_mutex`.

would make sure there's a catalog for each catalog path by calling
`create_missing_catalogs()`
2025-02-05 12:45:58 +01:00
Campbell Barton
861d53cb41 Merge branch 'blender-v4.4-release' 2025-02-05 22:11:54 +11:00
Campbell Barton
4669e0f1ab Fix UNIX NDOF state being start/finish during continuous motion
Logic to ensure finish events were sent wasn't working properly
because processing the events could run before the SPNAV API had
filled the event queue.

Resolve by adding a delay of 100ms, before generating a "finish" event.

For the user this caused the NDOF Guide to flicker while navigating.
2025-02-05 22:03:02 +11:00
Campbell Barton
613e34b559 Docs: cross reference progress enum for GHOST/WM API's
Note that these enums need to be kept in sync.
2025-02-05 21:53:52 +11:00
Thomas Dinges
eaef5e87c2 Revert "Release: Bump branch to 4.4 Beta."
This reverts commit 8a6e3a0bd7.
2025-02-05 11:25:54 +01:00
Thomas Dinges
50651145e4 Merge branch 'blender-v4.4-release' 2025-02-05 11:25:43 +01:00
Thomas Dinges
8a6e3a0bd7 Release: Bump branch to 4.4 Beta.
Splash screen by Flow.
2025-02-05 11:24:33 +01:00
Thomas Dinges
2fb881b65a Release: Bump main to 4.5 2025-02-05 11:09:47 +01:00
Omar Emara
96f56da030 Fix #134073: Compositor crash with viewer inside muted group
The compositor crashes when the user goes into a muted group that has a
viewer node while the backdrop is enabled. The compositor should not
schedule viewer nodes inside muted contexts, so we need to add checks to
prevent this.

Pull Request: https://projects.blender.org/blender/blender/pulls/134093
2025-02-05 10:41:46 +01:00
Pratik Borhade
b545f8d223 Fix #133927: Image editor not syncing with active image node
When active node is clicked again, the image editor does not update and
keeps showing the old image. Always run `ED_space_image_sync`, when
clicked node is image texture node to resolve this issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/133956
2025-02-05 10:39:02 +01:00
Pratik Borhade
90ae533aa1 Fix #101612: Viewport switched to perspective mode from camera view
When camera view is active, regardless of camera view type, view changes
to perspsective mode in local view. Now fixed with extra case of camera
view type.

Pull Request: https://projects.blender.org/blender/blender/pulls/132103
2025-02-05 09:48:00 +01:00
Pratik Borhade
12b426d87e Fix #66367: Refresh view setting when exiting camera view
Send notifiers to redraw side panel when view exits from camera (similar
to smooth view)

Pull Request: https://projects.blender.org/blender/blender/pulls/132980
2025-02-05 09:38:55 +01:00
Pratik Borhade
b2a2aae237 Fix #133751: Render pass warning with GPU device
`compositor_is_in_use` sets `used_by_compositor` true when GPU device is
selected. This draws render pass warning even when viewport
compositor is disabled. Remove the condition to fix the unintentional
warning. Following function is just used in node drawing, seems safe to
remove then.

Pull Request: https://projects.blender.org/blender/blender/pulls/133753
2025-02-05 09:34:12 +01:00
Philipp Oeser
a44b12dd6b Fix #134031: Set Parent menu lists unsupported armature options
What is (or isnt) supported here depends on object types (but we were
getting most of the options for all object types):

| **obtype** | **supports Armature modifier**  | **supports vertex groups** | **supports envelopes** | **supports automatic weights** |
| -- | -- | -- | -- | -- |
| OB_MESH | yes | yes | yes | yes |
| OB_CURVES_LEGACY | yes | no | yes | no |
| OB_CURVES | no | no | no | no |
| OB_SURF | yes | no | yes | no |
| OB_MBALL | no | no | no | no |
| OB_FONT | yes | no | yes | no |
| OB_VOLUME | no | no | no | no |
| OB_GREASE_PENCIL | yes | yes | yes | yes |
| OB_LATTICE | yes | yes (broken though) | yes | no |
| OB_EMPTY | no | no | no | no |
| OB_SPEAKER | no | no | no | no |
| OB_LIGHTPROBE | no | no | no | no |
| OB_LAMP | no | no | no | no |
| OB_ARMATURE | no | no | no | no |
| OB_POINTCLOUD | no | no | no | no |

This PR does two things:
- tidy up the popup menu we get for parenting (removing non-funtional
options)
- enable "With Empty Groups" for lattices (no reason why this should not
work)

What this PR does not touch:
- the poll function for parenting (since this acts on selected objects,
checking all of them can be a costly operation which should not be part
of a poll function)

Pull Request: https://projects.blender.org/blender/blender/pulls/134037
2025-02-05 09:14:21 +01:00
Campbell Barton
3952c58183 Fix buffer overflow from an one error accessing environment variables 2025-02-05 19:08:58 +11:00
Campbell Barton
256f3cd52f Fix missing call to va_end(..)
Own regression in [0] replacing BLI_dynstr with BLI_vsprintfN.

[0]: 6fbe467021
2025-02-05 19:00:05 +11:00
Andrej730
380e8455e8 PyDoc: Fix typing issues with bpy.utils.register_tool
- Add `type[]` for the `tool_cls` as it's expecting tool type class,
  not the instance (similar to #132420)
- Add `set[str]` to `after` type as it's seems to be the way it's used
  the most widely, e.g. in "UI Tool Simple" example that comes with Blender:

`bpy.utils.register_tool(MyTool, after={"builtin.scale_cage"}, separator=True, group=True)`

Pull Request: https://projects.blender.org/blender/blender/pulls/133975
2025-02-05 07:06:53 +01:00
Campbell Barton
4083b9ce62 Cleanup: use a more specific name for NDOF's guide
Prepare for having a second guide (!129594).
2025-02-05 15:19:35 +11:00
Campbell Barton
c3a80b5b19 Fix driver "Update Dependencies" doing nothing
Regression in [0] which disabled the functionality for an unrelated
change.

[0]: ba3f26fac5
2025-02-05 14:45:57 +11:00
Campbell Barton
8f80e373a0 Cleanup: pass std::string arguments by reference instead of value 2025-02-05 14:38:56 +11:00
Campbell Barton
4ed5776990 Cleanup: avoid double precision loss when converting to/from floats 2025-02-05 14:38:56 +11:00
Campbell Barton
5add20a131 Cleanup: remove redundant checks 2025-02-05 14:38:56 +11:00
Campbell Barton
df3d1bf506 Cleanup: use const arguments & variables where appropriate 2025-02-05 14:38:56 +11:00
Campbell Barton
378e49059e Fix invalid null checks (caught by cppcheck)
Resolve two instances where values were null checked
after use.
2025-02-05 14:38:56 +11:00
Campbell Barton
77fca5b15a Fix 3D viewport depth calculation for comparison
Replace ED_view3d_calc_zfac with a matrix multiply because the "zfac"
is never negative and near zero values are set to 1.0.

This makes sense for tools & viewport logic that use the value for
division and don't handle negative values but not for depth comparison.
2025-02-05 12:27:13 +11:00
Campbell Barton
b02bbbdb37 Cleanup: rename "GL" selection to "DEPTH"
The reference to OpenGL is no longer relevant.
2025-02-05 11:21:50 +11:00
Campbell Barton
e9de621159 Docs: improve doc-string for OPTYPE_REGISTER
Include another example where the REGISTER flag is set without UNDO.
2025-02-05 11:14:32 +11:00
Campbell Barton
4186175af8 Cleanup: improve code-comments & naming for window decoration styles
- Expand on the code-comment regarding tests & WM_capabilities_flag and
  move it from the caller into the functions body since this is useful
  for other callers, also mention in the doc-string.
- Use a common prefix for `WM_window_decoration_style_*` functions.
- Add a doxy-section for decoration style functions.
2025-02-05 10:56:54 +11:00
Campbell Barton
bc6dc89d50 Cleanup: quiet check_spelling_* warnings, use doxygen doc-strings 2025-02-05 10:29:00 +11:00
Alaska
cb8e82a6ad Release tools: Update list of bug fixes tool for 4.4 Beta/4.5 Alpha
With the transition from 4.4 Alpha to 4.4 Beta and 4.5 Alpha, a few
small changes could be made to the "list of bug fixes per release" tool
to make it more reliable:
- 4.5 is added to the list so it can detect reports made from
Blender 4.5.
- Update the example usage to of the script to be the exact arguments
triagers should use for 4.4 Beta and 4.5 Alpha so triagers just need to
copy and paste the arguments to the command line.

With 4.4 Beta and 4.5 Alpha, small updates to the "list of bug fixes
per release" tool could be made to make the script.
2025-02-05 12:28:29 +13:00