Commit Graph

3153 Commits

Author SHA1 Message Date
Alaska
c30c19ad64 Fix #135391: Python type error reporting that addon is for newer version of Blender
This commits fixes a type error issue when reporting that a addon was
designed for a version of Blender newer than the current one.

Thanks to @Rakete for the fix.

Ref: !135392
2025-03-04 12:02:09 +11:00
Julien Duroure
5ddff2562b Fix: glTF Exporter: Another sanity check about slot 2025-03-02 08:02:56 +01:00
Julien Duroure
bb2f74e8ce Fix: glTF Exporter: Avoid crash when action has no slot assigned 2025-03-02 07:59:42 +01:00
Alaska
b3b80deac1 Fix #135294: Improve missing VR support error message on macOS
This commit improves the error message explaining why VR isn't
supported on the macOS platform.

Pull Request: https://projects.blender.org/blender/blender/pulls/135302
2025-03-01 02:00:57 +01:00
Damien Picard
cd7334473a I18n: Translate quick effect data
Quick effects create various physics setups by adding objects,
materials, modifiers, and data layers. This data can now be
translated.
2025-02-28 15:46:33 +01:00
Damien Picard
5fc2d5b308 I18n: Fix Node Wrangler merge menus
Commit 8ff8fc4859 changed the context for the modes in Merge Nodes
and Change Nodes operators to Nodetree. The enum items were thus
extracted using this context, but the UI Menus were not updated to
reflect this change and a few items were no longer translated.

This commit fixes the issue by using the same translation context for
the menus' drawing.
2025-02-28 15:46:33 +01:00
Pratik Borhade
277df9ce1f Fix #134711: Frame selected shortcut not showing in menu
`IDProperty` of keyitem and operator in UI were not matching in
`wm_keymap_item_find_in_keymap()`. Now fixed by removing explicit
property value from UI menu

Pull Request: https://projects.blender.org/blender/blender/pulls/134724
2025-02-28 10:22:27 +01:00
Julien Duroure
9b67e27fc3 Fix: glTF exporter: fix missing check that a SK slot is assigned 2025-02-27 18:58:45 +01:00
Christoph Lendenfeld
566f51c24a Fix: selecting bones of pose assets not respecting multiple slots
The code for selecting bones from a pose was still using the legacy api,
thus it didn't work properly for selecting bones of all slots.

Pull Request: https://projects.blender.org/blender/blender/pulls/134912
2025-02-27 14:46:36 +01:00
Julien Duroure
a8e476531b glTF: Fix: bad check type in a previous commit 2025-02-27 11:49:44 +01:00
Julien Duroure
22aa2fbfa8 Fix #135129 glTF Collection Exporter: Avoid to export multiple scene info when Collection Export 2025-02-26 16:40:37 +01:00
Julien Duroure
0778ad776e glTF exporter: Better slot management:
Avoid non valid glTF file by avoiding exporting multiple slots with same target_id_type in the same animation for a single object:
- Make sure to create multiple animation when needed
- Use action.name for active slots (can have multiple slots when different target_id_type)
- Use action.name - slot.name_display for additional animations
2025-02-26 16:34:50 +01:00
Brecht Van Lommel
0741d0141e Fix: Blender as Python Module shared library directory wrong
This could affect for example the USD and MaterialX Python modules
that are now bundled, and need appropriate paths to their libraries.

Ref #134676

Pull Request: https://projects.blender.org/blender/blender/pulls/134937
2025-02-26 15:19:23 +01:00
Philipp Oeser
138ede7194 Fix #134092: Keymap Editor can add an extra . to the end of an attribute
This happened for context attributes if already "complete" attributes
were typed/pasted in.

Reason is that this copies functionality from our intellisense
codecompletion where this is expected behavior, for context attributes
we cannot really use "tab" to expand, so it is less useful here.

When confirming (with the additional "."), the keymap entry would be
broken, so better solve in a way that we dont end up with those "." by
removing it.

NOTE: there might be ways to enhance the string-search behavior here (by
properly supporting "tab-expanding"), but this is a bit out-of-scope for
this bugfix.

Pull Request: https://projects.blender.org/blender/blender/pulls/135098
2025-02-26 09:12:28 +01:00
Campbell Barton
1ed27184c1 Cleanup: correct Python type hint
The `mypy --strict` command I used for checking wasn't reporting this.
Thanks to Sybren for pointing it out.
2025-02-26 10:53:40 +11:00
Aaron Carlisle
778b1efd84 PyAPI Docs: Properly document byte string types
Fixes blender/blender-manual#105044
2025-02-25 14:02:58 -05:00
Pratik Borhade
e51fff61c5 Grease Pencil: Channel color for groups
`channel_color` property was created for layers in 03b2fc744e. Now
exposed for layer groups too.

Pull Request: https://projects.blender.org/blender/blender/pulls/135088
2025-02-25 09:44:21 +01:00
Campbell Barton
cd9156bb32 Extensions: use dynamically created link to the manual
The literal URL was used before extensions was included in a release.
2025-02-25 15:14:10 +11:00
Campbell Barton
d9eda9322d Cleanup: remove unused prefix from a used argument 2025-02-25 14:05:14 +11:00
YimingWu
03706b6052 Fix #135052: Grease Pencil: "Convert To" missing in object context menu
Adds "Convert To" option back to the object context menu for Grease
Pencil.

Pull Request: https://projects.blender.org/blender/blender/pulls/135054
2025-02-24 17:00:21 +01:00
Julien Duroure
dafff07ad9 Fix: glTF exporter: remove empty action in filter list when refresh 2025-02-22 09:02:06 +01:00
Julien Duroure
1fcbab0503 Fix: glTF exporter: Fix typo in gltfpack option 2025-02-22 08:59:01 +01:00
Julien Duroure
9ea0655edf Fix: glTF exporter: Fix typo in cache system, leading to endless loop 2025-02-22 08:56:08 +01:00
Julien Duroure
69adbd3af1 Fix: glTF exporter: fix filter on collection when using both collection exporter and full collection hierarchy" 2025-02-22 08:53:01 +01:00
Julien Duroure
a2aabd75bc Fix: glTF exporter: export all single armature actions only when "actions" mode
Other modes are not compatible with this option
2025-02-22 08:50:14 +01:00
Julien Duroure
3af38e1132 Fix: glTF exporter: Reset skin if mesh failed to export 2025-02-22 08:46:14 +01:00
Sybren A. Stüvel
0bb750ee84 Fix: #134636: VSE - Fade In and Out not working
Use the new `action.fcurve_ensure_for_datablock()` function to ensure
the opacity F-Curve exists.

This function also ensures that the Action itself is ready for keying
(it has a layer and a keyframe strip), and ensures the slot for the
Scene exists and is assigned.

Co-authored-by: Pratik Borhade <pratikborhade302@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/134753
2025-02-20 11:13:57 +01:00
Campbell Barton
42cc42e197 Fix exception in poll function when the brush is None 2025-02-20 16:28:45 +11:00
Sean Kim
f1fca48a4f Fix #134292: Clone brush cannot access local blendfile images
With the brush assets project, brushes were moved from being local to
the working blendfile to being linked from asset libraries. This breaks
the Image Paint 'Clone' brush, as it has a brush property that links to
other Image datablocks.

To support this functionality, this commit adds the corresponding
properties into the `ImagePaintSettings` struct so that it is stored
locally with the images that will be used by the tool, inside the main
blendfile.

The source image property is shared with the 3D version of the 'Clone'
brush instead of adding a separate field to preserve old behavior.

Notably, this has the following limitations:
* If clone brush assets have been made and shared with external packs,
  they would not work out of the box with linked image assets.
* Despite these settings being stored on the scene, they are populated
  inside the tool window under "Brush Settings" which is potentially
  misleading. However, this is already the case for the 3D version of
  the brush, so further UI refinement will happen outside of this PR.
* Users will be unable to use separate images simultaneously for the
  Image editor and the 3D viewport, unlike in pre-4.3 versions. This
  can be adjusted in the future if it is a critical workflow.

Because the intended design and functionality of this tool is currently
questionable, this commit opts to make these changes instead of doing
further design to support both accessing data on the brush and on the
scene.

Pull Request: https://projects.blender.org/blender/blender/pulls/134474
2025-02-19 22:00:39 +01:00
Campbell Barton
9e0c8a41cd Object Mode: conversion no longer depends on the active object
Conversion was only possible if the active object was editable &
selected, this complicated overriding the operator from Python
since it wasn't enough to override the selection & active-object.

Now it's possible to use bpy.ops.object.convert() from Python
overriding the selected_editable_objects only.

For users the difference isn't so significant:

- Having an active object is no longer required.

- It's possible there are no objects to operate on,
  as previously the active object was used to check at least one
  object could be converted, although this check wasn't fool-proof
  as it didn't check the objects data-type.

Resolves #100664.

Ref !134728.
2025-02-19 11:06:31 +11:00
Pratik Borhade
73a9a024f9 Fix #134380: Error adding a torus after hiding a collection
This reverts 06a2617107.
Commit has introduced few errors from user perspective (#134277) and
python side (#134380). Best to revert it now then handle the bug fixes later.

The error in #134380 was due to `context.layer_collection` and
`active_layer_collection` returning excluded collection.

Pull Request: https://projects.blender.org/blender/blender/pulls/134546
2025-02-18 10:05:59 +01:00
Maxime-Cots
b6617ae946 Fix #134451: SVG: Reuse material data on SVG Import
Reuse SVG Material and prevent creation of duplicate material
multiple times. Issue occurred because the check for a duplicate
material was placed too early.

Co-authored-by: Nig3l <nig3lpro@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/134529
2025-02-17 18:31:53 +01:00
Pratik Borhade
6d749db0c2 Fix #134468: Grease Pencil: Primtive tools considering mouse drag threshold
This is due to the click_drag event assigned for primitives. Event types
that are not "PRESS" are forwarded to drag_queue then waits until
`WM_event_drag_test_with_delta/WM_event_drag_test` is true i.e. mouse
threshold value.

Pull Request: https://projects.blender.org/blender/blender/pulls/134480
2025-02-13 11:53:03 +01:00
Campbell Barton
d2e2cec94e Cleanup: don't sub-class other registered classes
This complicates registration logic, ideally this would raise an
exception however detecting this at run-time is quite expensive.
2025-02-13 11:11:01 +11:00
Campbell Barton
c7804568e7 Cleanup: reference imported types in class definitions 2025-02-13 10:15:19 +11:00
Aaron Carlisle
f8cb37a322 Docs: Update RNA to user manual URL mapping 2025-02-11 21:29:05 -05:00
Campbell Barton
07340e1093 Docs: add code-comments to clarify bad-level include & developer only UI 2025-02-12 10:59:16 +11:00
Campbell Barton
dab47b83a8 Cleanup: de-duplicate numbered key definition with loop 2025-02-11 12:09:19 +11:00
Falk David
971f3e0699 Fix #132826: Grease Pencil: Missing "Paste by Layer" option
The Grease Pencil `Clipboard` only stored a single `CurvesGeometry`. This meant
that the `Paste by Layer` operation (from 4.2 LTS) couldn't be implemented.

This PR adds an `Array` of `ClipboardLayer`s to the  `Clipboard`. Each layer stores
the name of the Grease Pencil layer that it was copied from and the `CurvesGeometry`.

The `grease_pencil.paste` operator has a new property `type` (`ACTIVE` or `LAYER`)
that decides how to paste the strokes.

Using the `ACTIVE` type, the strokes of all the `ClipboardLayer`s get merged and then
pasted to the active layer.
Using the `LAYER` type, we first try to find layers to paste the `ClipboardLayer`s into.
We just look for matching layer names. If no matching layer is found, the strokes are
pasted into the active layer instead.

This should be consistent with how Grease Pencil used to behave in 4.2. LTS.

Pull Request: https://projects.blender.org/blender/blender/pulls/134168
2025-02-07 16:17:16 +01:00
Pratik Borhade
2d18046bbc Fix: Grease Pencil: Missing operator to delete breakdown keyframes
Operation to delete keys generated from interpolate sequence.

Resolves #134081

Pull Request: https://projects.blender.org/blender/blender/pulls/134091
2025-02-07 13:36:38 +01:00
Campbell Barton
e9dd4853f6 Fix #131947: Error closing prefs while installing extensions on WIN32
Using `signal.SIGINT` to send a signal to a sub-process isn't supported
on WIN32, replace with `signal.CTRL_BREAK_EVENT`.
2025-02-07 23:07:30 +11:00
Campbell Barton
198d07e240 Extensions: resolve unhandled exceptions when wheel extraction fails
Setting up wheels wasn't handling errors if extraction failed.

Addresses the error in #132924.
2025-02-07 20:30:08 +11:00
Campbell Barton
fb3fe458bf Extensions: forward any errors setting up wheels to reports
When actions on extensions failed setup extensions, errors weren't
forwarded to the user and were only visible in the terminal.
2025-02-07 20:30:02 +11:00
Campbell Barton
b113e848ef NDOF: implement new methods to pick the orbit-center
Note: this is a back-port from `main`, details below,
Original message:

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>

Back-ported as this change as this only missed the 4.4 branch by hours
and is considered an important feature for 4.4 by 3dconnexion.

This includes the following commits from main:

1a14d69498
30399fd165
3a8658958f
da8d9d989e
2a0ce11104
fb539baa89
2025-02-07 10:23:45 +11:00
YimingWu
6cf73b052e Fix #134159: Grease Pencil: Use "Blank" for the entry name in add menu
When adding an empty grease pencil object, the menu entry should be
"Blank" instead of "Empty" to be consistent with 4.2x and previous
versions.

Pull Request: https://projects.blender.org/blender/blender/pulls/134175
2025-02-06 13:38:36 +01:00
Andrej730
380e8455e8 PyDoc: Fix typing issues with bpy.utils.register_tool
- Add `type[]` for the `tool_cls` as it's expecting tool type class,
  not the instance (similar to #132420)
- Add `set[str]` to `after` type as it's seems to be the way it's used
  the most widely, e.g. in "UI Tool Simple" example that comes with Blender:

`bpy.utils.register_tool(MyTool, after={"builtin.scale_cage"}, separator=True, group=True)`

Pull Request: https://projects.blender.org/blender/blender/pulls/133975
2025-02-05 07:06:53 +01:00
Campbell Barton
4083b9ce62 Cleanup: use a more specific name for NDOF's guide
Prepare for having a second guide (!129594).
2025-02-05 15:19:35 +11:00
Nicola
6f80dba66c Sculpt: Add 'Plane' brush type
This patch introduces the `Plane` brush, a generalization of the
existing `Flatten`, `Fill` and `Scrape` brushes, with the objective of
providing more flexibility when sculpting.

This brush has the following key features:
* `Height` and `Depth` parameters to control the range of the brush in
  the local z-axis.
* Stabilizers for the normal and center of the brush plane.

When inverting, the user can choose between two options:
* `Invert Displacement`: Identical to the existing behavior, displacing
  vertices away from the plane.
* `Swap Height and Depth`: Exchanges the roles of `Height` and `Depth`.
  For example a brush with `Height` = 0.7 and `Depth` = 0.3 behaves as
  if it had `Height` = 0.3 and `Depth` = 0.7. In particular, this
  ensures that a scrape brush (`Height` = 1, `Depth` = 0) becomes
  equivalent to a fill brush (`Height` = 0, `Depth` = 1)  when inverted,
  and viceversa.

In the existing planar brushes, the influence on a vertex is determined
by the 3D Euclidean distance between the vertex and the cursor position,
multiplied by the vertex's distance from the brush plane (and other
factors common to all brushes).

In the `Plane` brush, the 3D distance is between the vertex and the
plane center instead of the cursor position.

The Plane brush introduces two parameters — `Stabilize Normal` and
`Stabilize Plane`. These can be thought of as the non-binary version of
the `Original Normal` and `Original Plane` options found in existing
brushes. These values are a weighted moving average across a window of
previous stroke steps.

Pull Request: https://projects.blender.org/blender/blender/pulls/132723
2025-02-04 22:38:23 +01:00
Christoph Lendenfeld
358a0479e8 Anim: create pose assets to different libraries
Similar to how brush assets are created and managed this
PR allows to export pose assets into a different library.
Because of this there is a limitation to this where each
asset is stored in a separate blend file.
This may be lifted in the future as there are planned changes in
the design phase: #122061

### Create Asset

Now available in the 3D viewport in the "Pose" menu: "Create Pose Asset".
The button in the Dope Sheet will now call this new operator as well.

Clicking either of those will open a popup in which you can:

* Choose the name of the asset, which library and catalog it goes into.
* Clicking "Create" will create a pose asset on disk in the given library.

It is possible to create files into an outside library or add it in the current file.
The latter option does a lot less since it basically just creates the
action and tags it as an asset.

If no Asset Shelf **AND** no Asset Browser is visible anywhere in Blender,
the Asset Shelf will be shown on the 3D viewport from which
the operator was called.

### Adjust Pose Asset

Right clicking a pose asset that has been created in the way described
before will have options to overwrite it.
Only the active object will be considered for updating a pose asset

Available Options (the latter 3 under the "Modify Pose Asset" submenu):
* Adjust Pose Asset: From the selected bones, update ONLY channels that
are also present in the asset. This is the default.
* Replace: Will completely replace the data in the Pose Asset from
the current selection
* Add: Adds the current selection to the Pose Asset. Any already existing
channels have their values updated
* Remove: Remove selected bones from the pose asset

Currently this refreshes the thumbnail. In the case of custom
thumbnails it might not be something want

### Deleting an existing Pose Asset

Right click on a Pose Asset and hit "Delete Pose Asset". Works in the shelf
and in the asset library. Doing so will pop up a confirmation dialog,
if confirming, the asset is gone forever. Deleting a local asset is basically the
same as clearing the asset. This is a bit confusing because you get
two options that basically do the same thing sometimes,
but "Delete" works in other cases as well.
I currently don't see a way around that.

Part of design #131840

Pull Request: https://projects.blender.org/blender/blender/pulls/132747
2025-02-04 11:29:05 +01:00
Campbell Barton
6fcd84721c Cleanup: quiet some warnings from check_pep8 target 2025-02-04 14:51:17 +11:00