[Bf-blender-cvs] [83cb34ccd15] master: Cleanup: unused functions

Campbell Barton noreply at git.blender.org
Sat Jun 9 18:48:01 CEST 2018


Commit: 83cb34ccd15a3f43ebff7e62085a360e7a5c383e
Author: Campbell Barton
Date:   Sat Jun 9 18:47:39 2018 +0200
Branches: master
https://developer.blender.org/rB83cb34ccd15a3f43ebff7e62085a360e7a5c383e

Cleanup: unused functions

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

M	source/blender/blenkernel/BKE_brush.h
M	source/blender/blenkernel/intern/brush.c

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

diff --git a/source/blender/blenkernel/BKE_brush.h b/source/blender/blenkernel/BKE_brush.h
index f2601f2ca32..9f326d97937 100644
--- a/source/blender/blenkernel/BKE_brush.h
+++ b/source/blender/blenkernel/BKE_brush.h
@@ -57,12 +57,6 @@ void BKE_brush_sculpt_reset(struct Brush *brush);
 /* image icon function */
 struct ImBuf *get_brush_icon(struct Brush *brush);
 
-/* brush library operations used by different paint panels */
-int BKE_brush_texture_set_nr(struct Brush *brush, int nr);
-int BKE_brush_texture_delete(struct Brush *brush);
-int BKE_brush_clone_image_set_nr(struct Brush *brush, int nr);
-int BKE_brush_clone_image_delete(struct Brush *brush);
-
 /* jitter */
 void BKE_brush_jitter_pos(
         const struct Scene *scene, struct Brush *brush,
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index d82c1ca56fe..7f50e521e63 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -457,68 +457,6 @@ void BKE_brush_curve_preset(Brush *b, eCurveMappingPreset preset)
 	curvemapping_changed(b->curve, false);
 }
 
-/* XXX Unused function. */
-int BKE_brush_texture_set_nr(Brush *brush, int nr)
-{
-	ID *idtest, *id = NULL;
-
-	id = (ID *)brush->mtex.tex;
-
-	idtest = (ID *)BLI_findlink(&G.main->tex, nr - 1);
-	if (idtest == NULL) { /* new tex */
-		if (id) idtest = (ID *)BKE_texture_copy(G.main, (Tex *)id);
-		else idtest = (ID *)BKE_texture_add(G.main, "Tex");
-		id_us_min(idtest);
-	}
-	if (idtest != id) {
-		BKE_brush_texture_delete(brush);
-
-		brush->mtex.tex = (Tex *)idtest;
-		id_us_plus(idtest);
-
-		return 1;
-	}
-
-	return 0;
-}
-
-int BKE_brush_texture_delete(Brush *brush)
-{
-	if (brush->mtex.tex)
-		id_us_min(&brush->mtex.tex->id);
-
-	return 1;
-}
-
-int BKE_brush_clone_image_set_nr(Brush *brush, int nr)
-{
-	if (brush && nr > 0) {
-		Image *ima = (Image *)BLI_findlink(&G.main->image, nr - 1);
-
-		if (ima) {
-			BKE_brush_clone_image_delete(brush);
-			brush->clone.image = ima;
-			id_us_plus(&ima->id);
-			brush->clone.offset[0] = brush->clone.offset[1] = 0.0f;
-
-			return 1;
-		}
-	}
-
-	return 0;
-}
-
-int BKE_brush_clone_image_delete(Brush *brush)
-{
-	if (brush && brush->clone.image) {
-		id_us_min(&brush->clone.image->id);
-		brush->clone.image = NULL;
-		return 1;
-	}
-
-	return 0;
-}
-
 /* Generic texture sampler for 3D painting systems. point has to be either in
  * region space mouse coordinates, or 3d world coordinates for 3D mapping.
  *



More information about the Bf-blender-cvs mailing list