openrig.conventions.conventions module
Rigging conventions loader for OpenRig.
Reads conventions/config.json, validates the values, and exposes
load_conventions() for file-based loading and RiggingConventions
for direct programmatic construction.
- Exported symbols (consumed by
__init__.py): ConventionsError: raised on any load or validation failure.RiggingConventions: frozen dataclass holding the active defaults.load_conventions(path): reads a JSON file and returns an instance.
- exception openrig.conventions.conventions.ConventionsError[source]
Bases:
ExceptionRaised when rigging conventions cannot be loaded or are invalid.
- class openrig.conventions.conventions.RiggingConventions(aim_axis: Axis, up_axis: Axis, side_axis: Axis, default_rotate_order: RotateOrder, default_side: Side)[source]
Bases:
objectActive rigging conventions for a project.
Construct directly for programmatic configuration or testing. Use
load_conventions()orget_conventions()for file-based loading.- aim_axis
The axis joints and controls aim along.
- Type:
- up_axis
The axis used as the up vector.
- Type:
- side_axis
The axis used for the side direction.
- Type:
- default_rotate_order
The default rotate order for joints and controls.
- default_side
The default side token when none is specified.
- Type:
- default_rotate_order: RotateOrder
- openrig.conventions.conventions.load_conventions(path: Path | str | None = None) RiggingConventions[source]
Loads rigging conventions from a JSON file.
Falls back to the package-level default (
conventions/config.json) when no path is provided.- Parameters:
path – Path to a JSON config file, or
Noneto use the package default.- Returns:
A validated
RiggingConventionsinstance.- Raises:
ConventionsError – If the file is missing, malformed, or contains invalid values.