static void undocurve_free_data(UndoCurve *uc) { BKE_nurbList_free(&uc->nubase); BKE_curve_editNurb_keyIndex_free(&uc->undoIndex); free_fcurves(&uc->fcurves); free_fcurves(&uc->drivers); }
static void cleardrivers_animdata_cb(int UNUSED(event), TreeElement *UNUSED(te), TreeStoreElem *tselem) { IdAdtTemplate *iat = (IdAdtTemplate *)tselem->id; /* just free drivers - stored as a list of F-Curves */ free_fcurves(&iat->adt->drivers); }
static void undocurve_to_editcurve(Main *bmain, UndoCurve *ucu, Curve *cu, short *r_shapenr) { ListBase *undobase = &ucu->nubase; ListBase *editbase = BKE_curve_editNurbs_get(cu); Nurb *nu, *newnu; EditNurb *editnurb = cu->editnurb; AnimData *ad = BKE_animdata_from_id(&cu->id); BKE_nurbList_free(editbase); if (ucu->undoIndex) { BKE_curve_editNurb_keyIndex_free(&editnurb->keyindex); editnurb->keyindex = ED_curve_keyindex_hash_duplicate(ucu->undoIndex); } if (ad) { if (ad->action) { free_fcurves(&ad->action->curves); copy_fcurves(&ad->action->curves, &ucu->fcurves); } free_fcurves(&ad->drivers); copy_fcurves(&ad->drivers, &ucu->drivers); } /* copy */ for (nu = undobase->first; nu; nu = nu->next) { newnu = BKE_nurb_duplicate(nu); if (editnurb->keyindex) { ED_curve_keyindex_update_nurb(editnurb, nu, newnu); } BLI_addtail(editbase, newnu); } cu->actvert = ucu->actvert; cu->actnu = ucu->actnu; cu->flag = ucu->flag; *r_shapenr = ucu->obedit.shapenr; ED_curve_updateAnimPaths(bmain, cu); }
/** Free (or release) any data used by this action (does not free the action itself). */ void BKE_action_free(bAction *act) { /* No animdata here. */ /* Free F-Curves */ free_fcurves(&act->curves); /* Free groups */ BLI_freelistN(&act->groups); /* Free pose-references (aka local markers) */ BLI_freelistN(&act->markers); }
void free_action (bAction *act) { /* sanity check */ if (act == NULL) return; /* Free F-Curves */ free_fcurves(&act->curves); /* Free groups */ if (act->groups.first) BLI_freelistN(&act->groups); /* Free pose-references (aka local markers) */ if (act->markers.first) BLI_freelistN(&act->markers); }