/** Free (or release) any data used by this linestyle (does not free the linestyle itself). */ void BKE_linestyle_free(FreestyleLineStyle *linestyle) { LineStyleModifier *m; int a; BKE_animdata_free(&linestyle->id, false); for (a = 0; a < MAX_MTEX; a++) { MEM_SAFE_FREE(linestyle->mtex[a]); } /* is no lib link block, but linestyle extension */ if (linestyle->nodetree) { ntreeFreeTree(linestyle->nodetree); MEM_freeN(linestyle->nodetree); linestyle->nodetree = NULL; } while ((m = (LineStyleModifier *)linestyle->color_modifiers.first)) BKE_linestyle_color_modifier_remove(linestyle, m); while ((m = (LineStyleModifier *)linestyle->alpha_modifiers.first)) BKE_linestyle_alpha_modifier_remove(linestyle, m); while ((m = (LineStyleModifier *)linestyle->thickness_modifiers.first)) BKE_linestyle_thickness_modifier_remove(linestyle, m); while ((m = (LineStyleModifier *)linestyle->geometry_modifiers.first)) BKE_linestyle_geometry_modifier_remove(linestyle, m); }
/** Free (or release) any data used by this lattice (does not free the lattice itself). */ void BKE_lattice_free(Lattice *lt) { BKE_animdata_free(<->id, false); BKE_lattice_batch_cache_free(lt); MEM_SAFE_FREE(lt->def); if (lt->dvert) { BKE_defvert_array_free(lt->dvert, lt->pntsu * lt->pntsv * lt->pntsw); lt->dvert = NULL; } if (lt->editlatt) { Lattice *editlt = lt->editlatt->latt; if (editlt->def) { MEM_freeN(editlt->def); } if (editlt->dvert) { BKE_defvert_array_free(editlt->dvert, lt->pntsu * lt->pntsv * lt->pntsw); } MEM_freeN(editlt); MEM_freeN(lt->editlatt); lt->editlatt = NULL; } }
void BKE_world_free_ex(World *wrld, bool do_id_user) { MTex *mtex; int a; for (a = 0; a < MAX_MTEX; a++) { mtex = wrld->mtex[a]; if (do_id_user && mtex && mtex->tex) mtex->tex->id.us--; if (mtex) MEM_freeN(mtex); } BKE_previewimg_free(&wrld->preview); BKE_animdata_free((ID *)wrld); /* is no lib link block, but world extension */ if (wrld->nodetree) { ntreeFreeTree_ex(wrld->nodetree, do_id_user); MEM_freeN(wrld->nodetree); } if (wrld->gpumaterial.first) GPU_material_free(&wrld->gpumaterial); BKE_icon_delete((struct ID *)wrld); wrld->id.icon_id = 0; }
void BKE_speaker_free(Speaker *spk) { if (spk->sound) spk->sound->id.us--; BKE_animdata_free((ID *)spk); }
void BKE_lamp_free(Lamp *la) { MTex *mtex; int a; for (a = 0; a < MAX_MTEX; a++) { mtex = la->mtex[a]; if (mtex && mtex->tex) mtex->tex->id.us--; if (mtex) MEM_freeN(mtex); } BKE_animdata_free((ID *)la); curvemapping_free(la->curfalloff); /* is no lib link block, but lamp extension */ if (la->nodetree) { ntreeFreeTree(la->nodetree); MEM_freeN(la->nodetree); } BKE_previewimg_free(&la->preview); BKE_icon_id_delete(&la->id); la->id.icon_id = 0; }
/** Free (or release) any data used by this texture (does not free the texure itself). */ void BKE_texture_free(Tex *tex) { BKE_animdata_free((ID *)tex, false); /* is no lib link block, but texture extension */ if (tex->nodetree) { ntreeFreeTree(tex->nodetree); MEM_freeN(tex->nodetree); tex->nodetree = NULL; } MEM_SAFE_FREE(tex->coba); if (tex->env) { BKE_texture_envmap_free(tex->env); tex->env = NULL; } if (tex->pd) { BKE_texture_pointdensity_free(tex->pd); tex->pd = NULL; } if (tex->vd) { BKE_texture_voxeldata_free(tex->vd); tex->vd = NULL; } if (tex->ot) { BKE_texture_ocean_free(tex->ot); tex->ot = NULL; } BKE_icon_id_delete((ID *)tex); BKE_previewimg_free(&tex->preview); }
/* Free all of GPencil datablock's related data, but not the block itself */ void BKE_gpencil_free(bGPdata *gpd) { /* free layers */ free_gpencil_layers(&gpd->layers); /* free animation data */ if (gpd->adt) { BKE_animdata_free(&gpd->id); gpd->adt = NULL; } }
/* do not free mball itself */ void BKE_mball_free(MetaBall *mb) { BKE_mball_unlink(mb); if (mb->adt) { BKE_animdata_free((ID *)mb); mb->adt = NULL; } if (mb->mat) MEM_freeN(mb->mat); BLI_freelistN(&mb->elems); if (mb->disp.first) BKE_displist_free(&mb->disp); }
/** Free (or release) any data used by this cachefile (does not free the cachefile itself). */ void BKE_cachefile_free(CacheFile *cache_file) { BKE_animdata_free((ID *)cache_file, false); #ifdef WITH_ALEMBIC ABC_free_handle(cache_file->handle); #endif if (cache_file->handle_mutex) { BLI_mutex_free(cache_file->handle_mutex); } BLI_freelistN(&cache_file->object_paths); }
void BKE_light_free(Light *la) { BKE_animdata_free((ID *)la, false); curvemapping_free(la->curfalloff); /* is no lib link block, but light extension */ if (la->nodetree) { ntreeFreeNestedTree(la->nodetree); MEM_freeN(la->nodetree); la->nodetree = NULL; } BKE_previewimg_free(&la->preview); BKE_icon_id_delete(&la->id); la->id.icon_id = 0; }
void BKE_lattice_free(Lattice *lt) { if (lt->def) MEM_freeN(lt->def); if (lt->dvert) BKE_defvert_array_free(lt->dvert, lt->pntsu * lt->pntsv * lt->pntsw); if (lt->editlatt) { Lattice *editlt = lt->editlatt->latt; if (editlt->def) MEM_freeN(editlt->def); if (editlt->dvert) BKE_defvert_array_free(editlt->dvert, lt->pntsu * lt->pntsv * lt->pntsw); MEM_freeN(editlt); MEM_freeN(lt->editlatt); } /* free animation data */ if (lt->adt) { BKE_animdata_free(<->id); lt->adt = NULL; } }
static void rna_ID_animation_data_free(ID *id, Main *bmain) { BKE_animdata_free(id); DAG_relations_tag_update(bmain); }
void BKE_speaker_free(Speaker *spk) { BKE_animdata_free((ID *)spk, false); }
static void clear_animdata_cb(int UNUSED(event), TreeElement *UNUSED(te), TreeStoreElem *tselem, void *UNUSED(arg)) { BKE_animdata_free(tselem->id); }
void BKE_camera_free(Camera *ca) { BKE_animdata_free((ID *)ca); }