Commit Graph

3492 Commits

Author SHA1 Message Date
Campbell Barton
29f5d56359 Merge branch 'blender-v4.2-release' 2024-07-09 19:49:46 +10:00
Campbell Barton
b44d5cb5af Fix unhandled exception when updating legacy add-ons to extensions 2024-07-09 19:45:18 +10:00
Campbell Barton
f4231418e9 Extensions: limit the size of the data read from the lock-file
Avoid reading a large amount of data if the lock file
inexplicably contains large amounts of data.
2024-07-09 19:37:12 +10:00
Campbell Barton
1ffde9338d Extensions: support force unlocking a repository
When the repository is owned by another Blender session,
support removing the file-system lock.

This is accessible from a menu in the repository popover.

This is needed if Blender exits unexpectedly while a repository
is being modified (typically install/upgrade).

Addresses #122135.
2024-07-09 19:27:32 +10:00
Campbell Barton
d06c79958c Merge branch 'blender-v4.2-release' 2024-07-09 15:43:02 +10:00
Campbell Barton
912194390a Extensions: ensure generated strings in the TOML file are valid
While this wasn't likely to cause any problems in practice,
using the sub-command "build --split-platform" with a platform
containing any characters that need escaping would have produced a TOML
with invalid syntax.

Add a utility function that's guaranteed to create a valid TOML string.
2024-07-09 15:32:09 +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
b8fc441fdd Merge branch 'blender-v4.2-release' 2024-07-09 13:47:10 +10:00
Campbell Barton
5d379b9887 Cleanup: remove type hints, follow code style for core scripts 2024-07-09 13:32:30 +10: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
Bastien Montagne
385dfb4650 Merge branch 'blender-v4.2-release' 2024-07-08 20:51:48 +02:00
Bastien Montagne
92d5659653 I18N: Update UI translations from git/weblate repository (9735e28dcce47210).
Note that this commit also introduces a new language, Slovenian.
2024-07-08 20:50:07 +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
4e98eebab8 Merge branch 'blender-v4.2-release' 2024-07-08 10:14:03 -07:00
Harley Acheson
987b781412 UI: Various Grammar Changes for Extensions
Various minimal grammar changes in the new Extensions system. For
example changing "Please turn Online Access on the System settings" to
"Please turn Online Access on in the System settings"

Pull Request: https://projects.blender.org/blender/blender/pulls/124262
2024-07-08 19:12:56 +02:00
Jesse Yurkovich
5bb5cfd97a Merge branch 'blender-v4.2-release' 2024-07-08 09:07:07 -07: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
56387f5be5 Assets: Disable "Open Blend File" operator for assets from asset system files
Asset system files (using the `.asset.blend` extension) are special and cannot
be edited like normal files. Opening them showes warnings about this. So better
not "encourage" editing these files that much.

Note that this check will result in false positives, since users may create
files with this extension. Asset system files have an extra flag stored
identifying them. Accessing that from the asset representation is a bit more
involved, probably requires changes in the asset indexer. For now keeping it
simple, the false positives are not a big deal for this convenience operator.

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

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
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
Hans Goudey
4e6a962b2b Fix #120590: FBX import gives sharp edges for non-normalized normals
A few files included in reports contained normals that were not normalized.
In order to contain consistent normals around smooth corner fans, sharp
edges are added when neighboring corner normals aren't close enough.
Non-unit-vector normals also triggered this check.

Blender used to do this implicitly when the derived `MeshLoop.normal`
value was set. That API has been changed already, and it's clearer if the
addon provides normalized normals, so this PR adds a normalization
step to the FBX importer.

Pull Request: https://projects.blender.org/blender/blender/pulls/124261
2024-07-08 17:09:22 +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
Sybren A. Stüvel
ef669e3b99 Anim: fix Rigify bone selection set generation code
The "create selection set for bone collection" function was checking for
bone collection membership the wrong way. This is now fixed.

Reviewed On: https://projects.blender.org/blender/blender/pulls/124343
2024-07-08 16:28:42 +02:00
Campbell Barton
df162e5f1b Merge branch 'blender-v4.2-release' 2024-07-08 22:36:13 +10:00
Damien Picard
e9de6b5e7a I18n: More translation fixes for Rigify
Allow translation of a few missing messages in the Rigify add-on. In
particular, the most important "Generate Rig" button!

Some issues reported by Gabriel Gazzàn.
2024-07-08 13:00:08 +02:00
Campbell Barton
e52783033d Merge branch 'blender-v4.2-release' 2024-07-08 15:31:44 +10:00
Campbell Barton
9bbf269fe3 Extensions: suppress all pylint warnings & handle add-on errors
- Suppress pylint warnings via comments or be minor changes.
- Any errors disabling add-ons before upgrading or uninstalling are now
  reported to the operators.
- Disable cyclic import warning is it's impractical to resolve.
- Enable useless-suppression warning.
2024-07-08 15:29:27 +10:00
Campbell Barton
817efe4aef Merge branch 'blender-v4.2-release' 2024-07-08 13:33:34 +10:00
Campbell Barton
05feac04fa Extensions: minor changes to error handling & uninstalling
- Any change that cases validate to fail reports a fatal_error.
- If removing a package fails, attempt to the remove cache.
2024-07-08 13:27:58 +10:00
Campbell Barton
bae1d3311f Merge branch 'blender-v4.2-release' 2024-07-08 13:05:49 +10:00
Campbell Barton
ac6e216b26 Merge branch 'blender-v4.2-release' 2024-07-08 13:05:45 +10:00
Campbell Barton
74f8ac15f5 Extensions: "build --split-platform" now includes it's own wheels
The `[build.generated]` section now includes a filtered list of wheels
to simplify checking existing wheels on the server.

Also disallow quotes & control characters in wheel paths because they
already shouldn't be used and doing so would cause escaping issues in
the generated TOML.

Implements #124242.
2024-07-08 12:50:43 +10:00
Campbell Barton
f3630777f6 Extensions: show add-on errors in the add-ons panel
Restore the UI from 4.1. Also correct an error when extensions are
disabled.
2024-07-08 11:36:52 +10:00
Campbell Barton
a515da841b Merge branch 'blender-v4.2-release' 2024-07-07 17:51:42 +10:00
Campbell Barton
5877efbec3 Extensions: add missing checks for errors in IO, JSON & TOML data
Exceptions need be caught and forwarded so they show it in Blender's
interface. While most common errors where accounted for, various IO
errors & malformed JSON/TOML could cause internal operations to fail
with unhandled exceptions.
2024-07-07 17:43:33 +10:00
John Kiril Swenson
406554c11e VSE: Add snapping in preview area
Adds snapping in the VSE preview area.

Source points are the four corners and origins of all selected, visible
image quads. Targets can be preview borders, preview center, or
corners/origins of other strips.

Pull Request: https://projects.blender.org/blender/blender/pulls/122759
2024-07-06 15:24:52 +02:00
Campbell Barton
08bf742302 Merge branch 'blender-v4.2-release' 2024-07-06 15:00:43 +10:00
Campbell Barton
11b1919bcf Extensions: resolve popup glitches when dropping URL's
Use UILayout::template_popup_confirm to replace workarounds that didn't
work very well.

- Resolve "Add Repository..." button in the dialog not closing the
  popup when pressed.
- Add a "Cancel" button while the remote resository data is
  downloading.
- Remove the hack to scale the UILayout to hide the existing
  confirm/cancel buttons.

Resolves #124098.
2024-07-06 14:49:41 +10:00
Sybren A. Stüvel
0aa75ab57b Refactor: rename "Animation data-block" to "Action"
Rename "Animation data-block" to "Action" or "Layered Action", where
appropriate. Some uses of the term actually refer to the `AnimData`
struct, in which case they were left as-is.

No real functional changes, just changing some messages & descriptions.

Pull Request: https://projects.blender.org/blender/blender/pulls/124170
2024-07-05 17:52:55 +02:00
Sybren A. Stüvel
c0364efec0 Refactor: rename 'Action Binding' to 'Action Slot'
Rename 'Binding' to 'Slot'. The old term was causing all kind of
confusion, and 'slot' was considered to be a better term for the
intended functionality.

This commit breaks existing blend files that were using the new layered
Action for their animation. The animation data will be lost due to the
rename, as there is no versioning code or DNA renaming logic. At this
time the new system is still marked as experimental, so shouldn't be
used for anything serious anyway.

Pull Request: https://projects.blender.org/blender/blender/pulls/124170
2024-07-05 17:52:55 +02:00
Campbell Barton
8250ac142f Merge branch 'blender-v4.2-release' 2024-07-05 20:49:47 +10:00
Campbell Barton
337abcdfc1 Merge branch 'blender-v4.2-release' 2024-07-05 20:49:45 +10:00
Campbell Barton
a53aad6f73 Extensions: refactor message logging into a class
Pass a logging class between functions instead of a function. Has the
advantage that different kinds of messages are exposed as methods.
2024-07-05 20:46:40 +10:00
Campbell Barton
08b75549e3 Extensions: add a new error type "FATAL_ERROR"
Some errors were reported as warnings because they didn't prevent the
operation from completing (such as failing to remove some paths when
uninstalling).

Change message types for the extensions internal command line program:

- Add "fatal error" to use when an operation fails and exits with a
  non-zero error code.
- Use "error" when an operation fails which doesn't prevent other
  actions from succeeding.
- Use "warn" reporting issues what don't prevent the operation
  from completing but may cause problems.
2024-07-05 20:46:40 +10:00
Abdelrahman
789bcaae78 GPv3: Port frame_clean_duplicate operator
Port the `frame_clean_duplicate` operator to GPv3.
Resolves #114182.

Pull Request: https://projects.blender.org/blender/blender/pulls/116655
2024-07-05 09:48:20 +02:00
Campbell Barton
169ad993f5 Merge branch 'blender-v4.2-release' 2024-07-05 16:29:03 +10:00
Campbell Barton
726d9c5b38 Extensions: detect remote repositories when dropping a file
When dropping an extension into Blender, check if the extensions is
part of a remote repository which is then used to set the default
repository.

This makes it more convenient to download larger extensions from
remote repositories using a web-browser & drop them into Blender after,
rather than dropping the URL directly into Blender.
2024-07-05 16:18:52 +10:00
Harley Acheson
6fbb5ce8d8 Merge branch 'blender-v4.2-release' 2024-07-04 11:19:14 -07:00
Christoph Lendenfeld
af089bee98 Fix: Add missing Bake Channel operator to Dope Sheet
This PR adds the operator "Bake Channels" to the "Channels" menu of the dope sheet.
The operator was already in the "Channels" menu of the Graph Editor.

Pull Request: https://projects.blender.org/blender/blender/pulls/123559
2024-07-04 17:12:04 +02:00
Sybren A. Stüvel
1d2cea1e3e Show Action Slots (Bindings) in the Action editor
In the Action mode of the Dope Sheet, show the Bindings, optionally
showing all Bindings in that Action. This also works when different
data-block types are animated from the same Action.

Bindings are selectable in the Action editor with box/range select.
Since there is no use for an 'active Binding' yet, this has not been
implemented, and as a result, clicking on a Binding does nothing.

Note on 'Binding' vs 'Slot': this code change was created before the
decision to change the name from 'Bindings' to 'Slots'. To avoid
confusion, and to keep this PR in sync with the code changes, it still
uses the term 'binding'. Renames of 'Binding' to 'Slot' in the code will
happen after this PR lands.

Pull Request: https://projects.blender.org/blender/blender/pulls/122672
2024-07-04 14:44:19 +02:00
Bastien Montagne
9a13aff4b8 Merge branch 'blender-v4.2-release' 2024-07-04 14:39:58 +02:00