Skip to content

Generate rewrite #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: rigify_0.6_beta
Choose a base branch
from

Conversation

angavrilov
Copy link

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.

This includes and supersedes pull requests #9 and #12.

@angavrilov angavrilov force-pushed the generate-rewrite branch 2 times, most recently from 21d6a61 to b0c13d6 Compare November 29, 2018 10:00
@angavrilov angavrilov force-pushed the generate-rewrite branch 2 times, most recently from d8beaac to 453eed9 Compare December 9, 2018 19:27
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.
These types demonstrate the use of all callbacks, bone creation
and parenting utilities, constraint & driver creation tools,
and python script generation.
Combining spine, head and tail in the same rig leads to overly
complicated and inflexible code. The only reason to do that is
to be able to join the B-Bone chains together, and with the new
rig class structure it can be done via rig interaction.

Thus the rig is split into a basic spine rig, and a head rig
that can optionally attach its deform chain to the parent.
@angavrilov
Copy link
Author

As I said in the chat, it would be perfectly understandable if you wanted to review all those rigs separately (even one by one).

The reason I converted all those rigs was to thoroughly test the new base class API, and find which utilities/features are still missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant