Age | Commit message (Collapse) | Author |
|
Requested by @dexon, see rBAece39d809ce#339214.
This patch tries to improve a workflow that was hurt by D11356.
One of the goals of that patch was to make the connection between
metarig and generated rig stronger and more reliable, by using
datablock pointers rather than text-based matching. This allows
users to rename their datablocks as they would do with any other
datablock in Blender, so there's much more freedom with naming
when working with one metarig per generated rig per file.
However, this made it hard to duplicate the metarig, make changes
to it, and make a new rig out of it within the same file. Renaming
several datablocks in this case is not an "option", but an unintuitive
necessity.
With the patch applied, when the metarig has no target rig, there is
an option to input a rig name. If something is input by the user, that
name will be used for the rig, the widget collection (by extension the
widget objects) and the rig script, as long as they are not specified.
So, while still requiring a few more clicks than before, the workflow
for duplicating metarigs to make new ones is now much more reasonable:
- Duplicate metarig, make changes
- Remove the datablock references
- Input a rig name
- Generate
If the a rig object with the same name already existed, it will NOT be
overwritten, and the generated rig will have a .001 suffix. This matches
the "new" option of the removed "new/overwrite" options.
Meanwhile, the other workflow of having one metarig per generated rig
per file is not affected at all: The text box for the name input can
simply be ignored on the first generation. It will not show up after
that, since you would never remove the target rig in this workflow.
Differential Revision: https://developer.blender.org/D14757
|
|
|
|
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.
|
|
|
|
See T95597
|
|
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
|
|
|
|
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.
|
|
Just in case the user wants to apply some custom changes to the
generated rig, allow executing a text datablock as a python script
after generation completes.
The script is executed with the generated rig active and in object
mode. When executed by rigify, the generator instance is available
via `rigify.get_generator()`. Outside of Rigify generation the return
value is None.
|
|
Rig generation fails if the target rig that is to be overwritten
is hidden, either directly or via collections. To improve usability,
try unhiding the object, and fail with an appropriate message if
it doesn't work.
In addition, slightly refactor code that selects a suitable
unhidden collection to use for generation.
This started as D11355 by @Mets, but was somewhat refactored.
|
|
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
|
|
Accidental commit by misclicking in VSC, yikes!
This reverts commit 9a7afcbcae91978db8173e205f0ec73f1d6ad440.
|
|
The UX for this panel felt like it could use a facelift. It was extremely ugly to look at, nothing about it was done the correct way and it broke every possible modern Blender UI convention it could.
Before/After:
{F10135475}
{F10159077}
After generating a rig:
{F10159078}
- Removed the "overwrite/new" enum.
- If there is a target rig object, we overwrite. If not, we create. I think that's intuitive behaviour without the extra UI element.
- 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.
- Renamed the panel from "Rigify Buttons" to "Rigify Generation" in pose/object mode and "Rigify Samples" in edit mode.
- Changed the "Advanced Options" into a sub-panel instead.
- Single column layout.
- Added an info message to show the name of the successfully generated rig:
{F10159079}
Feedback welcome.
Differential Revision: https://developer.blender.org/D11356
|
|
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.
|
|
If the metarig contains a bone called 'root', it is used as the
root bone for the generated rig instead of creating a new one.
This allows changing root location, orientation, size, widget, or
adding custom properties that show up in the rig UI via raw_copy.
|
|
The issue is that if a different object has a constraint or driver
targeting a control of the rig, renaming the bone after join when
re-generating the rig would change that target to the ORG bone.
To fix this, apply the renames to the temporary copy of the metarig
before joining it to the rig armature object. This also requires
moving the driver freeze to this stage.
|
|
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.
|
|
Originally the raw_copy rig used a standard API of rigify to rename
the bone after generate already added an ORG prefix. However, if the
bone already had that prefix, generate didn't add the second one to
avoid 'ORG-ORG', and thus raw_copy removed the only remaining prefix.
As the simplest solution, hard-code handling of this rig in generate.
This isn't that bad, because this rig is special by definition, and
the special handling consists in doing nothing.
The original API based code is kept commented out as an example.
|
|
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
|
|
Otherwise this can break generation of deliberately asymmetric rigs.
|
|
This function seemed to be doing a lot of unneccessary stuff, including mode switching, so it seemed worthwhile to optimize a bit.
No functional changes.
Reviewed By: sybren
Differential Revision: https://developer.blender.org/D8514
|
|
Just removing some unused imports.
I tested generating every built-in metarig to make sure I didn't remove any imports that were actually used. I also tested installing and using a feature-set.
Reviewed By: angavrilov
Differential Revision: https://developer.blender.org/D8026
|
|
Add a separate rig aimed at transferring bones from the metarig
completely verbatim without the ORG prefix, and remove the hacky
copy_chain/super_copy option for renaming ORG to DEF. Share the
constraint retargeting feature between super_copy and raw_copy.
|
|
|
|
|
|
|
|
Match object orientations during join, as suggested by @pioverfour.
|
|
By storing the Rigify advanced generation options (name, target rig,
target ui script) in the armature data instead of the window manager
as before, multiple rigs can have different options. Additionally,
these options are stored in the blend file, and not lost when reloading.
Also, the rig name is not automatically suffixed with `_rig`, which
doesn't make sense as far as I can tell.
Differential Revision: https://developer.blender.org/D5675
|
|
Toes behave as FK, but are needed both in IK and FK mode.
|
|
The main goals are to provide an official way for rigs to
interact in a structured way, and to remove mode switching
within rigs.
This involves introducing a base class for rigs that holds
rig-to-rig and rig-to-bone references, converting the main
generator into a class and passing it to rigs, and splitting
the single generate method into multiple passes.
For backward compatibility, old rigs are automatically handled
via a wrapper that translates between old and new API.
In addition, a way to create objects that receive the generate
callbacks that aren't rigs is introduced via the GeneratorPlugin
class. The UI script generation code is converted into a plugin.
Making generic rig 'template' classes that are intended to be
subclassed in specific rigs involves splitting operations done
in each stage into multiple methods that can be overridden
separately. The main callback thus ends up simply calling a
sequence of other methods.
To make such code cleaner it's better to allow registering
those methods as new callbacks that would be automatically
called by the system. This can be done via decorators.
A new metaclass used for all rig and generate plugin classes
builds and validates a table of all decorated methods, and
allows calling them all together with the main callback.
A new way to switch parents for IK bones based on the new
features is introduced, and used in the existing limb rigs.
Reviewers: icappiello campbellbarton
Differential Revision: https://developer.blender.org/D4624
|
|
Only objects in the current view layer can be deselected, this would throw an
error when there exist objects not in the current view layer.
|
|
After the change in PoseBone.bone behavior, drivers will be added there.
|
|
Only visible and selectable collections can be used for temporary
objects during generation due to the way operators work.
|
|
As suggested by @icappielo, and after discussion with @meta-androcto,
I start a public request to commit third-party contributions already
accepted to https://github.com/eigen-value/rigify/tree/rigify_0.6_beta
Specifically, this includes:
* User-defined rig package (feature set) support by @pioverfour.
This allows users to install pre-packaged rig sets via zip
files, which become accessible together with built-in rigs,
as discussed in T52758.
https://github.com/eigen-value/rigify/pull/1
* Modularization of python script generation, allowing rigs to
add their own utility functions and operators to the generated
script. This is critical to make custom rig support really
useful.
https://github.com/eigen-value/rigify/pull/5
* The utils.py file is split into multiple modules with a backward
compatibility proxy for old functions.
* Automatic verification that different rigs don't try to create
different rig settings with the same name to alleviate increased
risk of namespace conflicts with custom rigs.
https://github.com/eigen-value/rigify/pull/7
* New utility class that implements bone layer selection UI.
https://github.com/eigen-value/rigify/pull/6
* New utilities to replace copy & pasted boilerplate code for
creating custom properties, constraints and drivers.
https://github.com/eigen-value/rigify/pull/11
Some other random changes by MAD have likely slipped through.
These changes have already been extensively discussed and accepted
into the branch by @luciorossi, so I see no reason not to commit
them to the official repository to be tested during 2.8 beta.
Reviewers: icappiello
Differential Revision: https://developer.blender.org/D4364
|
|
The code attaching the UI script to the rig didn't check
that animation_data exists before accessing it.
|
|
|
|
|
|
|
|
Now all the widget elements are in the Widgets collection.
And the collection is hidden for the viewport.
There is one thing still not fully working, but it is a bug in Blender I
believe. Basically not all the custom bones are shown until you go to an
object that has its mesh and toggle in and out of edit mode.
|
|
With those changes the addon is working in some functional state.
Thus I'm bumping its version to 2.80.
TODOS:
* Handle collections (put all the new objects in a collection).
* We should also replace the old WGT_LAYERS with subcollections.
* Move toolshelf operators out of there (make tools or move to sidebar).
|
|
This replaces the old trick of using game controllers.
|
|
|
|
Reason for rename is that 'set' is a python builtin data structure.
|
|
|
|
small fixes & UI improvements
|
|
CREDITS and README files
|
|
|