Cleanup: get rid of some now unused animdata ID management custom functions.
authorBastien Montagne <montagne29@wanadoo.fr>
Fri, 9 Jun 2017 14:29:20 +0000 (16:29 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Fri, 9 Jun 2017 14:30:59 +0000 (16:30 +0200)
That's the kind of commit that are nice to do - getting rid of
half-working custom pieces of code, now that we have generic tools
to do same thing. ;)

source/blender/blenkernel/BKE_animsys.h
source/blender/blenkernel/intern/anim_sys.c

index a67e903877a6b230ddb17b05ab27a4ae8c57aa8b..420ae4bb12dd1e4937975229b3498a67c5ea4060 100644 (file)
@@ -89,12 +89,6 @@ typedef enum eAnimData_MergeCopy_Modes {
 
 void BKE_animdata_merge_copy(struct ID *dst_id, struct ID *src_id, eAnimData_MergeCopy_Modes action_mode, bool fix_drivers);
 
-/* Make Local */
-void BKE_animdata_make_local(struct AnimData *adt);
-
-/* Re-Assign ID's */
-void BKE_animdata_relink(struct AnimData *adt);
-
 /* ************************************* */
 /* KeyingSets API */
 
index 0b637355ecfa72388c7727bdf20f3a3f57fa65ec..bcc0d1aeacbfdfbad6050de3b4c1f2f030af5025 100644 (file)
@@ -397,73 +397,6 @@ void BKE_animdata_merge_copy(ID *dst_id, ID *src_id, eAnimData_MergeCopy_Modes a
        }
 }
 
-/* Make Local -------------------------------------------- */
-
-static void make_local_strips(ListBase *strips)
-{
-       NlaStrip *strip;
-
-       for (strip = strips->first; strip; strip = strip->next) {
-               if (strip->act) BKE_action_make_local(G.main, strip->act, false);
-               if (strip->remap && strip->remap->target) BKE_action_make_local(G.main, strip->remap->target, false);
-               
-               make_local_strips(&strip->strips);
-       }
-}
-
-/* Use local copy instead of linked copy of various ID-blocks */
-void BKE_animdata_make_local(AnimData *adt)
-{
-       NlaTrack *nlt;
-       
-       /* Actions - Active and Temp */
-       if (adt->action) BKE_action_make_local(G.main, adt->action, false);
-       if (adt->tmpact) BKE_action_make_local(G.main, adt->tmpact, false);
-       /* Remaps */
-       if (adt->remap && adt->remap->target) BKE_action_make_local(G.main, adt->remap->target, false);
-       
-       /* Drivers */
-       /* TODO: need to remap the ID-targets too? */
-       
-       /* NLA Data */
-       for (nlt = adt->nla_tracks.first; nlt; nlt = nlt->next)
-               make_local_strips(&nlt->strips);
-}
-
-
-/* When duplicating data (i.e. objects), drivers referring to the original data will 
- * get updated to point to the duplicated data (if drivers belong to the new data)
- */
-void BKE_animdata_relink(AnimData *adt)
-{
-       /* sanity check */
-       if (adt == NULL)
-               return;
-       
-       /* drivers */
-       if (adt->drivers.first) {
-               FCurve *fcu;
-               
-               /* check each driver against all the base paths to see if any should go */
-               for (fcu = adt->drivers.first; fcu; fcu = fcu->next) {
-                       ChannelDriver *driver = fcu->driver;
-                       DriverVar *dvar;
-                       
-                       /* driver variables */
-                       for (dvar = driver->variables.first; dvar; dvar = dvar->next) {
-                               /* only change the used targets, since the others will need fixing manually anyway */
-                               DRIVER_TARGETS_USED_LOOPER(dvar)
-                               {
-                                       if (dtar->id && dtar->id->newid) {
-                                               dtar->id = dtar->id->newid;
-                                       }
-                               }
-                               DRIVER_TARGETS_LOOPER_END
-                       }
-               }
-       }
-}
-
 /* Sub-ID Regrouping ------------------------------------------- */
 
 /**