Commit Graph

120055 Commits

Author SHA1 Message Date
Jesse Yurkovich
ae1a5aa2a1 Fix: USD: Incorrect call to Map::add_new during dupli-vert export
Mistake in 6704647c66. Test coverage being added for another bug fix
uncovered this one.

Problem occurs when exporting an object that is duplicating at least two
other objects with the dupli vert system.

Pull Request: https://projects.blender.org/blender/blender/pulls/135369
2025-03-02 22:51:23 +01:00
Harley Acheson
1ad39b95d9 Merge branch 'blender-v4.4-release' 2025-03-02 12:39:19 -08:00
Harley Acheson
1a72a0f22c Fix #135295: Always Restore Previous Editor with set_or_cycle
ED_area_newspace correctly changes an area's space when the type and
subtype are set beforehand. But SCREEN_OT_space_type_set_or_cycle, when
changing to a new editor rather than cycling, needs newspace to ignore
the set subtype and use the last-used saved in the space. This
situation cannot be tested for in newspace. Instead have the operator
pass -1 as subtype to signal this intended behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/135367
2025-03-02 21:38:02 +01:00
Campbell Barton
98aee659cf Merge branch 'blender-v4.4-release' 2025-03-02 15:50:15 +11:00
Campbell Barton
0fc7b7ef9a Merge branch 'blender-v4.4-release' 2025-03-02 15:50:09 +11:00
Campbell Barton
2be7586bce Fix the line-width controlling UI element scale & drag threshold
The line-width is used to calculate the `U.pixelsize` which should only
be used to control the size of lines & points.

Update doc-strings to mention the intended use, remove unused defines.
2025-03-02 15:46:22 +11:00
Hans Goudey
0d28c93f08 Cleanup: Sculpt: Use Map instead of GHash for dyntopo edge collapse 2025-03-01 18:11:44 -05:00
Hans Goudey
aafcc5d3b9 Cleanup: Use references, nodiscard, for BMesh partial update 2025-03-01 18:02:30 -05:00
Hans Goudey
64c3fd7b1c Cleanup: Use Vector, BitVector for BMesh partial update struct
Avoid reimplementing amortized growth, and generally make
the code friendlier with the improved BitVector class.
2025-03-01 17:47:55 -05:00
Hans Goudey
76a253a973 Fix: Potential issue in BMesh points index buffer extraction
The same fix as 81d5af15a6.
That commit only applied the change to Mesh, not BMesh.
2025-03-01 17:46:33 -05:00
Hans Goudey
b8cebdc9fe Fix #135333: Node tools crash with empty mesh input
The implicit sharing info can actually be null when there is
no shared array data.
2025-03-01 12:24:28 -05:00
Hans Goudey
8fe63f0ad8 Cleanup: Remove outdated references to GHash 2025-03-01 12:10:18 -05:00
Pratik Borhade
725617c7a0 Fix #135185: Delete pose asset crash
This is due to accessing member of nullptr Asset. After deleting the
action id from asset library, `CTX_wm_asset` won't return value because
force reset for files was tagged (`FL_FORCE_RESET_MAIN_FILES`).
Instead of updating library from active asset, use library reference to
clear then read/draw the updated asset library

Pull Request: https://projects.blender.org/blender/blender/pulls/135219
2025-03-01 14:56:24 +01:00
Sean Kim
de3c473ebb Cleanup: Various non-functional changes for bmesh_log.cc
* Uses const where possible
* Joins declaration with assignment
* Use std::array where possible instead of C-style array
* Use float3 instead of C-style array for position and normal
* Reduces scope of variables where possible

Pull Request: https://projects.blender.org/blender/blender/pulls/135336
2025-03-01 07:06:55 +01:00
Sean Kim
e6384bcce6 Cleanup: Switch GHash for blender::Map for bmesh_log.cc
This commit changes usages of `GHash` inside `bmesh_log.cc` into their
equivalent `blender::Map` declarations and functions.

Additionally, some debug functions are put inside a NDEBUG section
instead of being kept in a broken state behind `#if 0`

Pull Request: https://projects.blender.org/blender/blender/pulls/135276
2025-03-01 05:13:32 +01:00
Hans Goudey
8b297ab168 Cleanup: Use bNodeTree all_nodes() accessor method
This is always built at runtime.

Pull Request: https://projects.blender.org/blender/blender/pulls/135321
2025-02-28 22:12:34 +01:00
Harley Acheson
46ddd76609 Merge branch 'blender-v4.4-release' 2025-02-28 12:38:10 -08:00
John Kiril Swenson
f874d46589 Fix: UI: Transform Feedback for Invalid Trackball
Patch #132957 added helpful UI feedback when attempting to rotate or
scale an object whose transforms are set to "only affect locations."
But it neglected to check for invalid trackpad rotations that are
affected the same way. This patch renames the original `HLP_ERROR` to
`HLP_ERROR_DASH` to distinguish it from a `HLP_ERROR` transform cursor
with no dashed line present, which matches trackball's normal state.

Pull Request: https://projects.blender.org/blender/blender/pulls/134653
2025-02-28 21:14:36 +01:00
Jacques Lucke
613bb9771b Nodes: UI: support panel toggles in materials tab
This adds support for panel toggles from 2822777f13
to the materials tab in the properties editor. At the same
time, it also starts making use of layout panels which
offer a more standardized UI than the ad-hoc panels
implementation that was used there beforehand.
2025-02-28 20:06:28 +01:00
Jacques Lucke
53d8390c1b Cleanup: remove redundant layout panel function
While using the other function is a little more verbose, it's also more
explicit and having two functions this similar is confusing.
2025-02-28 19:33:07 +01:00
Falk David
2822777f13 Nodes: support boolean inputs as toggles in panel headers
Adds the option to create a boolean socket that can be used as a panel toggle.
This allows creating simpler and more compact node group UIs when a panel
can be "disabled".

The toggle input is a normal input socket that is just drawn a bit differently in
the UI. Whether a boolean is a toggle input or not does not affect evaluation.

Also see #133936 for guides on how to add and remove panel toggles.

Pull Request: https://projects.blender.org/blender/blender/pulls/133936
2025-02-28 19:07:02 +01:00
Harley Acheson
21e14163c6 Merge branch 'blender-v4.4-release' 2025-02-28 10:05:31 -08:00
Harley Acheson
ead7a881a5 Fix: Constrain Docking Hint to Window Bounds
While joining and docking areas there is hint shown near the mouse that
describes the potential operation. But it is cut off if your mouse is
at the extreme right or bottom edge of the window. This PR just clamps
the position so it is always visible.

Co-authored-by: Jonas Holzman <jonas@holzman.fr>
Pull Request: https://projects.blender.org/blender/blender/pulls/135211
2025-02-28 19:04:22 +01:00
Jacques Lucke
e09381a716 Fix: use selected objects in Visual Geometry to Objects operator
Previously, only the active object was taken into account.
2025-02-28 18:21:08 +01:00
Bastien Montagne
16e552298c Refactor: Core: ID's 'namemap' used to generate unique ID names.
Note: This commit is essentially non-behavioral change, expect in some
fairly rare edge cases.

This commit does a few things:
* Move the whole BKE_main_namemap code to modern C++.
* Split API calls to work with the global namemap, or the local ones.
* Simplify and make the code easier to follow and understand.
* Reduce 'default' memory usage by using growing BitVector for numeric
  suffix management, instead of a fixed 1K items.
* Fix inconsistent handling of 'same base name and numeric suffix,
  different name' issues (e.g. 'Foo.1' and 'Foo.001'), see
  `re_create_equivalent_numeric_suffixes` new unittest.
* Fix completely broken handling of `global` namemaps. This was
  (probably!) OK so far because of their currently very limited
  use-cases.

It also adds a few minor improvements to existing behavior (essentially
in exotic rare edge cases):
* Names that get too long are now only shortened by one char at a time,
  trying to modify the requested base name as little as possible.
* Names that are short, but for which all the manageable numeric suffixes
  are already in use, are extended with an (increasing)  number, instead
  of being shortened.

This work also allowed to detect a few (apparently harmless?) bugs in
existing code, which have been fixed already in 4.4 and main, or in this
commit as well when they depend on changes in namemap code itself.

About performances: This commit introduces a minor slow-down. Some tests
heavily relying on this code (like `bl_id_management` and `blendkernel`
e.g.) get slightly slower (resp. about 1% and 5%). This seems to come
mostly from the added complexity to handle correctly multiple different
names with the same base and numeric suffix value ('Foo.1' and
'Foo.001', but also in the global namemap context where IDs from
different libraries can have the same name).

Pull Request: https://projects.blender.org/blender/blender/pulls/135199
2025-02-28 17:58:58 +01:00
Brecht Van Lommel
6c29dbff10 Merge branch 'blender-v4.4-release' 2025-02-28 17:38:28 +01:00
Gracjan Jeżewski
901353ce4c Fix: Hydra camera missing depth of field parameters
Add the missing F-Stop and Focus Distance.

Pull Request: https://projects.blender.org/blender/blender/pulls/134896
2025-02-28 17:37:35 +01:00
Brecht Van Lommel
9e44514b46 Fix: Hydra incorrect assmes camera object is always a camera 2025-02-28 17:37:35 +01:00
Philipp Oeser
a95753b36a Merge branch 'blender-v4.4-release' 2025-02-28 17:31:29 +01:00
Philipp Oeser
65288e4130 Attempt to fix build error
introduced in 9855c11d2c
2025-02-28 17:30:11 +01:00
Clément Foucault
6e5b7f6375 Refactor: DRW: Make DRWManager more C++ oriented
This wrap some functions as class methods
and rename members to reduce confusion with
the old class meaning.

Rename the old DRWManager to DRWContext.

Also wrap access to DST inside a function
to allow to change it to thread local in a
following PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/135268
2025-02-28 17:26:07 +01:00
Bastien Montagne
00f406c34c Refactor: BLI: Re-implement BLI_string_split_name_number in C++.
Allows to use this code from C++ code/data, without duplicating strings
to char arrays. C-compatible API is kept as a wrapper around the new
implementation.

No behavioral change is expected from this commit.

Part of !135199.
2025-02-28 17:21:59 +01:00
Philipp Oeser
b0d63ff8e1 Merge branch 'blender-v4.4-release' 2025-02-28 17:14:34 +01:00
Philipp Oeser
412cefe9bb Fix: Broken "File -> External Data -> Pack Linked Libraries"
The operator refused to pack libraries with absolute paths (wasnt the
case in its original implementation 16411da41e, but was added in
129fb516f4 -- for the reason of preventing "bad things happen on
unpacking" without an explanation of what these exactly are). It did so
by cancelling as soon as **one** library with ab absolute path was
found.

Now with the introduction of essential assets, we have those absolute
path linkages more or less "by default"  as soon as e.g. a brush is
used, so the operator is more or less unusable now. NOTE: these absolute
essential asset library paths seem to be converted to relative on save?
Upon reload, these are then gone... (might be another hint for an
alternative fix, see below)

By "bad things happen on unpacking" I would assume the scenario of
folders being created in unwanted locations (e.g. when moving from one
OS to another), but the same thing is also true for packing **files**
instead of libraries (there, absolute paths are allowed, and unpacking
in original locations can equally fail or create folder structures that
are "unexpected"). NOTE: for files though we have the choice of
unpacking to a relative folder (which wouldnt really be possible since
libraries can be nested and we would have to correct paths all over the
place). NOTE: the chance of creating "unwanted" folder structures with
relative paths might be slimmer, but if you have a lot of "upwards"
parent folders, relative can easily "break" as well.

Possible ways to resolve this:

### [1] skip libraries identified as essentials assets (still cancel on all other absolute paths)
Can check a library path to be contained in `EssentialsAssetLibrary`
`essentials_directory_path`. This would be the safest imo since it is a no-behavior change.

### [2] lift the limitation of absolute paths alltogether
Like mentioned above, things could break with "relative" almost as
easily as with "absolute", there might even be scenarios where
"absolute" is wanted. It is a more behavior-changing fix that we might
explore more after 4.4 is out.

### [3] skip absolute libraries (but continue with non-absolute libraries)
This does change behavior as well (it does not cancel as soon as **one**
library with ab absolute path was found anymore, but the worst case
scenario is that you end up with an "incomplete" file if you really
mixed absolute and realtive lib linking).

This PR implements [1] for now, [2] or [3] can follow for 4.5.

Fixes #134665

Pull Request: https://projects.blender.org/blender/blender/pulls/134839
2025-02-28 17:14:14 +01:00
Philipp Oeser
9855c11d2c Fix #135217: ColorManage Settings RNA paths incomplete/wrong
`ColorManagedDisplaySettings`, `ColorManagedViewSettings`,
`ColorManagedInputColorspaceSettings` were affected since these are used
from multiple places (Scene, File output nodes, ..).

Similar to how we are getting the path for `ImageFormatSettings` (which
pretty much has the distinction logic already), we can do so for the
ColorManage Settings as well (piggbacking on the already correct path to
the `ImageFormatSettings`.

With this, we can also remove these "known failures" from the test
introduced in 4032b853c3.

Pull Request: https://projects.blender.org/blender/blender/pulls/135238
2025-02-28 17:13:43 +01:00
Sybren A. Stüvel
559d7575a6 Cleanup: remove mention of once-planned 'Animation' data-block
Remove the mention of the 'Animation' data-block in a comment, as that
never was actually implemented.

No functional changes.
2025-02-28 17:12:39 +01:00
Bastien Montagne
f6ad99c648 Merge branch 'blender-v4.4-release' 2025-02-28 15:48:13 +01:00
Damien Picard
910895dcf3 I18n: Disambiguate "To"
Depending on context, "To" can have different translations. Add
"Modifier" context to one of them.

Reported by Alexandr Fatih.

Pull Request: https://projects.blender.org/blender/blender/pulls/135173
2025-02-28 15:46:33 +01:00
Damien Picard
1fc5f9d408 I18n: Disambiguate "Home"
"Home" in the context of the navigation key, as opposed to the home
directory in the file browser.

Reported by Satoshi Yamasaki.
2025-02-28 15:46:33 +01:00
Damien Picard
e76d997b44 I18n: Disambiguate "Clip"
Volumes' "Sequence Mode" recently got the "Sequence" context in
2b3f0d0110. The intention was to disambiguate the "Extend" enum item,
but this caused another item, "Clip" to also get this context. That
one already existed and referred to a sequencer clip.

Use the more specific "Volume" context instead.

Reported by Gabriel Gazzán.
2025-02-28 15:46:33 +01:00
Damien Picard
7f2fef78c3 I18n: Translate "Action" name when created with action.new operator
Actions get the default name "Action" when created through
action.new(). This is user data that can be translated.

Reported by Gabriel Gazzán.
2025-02-28 15:46:33 +01:00
Bastien Montagne
e5d1cf96fd Merge branch 'blender-v4.4-release' 2025-02-28 15:45:36 +01:00
Andrej730
25922344e5 RNA: WM API: fileselect_add - document filter_glob operator property usage
Pull Request: https://projects.blender.org/blender/blender/pulls/135288
2025-02-28 15:44:45 +01:00
Omar Emara
e2d886a104 Compositor: Implement link validation
This patch implements link validation for compositor node trees. All
links are valid in the compositor, since there is implicit conversion
between all supported types. This is needed for link gather search
operations.
2025-02-28 16:34:38 +02:00
Miguel Pozo
028263d9e5 Draw: Use StaticShaders for GPU subdivision
Make subdivision shaders compilation thread-safe.
(Continuation of #134812)

Pull Request: https://projects.blender.org/blender/blender/pulls/135265
2025-02-28 15:27:13 +01:00
Aras Pranckevicius
5f667fa2bc Cleanup: Replace IMB_processor_apply_threaded_scanlines with parallel loops
Code can become quite a bit smaller without intermediate structs

Pull Request: https://projects.blender.org/blender/blender/pulls/135299
2025-02-28 14:43:05 +01:00
Jacques Lucke
a55dbea0e7 Fix #135190: wrong file path filter for properties
This was caused by e05ef4c838. It wasn't obvious that just adding
the `filter_glob` would affect behavior elsewhere. Now there is a check
to see if the glob is non-empty.
2025-02-28 13:33:24 +01:00
Aras Pranckevicius
058fc8910c ImBuf: speedup/cleanup IMB_display_buffer_acquire
Replace (only two remaining) usages of C-style IMB_processor_apply_threaded
with just threading::parallel_for which is much easier to use in C++ without
intermediate structs.

IMB_display_buffer_acquire got faster as a result -- parallel for has lower
overhead compared to the task pool approach that the previous
implementation was using.  While at it, noticed that
IMB_display_buffer_acquire was clearing just-allocated memory, immediately
before overwriting it. So that is now gone too.

IMB_display_buffer_acquire time during playback of 4K resolution float
content in VSE (Ryzen 5950X, Windows): 10.7ms -> 7.7ms

Pull Request: https://projects.blender.org/blender/blender/pulls/135269
2025-02-28 12:51:37 +01:00
Campbell Barton
86c0190924 GHOST/Wayland: set the size of custom cursors based on the DPI
HI-DPI screens now select larger custom cursors on Wayland,
previously small cursors would be scaled up.

This only works well when all outputs have the same scaling
as custom-cursors don't support sending multiple sized cursors
to GHOST at once, see code-comments for details.
2025-02-28 22:36:03 +11:00
Harley Acheson
fcf57e2024 UI: add larger mouse cursors
On Windows and Mac we use platform-specific mouse cursors that work at
multiple sizes. But Linux uses cursors that are defined in our source
code and are 16x16 pixels. This commit adds 24x24 and 32x32 versions of
all these cursors, using them will be committed separately.

Ref: !134894
2025-02-28 22:36:03 +11:00