Commit Graph

111231 Commits

Author SHA1 Message Date
Harley Acheson
aa90a9179a Merge branch 'blender-v4.2-release' 2024-07-08 09:43:12 -07:00
Pratik Borhade
e8f0dabc7e Fix #124302: Crash when clicking arrow button in outliner
This is due to missing rebuild of outliner tree. Auto smooth operator
is cleared with shade flat execution but outliner is unaware of this and
the modifier tree element remains intact. This add a notifier.

Pull Request: https://projects.blender.org/blender/blender/pulls/124330
2024-07-08 18:42:06 +02:00
Sergey Sharybin
584834e5a8 Fix #124342: Color sampling clamped to 1 for specific tool
SHift-X sets the color value directly, bypassing clamping done
on the RNA level. The color picker uses RNA setter to assign
colors, which enforces limits.

This change makes it so the 0..1 is an UI range, but allows to
manually type in values above that. This is similar to colors
in the node trees, but a bit more conservative by using UI range
explicitly.

Thanks Omar for identifying the root cause of where the clamping
is coming from!

Pull Request: https://projects.blender.org/blender/blender/pulls/124355
2024-07-08 18:21:50 +02:00
Jacques Lucke
eeb1e14531 GPv3: simplify adding multiple layers with empty drawings
This is often required when generating grease pencil procedurally, e.g. in #124279.
2024-07-08 18:09:36 +02:00
Jacques Lucke
346110a415 GPv3: add method to set local layer transform
Used by e.g. #124279.
2024-07-08 18:09:36 +02:00
Jesse Yurkovich
5bb5cfd97a Merge branch 'blender-v4.2-release' 2024-07-08 09:07:07 -07:00
Jesse Yurkovich
7d6835f043 Fix #124075: Read Alembic point cloud velocity data
This regressed during the change to use GeometrySets in ea256346a8.

Pull Request: https://projects.blender.org/blender/blender/pulls/124077
2024-07-08 17:56:43 +02:00
Jesse Yurkovich
f9b2edbf01 Fix #124009: Clamp material index when uploading mesh through Hydra
Prevent crash from a mesh created around the time of Blender 4.0 with
bad (negative) material indices on some faces.

The Poly Haven folks were poked to fix the actual asset as well but it's
simple enough for us to clamp in this code path, especially since we
were already doing it for the upper bound.

Pull Request: https://projects.blender.org/blender/blender/pulls/124026
2024-07-08 17:55:50 +02:00
Julian Eisel
f4525c9901 Sculpt/Paint: Rename "Sculpt Tool" etc to "Brush Type" in the UI
Renames "Sculpt Tool", "Vertex Paint Tool", ... to "Brush Type" in all cases.

The name "tool" is overloaded, plus, there actually is a "Brush Tool" now. As a
follow up to the assets project merge we can rename this in C++, added this
to #116337 and opened #124201. At least rename it in the UI for a start.

Pull request: https://projects.blender.org/blender/blender/pulls/124203
2024-07-08 17:50:25 +02:00
Julian Eisel
2ffe132313 Assets: Make brush assets non-experimental
With the previous commit brush assets are now well supported, and can be
enabled by default (not disabled anymore by the "Extended Asset Browser"
experimental feature). In fact this commit only enables displaying them
in the asset browser and using normal asset operators on brushes.

Part of the brush assets project, see:
- https://projects.blender.org/blender/blender/issues/116337
- https://projects.blender.org/blender/blender/pulls/106303
2024-07-08 17:50:25 +02:00
Julian Eisel
7b0ea0f1b4 Sculpt/Paint: New asset based brush management workflow
This is the main merge commit of the brush assets project. The previous
commits did some preparing changes, more tweaks are in the following commits.
Also, a lot of the more general work was already merged into the main branch
over the last two years.

With the new design, quite some things can be removed/replaced:
- There's a unified "Brush" tool now, brush based tools and all special
  handling is removed.
- Old tool and brush icons are unsed now, and their initialization code
  removed here. That means they draw as blank now, and the icon files can be
  removed in a follow up.
- Creation of default brushes is unnecessary since brushes are now bundled in
  the Essentials asset library. Icons/previews are handled as standard asset
  previews.
- Grease pencil eraser options are replaced by a general default eraser brush
  that can be set by the user.

More changes are planned still, see task list issue below.

Main Authors: Bastien Montagne, Brecht Van Lommel, Hans Goudey, Julian Eisel
Additionally involved on the design: Dalai Felinto, Julien Kaspar

Blog Post: https://code.blender.org/2024/07/brush-assets-is-out/

Tasks:
https://projects.blender.org/blender/blender/issues/116337

Reviewed incrementally as part of the brush assets project, see:
https://projects.blender.org/blender/blender/pulls/106303
2024-07-08 17:50:25 +02:00
Julian Eisel
721dbfccfd UI: Turn asset shelf popup into a popover, add operator to call from shortcut
Turns the asset shelf into a popover which reduces some of the special
handling. An operator `WM_OT_call_asset_shelf_popover()` (similar to
`WM_OT_call_panel()`) is added to be able to call the popover from shortcuts.
Exactly this was an important aspect for the brush assets project, to allow
quick searching for brushes from the popup.

A custom shortcut can be added to asset shelf popovers using "Assign Shortcut"
in the context menu of buttons invoking it.

The popover is spawned with the mouse hovering the first asset and the search
button active using "semi modal" handling. That means while the popover is
open, any text input is captured by the search button, while the rest of the
popover stays interactive. So for example navigating through asset catalogs is
possible, a single click activates an asset and closes the popover.

Reviewed as part of the asset shelf project, see:
- https://projects.blender.org/blender/blender/issues/116337
- https://projects.blender.org/blender/blender/pulls/106303
2024-07-08 17:50:24 +02:00
Julian Eisel
adb8157ebb UI: Uncollapse first levels of catalogs by default in asset shelf
When opening the popup to select the asset catalogs to show as tabs in the
asset shelf, it's annoying that they would collapse back to the root level
every time. This would mean users have to manually uncollapse a bunch of
catalogs every time they call the popup. Since this is a popup, we don't need
to be too careful about saving space. And in practice these catalog trees are
usually rather small anyway. So simply uncollapse the first few levels of
catalogs.

Part of the brush assets project, see:
- https://projects.blender.org/blender/blender/issues/116337
- https://projects.blender.org/blender/blender/pulls/106303
2024-07-08 17:50:24 +02:00
Julian Eisel
e108517bd6 Fix asset shelf context menu acting on active, not clicked asset
Make sure the view item the context menu is spawned from is always activated.
The brush assets context menu relies on that (it accesses the active brush from
paint settings, and the brush needs to be imported to apply operations like
"Edit Metadata").

Had to refactor how closing the popup on activation works. It's now a general
view feature and enabled by default. Can be disabled using
`ui::AbstractView::set_popup_keep_open()`.

Pull Request: https://projects.blender.org/blender/blender/pulls/124043

Part of the brush assets project, see:
- https://projects.blender.org/blender/blender/issues/116337
- https://projects.blender.org/blender/blender/pulls/106303
2024-07-08 17:50:24 +02:00
Brecht Van Lommel
fa6951755e UI: Allow asset shelf to not have an active item
For brush assets we want to display brush assets with any tool selected, but
only highlight the active brush asset when the "Brush" tool is enabled. It can
be confusing to have the brush highlighted when it doesn't actually do anything
currently.

Initially reviewed in:
https://projects.blender.org/blender/blender/pulls/121671

Part of the brush assets project, see:
- https://projects.blender.org/blender/blender/issues/116337
- https://projects.blender.org/blender/blender/pulls/106303
2024-07-08 17:50:24 +02:00
Brecht Van Lommel
9ba74d7429 Fix missing redraw of asset shelves on tool changes
Context sensitivity for asset shelves is important, for example it may react to
mode or tool changes.

Initially reviewed in:
https://projects.blender.org/blender/blender/pulls/121671

Part of the brush assets project, see:
- https://projects.blender.org/blender/blender/issues/116337
- https://projects.blender.org/blender/blender/pulls/106303
2024-07-08 17:50:24 +02:00
Bastien Montagne
1ae0bc8e9e Fix asset list not stopping read job when clearing
Operators may want to refresh the visible list of assets (e.g. when an asset is
added), which wouldn't work correctly when the asset list was already loading
in a background thread.

Part of the brush assets project, see:
- https://projects.blender.org/blender/blender/issues/116337
- https://projects.blender.org/blender/blender/pulls/106303
2024-07-08 17:50:24 +02:00
Brecht Van Lommel
5190b1d846 Assets: Add API for editing assets stored externally in .asset.blend files
Adds the API for editing assets without opening the blend-file containing them,
using special asset system files (using an .asset.blend extension) introduced
in the previous commit.

Refer to the technical documentation for more information:
https://developer.blender.org/docs/features/asset_system/asset_editing/

Part of the brush assets project (see #116337), only brush assets will use this
for now.

Main Authors: Bastien Montagne, Brecht Van Lommel

Reviewed incrementally as part of the brush assets project, see:
- https://projects.blender.org/blender/blender/issues/116337
- https://projects.blender.org/blender/blender/pulls/106303
2024-07-08 17:50:24 +02:00
Julian Eisel
c5180e0988 Assets: Special .asset.blend files, for storing externally editable assets
Introduces a new kind of blend file that store assets that can savely be edited
from the Blender UI, without having to open the blend-file storing the asset
itself (asset "pushing" workflow).

Only brush assets will use this for now.

Technical Documentation:
https://developer.blender.org/docs/features/asset_system/asset_editing/

User Documentation:
https://docs.blender.org/manual/en/latest/files/asset_libraries/introduction.html#asset-system-files-asset-blend-extention

The API to manage assets by generating these files is added in the following
commit.

Main authors: Bastien Montagne, Brecht Van Lommel, Julian Eisel

Pull Request for the latest design iteration:
https://projects.blender.org/blender/blender/pulls/124246

Part of the brush assets project, see:
- https://projects.blender.org/blender/blender/issues/116337
- https://projects.blender.org/blender/blender/pulls/106303
2024-07-08 17:50:24 +02:00
Julian Eisel
5f6586526c UI: Support semi-modal text input while other UI stays interactive
Adds support for text buttons that capture text input, while the rest of the
UI stays interactive. This is useful for example for filter buttons in popups
that are used for searching. Current search popups are an ad-hoc implementation
that doesn't use the normal widget system (and thus are quite limited).

For the brush assets project this is important to allow quickly popping up the
brush asset shelf popup, immediately typing to search a brush, and activating
a brush with a single click (rather than having to confirm text input first).
All UI elements stay interactive with hover feedback, changing asset library
and catalogs is possible, tooltips and context menus can be opened, and any
text input is still sent to the search button.

Normal search popups already keep their search results interactive like this
during text input, but are too limited because they don't use our widget
system. For example custom layouts are not possible with them. With this
feature implemented, we could consider rewriting them to use the widget
system, removing the ad-hoc implementation.

Part of the brush assets project, see:
- https://projects.blender.org/blender/blender/issues/116337
- https://projects.blender.org/blender/blender/pulls/106303

Initially reviewed in:
https://projects.blender.org/blender/blender/pulls/122871
2024-07-08 17:50:24 +02:00
Clément Foucault
15b2d77f29 Fix: EEVEE: Invalid sphere probe border pixel
Border pixels of the world probe were not
copied correctly to local sphere probes.

Maybe side effect of #123074 or maybe it was
always broken.

Fix is to use the same sampling functions as
regular sampling for biasing the UVs correctly.

Fixes render tests.
2024-07-08 17:27:10 +02:00
Lukas Tönne
d51cab60df Fix #124181: Add depsgraph relation to clear cache from modifiers
Point caches can be part of modifiers, in which case changes to the
input geometry should reset the cache. This worked when the input data
is the initial object data, but does not take the modifier stack into
account. A preceding modifier could update based on some dependency
and the point cache would be none the wiser.

The `POINT_CACHE_RESET` depsgraph node now gets additional dependencies
if it's in a modifier with a predecessor.

Caveat: all caches are represented by a single node currently. That
means an indirect change to a modifier will reset all caches of that
object.

Fixes #74523

Pull Request: https://projects.blender.org/blender/blender/pulls/124247
2024-07-08 17:16:19 +02:00
Falk David
07bc687785 Python: Define attribute groups based on AttributeOwnerType
The function `rna_def_attributes_common` assumed that the owner of the
attributes is an `ID`. This PR refactors the code to partially remove this
assumption.

The `rna_def_attributes_common` function now takes an argument
`AttributeOwnerType type` that defines what `AttributeGroup` should be used.

This is in preperation for #116043 where we want to use
`rna_def_attributes_common` for grease pencil drawings, which are not IDs.

In addition to the refactor explained above, this also changes the API
slightly:
Previously, the `AttributeGroup` defiend `active_color`,
`active_color_index`, `active_color_name`, `default_color_name`, and
`render_color_index` for all IDs. These properties could only be used by
meshes. So this PR seperates the `AttributeGroup` type into one type
per attribute owner: `AttributeGroupMesh`, `AttributeGroupPointCloud`,
`AttributeGroupCurves`, and `AttributeGroupGreasePencil`.
As such the properties mentioned above are now only usable by meshes.

Note that this technically breaks the API and will have to be noted in the
release notes.

Pull Request: https://projects.blender.org/blender/blender/pulls/123658
2024-07-08 17:11:21 +02:00
Jacques Lucke
d02ffdf1fe Fix: GPv3: use curve plane normal as projection direction for triangulation
The projection direction was hardcoded previously. This leads to bad results
if the curves happen to be orthogonal to the projection direction, e.g. when
they were on the XY plane.
2024-07-08 16:55:34 +02:00
Sybren A. Stüvel
9d3dc77e05 Anim: move Bone Selection Sets add-on into Blender
The functionality of the Bone Selection Sets add-on is now integrated
into Blender itself. Rigify has been updated to no longer check for the
add-on, but just assume that the functionality is available.

The keymap is still the same, and so are all the class names. This
ensures that there are no conflicts when people still have the old
add-on enabled somehow. And there is versioning code to remove the
'add-on enabled' state so that Blender won't complain it cannot find it
any more.

Compared to the add-on, the following changes are made:

- The 'bone' icon has been removed from the list of available selection
  sets. It was the same for each entry anyway, and thus didn't provide
  any information.
- The code has been split up into multiple files, with the UI elements
  in `scripts/startup/bl_ui/properties_data_armature.py` and the
  operators in `scripts/startup/bl_operators/bone_selection_sets.py`.
- Helper functions and classes are prefixed with `_` to indicate that
  they are not part of any public API.
- The `Operator` helper subclasses have been transformed to mix-in
  classes. This way the only subclasses of `Operator` are the actual
  operators.
- Comments & descriptions have been updated for clarity & consistency.

This commit contains code by the following authors, ordered by number of
commits in the original add-on repository, highest first:

Co-Authored By: Ines Almeida <britalmeida@gmail.com>
Co-Authored By: Sybren A. Stüvel <sybren@stuvel.eu>
Co-Authored By: Campbell Barton <ideasman42@gmail.com>
Co-Authored By: meta-androcto <meta.androcto1@gmail.com>
Co-Authored By: Demeter Dzadik <Mets>
Co-Authored By: lijenstina <lijenstina@gmail.com>
Co-Authored By: Brecht Van Lommel <brechtvanlommel@gmail.com>
Co-Authored By: Aaron Carlisle <carlisle.b3d@gmail.com>

For the full history see the original add-on at:
https://projects.blender.org/blender/blender-addons/commits/branch/main/bone_selection_sets.py

Reviewed On: https://projects.blender.org/blender/blender/pulls/124343
2024-07-08 16:28:42 +02:00
Philipp Oeser
782b9a80fe Merge branch 'blender-v4.2-release' 2024-07-08 16:04:28 +02:00
Philipp Oeser
93585602a1 Fix #100164: Alembic import: Ensure mesh normals are normalized
Similar to !124267 and !124261

This normal data is eventually passed into `BKE_mesh_set_custom_normals`
and through to `mesh_normals_corner_custom_set` which expects normals to
actually be normalized per its documentation.

Not doing so would yield meshes with incorrect "sharp" data for affected
edges.

Thx @OmarEmaraDev for the initial patch

Pull Request: https://projects.blender.org/blender/blender/pulls/124336
2024-07-08 16:03:52 +02:00
Miguel Pozo
6c8e14bb30 Merge branch 'blender-v4.2-release' 2024-07-08 15:25:12 +02:00
Miguel Pozo
a7e24222cf EEVEE: Show compilation subprocesses information
Inform the user when EEVEE is compiling materials and parallel
compilation is disabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/124249
2024-07-08 15:23:58 +02:00
Hans Goudey
47dada536d Merge branch 'blender-v4.2-release' 2024-07-08 09:23:49 -04:00
Hans Goudey
80a0c4237a Fix #121696: Use after free with static asset caches when opening new file
The cause of the crash was that asset libraries are freed, but the filtered
trees used for things like node tool menus weren't marked dirty, so we
continued to use the freed asset data. On a design level this is quite
concerning because it means the lifetimes of the asset tree caches and
the asset system's asset libraries are connected tenuously.

Eventually there should be a better solution, but I found the simplest
fix for now is just to add a notifier when opening a new file that causes
the asset tree caches to be tagged dirty.

Pull Request: https://projects.blender.org/blender/blender/pulls/124254
2024-07-08 15:10:42 +02:00
Lukas Tönne
996520960b Merge branch 'blender-v4.2-release' 2024-07-08 15:05:42 +02:00
Lukas Tönne
d14478c747 Fix #124310: Add override flag to prevent infinite recursion
The `enum_definition` property was changed by #121234 and now returns
the node itself. This creates an infinite recursion in the override
system that must be avoided by adding this flag.

Pull Request: https://projects.blender.org/blender/blender/pulls/124347
2024-07-08 15:04:49 +02:00
Lukas Stockner
26b6c2b94d Fix #124211: FCurve generates NaNs with Vector handles
The issue here was that the left handle of the first point was calculated
incorrectly (set to the position of the point itself), which caused a
NaN when attempting to normalize a zero vector when computing extrapolation
vectors.

Pull Request: https://projects.blender.org/blender/blender/pulls/124239
2024-07-08 15:01:18 +02:00
Sergey Sharybin
2925e84e15 Merge branch 'blender-v4.2-release' 2024-07-08 14:38:33 +02:00
Alaska
a0869d2ca6 Shader: Update Principled BSDF node description
Update the description to mention the node is now based on the OpenPBR
model rather than the Disney Principled Model. This has been the
case since Blender 4.0.

Pull Request: https://projects.blender.org/blender/blender/pulls/124209
2024-07-08 14:38:07 +02:00
Campbell Barton
c859ae0f93 Merge branch 'blender-v4.2-release' 2024-07-08 22:36:19 +10:00
Campbell Barton
6ed97d7bd6 Merge branch 'blender-v4.2-release' 2024-07-08 22:36:16 +10:00
Campbell Barton
5eef5454fa Fix #124250: enabling add-ons from command line broken
Excluding add-ons caused an `_bpy_internal.addons` not to install.
2024-07-08 22:27:47 +10:00
Jeroen Bakker
6471b715b2 Vulkan: Remove performance warning about depth clearing
When clearing depth attachment the write depth state should be enabled.
When this isn't the case a clear texture is being performed. Before
the render graph this used to be a performance issue as the rendering
would be suspended.

The render graph currently reorders these texture clears before of
the rendering context and therefore isn't seen as a performance issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/124340
2024-07-08 14:00:40 +02:00
Falk David
065219b6fa Fix: GPv3: Draw Tool creates wrong curve type
The draw tool was creating catmull-rom curves because the
curve type attribute was being reset to the default (0) which
happens to be the catmull-rom type.

The fix makes sure to skip over the `curve_type` attribute when
initializing the other attributes to their default.
2024-07-08 13:59:01 +02:00
Bastien Montagne
5270d72426 Fix (unreported) yet another MEM_new/MEM_freeN mismatch... 2024-07-08 13:54:15 +02:00
Bastien Montagne
9f90594db7 UI: Support non-C-allocated data for buttons and blocks func_argN data.
This change allows to pass optional freeing and copy callbacks to
functions setting the `func_argN` member of the `uiBut` and `uiBlock`
structs. These callbacks are used to free or duplicate the data stored
in these void pointers.

Defaults are set respectively to `MEM_freeN` and `MEM_dupallocN`, to
match previous hard-coded behavior.

Utils template functions are added to easily generate callbacks to
types that are managed with the `MEM_new`/`MEM_delete` C++-style
allocation, as long as they provide a copy constructor.

Note that this change should be considered as a temporary, transitional
solution. A more robust and future-proof solution is to move towards
more usage of `std::function` for these callbacks, which can then own
and manage their custom data themselves.
2024-07-08 13:54:15 +02:00
Damien Picard
9a0b5ac0c6 I18n: Translate sequencer channel and metastrip names
Both the metastrips and sequencer channels are user-editable data, so
translation of their names uses DATA_().

Issues reported by Gabriel Gazzàn.

Pull Request: https://projects.blender.org/blender/blender/pulls/124314
2024-07-08 13:00:09 +02:00
Jeroen Bakker
180a257eef Cleanup: Vulkan: Use stamp in stead of version
Pull Request: https://projects.blender.org/blender/blender/pulls/124339
2024-07-08 12:56:21 +02:00
Casey Bianco-Davis
18b5f510d4 Fix #122536: GPv3: Render cyclic stroke with 2 point break next fills.
The issue was that parts of the code considered cyclic strokes with less than 3
points to also have a fill.

Pull Request: https://projects.blender.org/blender/blender/pulls/124266
2024-07-08 12:48:45 +02:00
Jeroen Bakker
08d365b810 Vulkan: Cleanup barrier state
Try to reduce the barrier state so we can be more flexible when adding
support for sub resource tracking.

Pull Request: https://projects.blender.org/blender/blender/pulls/124237
2024-07-08 12:28:11 +02:00
YimingWu
0fbb83ef85 Fix #124296: Lower case name in Multistroke modifier
Just a typo in Grease Pencil Multistroke modifier.

Pull Request: https://projects.blender.org/blender/blender/pulls/124327
2024-07-08 06:09:50 +02:00
Jesse Yurkovich
74c282f532 Merge branch 'blender-v4.2-release' 2024-07-07 12:28:30 -07:00
Jesse Yurkovich
f49780b888 Fix #120590: USD: Ensure mesh normals are actually normalized
This normal data is eventually passed into `BKE_mesh_set_custom_normals`
and through to `mesh_normals_corner_custom_set` which expects normals to
actually be normalized per its documentation.

Not doing so would yield meshes with incorrect "sharp" data for affected
edges.

Pull Request: https://projects.blender.org/blender/blender/pulls/124267
2024-07-07 21:27:01 +02:00