[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [56899] tags/blender-2.67a-release/blender : svn merge ^/trunk/blender -c56892 -c56896 -c56898
Campbell Barton
ideasman42 at gmail.com
Sat May 18 15:41:44 CEST 2013
Revision: 56899
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56899
Author: campbellbarton
Date: 2013-05-18 13:41:44 +0000 (Sat, 18 May 2013)
Log Message:
-----------
svn merge ^/trunk/blender -c56892 -c56896 -c56898
Modified Paths:
--------------
tags/blender-2.67a-release/blender/intern/ghost/intern/GHOST_SystemCocoa.mm
tags/blender-2.67a-release/blender/source/blender/compositor/operations/COM_CompositorOperation.cpp
tags/blender-2.67a-release/blender/source/blender/compositor/operations/COM_RenderLayersBaseProg.cpp
tags/blender-2.67a-release/blender/source/blender/editors/sculpt_paint/paint_cursor.c
tags/blender-2.67a-release/blender/source/blender/editors/sculpt_paint/paint_stroke.c
Property Changed:
----------------
tags/blender-2.67a-release/blender/
Property changes on: tags/blender-2.67a-release/blender
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/soc-2011-tomato:42376,42378-42379,42383,42385,42395,42397-42400,42407,42411,42418,42443-42444,42446,42467,42472,42486,42650-42652,42654-42655,42709-42710,42733-42734,42801,43872,44130,44141,44147-44149,44151-44152,44229-44230,45623-45625,46037,48089,48092,48551-48552,48679,48790,48792-48793,49076,49087,49292,49294,49466,49894,50052,50126,52854-52856,54573
/trunk/blender:56529-56532,56534,56537-56539,56572,56577,56581,56601,56605-56606,56620,56639,56643,56647-56648,56650-56651,56653-56654,56661-56663,56668,56670-56674,56676,56678-56680,56682,56688-56689,56698,56700,56707,56711,56735,56745,56747-56749,56755-56756,56759-56760,56763,56766-56767,56773,56778,56783-56785,56790-56791,56793,56800,56806-56807,56809,56815-56816,56820,56823,56826,56828,56830,56833-56834,56836,56839,56851,56857,56863,56865,56868,56871-56873,56879-56882,56885,56890
+ /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/soc-2011-tomato:42376,42378-42379,42383,42385,42395,42397-42400,42407,42411,42418,42443-42444,42446,42467,42472,42486,42650-42652,42654-42655,42709-42710,42733-42734,42801,43872,44130,44141,44147-44149,44151-44152,44229-44230,45623-45625,46037,48089,48092,48551-48552,48679,48790,48792-48793,49076,49087,49292,49294,49466,49894,50052,50126,52854-52856,54573
/trunk/blender:56529-56532,56534,56537-56539,56572,56577,56581,56601,56605-56606,56620,56639,56643,56647-56648,56650-56651,56653-56654,56661-56663,56668,56670-56674,56676,56678-56680,56682,56688-56689,56698,56700,56707,56711,56735,56745,56747-56749,56755-56756,56759-56760,56763,56766-56767,56773,56778,56783-56785,56790-56791,56793,56800,56806-56807,56809,56815-56816,56820,56823,56826,56828,56830,56833-56834,56836,56839,56851,56857,56863,56865,56868,56871-56873,56879-56882,56885,56890,56892,56896,56898
Modified: tags/blender-2.67a-release/blender/intern/ghost/intern/GHOST_SystemCocoa.mm
===================================================================
--- tags/blender-2.67a-release/blender/intern/ghost/intern/GHOST_SystemCocoa.mm 2013-05-18 12:21:01 UTC (rev 56898)
+++ tags/blender-2.67a-release/blender/intern/ghost/intern/GHOST_SystemCocoa.mm 2013-05-18 13:41:44 UTC (rev 56899)
@@ -1421,8 +1421,8 @@
// 2. device is not sending [event pointingDeviceType], due no eraser
if (ct.Active == GHOST_kTabletModeNone)
ct.Active = GHOST_kTabletModeStylus;
-
- ct.Pressure = sqrtf(powf([event pressure], 5 )); // experimental: change sensivity curve
+
+ ct.Pressure = [event pressure];
ct.Xtilt = [event tilt].x;
ct.Ytilt = [event tilt].y;
break;
Modified: tags/blender-2.67a-release/blender/source/blender/compositor/operations/COM_CompositorOperation.cpp
===================================================================
--- tags/blender-2.67a-release/blender/source/blender/compositor/operations/COM_CompositorOperation.cpp 2013-05-18 12:21:01 UTC (rev 56898)
+++ tags/blender-2.67a-release/blender/source/blender/compositor/operations/COM_CompositorOperation.cpp 2013-05-18 13:41:44 UTC (rev 56899)
@@ -145,6 +145,7 @@
bool breaked = false;
int dx = 0, dy = 0;
+#if 0
const RenderData *rd = this->m_rd;
if (rd->mode & R_BORDER && rd->mode & R_CROP) {
@@ -181,6 +182,7 @@
dx = rd->border.xmin * full_width - (full_width - this->getWidth()) / 2.0f;
dy = rd->border.ymin * full_height - (full_height - this->getHeight()) / 2.0f;
}
+#endif
for (y = y1; y < y2 && (!breaked); y++) {
for (x = x1; x < x2 && (!breaked); x++) {
Modified: tags/blender-2.67a-release/blender/source/blender/compositor/operations/COM_RenderLayersBaseProg.cpp
===================================================================
--- tags/blender-2.67a-release/blender/source/blender/compositor/operations/COM_RenderLayersBaseProg.cpp 2013-05-18 12:21:01 UTC (rev 56898)
+++ tags/blender-2.67a-release/blender/source/blender/compositor/operations/COM_RenderLayersBaseProg.cpp 2013-05-18 13:41:44 UTC (rev 56899)
@@ -112,6 +112,7 @@
void RenderLayersBaseProg::executePixel(float output[4], float x, float y, PixelSampler sampler)
{
+#if 0
const RenderData *rd = this->m_rd;
int dx = 0, dy = 0;
@@ -129,6 +130,10 @@
int ix = x - dx;
int iy = y - dy;
+#else
+ int ix = x;
+ int iy = y;
+#endif
if (this->m_inputBuffer == NULL || ix < 0 || iy < 0 || ix >= (int)this->getWidth() || iy >= (int)this->getHeight() ) {
zero_v4(output);
Modified: tags/blender-2.67a-release/blender/source/blender/editors/sculpt_paint/paint_cursor.c
===================================================================
--- tags/blender-2.67a-release/blender/source/blender/editors/sculpt_paint/paint_cursor.c 2013-05-18 12:21:01 UTC (rev 56898)
+++ tags/blender-2.67a-release/blender/source/blender/editors/sculpt_paint/paint_cursor.c 2013-05-18 13:41:44 UTC (rev 56899)
@@ -809,7 +809,7 @@
/* TODO: as sculpt and other paint modes are unified, this
* special mode of drawing will go away */
- if (vc.obact->sculpt) {
+ if (vc.obact && vc.obact->sculpt) {
float location[3];
int pixel_radius, hit;
Modified: tags/blender-2.67a-release/blender/source/blender/editors/sculpt_paint/paint_stroke.c
===================================================================
--- tags/blender-2.67a-release/blender/source/blender/editors/sculpt_paint/paint_stroke.c 2013-05-18 12:21:01 UTC (rev 56898)
+++ tags/blender-2.67a-release/blender/source/blender/editors/sculpt_paint/paint_stroke.c 2013-05-18 13:41:44 UTC (rev 56899)
@@ -63,8 +63,7 @@
typedef struct PaintSample {
float mouse[2];
-
- /* TODO: other input properties, e.g. tablet pressure */
+ float pressure;
} PaintSample;
typedef struct PaintStroke {
@@ -94,9 +93,14 @@
bool brush_init;
float initial_mouse[2];
+ /* cached_pressure stores initial pressure for size pressure influence mainly */
float cached_pressure;
+ /* last pressure will store last pressure value for use in interpolation for space strokes */
+ float last_pressure;
+
float zoom_2d;
+ int pen_flip;
StrokeGetLocation get_location;
StrokeTestStart test_start;
@@ -253,7 +257,7 @@
/* Put the location of the next stroke dot into the stroke RNA and apply it to the mesh */
-static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, const wmEvent *event, const float mouse_in[2])
+static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, const float mouse_in[2], float pressure)
{
Scene *scene = CTX_data_scene(C);
wmWindow *window = CTX_wm_window(C);
@@ -265,12 +269,7 @@
float mouse_out[2];
PointerRNA itemptr;
float location[3];
- float pressure;
- int pen_flip;
- /* see if tablet affects event */
- pressure = event_tablet_data(event, &pen_flip);
-
/* the following code is adapted from texture paint. It may not be needed but leaving here
* just in case for reference (code in texpaint removed as part of refactoring).
* It's strange that only texpaint had these guards. */
@@ -290,6 +289,7 @@
/* copy last position -before- jittering, or space fill code
* will create too many dabs */
copy_v2_v2(stroke->last_mouse_position, mouse_in);
+ stroke->last_pressure = pressure;
paint_brush_update(C, brush, mode, stroke, mouse_in, pressure);
@@ -323,7 +323,7 @@
RNA_float_set_array(&itemptr, "location", location);
RNA_float_set_array(&itemptr, "mouse", mouse_out);
- RNA_boolean_set(&itemptr, "pen_flip", pen_flip);
+ RNA_boolean_set(&itemptr, "pen_flip", stroke->pen_flip);
RNA_float_set(&itemptr, "pressure", pressure);
stroke->update_step(C, stroke, &itemptr);
@@ -338,11 +338,12 @@
}
/* Returns zero if no sculpt changes should be made, non-zero otherwise */
-static int paint_smooth_stroke(PaintStroke *stroke, float output[2],
+static int paint_smooth_stroke(PaintStroke *stroke, float output[2], float *outpressure,
const PaintSample *sample, PaintMode mode)
{
output[0] = sample->mouse[0];
output[1] = sample->mouse[1];
+ *outpressure = sample->pressure;
if (paint_supports_smooth_stroke(stroke->brush, mode)) {
float radius = stroke->brush->smooth_stroke_radius * stroke->zoom_2d;
@@ -357,67 +358,95 @@
output[0] = sample->mouse[0] * v + stroke->last_mouse_position[0] * u;
output[1] = sample->mouse[1] * v + stroke->last_mouse_position[1] * u;
+ *outpressure = sample->pressure * v + stroke->last_pressure * u;
}
return 1;
}
+static float paint_space_stroke_spacing(const Scene *scene, PaintStroke *stroke, float size_pressure, float spacing_pressure)
+{
+ /* brushes can have a minimum size of 1.0 but with pressure it can be smaller then a pixel
+ * causing very high step sizes, hanging blender [#32381] */
+ const float size_clamp = max_ff(1.0f, BKE_brush_size_get(scene, stroke->brush) * size_pressure);
+ float spacing = stroke->brush->spacing;
+
+ /* apply spacing pressure */
+ if (stroke->brush->flag & BRUSH_SPACING_PRESSURE)
+ spacing = max_ff(1.0f, spacing * (1.5f - spacing_pressure));
+
+ /* stroke system is used for 2d paint too, so we need to account for
+ * the fact that brush can be scaled there. */
+ spacing *= stroke->zoom_2d;
+
+ return (size_clamp * spacing / 50.0f);
+}
+
+static float paint_space_stroke_spacing_variable(const Scene *scene, PaintStroke *stroke, float pressure, float dpressure, float length)
+{
+ if (BKE_brush_use_size_pressure(scene, stroke->brush)) {
+ /* use pressure to modify size. set spacing so that at 100%, the circles
+ * are aligned nicely with no overlap. for this the spacing needs to be
+ * the average of the previous and next size. */
+ float s = paint_space_stroke_spacing(scene, stroke, 1.0f, pressure);
+ float q = s*dpressure/(2.0f*length);
+ float pressure_fac = (1.0f + q)/(1.0f - q);
+
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list