forked from bartvdbraak/blender
Cleanup: get rid of some now unused animdata ID management custom functions.
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. ;)
This commit is contained in:
parent
f097e73a2a
commit
e0bc5b533c
@ -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 */
|
||||
|
||||
|
@ -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 ------------------------------------------- */
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user