diff options
Diffstat (limited to 'source/blender/blenkernel/intern/mask.c')
-rw-r--r-- | source/blender/blenkernel/intern/mask.c | 59 |
1 files changed, 3 insertions, 56 deletions
diff --git a/source/blender/blenkernel/intern/mask.c b/source/blender/blenkernel/intern/mask.c index 930a3c487ec..94e53755ac4 100644 --- a/source/blender/blenkernel/intern/mask.c +++ b/source/blender/blenkernel/intern/mask.c @@ -1010,63 +1010,10 @@ void BKE_mask_layer_free_list(ListBase *masklayers) } } -/** free for temp copy, but don't manage unlinking from other pointers */ -void BKE_mask_free_nolib(Mask *mask) +/** Free (or release) any data used by this mask (does not free the mask itself). */ +void BKE_mask_free(Mask *mask) { - BKE_mask_layer_free_list(&mask->masklayers); -} - -void BKE_mask_free(Main *bmain, Mask *mask) -{ - bScreen *scr; - ScrArea *area; - SpaceLink *sl; - Scene *scene; - - for (scr = bmain->screen.first; scr; scr = scr->id.next) { - for (area = scr->areabase.first; area; area = area->next) { - for (sl = area->spacedata.first; sl; sl = sl->next) { - switch (sl->spacetype) { - case SPACE_CLIP: - { - SpaceClip *sc = (SpaceClip *)sl; - - if (sc->mask_info.mask == mask) { - sc->mask_info.mask = NULL; - } - break; - } - case SPACE_IMAGE: - { - SpaceImage *sima = (SpaceImage *)sl; - - if (sima->mask_info.mask == mask) { - sima->mask_info.mask = NULL; - } - break; - } - } - } - } - } - - for (scene = bmain->scene.first; scene; scene = scene->id.next) { - if (scene->ed) { - Sequence *seq; - - SEQ_BEGIN (scene->ed, seq) - { - if (seq->mask == mask) { - seq->mask = NULL; - } - } - SEQ_END - } - } - - FOREACH_NODETREE(bmain, ntree, id) { - BKE_node_tree_unlink_id((ID *)mask, ntree); - } FOREACH_NODETREE_END + BKE_animdata_free((ID *)mask, false); /* free mask data */ BKE_mask_layer_free_list(&mask->masklayers); |