[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55997] trunk/blender/source/blender: Fixes:
Antony Riakiotakis
kalast at gmail.com
Fri Apr 12 23:58:19 CEST 2013
Revision: 55997
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55997
Author: psy-fi
Date: 2013-04-12 21:58:18 +0000 (Fri, 12 Apr 2013)
Log Message:
-----------
Fixes:
* Overlay invalidation did not happen when changing brush, .either
through UI or through shortcuts
* Add initiliazation of curves before threaded overlay texture
evaluation or we may get memory leaks due to race conditions.
Modified Paths:
--------------
trunk/blender/source/blender/editors/sculpt_paint/paint_cursor.c
trunk/blender/source/blender/editors/sculpt_paint/paint_ops.c
trunk/blender/source/blender/makesrna/intern/rna_sculpt_paint.c
Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_cursor.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_cursor.c 2013-04-12 17:59:38 UTC (rev 55996)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_cursor.c 2013-04-12 21:58:18 UTC (rev 55997)
@@ -45,6 +45,7 @@
#include "BKE_context.h"
#include "BKE_image.h"
#include "BKE_paint.h"
+#include "BKE_colortools.h"
#include "WM_api.h"
@@ -120,10 +121,8 @@
refresh =
!overlay_texture ||
- (br->mtex.tex &&
- (invalid & PAINT_INVALID_OVERLAY_TEXTURE_PRIMARY)) ||
- (br->curve &&
- (invalid & PAINT_INVALID_OVERLAY_CURVE)) ||
+ (invalid & PAINT_INVALID_OVERLAY_TEXTURE_PRIMARY) ||
+ (invalid & PAINT_INVALID_OVERLAY_CURVE) ||
old_zoom != zoom ||
old_col != col ||
!same_tex_snap(&snap, br, vc);
@@ -175,6 +174,8 @@
if (br->mtex.tex)
pool = BKE_image_pool_new();
+ curvemapping_initialize(br->curve);
+
#pragma omp parallel for schedule(static)
for (j = 0; j < size; j++) {
int i;
Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_ops.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_ops.c 2013-04-12 17:59:38 UTC (rev 55996)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_ops.c 2013-04-12 21:58:18 UTC (rev 55997)
@@ -284,6 +284,7 @@
if (brush) {
BKE_paint_brush_set(paint, brush);
+ BKE_paint_invalidate_overlay_all();
WM_main_add_notifier(NC_BRUSH | NA_EDITED, brush);
return OPERATOR_FINISHED;
}
Modified: trunk/blender/source/blender/makesrna/intern/rna_sculpt_paint.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_sculpt_paint.c 2013-04-12 17:59:38 UTC (rev 55996)
+++ trunk/blender/source/blender/makesrna/intern/rna_sculpt_paint.c 2013-04-12 21:58:18 UTC (rev 55997)
@@ -279,6 +279,12 @@
return BLI_strdup("tool_settings.particle_edit.brush");
}
+static void rna_Paint_brush_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
+{
+ Brush *br = (Brush *)ptr->data;
+ BKE_paint_invalidate_overlay_all();
+ WM_main_add_notifier(NC_BRUSH | NA_EDITED, br);
+}
#else
static void rna_def_paint(BlenderRNA *brna)
@@ -294,7 +300,7 @@
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Brush_mode_poll");
RNA_def_property_ui_text(prop, "Brush", "Active Brush");
- RNA_def_property_update(prop, NC_BRUSH | NA_EDITED, NULL);
+ RNA_def_property_update(prop, 0, "rna_Paint_brush_update");
prop = RNA_def_property(srna, "show_brush", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_SHOW_BRUSH);
More information about the Bf-blender-cvs
mailing list