[Bf-blender-cvs] [6770f76bd49] master: Fix T60982: don't allow editing group properties in linked actions.

Alexander Gavrilov noreply at git.blender.org
Wed Apr 17 13:47:14 CEST 2019


Commit: 6770f76bd49f0104e51d2c8a523e880f0c40cf7a
Author: Alexander Gavrilov
Date:   Wed Apr 17 14:43:02 2019 +0300
Branches: master
https://developer.blender.org/rB6770f76bd49f0104e51d2c8a523e880f0c40cf7a

Fix T60982: don't allow editing group properties in linked actions.

===================================================================

M	source/blender/editors/animation/anim_channels_defines.c
M	source/blender/editors/animation/anim_channels_edit.c
M	source/blender/editors/animation/anim_filter.c

===================================================================

diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index a4fc022821a..67d0e969735 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -4630,12 +4630,14 @@ static void draw_setting_widget(bAnimContext *ac,
           UI_but_func_set(but, achannel_setting_widget_cb, NULL, NULL);
           break;
       }
-    }
-  }
 
-  if ((ale->fcurve_owner_id != NULL && ID_IS_LINKED(ale->fcurve_owner_id)) ||
-      (ale->id != NULL && ID_IS_LINKED(ale->id))) {
-    UI_but_flag_enable(but, UI_BUT_DISABLED);
+      if ((ale->fcurve_owner_id != NULL && ID_IS_LINKED(ale->fcurve_owner_id)) ||
+          (ale->id != NULL && ID_IS_LINKED(ale->id))) {
+        if (setting != ACHANNEL_SETTING_EXPAND) {
+          UI_but_flag_enable(but, UI_BUT_DISABLED);
+        }
+      }
+    }
   }
 }
 
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c
index c2878a64e97..67ec5a95913 100644
--- a/source/blender/editors/animation/anim_channels_edit.c
+++ b/source/blender/editors/animation/anim_channels_edit.c
@@ -2586,6 +2586,13 @@ static bool rename_anim_channels(bAnimContext *ac, int channel_index)
     return false;
   }
 
+  /* don't allow renaming linked channels */
+  if ((ale->fcurve_owner_id != NULL && ID_IS_LINKED(ale->fcurve_owner_id)) ||
+      (ale->id != NULL && ID_IS_LINKED(ale->id))) {
+    ANIM_animdata_freelist(&anim_data);
+    return false;
+  }
+
   /* check that channel can be renamed */
   acf = ANIM_channel_get_typeinfo(ale);
   if (acf && acf->name_prop) {
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index 2687183166b..b5891a03f0a 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -1344,7 +1344,7 @@ static size_t animfilter_act_group(bAnimContext *ac,
       /* filter selection of channel specially here again,
        * since may be open and not subject to previous test */
       if (ANIMCHANNEL_SELOK(SEL_AGRP(agrp))) {
-        ANIMCHANNEL_NEW_CHANNEL(agrp, ANIMTYPE_GROUP, owner_id, NULL);
+        ANIMCHANNEL_NEW_CHANNEL(agrp, ANIMTYPE_GROUP, owner_id, &act->id);
       }
     }



More information about the Bf-blender-cvs mailing list