Cleanup: Get rid of remaining 'BKE_<id>_unlink()' functions, no more used anyway.

This commit is contained in:
Bastien Montagne 2016-06-25 18:35:54 +02:00
parent 1b6cf7a99b
commit aff81c6393
4 changed files with 0 additions and 89 deletions

@ -40,7 +40,6 @@ struct MovieClipUser;
struct MovieDistortion;
void BKE_movieclip_free(struct MovieClip *clip);
void BKE_movieclip_unlink(struct Main *bmain, struct MovieClip *clip);
struct MovieClip *BKE_movieclip_file_add(struct Main *bmain, const char *name);
struct MovieClip *BKE_movieclip_file_add_exists_ex(struct Main *bmain, const char *name, bool *r_exists);

@ -216,21 +216,6 @@ void BKE_brush_free(Brush *brush)
BKE_previewimg_free(&(brush->preview));
}
/**
* \note Currently users don't remove brushes from the UI (as is done for scene, text... etc)
* This is only used by RNA, which can remove brushes.
*/
void BKE_brush_unlink(Main *bmain, Brush *brush)
{
Brush *brush_iter;
for (brush_iter = bmain->brush.first; brush_iter; brush_iter = brush_iter->id.next) {
if (brush_iter->toggle_brush == brush) {
brush_iter->toggle_brush = NULL;
}
}
}
static void extern_local_brush(Brush *brush)
{
id_lib_extern((ID *)brush->mtex.tex);

@ -427,12 +427,6 @@ bool BKE_mesh_has_custom_loop_normals(Mesh *me)
}
}
/* Note: unlinking is called when me->id.us is 0, question remains how
* much unlinking of Library data in Mesh should be done... probably
* we need a more generic method, like the expand() functions in
* readfile.c */
/** Free (or release) any data used by this mesh (does not free the mesh itself). */
void BKE_mesh_free(Mesh *me)
{

@ -1491,73 +1491,6 @@ void BKE_movieclip_free(MovieClip *clip)
BKE_tracking_free(&clip->tracking);
}
void BKE_movieclip_unlink(Main *bmain, MovieClip *clip)
{
bScreen *scr;
ScrArea *area;
SpaceLink *sl;
Scene *sce;
Object *ob;
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) {
if (sl->spacetype == SPACE_CLIP) {
SpaceClip *sc = (SpaceClip *) sl;
if (sc->clip == clip)
sc->clip = NULL;
}
else if (sl->spacetype == SPACE_VIEW3D) {
View3D *v3d = (View3D *) sl;
BGpic *bgpic;
for (bgpic = v3d->bgpicbase.first; bgpic; bgpic = bgpic->next) {
if (bgpic->clip == clip)
bgpic->clip = NULL;
}
}
}
}
}
for (sce = bmain->scene.first; sce; sce = sce->id.next) {
if (sce->clip == clip)
sce->clip = NULL;
}
for (ob = bmain->object.first; ob; ob = ob->id.next) {
bConstraint *con;
for (con = ob->constraints.first; con; con = con->next) {
if (con->type == CONSTRAINT_TYPE_FOLLOWTRACK) {
bFollowTrackConstraint *data = (bFollowTrackConstraint *) con->data;
if (data->clip == clip)
data->clip = NULL;
}
else if (con->type == CONSTRAINT_TYPE_CAMERASOLVER) {
bCameraSolverConstraint *data = (bCameraSolverConstraint *) con->data;
if (data->clip == clip)
data->clip = NULL;
}
else if (con->type == CONSTRAINT_TYPE_OBJECTSOLVER) {
bObjectSolverConstraint *data = (bObjectSolverConstraint *) con->data;
if (data->clip == clip)
data->clip = NULL;
}
}
}
FOREACH_NODETREE(bmain, ntree, id) {
BKE_node_tree_unlink_id((ID *)clip, ntree);
} FOREACH_NODETREE_END
clip->id.us = 0;
}
float BKE_movieclip_remap_scene_to_clip_frame(MovieClip *clip, float framenr)
{
return framenr - (float) clip->start_frame + 1.0f;