Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gavrilov <angavrilov@gmail.com>2021-07-20 12:18:03 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2021-07-20 12:18:10 +0300
commite4d9cf84d00a6d223af3c89073858547090217ef (patch)
treeb161fc6f8d494afed440b04442e1c88123f8485d /rigify/generate.py
parent1adb56d8b01cf1327f58c6fb8b1ccc8b7efd76ad (diff)
Rigify: clear driver errors after generation.
In the process of re-generating a rig, drivers that reference it from other objects can temporarily become invalid. This sets an error flag in the driver, stopping its evaluation, so the error doesn't clear out even when it becomes valid again. To fix stuck drivers, loop over all objects in the file after generation and refresh their drivers by fake modification.
Diffstat (limited to 'rigify/generate.py')
-rw-r--r--rigify/generate.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/rigify/generate.py b/rigify/generate.py
index c6c9f3a9..aa9a9a84 100644
--- a/rigify/generate.py
+++ b/rigify/generate.py
@@ -29,6 +29,7 @@ from .utils.layers import ORG_LAYER, MCH_LAYER, DEF_LAYER, ROOT_LAYER
from .utils.naming import ORG_PREFIX, MCH_PREFIX, DEF_PREFIX, ROOT_NAME, make_original_name
from .utils.widgets import WGT_PREFIX
from .utils.widgets_special import create_root_widget
+from .utils.mechanism import refresh_all_drivers
from .utils.misc import gamma_correct, select_object
from .utils.collections import ensure_widget_collection, list_layer_collections, filter_layer_collections_by_object
from .utils.rig import get_rigify_type
@@ -540,6 +541,9 @@ class Generator(base_generate.BaseGenerator):
child.parent_bone = sub_parent
child.matrix_world = mat
+ # Clear any transient errors in drivers
+ refresh_all_drivers()
+
#----------------------------------
# Restore active collection
view_layer.active_layer_collection = self.layer_collection