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-08-16 23:50:00 +0400
committerNicholas Bishop <nicholasbishop@gmail.com>2009-08-16 23:50:00 +0400
commitafa0fa5e29de94b093f4eda2f8105faa59ba5573 (patch)
treec7fa9cf5336e472ac10a95e78a2ac179ee0d97fd /source/blender/editors/sculpt_paint/paint_utils.c
parentd5c990664e421567f45df7c6148cc5786aa2dbd7 (diff)
2.5 Sculpt:
* Added a new Paint type in scene DNA. This is now the base struct for Sculpt. * The Paint type contains a list of Brushes, you can add or remove these much like material and texture slots. * Modified the UI for the new Paint type, now shows the list of brushes active for this mode * Added a New Brush operator, shows in the UI as a list of brush tool types to add * Made the sculpt tool property UI smaller and not expanded, expectation is that we will have a number of preset brushes that will cover the basic sculpt brush types TODO: * Vertex paint, weight paint, texture paint need to be converted to this system next * Add brush presets to the default blend
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_utils.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_utils.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c
index 8120e23f5f2..23bc119afb4 100644
--- a/source/blender/editors/sculpt_paint/paint_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_utils.c
@@ -19,6 +19,8 @@
#include "BKE_context.h"
#include "BKE_DerivedMesh.h"
#include "BKE_global.h"
+#include "BKE_paint.h"
+
#include "BKE_utildefines.h"
#include "BIF_gl.h"
@@ -168,7 +170,7 @@ int imapaint_pick_face(ViewContext *vc, Mesh *me, int *mval, unsigned int *index
/* used for both 3d view and image window */
void paint_sample_color(Scene *scene, ARegion *ar, int x, int y) /* frontbuf */
{
- Brush **br = current_brush_source(scene);
+ Brush *br = paint_brush(paint_get_active(scene));
unsigned int col;
char *cp;
@@ -181,16 +183,16 @@ void paint_sample_color(Scene *scene, ARegion *ar, int x, int y) /* frontbuf */
cp = (char *)&col;
- if(br && *br) {
- (*br)->rgb[0]= cp[0]/255.0f;
- (*br)->rgb[1]= cp[1]/255.0f;
- (*br)->rgb[2]= cp[2]/255.0f;
+ if(br) {
+ br->rgb[0]= cp[0]/255.0f;
+ br->rgb[1]= cp[1]/255.0f;
+ br->rgb[2]= cp[2]/255.0f;
}
}
static int brush_curve_preset_exec(bContext *C, wmOperator *op)
{
- Brush *br = *current_brush_source(CTX_data_scene(C));
+ Brush *br = paint_brush(paint_get_active(CTX_data_scene(C)));
brush_curve_preset(br, RNA_enum_get(op->ptr, "shape"));
return OPERATOR_FINISHED;
@@ -198,9 +200,9 @@ static int brush_curve_preset_exec(bContext *C, wmOperator *op)
static int brush_curve_preset_poll(bContext *C)
{
- Brush **br = current_brush_source(CTX_data_scene(C));
+ Brush *br = paint_brush(paint_get_active(CTX_data_scene(C)));
- return br && *br && (*br)->curve;
+ return br && br->curve;
}
void BRUSH_OT_curve_preset(wmOperatorType *ot)