Commit Graph

117289 Commits

Author SHA1 Message Date
Hans Goudey
f3603b4cd9 Fix: Mistake in previous menu search fix/refactor
Causing a use after free with developer extras turned on.
2025-02-05 22:31:30 -05:00
Campbell Barton
115cc6372f Merge branch 'blender-v4.4-release' 2025-02-06 12:40:40 +11:00
Campbell Barton
8e122ccc72 Cleanup: correct spelling in comments (check_spelling_*) 2025-02-06 12:37:32 +11:00
Campbell Barton
2a0ce11104 NDOF: adjust when guides are shown
- Hide the axis guide when not orbiting
  this drew a permanent blue-dot in the middle of the viewport
  which is distracting & unnecessary.

- Hide the orbit center when it's invalid or unused because of
  object/3d-cursor viewport locks.
2025-02-06 11:06:38 +11:00
Campbell Barton
da8d9d989e NDOF: ignore orbit center lock when locked to object or 3D cursor
For views that lock to an object or 3D cursor it doesn't make sense
to calculate a new center.
2025-02-06 10:51:46 +11:00
Hans Goudey
3b4ead2ecc Fix: Link error from missing include 2025-02-05 18:27:44 -05:00
Hans Goudey
d216476458 Cleanup: Use StringRef for UI search menu code
Also use Vector to store menu search items instead of a linked
list. And extend the change into the autocomplete API slightly.
The main benefit is to avoid measuring the length of strings over
and over, but the code also gets simpler.
2025-02-05 18:27:44 -05:00
Hans Goudey
93ab2813a7 Cleanup: Remove unnecessary "using" statements 2025-02-05 18:27:43 -05:00
Guillermo Venegas
5a1e8de77b Fix: Pointer reseted to nullptr
The pointer is de-referenced few lines below

Pull Request: https://projects.blender.org/blender/blender/pulls/134154
2025-02-06 00:23:01 +01:00
Campbell Barton
9154b5d14a Cleanup: correct misleading variable name
Don't mix up the "patch" version and the "subversion".
2025-02-06 10:12:39 +11:00
Campbell Barton
3a8658958f Correct error bumping patch level instead of subversion
Correct mistake in 30399fd165
2025-02-06 10:08:05 +11:00
Campbell Barton
30399fd165 NDOF: enable "Auto" center & show orbit center guide by default 2025-02-06 09:54:44 +11:00
Campbell Barton
1a14d69498 NDOF: implement new methods to pick the orbit-center
Add support for dynamic NDOF orbit center calculation.

- When "Auto" NDOF preference is enabled:
  All visible objects in the viewport are used to calculate a
  bounding box center, if the bounds are outside the view or the center
  is behind the viewport, use a Z-Buffer test to calculate the depth in
  the middle of the region.

- When "Use Selected Items" NDOF preferences is enabled,
  calculating the bounds from the selection.

- An option to show the orbit center as a guide has also been added.

Ref !129594

Co-authored-by: Kamil Galik <kgalik@3dconnexion.com>
2025-02-06 09:54:41 +11:00
Hans Goudey
dec38419cd Fix: Menu search crash after recent PointerRNA change
Caused by 45f231141d.

The problem was that the now non-trivial PointerRNA type was used inside
of a union. To fix that, replace it with a variant, and generally move
the file towards proper C++ patterns. Also replace the memory arena with
a ResourceScope, of  change from dynstr to the fmt::memory_buffer, and
use a destructor instead of manually freeing memory.

Pull Request: https://projects.blender.org/blender/blender/pulls/134144
2025-02-05 22:33:50 +01:00
Harley Acheson
96550013bb Merge branch 'blender-v4.4-release' 2025-02-05 13:31:13 -08:00
Harley Acheson
b39c637d63 Fix #134061: Consider 2D Zoom in Event Icon Text Sizing
Most event icons shown on the status bar are made up of an icon with
text inside of it. The icon sizing used 2D zoom aspect value, but the
text does not. I had not noticed any use of these outside of Status Bar
so this wasn't tested. Using aspect requires much more precise
measurement and placement of the text using calculated margin values.

Pull Request: https://projects.blender.org/blender/blender/pulls/134146
2025-02-05 22:29:48 +01:00
Hans Goudey
190ea95ae6 Fix: Radial control operator crash after PointerRNA change
Caused by 45f231141d.

The non-trivial nature of `RadialControl` was hidden behind
C-style allocation. Now write the default values for `RadialControl`
explicitly since it isn't allocated by calloc anymore.
2025-02-05 13:54:11 -05:00
Clément Foucault
a6e82a20de Merge branch 'blender-v4.4-release' 2025-02-05 19:37:56 +01:00
Clément Foucault
0f9c2e47e5 Fix #133576: EEVEE: 'offscreen.draw_view3d' projection matrix broken
This was caused by the input matrix not being used.
Instead EEVEE was trying to derive the projection matrix
again based on the actual viewport state. But this state
was not reflecting the input matrix.

To fix this, we remove any camera setup from the rv3d during
the offscreen drawing and set the lens param to 0.
This ensure EEVEE loads the input projection matrix.
2025-02-05 19:37:05 +01:00
Julian Eisel
9a9e2e19a9 Fix #130007: Invalid current file asset catalogs after saving file
Second part to fix #130007, after 50f7666785.

When saving a new file with the current file asset library loaded, the
library wasn't converted properly to an on-disk library. While the
library was loaded again as on-disk library, the previous runtime
version of it wasn't cleared, so catalog definitions could be duplicated
across available libraries.

Make sure the runtime only library is destructed properly, and the UI
refreshed.

There seem to be more issues with converting the runtime current file library to
a on-disk current file library, but these can be addressed after the crashes and
hangs are fixed, see report.

Pull Request: https://projects.blender.org/blender/blender/pulls/133341
2025-02-05 18:40:04 +01:00
Hans Goudey
4e873487dc Fix: Potential crash in curves attribute set operator
Similar to #134108.
Caused by 0089a90625dd425803e8921a6573e17719b4bf9f..
2025-02-05 11:50:53 -05:00
Harley Acheson
cd1aca3ed4 Merge branch 'blender-v4.4-release' 2025-02-05 08:31:17 -08:00
Harley Acheson
a7178e69f4 Fix: Stop View3D FPS Overlay from Jiggling
If "Playback Frame Rate" is enabled (Preferences / ViewPort / Display)
and showing the "Text Info" viewport overlay, then "fps" is shown in
the place of the View Name while the animation is played. Every time
this starts there is a jiggle where the Object Info line is drawn at
the first line instead. This is because the FPS can early exit and not
update the vertical line position. This PR fixes that.

Pull Request: https://projects.blender.org/blender/blender/pulls/134074
2025-02-05 17:30:17 +01:00
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
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
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
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
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