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
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
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
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
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.
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
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
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 `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