Commit Graph

17 Commits

Author SHA1 Message Date
Nathan Vegdahl
b634fd04ed Fix #133010: Rigify operators for copying rig-type parameters fail
The underlying issue was that the code was trying to directly assign a Python
dictionary to an add-on defined Group Property accessed via `[]` syntax, like
this:

```
to_bone['rigify_parameters'] = param_dict
```

That only works if 'rigify_parameters' does *not* already exist according to the
`[]` lookup, so this was failing whenever it already did.

This PR fixes that by simply deleting the property first when it already exists.

Co-authored-by: Ayoub ibn Muhammad <cl3m3c7@riseup.net>
Co-authored-by: Sybren A. Stüvel <sybren@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/135233
2025-03-07 12:53:56 +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
Damien Picard
74f5fa55ac I18n: Disambiguate "Samples"
"Samples" is used in Rigify rig templates, as opposed to rendering.
2025-01-13 12:40:45 +01:00
Pratik Borhade
dda364637c Fix #130059: Rigify Limb menu disppears for some rotation fields
Caused by 78b9218c98
Undefined `iface_` is used, this terminates execution of further UI panel draw
code. Fix this by importing iface_ from module.

Pull Request: https://projects.blender.org/blender/blender/pulls/130063
2024-11-12 12:08:53 +01:00
Sybren A. Stüvel
ba1f7caffa Fix #125226: Anim: Rigify limbs.spline_tentacle doesn't generate correctly
A template string was accidentally turned into an f-string in
78b9218c98, which changes the way it is
evaluated. Easy enough to roll back that one change.
2024-07-30 16:13:27 +02:00
Sybren A. Stüvel
9d3dc77e05 Anim: move Bone Selection Sets add-on into Blender
The functionality of the Bone Selection Sets add-on is now integrated
into Blender itself. Rigify has been updated to no longer check for the
add-on, but just assume that the functionality is available.

The keymap is still the same, and so are all the class names. This
ensures that there are no conflicts when people still have the old
add-on enabled somehow. And there is versioning code to remove the
'add-on enabled' state so that Blender won't complain it cannot find it
any more.

Compared to the add-on, the following changes are made:

- The 'bone' icon has been removed from the list of available selection
  sets. It was the same for each entry anyway, and thus didn't provide
  any information.
- The code has been split up into multiple files, with the UI elements
  in `scripts/startup/bl_ui/properties_data_armature.py` and the
  operators in `scripts/startup/bl_operators/bone_selection_sets.py`.
- Helper functions and classes are prefixed with `_` to indicate that
  they are not part of any public API.
- The `Operator` helper subclasses have been transformed to mix-in
  classes. This way the only subclasses of `Operator` are the actual
  operators.
- Comments & descriptions have been updated for clarity & consistency.

This commit contains code by the following authors, ordered by number of
commits in the original add-on repository, highest first:

Co-Authored By: Ines Almeida <britalmeida@gmail.com>
Co-Authored By: Sybren A. Stüvel <sybren@stuvel.eu>
Co-Authored By: Campbell Barton <ideasman42@gmail.com>
Co-Authored By: meta-androcto <meta.androcto1@gmail.com>
Co-Authored By: Demeter Dzadik <Mets>
Co-Authored By: lijenstina <lijenstina@gmail.com>
Co-Authored By: Brecht Van Lommel <brechtvanlommel@gmail.com>
Co-Authored By: Aaron Carlisle <carlisle.b3d@gmail.com>

For the full history see the original add-on at:
https://projects.blender.org/blender/blender-addons/commits/branch/main/bone_selection_sets.py

Reviewed On: https://projects.blender.org/blender/blender/pulls/124343
2024-07-08 16:28:42 +02:00
Sybren A. Stüvel
ef669e3b99 Anim: fix Rigify bone selection set generation code
The "create selection set for bone collection" function was checking for
bone collection membership the wrong way. This is now fixed.

Reviewed On: https://projects.blender.org/blender/blender/pulls/124343
2024-07-08 16:28:42 +02:00
Damien Picard
e9de6b5e7a I18n: More translation fixes for Rigify
Allow translation of a few missing messages in the Rigify add-on. In
particular, the most important "Generate Rig" button!

Some issues reported by Gabriel Gazzàn.
2024-07-08 13:00:08 +02:00
Bastien Montagne
dc8ab86aec Cleanup: make format 2024-07-04 14:39:23 +02:00
Damien Picard
78b9218c98 I18n: Fix translations for Rigify
Rigify was recently added to the core add-ons, and is now
translatable. This change fixes many issues that made messages
poorly or not translatable.

- Replace f-strings and % formatting with str.format().
- Use iface_ and rpt_ to translate formatted strings.
- Rename metarig submenus from "<Category> (submenu)" to simply
  "<Category>" to allow the menu entries and submenus to have the same
  name and be translated. The label was awkward anyway in my opinion.
- Remove trailing "." in operator reports.
2024-07-04 14:35:17 +02:00
Sybren A. Stüvel
246b317bd4 Add-on: Rigify, move meta-rigs into a 'Rigify Meta-Rigs' sub-menu
Instead of having the Rigify meta-rigs directly in the 'Add → Armature`
menu, move them into 'Add → Armature → Rigify Meta-Rigs`.

This also removes the " (Meta-Rig)" suffix from every individual
meta-rig menu item.

This serves multiple purposes:

- It's now clear that these meta-rigs come from Rigify.
- The built-in 'Single Bone' armature now has similar visual weight as
  the 'Rigify Meta-Rigs' menu item.
- Opens up the menu in a fairer way to other add-ons, to add their own
  entries in a similar way.

Pull Request: https://projects.blender.org/blender/blender/pulls/123833
2024-06-28 11:38:31 +02:00
Sybren A. Stüvel
d1e7346c63 Add-ons: Rigify, reformat code
Run `make format` to reformat the Rigify code. It now adheres to the
global Blender code style standard, rather than having its own style.

Most of the changes are simply adding spaces around operators, newlines
below docstrings, and changing some indentation.

Note that this does not reformat any stored-as-multiline-strings code
blocks.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/123833
2024-06-28 11:38:31 +02:00
Sybren A. Stüvel
09e431c511 Rigify: mark as support=OFFICIAL
Now that Rigify is part of the core add-ons, it should be marked as
officially supported.

Pull Request: https://projects.blender.org/blender/blender/pulls/123833
2024-06-28 11:38:31 +02:00
Nathan Vegdahl
3ad753e9f4 Fix: make foot roll rigs work again in Blender 4.2 and later (#4)
The fix is to set local-space Limit Rotation constraints to use the
legacy behavior from pre-4.2.  The legacy behavior isn't meaningful/
useful for other spaces, so we leave those constraints alone.

This is one part of a two-part fix for blender/blender#123105.  The other part
is blender/blender#123361, which adds the Legacy Behavior option to the Limit
Rotation constraint.

Reviewed-on: https://projects.blender.org/extensions/rigify/pulls/4
Reviewed-by: Sybren A. Stüvel <sybren@blender.org>
2024-06-28 11:38:31 +02:00
Demeter Dzadik
8d4cc5d998 Remove CloudRig as a promoted feature set (#1)
CloudRig is no longer a Rigify feature set. I re-wrote it as a standalone add-on.

Reviewed-on: https://projects.blender.org/extensions/rigify/pulls/1
Reviewed-by: Alexander Gavrilov <angavrilov@noreply.localhost>
2024-06-28 11:38:31 +02:00
Alexander Gavrilov
f5ac944658 Fix: Rigify Apply Toggle Pole to Keyframes clears out IK keyframes
Fix bug where the "Apply Toggle Pole to Keyframes" operator would erase
keyframes.

This was caused by f61d27b735622b940521024554aadcfc52ea76cf. The
solution was offered by Alexander Gavrilov in
https://projects.blender.org/blender/blender-addons/issues/105301#issuecomment-1187067

Fixes blender/blender-addons#105301
2024-06-28 11:38:31 +02:00
Sybren A. Stüvel
541e3aae25 Add-ons: Move Rigify into addons_core
Move Rigify from the external add-ons repository into
`scripts/addons_core`.

This commit adds Rigify, from the latest revision in [the add-ons
repo][addons]. It contains work by the following authors:

  202 Alexander Gavrilov
   67 Campbell Barton
   58 Nathan Vegdahl
   31 Lucio Rossi
   24 Demeter Dzadik
   10 Brecht Van Lommel
    8 Dalai Felinto
    7 Bastien Montagne
    7 Sybren A. Stüvel
    5 Damien Picard
    4 meta-androcto
    3 Ines Almeida
    2 Jonathan Smith
    2 ZanQdo
    1 Aaron Carlisle
    1 Andrej730
    1 Hans Goudey
    1 Luca Bonavita
    1 Patrick Huang
    1 Sergey Sharybin
    1 Thomas Dinges

For the full history see the read-only [add-ons repository][addons].

Rigify has existed briefly as an extension on the extensions platform,
and commits were made to Rigify's extension repository (which is
different from the above-mentioned add-ons repository). That repository
will be deleted soon. Its commits that actually changed Rigify will be
committed as followups to this commit. Some commits were necessary to
turn the add-on into an extension; those will be ignored, as they're no
longer relevant.

[addons]: https://projects.blender.org/blender/blender-addons/src/rigify

Ref: !121825

Pull Request: https://projects.blender.org/blender/blender/pulls/123833
2024-06-28 11:38:31 +02:00