Age | Commit message (Collapse) | Author |
|
Introduce a method to annotate types and names of entries in the
`bones` container of rig components and apply it, and other type
annotations, to a number of not very complex rig classes.
- Introduce BaseRigMixin as a typed base class for mixins intended
for use in rig classes (using BaseRig as a parent causes issues).
- Introduce TypedBoneDict that does not suppress the unknown attribute
analysis in PyCharm, and use it in a system of subclasses to
annotate the bones in various rigs. BaseBoneDict is necessary
because the annotation affects all subclasses, so TypedBoneDict
cannot inherit from BoneDict with the annotation.
- Add or adjust other type annotations of rig methods and utilities.
- Fix other warnings, e.g. undeclared attributes, excessively long
lines, whitespace style issues and typos.
|
|
CloudRig has a feature that allows the user to automatically generate
Action constraints that move bones of the rig based on the position
of other bones. This is done by adding and configuring the actions
in a UI panel of the metarig. The feature also supports corrective
actions that activate based on the state of two other actions.
This ports the feature to base Rigify with the necessary changes in
code organization and style, and replacing CloudRig-specific code.
There are also some functional changes:
- The order of action constraints is reversed.
- The way symmetry of LOCATION_X is handed is changed to
match how Paste Pose Flipped works.
- The action slot UI is shown even without a generated rig.
- More alerts in the UI, e.g. for duplicate rows.
Differential Revision: https://developer.blender.org/D16336
|
|
|
|
Also declare stage names for auto-completion.
|
|
|
|
Only consider local datablocks when searching for the rig object,
widget collection and widget objects themselves during generation.
|
|
|
|
This is no longer necessary, see: T98554.
|
|
Some files needed to be changed manually.
|
|
For IK controls that move freely in space without being tied to
a parent it makes sense to align the location channels to world
(or root), while keeping rotation channels aligned to the limb
end orientation.
Blender already has a Local Location parenting option for this
very use case, but Rigify wasn't using it. This adjusts the
switchable parent mechanism so that the option works as intended,
and provides a Rigify option that controls its value for IK controls.
Note that now it is possible to enable the Local Location option
directly on the control bones after generation and it will work
correctly - it is not required to enable IK Local Location.
|
|
See T95597
|
|
Existing IK & FK controls only allowed squash and stretch scaling.
|
|
The overall goal of this patch is to improve the UI/UX of the panel previously known as "Rigify Buttons" which presumably takes its name from the old "Buttons Panel" which is now known as the Properties Editor.
Before:
{F10511640}
After:
{F10511624}
- Make Rigify less reliant on name matching when it comes to maintaining the link between the metarig, the UI script, the generated rig, and the widgets collection. (Use pointers only, names shouldn't matter!)
- Change the "Advanced" toggle button into a real sub-panel.
- Split up the "Rigify Buttons" panels into "Rigify Generation" and "Rigify Samples" panels in non-edit and edit mode respectively, to better describe what the user will find there.
Changes in the Rigify Buttons panel:
- Removed the "overwrite/new" enum.
- If there is a target rig object, it will be overwritten. If not, it will be created.
- If a rig object with the desired name already existed, but wasn't selected as the target rig, the "overwrite" option still overwrote that rig. I don't agree with that because this meant messing with data without indicating that that data is going to be messed with. Unaware users could lose data/work. With these changes, the worst thing that can happen is that your rig ends up with a .001 suffix.
- Removed the "rig name" text input field. Before this patch, this would always rename your rig object and your rig script text datablock, which I think is more frustrating than useful. Now you can simply rename them after generation yourself, and the names will be kept in subsequent generations.
- Single-column layout
- Changed the "Advanced Options" into a sub-panel instead.
On request:
- Added an info message to show the name of the successfully generated rig:
{F10159079}
Feedback welcome.
Reviewed By: angavrilov
Differential Revision: https://developer.blender.org/D11356
|
|
|
|
|
|
The copy_custom_properties() function needs to check if a property is actually a custom property created by the user, or a property defined by an addon. I think we don't want to copy addon-defined properties here, since that's not what is usually meant by "custom property".
Reviewed By: angavrilov
Maniphest Tasks: T92530
Differential Revision: https://developer.blender.org/D13084
|
|
After the custom shape scale property was split into an XYZ vector,
it is possible to generate truly mirrored widgets using the same
mesh for the left and right side. The widgets Rigify generates are
originally symmetrical, but in practice they usually need to be
tweaked to fit the character better, and proper mirroring matters.
This commit implements widget mirroring and enables it by default.
When reusing widgets left from a previous generation the code tries
to detect whether they were actually originally mirrored by checking
object scale to avoid flipping in pre-existing rigs.
As an aside, reusing pre-existing widgets is made more robust
to random name changes by building a table via scanning the old
generated rig before overwriting it.
|
|
This is a followup patch for D9697 which applies the changes to the
addon reporistory. Almost all of the changes are in rigify, but there
is one change in "curve_tools" and two trivial changes in IO addons.
Differential Revision: https://developer.blender.org/D9919
|
|
Apart from imports the files are identical to the latest version.
Ref T89808
|
|
In the process of re-generating a rig, drivers that reference it
from other objects can temporarily become invalid. This sets an
error flag in the driver, stopping its evaluation, so the error
doesn't clear out even when it becomes valid again.
To fix stuck drivers, loop over all objects in the file after
generation and refresh their drivers by fake modification.
|
|
|
|
Move widget and driver utilities from the feature set and rewrite
create_circle_widget. Also increase the line length for autopep8.
|
|
- LazyRef utility class that provides a hashable field reference.
- NodeMerger plugin for grouping abstract points by distance.
- pose.rigify_copy_single_parameter operator for copying a single
property to all selected rigs that inherit from a specific class
(intended to be used via property panel buttons).
|
|
The line was missed when updating in rBA448eeb681 after rBf29a738e2.
Also remove an unneeded import.
|
|
|
|
|
|
Use new properties introduced in rBfc5bf09fd88c33.
|
|
The built-in layer button UI only draws dots if the property
belongs to an Armature, as a special behavior hard-coded in C.
This returns to drawing the UI from Python but using cleaner code.
|
|
Normally properties are copied to controls and made accessible
in the rig UI, so they should be overridable. Properties created
via make_property are already marked as such.
|
|
|
|
Improve auto-generated UI naming and update basic.pivot, basic.raw_copy
and basic.super_copy. Also allow raw_copy to generate builtin widgets.
|
|
This preserves the standard widget naming even with custom widgets.
|
|
|
|
Register the most generic widgets in the list and add a few more.
Use it to assign a nicer looking shoulder widget in human metarigs.
|
|
Since rigs like super_copy already support using widgets assigned
directly to metarig bones, implement adding them with the metarig.
|
|
As pointed out in comments to T73114, using the same name has downsides.
In addition, remove the widget parent object that was inherited
from the old pre-collection way Rigify worked and has no other
purpose than grouping objects like the collection already does.
Rename the widgets and the collection when renaming the rig.
Finally as an aside add a couple of options to create_widget.
|
|
Also make error handling more robust and extend constraint relink mixin.
|
|
- Don't try to add an update callback to CollectionProperty.
- Restore exact alignment of the super_finger master control to 1st bone.
- Add an option to run a sub-object after all methods of the parent.
- Fix wrong identifier in SideZ.from_parts.
|
|
This is for convenience of more complex utilities, since
the functions themselves immediately force the closures.
|
|
Also fix metarig Inherit Scale support in limbs.super_finger.
|
|
Add support for 5 bone chains to the limbs.paw rig.
Implement a new limbs.rear_paw rig, which provides a three bone IK
mechanism designed to keep the first and third bones nearly parallel
by default (based on a YouTube video by @Pieriko as suggested by
@icappiello).
Implement a limbs.front_paw rig with automation that aims to
keep the angle between second and third bones mostly stable
by default (has influence option), as suitable for front paws.
The horse and wolf metarigs are updated to use these new rig
types, with the horse rig further overhauled by @icappiello.
Maniphest Tasks: T78463
Differential Revision: https://developer.blender.org/D8496
|
|
|
|
In 2.90 derived bone lookup was tightened to fix certain issues when
bone names use the .001 suffixes by using explicit data about which
bone is derived from which one. Unfortunately, legacy rigs don't
provide that info, so add a special case using matching by name.
Also fix incorrect error reporting method name.
|
|
It seems like the make_constraint() function was designed to allow fully
defining a constraint with a single call, but currently when creating
Armature constraints, its targets have to be created separately after
the make_constraint() call.
This patch addresses this, allowing you to pass a "targets" dictionary.
Armature constraint targets only have three properties, which are "target",
"subtarget" and "weight". For convenience, since 99.99% of the times the
"target" will be the rig, that doesn't have to be specified, but it can be.
Differential Revision: https://developer.blender.org/D9092
|
|
rig script
In days of old, Custom Properties couldn't store datablock pointers, so a driver variable was used to reference the script datablock, thereby keeping it attached to the rig when the rig is linked or appended. This can now be achieved much more elegantly with one short line of code.
Reviewed By: angavrilov
Differential Revision: https://developer.blender.org/D9082
|
|
This class exists specifically for the purpose of defining and drawing the UI for bone layer assignment parameters, as seen in other rig types like super_chain, limb_rigs, simple_tentacle, etc. Only super_face was missing it for some reason.
Although the way it is used may be questionable, it's consistent with the rest of the codebase.
No functional changes.
Note for future: I would also like to use the ControlLayersOption class in even more places, and also maybe rename it and make improvements to it as needed. This would also be part of a bigger design of how Rigify handles bone organization, which I should write down.
Reviewed By: sybren
Differential Revision: https://developer.blender.org/D8802
|
|
Instead of implementing the 2 rows of layer boolean toggles, we can just use the 'LAYER' subtype on the BoolVectorProperty.
No functional changes.
Reviewed By: sybren
Differential Revision: https://developer.blender.org/D8801
|
|
Just removes an empty file and redundant function definition. No functional changes.
Reviewed By: sybren
Differential Revision: https://developer.blender.org/D8804
|
|
|
|
|