From 01e8af3348fac2babe3b5218dbe4ecdaa0e1eace Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Sat, 12 Nov 2022 23:54:17 +0200 Subject: Rigify: annotate and fix warnings in basic rig components. Introduce a method to annotate types and names of entries in the `bones` container of rig components and apply it, and other type annotations, to a number of not very complex rig classes. - Introduce BaseRigMixin as a typed base class for mixins intended for use in rig classes (using BaseRig as a parent causes issues). - Introduce TypedBoneDict that does not suppress the unknown attribute analysis in PyCharm, and use it in a system of subclasses to annotate the bones in various rigs. BaseBoneDict is necessary because the annotation affects all subclasses, so TypedBoneDict cannot inherit from BoneDict with the annotation. - Add or adjust other type annotations of rig methods and utilities. - Fix other warnings, e.g. undeclared attributes, excessively long lines, whitespace style issues and typos. --- rigify/utils/layers.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'rigify/utils/layers.py') diff --git a/rigify/utils/layers.py b/rigify/utils/layers.py index d1f56e90..cb013ee1 100644 --- a/rigify/utils/layers.py +++ b/rigify/utils/layers.py @@ -151,6 +151,15 @@ class ControlLayersOption: layout_layer_buttons(box, params, self.layers_option, active_layers) + # Declarations for auto-completion + FK: 'ControlLayersOption' + TWEAK: 'ControlLayersOption' + EXTRA_IK: 'ControlLayersOption' + FACE_PRIMARY: 'ControlLayersOption' + FACE_SECONDARY: 'ControlLayersOption' + SKIN_PRIMARY: 'ControlLayersOption' + SKIN_SECONDARY: 'ControlLayersOption' + ControlLayersOption.FK = ControlLayersOption( 'fk', description="Layers for the FK controls to be on") -- cgit v1.2.3