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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Oeser <info@graphics-engineer.com>2020-05-19 14:59:39 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2020-05-19 14:59:39 +0300
commit325307d82b3ab9d6fa52d23cc571e10a52b8003f (patch)
tree0de5e4e7aa57b1eeeee5542285af4c08bd079e26 /source/blender/blenkernel/intern/armature.c
parent4fa1fc29bd45835e26ff3497af8cf2a7c61d3c73 (diff)
parent82bda82ec4494717f3796a8b458c81a98836838b (diff)
Merge branch 'blender-v2.83-release'
Diffstat (limited to 'source/blender/blenkernel/intern/armature.c')
-rw-r--r--source/blender/blenkernel/intern/armature.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index 06a97fc3826..36921bd2662 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -67,6 +67,7 @@
#include "BKE_scene.h"
#include "DEG_depsgraph_build.h"
+#include "DEG_depsgraph_query.h"
#include "BIK_api.h"
@@ -500,14 +501,21 @@ static void armature_refresh_layer_used_recursive(bArmature *arm, ListBase *bone
}
}
-/* Update the layers_used variable after bones are moved between layer
- * NOTE: Used to be done in drawing code in 2.7, but that won't work with
- * Copy-on-Write, as drawing uses evaluated copies.
- */
-void BKE_armature_refresh_layer_used(bArmature *arm)
+void BKE_armature_refresh_layer_used(struct Depsgraph *depsgraph, struct bArmature *arm)
{
+ if (arm->edbo != NULL) {
+ /* Don't perform this update when the armature is in edit mode. In that case it should be
+ * handled by ED_armature_edit_refresh_layer_used(). */
+ return;
+ }
+
arm->layer_used = 0;
armature_refresh_layer_used_recursive(arm, &arm->bonebase);
+
+ if (depsgraph == NULL || DEG_is_active(depsgraph)) {
+ bArmature *arm_orig = (bArmature *)DEG_get_original_id(&arm->id);
+ arm_orig->layer_used = arm->layer_used;
+ }
}
/* Finds the best possible extension to the name on a particular axis. (For renaming, check for