[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38947] branches/soc-2011-onion/source/ blender/editors/sculpt_paint: Checking in what I have for BrushLib before I add a file importer for . myp files.

Jason Wilkins Jason.A.Wilkins at gmail.com
Tue Aug 2 19:49:25 CEST 2011


Revision: 38947
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38947
Author:   jwilkins
Date:     2011-08-02 17:49:24 +0000 (Tue, 02 Aug 2011)
Log Message:
-----------
Checking in what I have for BrushLib before I add a file importer for .myp files.  The settings for the BrushLib brush is the 'leaves' brush.

Modified Paths:
--------------
    branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_brushlib.cpp
    branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_brushlib.h
    branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_stroke.c
    branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_stroke.h
    branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_vertex.c
    branches/soc-2011-onion/source/blender/editors/sculpt_paint/sculpt_tools.c

Modified: branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_brushlib.cpp
===================================================================
--- branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_brushlib.cpp	2011-08-02 17:40:27 UTC (rev 38946)
+++ branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_brushlib.cpp	2011-08-02 17:49:24 UTC (rev 38947)
@@ -350,6 +350,7 @@
 {
 	Brush *brush= new Brush();
 
+#if 0
 	brush->set_base_value(BRUSH_OPAQUE, 1.0);
 	brush->set_base_value(BRUSH_OPAQUE_MULTIPLY, 0.0);
 	brush->set_mapping_n(BRUSH_OPAQUE_MULTIPLY, INPUT_PRESSURE, 4);
@@ -405,7 +406,146 @@
 	brush->set_base_value(BRUSH_ELLIPTICAL_DAB_RATIO, 1.0);
 	brush->set_base_value(BRUSH_ELLIPTICAL_DAB_ANGLE, 90.0);
 	brush->set_base_value(BRUSH_DIRECTION_FILTER, 2.0);
+#endif
+#if 0
+	brush->set_base_value(BRUSH_OPAQUE, 1.0);
+	brush->set_base_value(BRUSH_OPAQUE_MULTIPLY, 0.0);
+	brush->set_mapping_n(BRUSH_OPAQUE_MULTIPLY, INPUT_PRESSURE, 2);
+	brush->set_mapping_point(BRUSH_OPAQUE_MULTIPLY, INPUT_PRESSURE, 0, 0.000000, 0.000000);
+	brush->set_mapping_point(BRUSH_OPAQUE_MULTIPLY, INPUT_PRESSURE, 1, 1.000000, 1.000000);
+	brush->set_base_value(BRUSH_OPAQUE_LINEARIZE, 0.0);
+	brush->set_base_value(BRUSH_RADIUS_LOGARITHMIC, 1.66);
+	brush->set_mapping_n(BRUSH_RADIUS_LOGARITHMIC, INPUT_PRESSURE, 2);
+	brush->set_mapping_point(BRUSH_RADIUS_LOGARITHMIC, INPUT_PRESSURE, 0, 0.000000, 0.891354);
+	brush->set_mapping_point(BRUSH_RADIUS_LOGARITHMIC, INPUT_PRESSURE, 1, 1.000000, 1.990000);
+	brush->set_mapping_n(BRUSH_RADIUS_LOGARITHMIC, INPUT_SPEED1, 2);
+	brush->set_mapping_point(BRUSH_RADIUS_LOGARITHMIC, INPUT_SPEED1, 0, 0.000000, -2.610000);
+	brush->set_mapping_point(BRUSH_RADIUS_LOGARITHMIC, INPUT_SPEED1, 1, 4.000000, -2.610000);
+	brush->set_mapping_n(BRUSH_RADIUS_LOGARITHMIC, INPUT_SPEED2, 2);
+	brush->set_mapping_point(BRUSH_RADIUS_LOGARITHMIC, INPUT_SPEED2, 0, 0.000000, -0.202857);
+	brush->set_mapping_point(BRUSH_RADIUS_LOGARITHMIC, INPUT_SPEED2, 1, 4.000000, 1.420000);
+	brush->set_base_value(BRUSH_HARDNESS, 0.1);
+	brush->set_mapping_n(BRUSH_HARDNESS, INPUT_PRESSURE, 2);
+	brush->set_mapping_point(BRUSH_HARDNESS, INPUT_PRESSURE, 0, 0.000000, 0.000000);
+	brush->set_mapping_point(BRUSH_HARDNESS, INPUT_PRESSURE, 1, 1.000000, 0.300000);
+	brush->set_base_value(BRUSH_DABS_PER_BASIC_RADIUS, 0.0);
+	brush->set_base_value(BRUSH_DABS_PER_ACTUAL_RADIUS, 4.0);
+	brush->set_base_value(BRUSH_DABS_PER_SECOND, 0.0);
+	brush->set_base_value(BRUSH_RADIUS_BY_RANDOM, 0.0);
+	brush->set_base_value(BRUSH_SPEED1_SLOWNESS, 0.04);
+	brush->set_base_value(BRUSH_SPEED2_SLOWNESS, 0.8);
+	brush->set_base_value(BRUSH_SPEED1_GAMMA, 4.0);
+	brush->set_base_value(BRUSH_SPEED2_GAMMA, 4.0);
+	brush->set_base_value(BRUSH_OFFSET_BY_RANDOM, 0.0);
+	brush->set_mapping_n(BRUSH_OFFSET_BY_RANDOM, INPUT_PRESSURE, 2);
+	brush->set_mapping_point(BRUSH_OFFSET_BY_RANDOM, INPUT_PRESSURE, 0, 0.000000, 0.000000);
+	brush->set_mapping_point(BRUSH_OFFSET_BY_RANDOM, INPUT_PRESSURE, 1, 1.000000, 0.300000);
+	brush->set_base_value(BRUSH_OFFSET_BY_SPEED, 0.0);
+	brush->set_base_value(BRUSH_OFFSET_BY_SPEED_SLOWNESS, 1.0);
+	brush->set_base_value(BRUSH_SLOW_TRACKING, 1.0);
+	brush->set_base_value(BRUSH_SLOW_TRACKING_PER_DAB, 0.0);
+	brush->set_base_value(BRUSH_TRACKING_NOISE, 6.36);
+	brush->set_base_value(BRUSH_COLOR_H, 0.425539463758);
+	brush->set_base_value(BRUSH_COLOR_S, 0.486544400454);
+	brush->set_base_value(BRUSH_COLOR_V, 0.432428926229);
+	brush->set_base_value(BRUSH_CHANGE_COLOR_H, 0.0);
+	brush->set_base_value(BRUSH_CHANGE_COLOR_L, 0.0);
+	brush->set_base_value(BRUSH_CHANGE_COLOR_HSL_S, 0.0);
+	brush->set_base_value(BRUSH_CHANGE_COLOR_V, 0.0);
+	brush->set_mapping_n(BRUSH_CHANGE_COLOR_V, INPUT_STROKE, 4);
+	brush->set_mapping_point(BRUSH_CHANGE_COLOR_V, INPUT_STROKE, 0, 0.000000, 0.000000);
+	brush->set_mapping_point(BRUSH_CHANGE_COLOR_V, INPUT_STROKE, 1, 0.246914, 1.440000);
+	brush->set_mapping_point(BRUSH_CHANGE_COLOR_V, INPUT_STROKE, 2, 0.753086, -1.440000);
+	brush->set_mapping_point(BRUSH_CHANGE_COLOR_V, INPUT_STROKE, 3, 1.000000, 0.000000);
+	brush->set_base_value(BRUSH_CHANGE_COLOR_HSV_S, 0.0);
+	brush->set_base_value(BRUSH_SMUDGE, 0.0);
+	brush->set_base_value(BRUSH_SMUDGE_LENGTH, 0.5);
+	brush->set_base_value(BRUSH_ERASER, 0.0);
+	brush->set_base_value(BRUSH_STROKE_THRESHOLD, 0.0);
+	brush->set_base_value(BRUSH_STROKE_DURATION_LOGARITHMIC, 1.59);
+	brush->set_mapping_n(BRUSH_STROKE_DURATION_LOGARITHMIC, INPUT_PRESSURE, 2);
+	brush->set_mapping_point(BRUSH_STROKE_DURATION_LOGARITHMIC, INPUT_PRESSURE, 0, 0.000000, -1.753333);
+	brush->set_mapping_point(BRUSH_STROKE_DURATION_LOGARITHMIC, INPUT_PRESSURE, 1, 1.000000, 2.630000);
+	brush->set_base_value(BRUSH_STROKE_HOLDTIME, 0.0);
+	brush->set_base_value(BRUSH_CUSTOM_INPUT, 0.0);
+	brush->set_base_value(BRUSH_CUSTOM_INPUT_SLOWNESS, 0.0);
+#endif
 
+#if 1
+	brush->set_base_value(BRUSH_OPAQUE, 1.0);
+	brush->set_mapping_n(BRUSH_OPAQUE, INPUT_STROKE, 3);
+	brush->set_mapping_point(BRUSH_OPAQUE, INPUT_STROKE, 0, 0.000000, 0.000000);
+	brush->set_mapping_point(BRUSH_OPAQUE, INPUT_STROKE, 1, 0.629630, 0.000000);
+	brush->set_mapping_point(BRUSH_OPAQUE, INPUT_STROKE, 2, 1.000000, -1.000000);
+	brush->set_base_value(BRUSH_OPAQUE_MULTIPLY, 0.0);
+	brush->set_mapping_n(BRUSH_OPAQUE_MULTIPLY, INPUT_PRESSURE, 2);
+	brush->set_mapping_point(BRUSH_OPAQUE_MULTIPLY, INPUT_PRESSURE, 0, 0.000000, 0.000000);
+	brush->set_mapping_point(BRUSH_OPAQUE_MULTIPLY, INPUT_PRESSURE, 1, 1.000000, 1.000000);
+	brush->set_base_value(BRUSH_OPAQUE_LINEARIZE, 0.0);
+	brush->set_base_value(BRUSH_RADIUS_LOGARITHMIC, 1.86);
+	brush->set_mapping_n(BRUSH_RADIUS_LOGARITHMIC, INPUT_STROKE, 5);
+	brush->set_mapping_point(BRUSH_RADIUS_LOGARITHMIC, INPUT_STROKE, 0, 0.000000, 0.000000);
+	brush->set_mapping_point(BRUSH_RADIUS_LOGARITHMIC, INPUT_STROKE, 1, 0.598765, -1.417500);
+	brush->set_mapping_point(BRUSH_RADIUS_LOGARITHMIC, INPUT_STROKE, 2, 0.709877, 0.227813);
+	brush->set_mapping_point(BRUSH_RADIUS_LOGARITHMIC, INPUT_STROKE, 3, 0.898148, -0.227813);
+	brush->set_mapping_point(BRUSH_RADIUS_LOGARITHMIC, INPUT_STROKE, 4, 1.000000, -2.430000);
+	brush->set_base_value(BRUSH_HARDNESS, 0.8);
+	brush->set_base_value(BRUSH_DABS_PER_BASIC_RADIUS, 0.0);
+	brush->set_base_value(BRUSH_DABS_PER_ACTUAL_RADIUS, 2.0);
+	brush->set_base_value(BRUSH_DABS_PER_SECOND, 0.0);
+	brush->set_base_value(BRUSH_RADIUS_BY_RANDOM, 0.0);
+	brush->set_base_value(BRUSH_SPEED1_SLOWNESS, 0.04);
+	brush->set_base_value(BRUSH_SPEED2_SLOWNESS, 0.8);
+	brush->set_base_value(BRUSH_SPEED1_GAMMA, -7.16);
+	brush->set_base_value(BRUSH_SPEED2_GAMMA, 4.0);
+	brush->set_base_value(BRUSH_OFFSET_BY_RANDOM, 0.0);
+	brush->set_base_value(BRUSH_OFFSET_BY_SPEED, 0.0);
+	brush->set_base_value(BRUSH_OFFSET_BY_SPEED_SLOWNESS, 1.0);
+	brush->set_base_value(BRUSH_SLOW_TRACKING, 0.0);
+	brush->set_base_value(BRUSH_SLOW_TRACKING_PER_DAB, 0.0);
+	brush->set_base_value(BRUSH_TRACKING_NOISE, 0.0);
+	brush->set_base_value(BRUSH_COLOR_H, 0.0);
+	brush->set_base_value(BRUSH_COLOR_S, 0.0);
+	brush->set_base_value(BRUSH_COLOR_V, 0.0);
+	brush->set_base_value(BRUSH_CHANGE_COLOR_H, 0.0);
+	brush->set_mapping_n(BRUSH_CHANGE_COLOR_H, INPUT_SPEED1, 2);
+	brush->set_mapping_point(BRUSH_CHANGE_COLOR_H, INPUT_SPEED1, 0, 0.000000, -0.000000);
+	brush->set_mapping_point(BRUSH_CHANGE_COLOR_H, INPUT_SPEED1, 1, 1.000000, -0.120000);
+	brush->set_mapping_n(BRUSH_CHANGE_COLOR_H, INPUT_STROKE, 5);
+	brush->set_mapping_point(BRUSH_CHANGE_COLOR_H, INPUT_STROKE, 0, 0.000000, 0.000000);
+	brush->set_mapping_point(BRUSH_CHANGE_COLOR_H, INPUT_STROKE, 1, 0.080247, -0.150625);
+	brush->set_mapping_point(BRUSH_CHANGE_COLOR_H, INPUT_STROKE, 2, 0.614198, 0.150625);
+	brush->set_mapping_point(BRUSH_CHANGE_COLOR_H, INPUT_STROKE, 3, 0.753086, 0.351458);
+	brush->set_mapping_point(BRUSH_CHANGE_COLOR_H, INPUT_STROKE, 4, 1.000000, 0.476979);
+	brush->set_base_value(BRUSH_CHANGE_COLOR_L, 0.0);
+	brush->set_base_value(BRUSH_CHANGE_COLOR_HSL_S, 0.0);
+	brush->set_base_value(BRUSH_CHANGE_COLOR_V, 0.195);
+	brush->set_mapping_n(BRUSH_CHANGE_COLOR_V, INPUT_PRESSURE, 2);
+	brush->set_mapping_point(BRUSH_CHANGE_COLOR_V, INPUT_PRESSURE, 0, 0.000000, 0.000000);
+	brush->set_mapping_point(BRUSH_CHANGE_COLOR_V, INPUT_PRESSURE, 1, 1.000000, -0.570000);
+	brush->set_mapping_n(BRUSH_CHANGE_COLOR_V, INPUT_RANDOM, 2);
+	brush->set_mapping_point(BRUSH_CHANGE_COLOR_V, INPUT_RANDOM, 0, 0.000000, 0.000000);
+	brush->set_mapping_point(BRUSH_CHANGE_COLOR_V, INPUT_RANDOM, 1, 1.000000, 0.355000);
+	brush->set_mapping_n(BRUSH_CHANGE_COLOR_V, INPUT_STROKE, 5);
+	brush->set_mapping_point(BRUSH_CHANGE_COLOR_V, INPUT_STROKE, 0, 0.000000, 0.000000);
+	brush->set_mapping_point(BRUSH_CHANGE_COLOR_V, INPUT_STROKE, 1, 0.080247, -0.150625);
+	brush->set_mapping_point(BRUSH_CHANGE_COLOR_V, INPUT_STROKE, 2, 0.614198, 0.150625);
+	brush->set_mapping_point(BRUSH_CHANGE_COLOR_V, INPUT_STROKE, 3, 0.753086, 0.351458);
+	brush->set_mapping_point(BRUSH_CHANGE_COLOR_V, INPUT_STROKE, 4, 1.000000, 0.476979);
+	brush->set_base_value(BRUSH_CHANGE_COLOR_HSV_S, 0.0);
+	brush->set_mapping_n(BRUSH_CHANGE_COLOR_HSV_S, INPUT_STROKE, 2);
+	brush->set_mapping_point(BRUSH_CHANGE_COLOR_HSV_S, INPUT_STROKE, 0, 0.000000, 0.000000);
+	brush->set_mapping_point(BRUSH_CHANGE_COLOR_HSV_S, INPUT_STROKE, 1, 1.000000, 1.690000);
+	brush->set_base_value(BRUSH_SMUDGE, 0.0);
+	brush->set_base_value(BRUSH_SMUDGE_LENGTH, 0.5);
+	brush->set_base_value(BRUSH_ERASER, 0.0);
+	brush->set_base_value(BRUSH_STROKE_THRESHOLD, 0.0);
+	brush->set_base_value(BRUSH_STROKE_DURATION_LOGARITHMIC, 2.76);
+	brush->set_base_value(BRUSH_STROKE_HOLDTIME, 10.0);
+	brush->set_base_value(BRUSH_CUSTOM_INPUT, 0.0);
+	brush->set_base_value(BRUSH_CUSTOM_INPUT_SLOWNESS, 0.0);
+#endif
+
 	brush->set_state(STATE_X, x);
 	brush->set_state(STATE_Y, y);
 
@@ -420,6 +560,23 @@
 	brush->set_base_value(BRUSH_RADIUS_LOGARITHMIC, logf(radius2d));
 }
 
+void paint_brushlib_set_color(
+	struct BrushLibBrush *brushlib_brush,
+	const float rgb[3])
+{
+	Brush* brush= reinterpret_cast<Brush *>(brushlib_brush);
+	float hsv[3];
+
+	for (int i= 0; i < 3; i++)
+		hsv[i]= rgb[i];
+
+	rgb_to_hsv_float(&hsv[0], &hsv[1], &hsv[2]);
+
+	brush->set_base_value(BRUSH_COLOR_H, hsv[0]);
+	brush->set_base_value(BRUSH_COLOR_S, hsv[1]);
+	brush->set_base_value(BRUSH_COLOR_V, hsv[2]);
+}
+

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list