Commit Graph

14 Commits

Author SHA1 Message Date
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
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
0d0f8fa8f4 Cleanup: remove unused function in pose_library
Ref !133145
2025-01-21 23:06:29 +11:00
Christoph Lendenfeld
6b421326b6 Fix #131495: Pose Library error with enum values
Enums in Blender evaluate to a string, so trying to add them to a pose
failed with an error because FCurves only accept numbers.

The fix is to modify the data path and split the property name off.
By evaluating that we arrive at the bone, from which we can call `get(property_name)`
to get the int value.

Pull Request: https://projects.blender.org/blender/blender/pulls/132124
2025-01-07 10:41:40 +01:00
Nathan Vegdahl
3cd0e0ab5e Anim: make creating slotted-action pose assets assign the slot
Previously, when creating pose assets with the experimental baklava flag
enabled, although the asset would be created correctly as a slotted action,
and the resulting action would be assigned to the ID, the slot itself was
not assigned.

This commit updates the code to select the slot as well when the asset
is created as a slotted action.

Note that *applying* pose assets that were created this way is still
not functioning correctly, which will be addressed in a forthcoming PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/128594
2024-10-07 15:52:09 +02:00
Campbell Barton
6cbdf0223b Cleanup: defer imports on startup 2024-10-01 10:01:16 +10:00
Campbell Barton
dc74a98b9e Cleanup: remove unused imports 2024-07-23 15:58:21 +10:00
George Mavroeidis
8fc617d8e2 Cleanup: Animation: Remove pose library UI hint about the new asset shelf UI
Remove the 'Pose Library' panel from the Animation tab, which showed
the UI hint and toggle for the new asset shelf.

Reporting issue: blender/blender#121779

Co-authored-by: George Mavroeidis <gdmavroeidis@hotmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/124839
2024-07-22 12:33:28 +02:00
Bastien Montagne
b42f2b7634 Merge branch 'blender-v4.2-release' 2024-07-04 11:08:56 +02:00
Damien Picard
6a52c76a65 I18n: Translate messages in extensions, operator descriptions, Node Wrangler
- Operator descriptions use tip_() since they will be displayed in
  tooltips.

- Extension messages:
  - Split "(Add-on|Theme) \"{:s}\" already installed!" into two
    messages.
  - Use rpt_() to translate error messages.

- Restore core add-on name and description translation.

- Use DATA_ to translate paint material slot name, so that translation
  happens only if the user enabled it for user-created data.

- Node Wrangler contains functions used to build operators' poll
  methods. This change allows them to be properly translated by using
  str.format() instead of f-strings, and explicit extraction with
  tip_().

Pull Request: https://projects.blender.org/blender/blender/pulls/123795
2024-07-04 10:49:52 +02:00
Julian Eisel
63de458f7d Cleanup: Pose Library: Remove unused asset view template leftovers
The pose library now uses the asset shelf and has a dedicated context menu for
that. This UI-list context menu for the asset view template isn't in use
anymore. Neither are the custom properties that were only necessary for the
template.

Pull Request: https://projects.blender.org/blender/blender/pulls/122768
2024-06-10 11:52:35 +02:00
Christoph Lendenfeld
345cd70404 Fix: Pose Library - Ctrl click not applying flipped
This has been mentioned as a bug in the recent A&R module meeting
https://devtalk.blender.org/t/2024-05-14-animation-rigging-module-meeting/34614#ux-quirks-in-the-pose-library-shelf-5
Pressing `Ctrl` only worked from within the modal operator, but not to start it.
The issue was that the entry for that was missing from the keymap.

This PR adds a keymap entry to apply and to blend a pose flipped,
by holding `Ctrl` first and then clicking the pose asset.

Pull Request: https://projects.blender.org/blender/blender/pulls/121860
2024-05-23 11:35:44 +02:00
Christoph Lendenfeld
3a40d2813f Anim: Pose Library - Allow blending flipped from the context menu
This adds the `Blend Pose Flipped` option to the
context menu of the pose library.
The operator already accepted a flipped property,
it was just missing a dedicated menu entry for that.

In order for this to work, the modal operator had to be modified.
Instead of setting the flipped state, pressing `Ctrl` now acts as a toggle.
That means that if the operator has been started in flipped mode,
pressing and holding `Ctrl` will unflip it.

This has been a point of discussion in the A&R module meeting
https://devtalk.blender.org/t/2024-05-14-animation-rigging-module-meeting/34614#ux-quirks-in-the-pose-library-shelf-5

Pull Request: https://projects.blender.org/blender/blender/pulls/121857
2024-05-21 11:08:22 +02:00
Campbell Barton
13a3603578 Move addons from the addons repo to "addons_core"
Ref: !121825
2024-05-15 19:26:29 +02:00