From 2b09062defa093a243b5fe64b099accb07b440a3 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 14 May 2018 15:42:49 +0200 Subject: COW Fix: The "layers used" display for armatures did not update after bones were moved between layers Previously, the "layers_used" value was getting updated by the drawing code. However, when using copy on write, the drawing code gets evaluated copies of the armature data instead of the original data, so any updates here fail to get flushed to the original data, hence the lack of updates in the UI. Fixed by moving the calculation to RNA when setting bone layers, as it should have been done originally. (The one downside to this is if we set individual layer memberships one by one - this could be slower as the recalc would have to happen each time this changes). --- source/blender/draw/intern/draw_armature.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'source/blender/draw/intern/draw_armature.c') diff --git a/source/blender/draw/intern/draw_armature.c b/source/blender/draw/intern/draw_armature.c index 5ad05da5cbf..d07febfdd22 100644 --- a/source/blender/draw/intern/draw_armature.c +++ b/source/blender/draw/intern/draw_armature.c @@ -1577,11 +1577,8 @@ static void draw_armature_pose(Object *ob, const float const_color[4]) const bool show_relations = true; /* TODO get value from overlays settings. */ /* being set below */ - arm->layer_used = 0; - for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { bone = pchan->bone; - arm->layer_used |= bone->layer; /* bone must be visible */ if ((bone->flag & (BONE_HIDDEN_P | BONE_HIDDEN_PG)) == 0) { -- cgit v1.2.3