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
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
<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
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
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
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:
1a14d6949830399fd1653a8658958fda8d9d989e2a0ce11104fb539baa89
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>
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
- 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
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
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
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
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
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