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-01-07 07:38:30 +0300
committerNicholas Bishop <nicholasbishop@gmail.com>2009-01-07 07:38:30 +0300
commita811d802dd96a2dc93885a1dab46004084386030 (patch)
tree42e09725613129f591b0b97f4d06d931bfd89ab6 /source/blender/blenkernel/intern/brush.c
parent23e3fdb28b1d0c7d7d8992c2835bd492daef528c (diff)
Changes/cleanup for sculptdata and brushes. Summary:
* Removed texfade, wasn't a very useful option (same result can be created with the falloff curve) * Removed CurveMapping from sculptdata, moved instead to Brush * Removed rake field from sculptdata, moved to Brush.flag * Moved Anchored flag from sculpt to Brush, same for direction field * Removed BrushData, replaced usages with the regular Brush type * Removed hardcoded brushes and brush_type from sculptdata, replaced with a pointer to the current Brush * Made sculpt tool type settable in Brush * Changed symmetry and axis lock fields to flags
Diffstat (limited to 'source/blender/blenkernel/intern/brush.c')
-rw-r--r--source/blender/blenkernel/intern/brush.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 021f76fd2f1..f8301943822 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -32,6 +32,7 @@
#include "MEM_guardedalloc.h"
#include "DNA_brush_types.h"
+#include "DNA_color_types.h"
#include "DNA_image_types.h"
#include "DNA_texture_types.h"
#include "DNA_scene_types.h"
@@ -114,6 +115,8 @@ void free_brush(Brush *brush)
MEM_freeN(mtex);
}
}
+
+ curvemapping_free(brush->curve);
}
void make_local_brush(Brush *brush)
@@ -217,6 +220,40 @@ void brush_toggled_fake_user(Brush *brush)
}
}
+
+void sculpt_preset_curve(Brush *b, BrushCurvePreset preset)
+{
+ CurveMap *cm = NULL;
+
+ if(!b->curve)
+ b->curve = curvemapping_add(1, 0, 0, 1, 1);
+
+ cm = b->curve->cm;
+
+ if(cm->curve)
+ MEM_freeN(cm->curve);
+
+ if(preset == BRUSH_PRESET_SHARP) {
+ cm->curve= MEM_callocN(3*sizeof(CurveMapPoint), "curve points");
+ cm->flag &= ~CUMA_EXTEND_EXTRAPOLATE;
+ cm->totpoint= 3;
+ cm->curve[0].x= 0;
+ cm->curve[0].y= 1;
+ cm->curve[1].x= 0.33;
+ cm->curve[1].y= 0.33;
+ cm->curve[2].x= 1;
+ cm->curve[2].y= 0;
+ }
+ else if(preset == BRUSH_PRESET_SMOOTH) {
+ // XXX: todo
+ }
+ else if(preset == BRUSH_PRESET_MAX) {
+ // XXX: todo
+ }
+
+ curvemapping_changed(b->curve, 0);
+}
+
int brush_texture_set_nr(Brush *brush, int nr)
{
ID *idtest, *id=NULL;