Commit Graph

120055 Commits

Author SHA1 Message Date
Campbell Barton
8bbe1fe6ef CMake: remove logic to exclude removed add-ons directories
Using a REGEX on an absolute path may not work reliably without
escaping the path. Remove the exclusion as these paths are no longer
part of Blender's sources.

If some developers happen to have these directories it's harmless as
they won't be used.
2024-07-09 15:32:08 +10:00
Fermin
ad58c9eaca XR: Add passthrough support for Meta Quest devices
Uses the OpenXR extension XR_FB_PASSTHROUGH_EXTENSION_NAME,
compatible mainly with the Meta Quest family of devices.

Currently, passthrough support over OpenXR is disabled by default
in the Quest Link app, and must be manually enabled in its settings
to use this feature.

The performance of the passthrough render varies with the quality
of the connection between the headset and the PC. For better results,
connecting the headset directly through USB to the PC, or at least
connecting the PC to the local network over ethernet, is recommended.

Thanks a lot to [KISKA](https://kiska.com/)
for their support in the development of this feature.

Pull Request: https://projects.blender.org/blender/blender/pulls/124204
2024-07-09 06:10:17 +02:00
Campbell Barton
514e1643e9 Merge branch 'blender-v4.2-release' 2024-07-09 13:47:15 +10:00
Campbell Barton
bf68ce401d Merge branch 'blender-v4.2-release' 2024-07-09 13:47:12 +10:00
Campbell Barton
5e4b07cb06 Merge branch 'blender-v4.2-release' 2024-07-09 13:47:04 +10:00
Campbell Barton
da9cfbdae9 Docs: add doc-string to mathutils.Vector swizzle attributes
Also refactor definitions into a macro as they were exceeding the
line-length and wrapping.

Ref: !124275

Co-authored-by: Nathan Burnham <nathan@nathanburnham.uk>
2024-07-09 13:45:07 +10:00
nutti
5523662414 Docs: add default parameters to Context.temp_override
Ref: !124348
2024-07-09 13:44:09 +10:00
Richard Antalik
1f42c9eb54 Fix: Crash when clicking on unrealized retiming key
When keys are realized, strip handle positions are used to ensure, that
left and right key exists. If strip content is offset to the right,
this caused crash. This happened, because `SEQ_retiming_add_key()`
clamped timeline frame to strip content only on right side.

Clamp timeline frame to strip content on both sides.

Pull Request: https://projects.blender.org/blender/blender/pulls/124207
2024-07-09 01:30:40 +02:00
Hans Goudey
bbcc720c13 Fix: Property search crash after recent allocator change
The button's callback function argument "free function" needs to be
copied along with the resource itself. We used to just call MEM_freeN
in this case, now we call the dedicated deallocation function which
supports non-trivial types.

Caused by 9f90594db7.
2024-07-08 19:09:25 -04:00
Hans Goudey
61db25b78e Fix: Linker error in lite build with OBJ import node 2024-07-08 19:05:36 -04:00
Hans Goudey
e474eef5d1 Cleanup: Formatting 2024-07-08 18:17:19 -04:00
Hans Goudey
28d3f7f638 Cleanup: Sculpt: Remove unused PBVH variables 2024-07-08 17:56:41 -04:00
Hans Goudey
4817ff1d72 Refactor: Sculpt: Remove PBVH CCGKey storage
Part of #118145.
2024-07-08 17:56:31 -04:00
Hans Goudey
977e961067 Fix: OBJ import node build error in lite build
Similar to 3a31fcebcf
2024-07-08 17:05:06 -04:00
Hans Goudey
68d6bf56e5 Sculpt: Refactor position and mask smoothing for BMesh and multires
Similar to:
- c93767a8b4
- 851505752f

Those commits didn't apply to the smoothing brushes. Now all refactored
brushes use the new code structure. This commit includes utilities for averaging
neighboring mask and position values which will be used by the mask and mesh
filters in future commits.

Pull Request: https://projects.blender.org/blender/blender/pulls/124371
2024-07-08 23:04:06 +02:00
Sean Kim
c070986e23 Cleanup: Sculpt: Extract common translation function
Pull Request: https://projects.blender.org/blender/blender/pulls/124368
2024-07-08 22:09:49 +02:00
Hans Goudey
8762290658 Fix: Windows build error after recent cleanup
Just switch back to the C allocator API here, I don't know how we're
supposed to allocate DNA types with `DNA_DEFINE_CXX_METHODS`.
2024-07-08 15:48:31 -04:00
Sean Kim
67dc0245e4 Merge branch 'blender-v4.2-release' 2024-07-08 12:38:10 -07:00
Sean Kim
d527e3a6bd Fix #122947: Curve stroke on duplicate object doesn't update normals
When a mesh is shared between multiple objects, sculpting with a brush
with the Curve stroke type doesnt update normal values for the affected
nodes when using PBVH drawing. This is because when reevaluating the
depsgraph for the objects, the shared PBVH is destroyed and the nodes
are recalculated, losing the existing node flag updates.

This only occurs for the Curve stroke type because all of its stroke
steps are performed within a single call to the overall operator when
the user presses enter, unlike other brush strokes which apply on each
mouse movement.

To fix this, we simply force update the normals before destroying the
PBVH at the end of the stroke step.

Pull Request: https://projects.blender.org/blender/blender/pulls/124268
2024-07-08 21:36:28 +02:00
Harley Acheson
f95436de08 Merge branch 'blender-v4.2-release' 2024-07-08 12:36:28 -07:00
Harley Acheson
9a26bfcd5f Fix: Shade Smooth Removal Notification When Needed
Only send `NC_OBJECT | ND_DRAW` notification if the smooth by angle
modifier has been removed, not on all changes. This is a slight
adjustment to #124330.

Pull Request: https://projects.blender.org/blender/blender/pulls/124362
2024-07-08 21:35:26 +02:00
Hans Goudey
792efafa2c Cleanup: Miscellaneous changes to OBJ/import nodes
- Sort add menu alphabetically
- Use forward declaration for GeometrySet again
- Use `this->` to access class methods
- Use `MEM_cnew`
- Fix typo
- Pass Span by value
- Pass MutableSpan instead of Vector &
- Remove unnecessary whitespace
- Use `BLI_SCOPED_DEFER` for freeing non-RAII objects
- Use `is_empty()` instead of `size() == 0`
- Use `GeometrySet::from_mesh` ability to handle null argument
2024-07-08 15:12:42 -04:00
Jacques Lucke
c876731844 Fix: new/free mismatch for cloth brush 2024-07-08 20:39:00 +02:00
Devashish Lal
4b884f737c Geometry Nodes: OBJ Import Node
Add a node similar to the STL import node (d1455c4138) that
imports OBJ files, including both meshes and curves. The output consists
of a geometry instance for each mesh/curve in the file.

There are a few improvements to address in the future: Currently the node
has no inputs besides the file path. Options may be exposed in the future.
Materials are also not imported yet, because creating material data-blocks
during evaluation may not be trivial.

This is part of a GSoC project:
https://devtalk.blender.org/t/gsoc-2024-geometry-nodes-file-import-nodes/34482

Pull Request: https://projects.blender.org/blender/blender/pulls/123967
2024-07-08 20:20:38 +02:00
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