Commit Graph

3141 Commits

Author SHA1 Message Date
Bastien Montagne
f3969bd1d2 Merge branch 'blender-v4.4-release' 2025-02-13 13:02:08 +01:00
Janne Nylander
f702eba53f Grease Pencil: Add python operator for masking with above/below layer
Adds a new python operator to Grease Pencil for adding the layer
above or below  as a masking layers to the active layer.

Creates a new file for Grease Pencil python operators in
`scripts/startup/bl_operators/grease_pencil.py`.

Pull Request: https://projects.blender.org/blender/blender/pulls/134401
2025-02-13 12:24:06 +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
61b2bf4953 Merge branch 'blender-v4.4-release' 2025-02-13 11:23:45 +11: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
Dalai Felinto
96d84d1832 Point Cloud: Expose 3D Cursor, annotation and ruler tools
<img width="298" alt="image.png" src="attachments/9336d17d-7dd5-445b-892c-ad7e91bb98d6">

---

The Selection tools are not working, so I did not add them to the toolbar.

Pull Request: https://projects.blender.org/blender/blender/pulls/134453
2025-02-12 22:05:07 +01:00
Harley Acheson
5956752eb7 UI: Themeable RedAlert, Error, Warning, Info Colors
The "Red Alert" color is currently hard-coded, which causes problems in
themes.  It also has an Enum value of 0, which precludes using this
value as "unset". We also use Error, Warning, and Info colors that are
part of the Info Editor.  This PR moves these out of the Info Editor
and into the "State" part of the theme. And then makes TH_REDALERT use
the TH_ERROR color.

Pull Request: https://projects.blender.org/blender/blender/pulls/131127
2025-02-12 20:59:47 +01:00
Aaron Carlisle
01763ea34b Merge branch 'blender-v4.4-release' 2025-02-11 21:32:11 -05:00
Aaron Carlisle
f8cb37a322 Docs: Update RNA to user manual URL mapping 2025-02-11 21:29:05 -05:00
Campbell Barton
e96acd433d Docs: add code-comments to clarify bad-level include & developer only UI 2025-02-12 13:21:07 +11: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
968909d57c Cleanup: rename RNA parameter to clarify its meaning
This flag is only used when classes are registered,
avoid confusion by renaming to `PARM_PYFUNC_REGISTER_OPTIONAL`.
2025-02-11 16:31:42 +11:00
Campbell Barton
60ef321e6d Merge branch 'blender-v4.4-release' 2025-02-11 12:12:37 +11:00
Campbell Barton
dab47b83a8 Cleanup: de-duplicate numbered key definition with loop 2025-02-11 12:09:19 +11:00
Devashish Lal
1a62fdc82a Geometry Nodes: CSV import node
This commit implements a node to import CSV files as a point cloud.
The interface is minimal, with just a file path input. The type of each
column is chosen by whether the first value is an integer or a float
(those are currently the only supported types).

The goal of the node is to make it easier to get arbitrary data into
geometry nodes for visualization purposes, for example.

https://devtalk.blender.org/t/gsoc-2024-geometry-nodes-file-import-nodes/34482

Pull Request: https://projects.blender.org/blender/blender/pulls/126308
2025-02-10 16:56:52 +01:00
Aras Pranckevicius
4f0fd32d6f VSE: Over Drop effect was not doing anything useful, map it to Alpha Over
Behavior of it was exactly the same as Alpha Over for the last 18 years (since
327d413eb3 in 2006 March), so just remap it to regular alpha over on file read.

Pull Request: https://projects.blender.org/blender/blender/pulls/134342
2025-02-10 16:10:01 +01:00
Sebastian Parborg
7a0f2ce8b1 Merge branch 'blender-v4.4-release' 2025-02-07 19:01:22 +01:00
Pasang Bomjan
5884c61b4c UI: Sort transform properties for custom bone shape
Sort the order of custom bone shape transform properties consistently
with other areas.

Pull Request: https://projects.blender.org/blender/blender/pulls/134173
2025-02-07 18:06:11 +01: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
Falk David
b00c8bd391 Merge branch 'blender-v4.4-release' 2025-02-07 15:01:35 +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
b1bd70b89e Merge branch 'blender-v4.4-release' 2025-02-07 23:11:04 +11: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
Falk David
a9f75d45ad Merge branch 'blender-v4.4-release' 2025-02-07 10:57:17 +01: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
2f641739aa Merge branch 'blender-v4.4-release' 2025-02-06 20:39:39 +08: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
Julien Duroure
b768b0d91d glTF: Bump version to 4.5.0 after 4.4 branch creation 2025-02-06 08:04:33 +01:00
Campbell Barton
1a14d69498 NDOF: implement new methods to pick the orbit-center
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>
2025-02-06 09:54:41 +11:00
Nika Kutsniashvili
9627bdfab3 UI: Shading: Move Cavity properties into a subpanel
Move cavity properties to a separate subpanel, instead of being
in-between unrelated settings.

Avoids issues with add-ons appending to the "Options" subpanel, which
would push cavity properties back to the middle.

Properties are now greyed out (instead of hidden) when unavailable
due to X-Ray being enabled.

More details and screenshots in pull request.

Pull Request: https://projects.blender.org/blender/blender/pulls/133944
2025-02-05 17:08:55 +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