Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Bishop <nicholasbishop@gmail.com>2009-03-11 03:43:08 +0300
committerNicholas Bishop <nicholasbishop@gmail.com>2009-03-11 03:43:08 +0300
commit33509e851077fa108bfb1e8934098d67e6b1b16f (patch)
tree1c464e1fcb10b4549eb90cb4becd77c3531d269b /source/blender/blenkernel
parent47311475ba16b59b7e5751cc63d5800bdd971586 (diff)
Changed vertexpaint and weightpaint to use the standard Brush struct, so they too work with the brush panel.
Note: these modes are only using color/alpha/size from Brush, so there's more integration work todo yet.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_brush.h2
-rw-r--r--source/blender/blenkernel/intern/brush.c13
2 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_brush.h b/source/blender/blenkernel/BKE_brush.h
index 4146d313d41..9eb0b15aed4 100644
--- a/source/blender/blenkernel/BKE_brush.h
+++ b/source/blender/blenkernel/BKE_brush.h
@@ -34,6 +34,7 @@
struct ID;
struct Brush;
struct ImBuf;
+struct Scene;
struct wmOperator;
/* datablock functions */
@@ -43,6 +44,7 @@ void make_local_brush(struct Brush *brush);
void free_brush(struct Brush *brush);
/* brush library operations used by different paint panels */
+struct Brush **current_brush_source(struct Scene *sce);
int brush_set_nr(struct Brush **current_brush, int nr);
int brush_delete(struct Brush **current_brush);
void brush_check_exists(struct Brush **brush);
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 398993be1a4..30a35cbe91c 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -185,6 +185,19 @@ void make_local_brush(Brush *brush)
/* Library Operations */
+Brush **current_brush_source(Scene *sce)
+{
+ if(G.f & G_SCULPTMODE)
+ return &sce->toolsettings->sculpt->brush;
+ else if(G.f & G_VERTEXPAINT)
+ return &sce->toolsettings->vpaint->brush;
+ else if(G.f & G_WEIGHTPAINT)
+ return &sce->toolsettings->wpaint->brush;
+ else if(G.f & G_TEXTUREPAINT)
+ return &sce->toolsettings->imapaint.brush;
+ return NULL;
+}
+
int brush_set_nr(Brush **current_brush, int nr)
{
ID *idtest, *id;