openrig.maya.core.registry module

Solution type registry.

All subclasses of SolutionBase that declare a solution_type class variable are registered automatically via __init_subclass__. Adding a new solution type requires only creating a new file in maya/solutions/ — no manual registration.

Usage (from the build pipeline):

from openrig.maya.core.registry import get, all_types

cls = get("Arm")        # → ArmSolution
cls = get("Spine")      # → SpineSolution
known = all_types()     # → {"Arm": ArmSolution, "Spine": SpineSolution}
openrig.maya.core.registry.register(solution_type: str, cls: type[object]) None[source]

Register a solution class under its type string.

Called automatically by SolutionBase.__init_subclass__. Logs a warning if the type string is already taken (the new class wins).

Parameters:
  • solution_type – The type string declared on the class (e.g. "Arm").

  • cls – The solution class to register.

openrig.maya.core.registry.get(solution_type: str) type[object][source]

Return the solution class registered under the given type string.

Parameters:

solution_type – The type string to look up (e.g. "Arm").

Returns:

The registered solution class.

Raises:

KeyError – If no solution is registered under solution_type.

openrig.maya.core.registry.all_types() dict[str, type[object]][source]

Return a snapshot of all currently registered solution types.

Returns:

A dict mapping type strings to their solution classes.