Commit Graph

3122 Commits

Author SHA1 Message Date
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
John Kiril Swenson
f79df39171 VSE: Move snap toggle to global SequencerCommon
This allows the keybind to be invoked from either the Sequencer or
Preview view types, now that snapping is also possible in the Preview.
2025-02-03 15:02:41 -06:00
Julien Duroure
6999f34ec1 glTF: Bump version to 4.4.42 after recent changes 2025-02-03 20:35:05 +01:00
Julien Duroure
c089c176cb Refactor: glTF: followup ActionKeyframeStrip.channels() rename
- Use slot identifier instead of slot handle
- Change API calls after changes in Blender (in PR #133868)
- Refactoring, avoiding duplicate functions

Pull Request: https://projects.blender.org/blender/blender/pulls/133915
2025-02-03 20:32:00 +01:00
Sybren A. Stüvel
226486aa91 Refactor: Anim, rename and adjust ActionKeyframeStrip.channels()
Rename `ActionKeyframeStrip.channels()` to `.channelbag()`, and change
its first parameter from `slot_handle` to `slot`.

This is to be consistent with `ActionKeyframeStrip.channelbags`, which is
the array of channelbags in the keyframe strip. Having a function that's
singluar makes sense for finding a single element in the array.

The change from using the slot handle to using the slot is to be consistent
with `.channelbags.new(slot)`. Furthermore, the Python API should be using
slot handles as little as possible (they're basically meaningless numbers).
Using the slots directly is preferred. If that's not possible, it is
recommended to use the slot identifier (`slot.identifier`) instead, as that
can be used to look up the slot (`action.slots[slot_identifier]`).

This breaks the glTF add-on, which will be fixed in !133915.

Pull Request: https://projects.blender.org/blender/blender/pulls/133868
2025-02-03 20:19:00 +01:00
T0MIS0N
a9c6889eb4 Fix #133453: Canvas button cannot be enabled
This fixes an issue where the Canvas button is always disabled when
trying to use the experimental feature, Sculpt Texture Paint.

This bug was caused by the new Asset System since it changed how paint
tools work. Before, the UI would check the current tool being used and
determine if the Canvas button should be activated. With the new Asset
System, painting is done with modular brushes instead of tools, so
previous methods of checking tool properties have stopped working.

This is fixed by activating the Canvas button based on the properties
of the current brush. If the brush's type is either Paint or Smear,
then the Canvas button is activated.

Co-authored-by: T0MIS0N <50230774+T0MIS0N@users.noreply.github.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/133566
2025-02-03 19:50:33 +01:00
Sybren A. Stüvel
fa2b131395 Fix #105216: Rigify (ui.py) console error, expected str not float
Use string formatting instead of the `+` operator, so that it doesn't
matter which exact type is used for the `rig_id` custom property.

Also reshuffle the code a bit to reduce indentation.

Pull Request: https://projects.blender.org/blender/blender/pulls/133967
2025-02-03 12:55:36 +01:00
John Kiril Swenson
16c6b227da VSE: Add keymap item for seq_slide with ctrl
Allows the user to select strips at the same time (`linked_time`) while
dragging so that they don't have to re-click to drag the handles.
2025-02-02 23:03:07 -06:00
Campbell Barton
59732c95d8 Cleanup: strip trailing space for TOML,HTML & XML 2025-02-02 13:58:34 +11:00
Julien Duroure
8abac73cbd glTF exporter: avoid crash when no tracks are exported 2025-02-01 19:06:45 +01:00
Julien Duroure
196cda9eef glTF exporter: Fix typo leading to crash at animation export (nla track mode) 2025-02-01 19:05:14 +01:00
Julien Duroure
83f9ed8771 glTF: New way of registering UI for hooks
- Explicit registration for hook UI
- Added some example in upstream repo: https://github.com/KhronosGroup/glTF-Blender-IO/blob/main/example-addons/example_gltf_exporter_extension/__init__.py
2025-02-01 18:59:03 +01:00
Julien Duroure
cccd45e32a glTF exporter: Create output directory if not exists
This should happen mainly for Collection Exporter or using api
2025-02-01 18:55:46 +01:00
Julien Duroure
3d2f45b408 glTF: Collection Exporter: Set collection custom props as glTF Scene extras
As we are exporting Collection only, it makes sense that the collection customs props
can be exported as glTF Scene extras, as the scene includes only objects from the collection
2025-02-01 18:52:53 +01:00
Julien Duroure
6aae3004fc glTF exporter: add pre & post export hooks 2025-02-01 18:49:38 +01:00
Campbell Barton
ec40ad0b3f Cleanup: use str.format to format strings in Python 2025-01-31 13:22:10 +11:00
Campbell Barton
20c08147b3 Cleanup: resolve warnings from pylint
- `self` -> `cls` for class methods.
- quiet long line & unused variable warnings.
2025-01-31 13:22:04 +11:00
Campbell Barton
448e3c2009 Cleanup: remove redundant setting & add NUMPAD_1 for direct lookups
Add NUMPAD_1 to match NUMBERS_1 to avoid inline formatting,
also de-duplicate logic that uses both NUMBERS_1 & NUMPAD_1.
2025-01-31 13:08:05 +11:00
RedMser
032feaf65f Fix #133812: Strip color picker uses invalid icon enum
Regression in a9c87a15fc - missed "sequence" -> "strip" renaming.

Pull Request: https://projects.blender.org/blender/blender/pulls/133814
2025-01-30 15:45:58 +01:00
Lukas Tönne
3be9f3d599 Fix #133516: Add basic support for radial control in the primitive operator
This adds another operator mode for changing brush radius and opacity while the
modal primitive operator is running. It's based on the `wm.radial_control`
operator but only implements simple mouse control for these two properties.

Pull Request: https://projects.blender.org/blender/blender/pulls/133675
2025-01-30 14:09:42 +01:00
Habib Gahbiche
d19fe522e4 Fix box select ignoring selection mode in node editors
Box select is broken for all node editors. It ignores selection modes and always uses the mode `Set a new selection`.

The operator `NODE_OT_select_box` works fine, but clicking anywhere in the node editor calls `NODE_OT_select` first, so we need to make sure it has no undesired side effects when it is not run.

Pull Request: https://projects.blender.org/blender/blender/pulls/133736
2025-01-30 12:45:50 +01:00
Pablo Vazquez
6ea8297477 Extensions: Quick access to add-on folder
When developing and testing add-ons it can be useful to get to the
folder containing such add-on.

When Developer Extras is enabled, show a folder icon next to the
extension's path to quickly open it using the system file browser.

Also display it in the list of duplicate add-ons, if any, so user can
access them more conveniently.

Pull Request: https://projects.blender.org/blender/blender/pulls/128474
2025-01-30 11:18:53 +01:00
Campbell Barton
c86d3b429e Cleanup: spelling in comments 2025-01-30 14:18:40 +11:00
Habib Gahbiche
4e544a89d6 Fix #133780: Menu search Python error in terminal
`poll()`  method must check properly for space type.

Pull Request: https://projects.blender.org/blender/blender/pulls/133781
2025-01-30 00:28:22 +01:00
Pratik Borhade
71213799b0 Fix #77799: Missing categories for gizmos in keymap hierarchy
Expose generic gizmo keymap in hierarchy.

Pull Request: https://projects.blender.org/blender/blender/pulls/132788
2025-01-29 20:18:10 +01:00
Habib Gahbiche
b51c560f6e Compositor: Implement shortcuts for Viewer nodes
Artists often want to quickly switch back and forth between two or more nodes while compositing.

This patch implements two operators `NODE_OT_viewer_shortcut_set` and `NODE_OT_viewer_shortcut_get` that allow users to map a viewer node to a shortcut. For example, pressing `cltr+1` while a node is selected, assigns that node to the shortcut `1`, creates a viewer node if it has none attached and sets that viewer node to active. Pressing `1` will set the active node with shortcut `1` to active.

Shortcuts are saved in DNA to preserve them after saving/loading blend files.

Limitations:
- Only compositor node tree is supported, because shading editor has no viewer node and geometry nodes viewer works differently.

Pull Request: https://projects.blender.org/blender/blender/pulls/123641
2025-01-29 18:35:26 +01:00
Philipp Oeser
a77e0ccd78 Fix: Curves "Warp" and "Randomize" dont update properly
Resolve by tagging positions as changed.

With this and !133544 (which fixes #133537) we can also expose those operators in the menu.

Pull Request: https://projects.blender.org/blender/blender/pulls/133548
2025-01-29 10:00:05 +01:00
Harley Acheson
05151fcd60 UI: Reduce Light Theme Icon Border Opacity
Reduce the Light Theme Icon Border Intensity from 1.0 to 0.7 to better
match the result in Blender versions prior to SVG icons. The icon
border is now done within the text shader so the result is a bit
stronger than the old method.

Pull Request: https://projects.blender.org/blender/blender/pulls/131396
2025-01-28 19:39:14 +01:00
Sybren A. Stüvel
2440861afe Anim: fix 'Fix to Camera' poll function exception when camera is missing
The 'Fix to Camera' poll function was raising `NotImplementedError` when
there is no scene camera. That's now fixed.

Pull Request: https://projects.blender.org/blender/blender/pulls/133710
2025-01-28 14:13:53 +01:00
Jonas Holzman
001c3b0d4b Fix #132150: macOS: Allow searching keymap using native modifiers key names
Allow searching through keybindings on macOS using native modifiers key
names "control", "option", and "command".

Pull Request: https://projects.blender.org/blender/blender/pulls/132579
2025-01-28 02:12:06 +01:00
Dangry98
e95687796d UV Editor: Add shortcut to Copy/Paste UVs
Assign Ctrl+C, Ctrl V to Copy/Paste UVs in UV Editor to the
default keymap and industry compatible keymap.

Similar to Copy/Paste splines in Mask editor.
Ref: https://projects.blender.org/blender/blender/issues/133558

Pull Request: https://projects.blender.org/blender/blender/pulls/133587
2025-01-27 19:57:28 +01:00
Falk David
1eb39a8689 Grease Pencil: Sculpt Mode Auto-Masking option
This implements all the auto masking options in sculpt mode.

* Stroke: Only affects strokes that are initially under the cursor.
* Layer: Only affect strokes in the same layer as the initial strokes under the cursor.
* Material: Only affect strokes with the same material as the initial strokes under the cursor.
* Active Layer: Only affect strokes in the active layer.
* Active Material: Only affect strokes that use the active material.

The `Active Layer` toggle in the toolbar has been moved to this panel.

Resolves #130022.

Pull Request: https://projects.blender.org/blender/blender/pulls/132986
2025-01-24 10:20:03 +01:00