Fix more missing ID remapping in animation editor callbacks
authorJoshua Leung <aligorith@gmail.com>
Thu, 15 Feb 2018 02:45:08 +0000 (15:45 +1300)
committerJoshua Leung <aligorith@gmail.com>
Wed, 21 Feb 2018 12:46:05 +0000 (01:46 +1300)
Applying the same fixes as introduced in 98d797b67c07e85889768bf8ecde292e9e6f70e9
this time, for the Graph and NLA editors

source/blender/editors/space_graph/space_graph.c
source/blender/editors/space_nla/space_nla.c

index f12db3108565fec5c96e7bac7441e4d53f8c2ee3..df6de83336d9fcf7ea7195c3bbe00306bdbc9e9c 100644 (file)
@@ -683,13 +683,12 @@ static void graph_id_remap(ScrArea *UNUSED(sa), SpaceLink *slink, ID *old_id, ID
 {
        SpaceIpo *sgraph = (SpaceIpo *)slink;
 
-       if (!ELEM(GS(old_id->name), ID_GR)) {
-               return;
-       }
-
        if (sgraph->ads && (ID *)sgraph->ads->filter_grp == old_id) {
                sgraph->ads->filter_grp = (Group *)new_id;
        }
+       if ((ID *)sgraph->ads->source == old_id) {
+               sgraph->ads->source = new_id;
+       }
 }
 
 /* only called once, from space/spacetypes.c */
index 3b5604087b9f2bd29617799277682313a8f6a5e5..020b3a41f4d2006d2afe29717c59452c2fb0d551 100644 (file)
@@ -506,13 +506,12 @@ static void nla_id_remap(ScrArea *UNUSED(sa), SpaceLink *slink, ID *old_id, ID *
 {
        SpaceNla *snla = (SpaceNla *)slink;
 
-       if (!ELEM(GS(old_id->name), ID_GR)) {
-               return;
-       }
-
        if ((ID *)snla->ads->filter_grp == old_id) {
                snla->ads->filter_grp = (Group *)new_id;
        }
+       if ((ID *)snla->ads->source == old_id) {
+               snla->ads->source = new_id;
+       }
 }
 
 /* only called once, from space/spacetypes.c */