Skip to content
Snippets Groups Projects
  • Alexander Gavrilov's avatar
    3423174b
    Rigify: redesign generate.py and introduce a base rig class. · 3423174b
    Alexander Gavrilov authored
    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
    3423174b
    History
    Rigify: redesign generate.py and introduce a base rig class.
    Alexander Gavrilov authored
    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