From a918332cc3f821f5a70b1de53b65dd9ca596b093 Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Mon, 19 Oct 2020 16:48:45 +0300 Subject: Rigify: suppress module load order list mismatch errors. It seems the order changed, maybe because of a Python version upgrade. To fix, ignore the position of the 'utils' module. --- rigify/__init__.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/rigify/__init__.py b/rigify/__init__.py index 83aafb8c..9254e49d 100644 --- a/rigify/__init__.py +++ b/rigify/__init__.py @@ -39,7 +39,6 @@ import bpy # With the sole exception of 'utils', modules must be listed in the # correct dependency order. initial_load_order = [ - 'utils', 'utils.errors', 'utils.misc', 'utils.rig', @@ -50,6 +49,7 @@ initial_load_order = [ 'utils.widgets', 'utils.widgets_basic', 'utils.widgets_special', + 'utils', 'utils.mechanism', 'utils.animation', 'utils.metaclass', @@ -66,6 +66,7 @@ initial_load_order = [ 'rot_mode', 'ui', ] +utils_module_name = __name__ + '.utils' def get_loaded_modules(): @@ -82,6 +83,14 @@ def reload_modules(): for name in reload_list: importlib.reload(sys.modules[name]) +def compare_module_list(a, b): + # Allow 'utils' to move around + a_copy = list(a) + a_copy.remove(utils_module_name) + b_copy = list(b) + b_copy.remove(utils_module_name) + return a_copy == b_copy + def load_initial_modules(): load_list = [ __name__ + '.' + name for name in initial_load_order ] @@ -91,7 +100,7 @@ def load_initial_modules(): module_list = get_loaded_modules() expected_list = load_list[0 : max(11, i+1)] - if module_list != expected_list: + if not compare_module_list(module_list, expected_list): print('!!! RIGIFY: initial load order mismatch after '+name+' - expected: \n', expected_list, '\nGot:\n', module_list) return load_list @@ -113,7 +122,7 @@ else: reload_list = reload_list_init = get_loaded_modules() - if reload_list != load_list: + if not compare_module_list(reload_list, load_list): print('!!! RIGIFY: initial load order mismatch - expected: \n', load_list, '\nGot:\n', reload_list) load_rigs() -- cgit v1.2.3