35 Commits

Author SHA1 Message Date
Damien Picard
58b8ae1717 UI: Fix a few typos
- "Acion Slot" -> "Action": typo.
- "Specifies the input node used the created zone" -> "by the created
  zone": typo.
- "No reference available {!r}, Update..." -> "update": lower case.
- "uninitialized file-list" -> "Uninitialized": sentence case.

Some issues reported by Alexandr Fatih.

Pull Request: https://projects.blender.org/blender/blender/pulls/148265
2025-10-17 16:13:30 +02:00
Christoph Lendenfeld
174279a2a5 Fix #148164: Rigify hide drivers not generated correctly
Some less obvious uses of the `Bone.hide` property were missed in the last fix.
Since the property was moved to the pose bone this no longer worked
and has been replaced with `PoseBone.hide`

Pull Request: https://projects.blender.org/blender/blender/pulls/148183
2025-10-16 08:31:00 +02:00
Damien Picard
197d69627d I18n: Fix translation of formatted string in report 2025-10-15 16:26:46 +02:00
Christoph Lendenfeld
d68680ed61 Fix #147709: Use correct property for bone selection in Python
Replace all calls to `pose_bone.bone.select` with
`pose_bone.select` since that is where the property lives now

Pull Request: https://projects.blender.org/blender/blender/pulls/147725
2025-10-09 16:52:06 +02:00
Demeter Dzadik
f5428c51e0 Rigify: Full Action Slot Support in Blender 5.0
This commit tries to make the bare minimum changes to add a meaningful
level of support for Action Slots in Rigify:

- You can now select an Action Slot in each Action Set-up, and that
  will be assigned to the generated Action Constraints.
- For this to be meaningful, we have to support selecting the same
  Action in multiple Action Set-ups, which would previously throw an
  error.
- For that to be possible however, it was necessary to make the
  trigger selectors of Corrective Action Set-ups select one of the
  other set-ups directly, rather than selecting an Action (datablock),
  and then making an association to one of the action set-ups based on
  that action pointer. (The necessity to allow users to point at
  another action set-up was the reason behind not allowing user to use
  the same action datablock multiple times.)

Pull Request: https://projects.blender.org/blender/blender/pulls/146182
2025-10-07 18:37:44 +02:00
Sybren A. Stüvel
d989117f09 Fix: correct RNA property access in Rigify
Ensure that Rigify correctly handles RNA properties as RNA properties.
Before, it mixed dictionary-style and attribute-style access, but
since 7276b2009a that is no longer
possible.

This means that the (un)registration of the RNA properties needs to
happen in two places: the add-on itself, and the code it generates in
the rig. To be able to inject the code into a blend file, Rigify needs
to access it as string. This commit introduces a new way of dealing
with this: it just has normal code, and uses Python's
[`inspect.getsource()`][getsource] to get that code as string for
injection into the rig file.

[getsource]: https://docs.python.org/3/library/inspect.html#inspect.getsource

The biggest chunk of code in this commit deals with the 'Copy
Parameters', 'Copy Type & Parameters', and 'Mirror Type & Parameters'
operators. Since it's no longer possible to access RNA properties as
dict-like custom properties, new code was written to recursively copy
`bpy.types.PropertyGroup` instances. Eventually this may end up in
Blender itself, but that would mean writing more thorough checks and
making sure it works in many cases. And it might be easier to
implement this on the C++ side, where it should just be a matter of
exposing one `IDP_CopyPropertyContent()` call to the Python API.
That's all for another Blender release, though -- for now this'll have
to do to fix up Rigify for 5.0.

Fixes: #146675
Pull Request: https://projects.blender.org/blender/blender/pulls/147199
2025-10-07 11:37:12 +02:00
Sybren A. Stüvel
7b18a2c324 Refactor: convert Rigify from legacy Action API to the current API
Minimal changes to make Rigify use the current Action API (introduced in
Blender 4.4) instead of the legacy API (removed in 5.0).

Most of the refactoring consists of:

- Find the right `Channelbag`
- Replace operations on `Action` with operations on that `Channelbag`.

I didn't manage to test all code, because some code paths are very hard
to follow, and others seem to only be available for legacy rigs.

This is part of #146586

Pull Request: https://projects.blender.org/blender/blender/pulls/147060
2025-10-02 14:42:43 +02:00
Casey Bianco-Davis
d2269441bb Python: Rename bpy.data.grease_pencils_v3 to bpy.data.grease_pencils
This renames `bpy.data.grease_pencils_v3` to `bpy.data.grease_pencils`.

Part of #125058.

Pull Request: https://projects.blender.org/blender/blender/pulls/146904
2025-09-29 12:32:08 +02:00
Damien Picard
ddbc6ed858 I18n: Allow translation of some messages using string formatting
- Add `iface_` translation functions and `translate=False` to a few UI
  elements.
- Add `rpt_` translation functions to a few reports.
2025-09-12 18:30:56 +02:00
Damien Picard
5998795aa6 UI: Replace contractions with long-form text
Avoid using contractions for can't, aren't, doesn't, and shouldn't.
Following the writing style guide in the Human Interface Guidelines.

Pull Request: https://projects.blender.org/blender/blender/pulls/143852
2025-08-05 11:16:22 +02:00
Falk David
4a36f5b2dc Fix: Rigify: Wrong type in create_object_data for Grease Pencil
The code was using the legacy Grease Pencil data type
in `create_object_data`. For the object type `GREASEPENCIL` we should
be using `bpy.data.grease_pencils_v3`.

Pull Request: https://projects.blender.org/blender/blender/pulls/142335
2025-08-01 13:35:10 +02:00
Aaron Carlisle
60bd15ca40 Core: Add-ons: Display Maintainer as "Blender Foundation"
The author field is displayed in the UI as "Maintainer",
most of the original authors are no longer active or are part of the foundation.
Since the core add-ons are maintained the same as the rest of Blender they should be shown accordingly.

The exceptions here are the GLTF and Hydra add-ons; these Khronos Group and AMD are included as maintainers.

The orginal author field is preserved in the chance the add-on looses it's "core" status.

Pull Request: https://projects.blender.org/blender/blender/pulls/140690
2025-07-26 03:42:15 +02:00
Nika Kutsniashvili
efa8d942b8 Refactor: Remove grid and compact UI list layout in Python scripts
The grid layout type for UI list is planned for removal in 5.0, see
blender/blender#110461.

In previous UI meetings, we talked about deprecating the Grid mode of
the UI list, which is not actually accessible in UI and was never used.
Nowadays, there is a new grid view that can be exposed in the API in
the future.

Initially, I wanted to remove references to layout_type in UI templates
in the text editor, because a lot of add-on developers on the
extensions platform base their lists on that code, and a lot of them
are therefore including soon to be deprecated code in their add-ons,
which I want to avoid in the future. But I thought we might as well
remove it from our python scripts as well, since it's just basically
redundant code that doesn't do anything. And also because many add-on
developers use bundled python scripts for references as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/138395
2025-06-18 13:45:06 +02:00
Hans Goudey
77b14f2dcb Cleanup: Grammar: Fallback vs. fall back
The former is a noun or adjective, the latter is a verb.
2025-06-02 17:13:56 -04:00
Gianluca Giampuzzo
f4117f7146 Fix: Rigify Cat metarig Palm.002 roll misorientation
Fix misorientation on palm.002 both L/R from 3.1416 to 0.0004.

The new value is also used by other palms in other rigs.

Fixes: blender/blender-addons#104772
Co-authored-by: techmadentertainment <tech@madentertainment.it>
Pull Request: https://projects.blender.org/blender/blender/pulls/138124
2025-05-15 11:40:59 +02:00
Gianluca Giampuzzo
e116038486 Fix: Rigify: Bone collection typo in Cat Metarig
Small typo in the bone collection name used in Rigify addon metarig>animals>cat.
Incorrect collection name `Arm,L (Tweak)` replaced with the correct `Arm.L (Tweak)`.

Co-authored-by: techmadentertainment <tech@madentertainment.it>
Pull Request: https://projects.blender.org/blender/blender/pulls/138120
2025-04-30 08:24:33 +02:00
Sybren A. Stüvel
a956c34efd Fix #125696: Rigify: spline_tentacle fails to generate sometimes
Ensure the code doesn't delete items from the same collection it is
looping over.

This is done by copying the `self.artifact_reuse_table` dictionary items
and looping over that, making it possible to delete from the original
dictionary.

Co-authored-by: Gianluca Giampuzzo
2025-04-25 16:14:48 +02:00
Sybren A. Stüvel
9811c5c5de Fix #136706: Converting bone rotation with Rigify crashes Blender
Fix a crash that was caused by looping over a collection and deleting
items from that collection at the same time.

Pull Request: https://projects.blender.org/blender/blender/pulls/136758
2025-03-31 14:08:47 +02:00
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