[Bf-blender-cvs] [aff81c6] master: Cleanup: Get rid of remaining 'BKE_<id>_unlink()' functions, no more used anyway.

Bastien Montagne noreply at git.blender.org
Sat Jun 25 18:36:52 CEST 2016


Commit: aff81c6393a56727b4ed5c37f1055b4c2a525677
Author: Bastien Montagne
Date:   Sat Jun 25 18:35:54 2016 +0200
Branches: master
https://developer.blender.org/rBaff81c6393a56727b4ed5c37f1055b4c2a525677

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

===================================================================

M	source/blender/blenkernel/BKE_movieclip.h
M	source/blender/blenkernel/intern/brush.c
M	source/blender/blenkernel/intern/mesh.c
M	source/blender/blenkernel/intern/movieclip.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_movieclip.h b/source/blender/blenkernel/BKE_movieclip.h
index afca326..3d963ac 100644
--- a/source/blender/blenkernel/BKE_movieclip.h
+++ b/source/blender/blenkernel/BKE_movieclip.h
@@ -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);
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index a3e006a..44cacff 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -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);
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index 4e47dfc..f82e5cf 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -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)
 {
diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c
index 5f66773..f99457a 100644
--- a/source/blender/blenkernel/intern/movieclip.c
+++ b/source/blender/blenkernel/intern/movieclip.c
@@ -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;




More information about the Bf-blender-cvs mailing list