static void free_buffers(MovieClip *clip) { if (clip->cache) { IMB_moviecache_free(clip->cache->moviecache); if (clip->cache->postprocessed.ibuf) IMB_freeImBuf(clip->cache->postprocessed.ibuf); if (clip->cache->stabilized.ibuf) IMB_freeImBuf(clip->cache->stabilized.ibuf); MEM_freeN(clip->cache); clip->cache = NULL; } if (clip->anim) { IMB_free_anim(clip->anim); clip->anim = NULL; } BKE_free_animdata((ID *) clip); }
static void rna_ColorManagedColorspaceSettings_reload_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { ID *id = ptr->id.data; if (GS(id->name) == ID_IM) { Image *ima = (Image *) id; DAG_id_tag_update(&ima->id, 0); BKE_image_signal(ima, NULL, IMA_SIGNAL_COLORMANAGE); WM_main_add_notifier(NC_IMAGE | ND_DISPLAY, &ima->id); WM_main_add_notifier(NC_IMAGE | NA_EDITED, &ima->id); } else if (GS(id->name) == ID_MC) { MovieClip *clip = (MovieClip *) id; BKE_movieclip_reload(clip); /* all sequencers for now, we don't know which scenes are using this clip as a strip */ BKE_sequencer_cache_cleanup(); BKE_sequencer_preprocessed_cache_cleanup(); WM_main_add_notifier(NC_MOVIECLIP | ND_DISPLAY, &clip->id); WM_main_add_notifier(NC_MOVIECLIP | NA_EDITED, &clip->id); } else if (GS(id->name) == ID_SCE) { Scene *scene = (Scene *) id; if (scene->ed) { ColorManagedColorspaceSettings *colorspace_settings = (ColorManagedColorspaceSettings *) ptr->data; Sequence *seq; bool seq_found = false; if (&scene->sequencer_colorspace_settings != colorspace_settings) { SEQ_BEGIN(scene->ed, seq); { if (seq->strip && &seq->strip->colorspace_settings == colorspace_settings) { seq_found = true; break; } } SEQ_END; } if (seq_found) { BKE_sequence_free_anim(seq); if (seq->strip->proxy && seq->strip->proxy->anim) { IMB_free_anim(seq->strip->proxy->anim); seq->strip->proxy->anim = NULL; } BKE_sequence_invalidate_cache(scene, seq); BKE_sequencer_preprocessed_cache_cleanup_sequence(seq); } else { SEQ_BEGIN(scene->ed, seq); { BKE_sequence_free_anim(seq); } SEQ_END; BKE_sequencer_cache_cleanup(); BKE_sequencer_preprocessed_cache_cleanup(); } WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, NULL); } } }
void IMB_close_anim(struct anim *anim) { if (anim == NULL) return; IMB_free_anim(anim); }