[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49207] trunk/blender/source/blender: mask now draws in the image view, misc minor edits.
Campbell Barton
ideasman42 at gmail.com
Wed Jul 25 15:44:59 CEST 2012
Revision: 49207
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49207
Author: campbellbarton
Date: 2012-07-25 13:44:59 +0000 (Wed, 25 Jul 2012)
Log Message:
-----------
mask now draws in the image view, misc minor edits.
Modified Paths:
--------------
trunk/blender/source/blender/blenkernel/BKE_paint.h
trunk/blender/source/blender/blenkernel/intern/paint.c
trunk/blender/source/blender/editors/sculpt_paint/paint_image.c
trunk/blender/source/blender/editors/sculpt_paint/paint_vertex.c
trunk/blender/source/blender/editors/sculpt_paint/sculpt.c
trunk/blender/source/blender/editors/space_clip/space_clip.c
trunk/blender/source/blender/editors/space_image/space_image.c
trunk/blender/source/blender/makesrna/intern/rna_space.c
Modified: trunk/blender/source/blender/blenkernel/BKE_paint.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_paint.h 2012-07-25 13:44:07 UTC (rev 49206)
+++ trunk/blender/source/blender/blenkernel/BKE_paint.h 2012-07-25 13:44:59 UTC (rev 49207)
@@ -51,7 +51,7 @@
extern const char PAINT_CURSOR_WEIGHT_PAINT[3];
extern const char PAINT_CURSOR_TEXTURE_PAINT[3];
-void paint_init(struct Paint *p, const char col[3]);
+void BKE_paint_init(struct Paint *p, const char col[3]);
void free_paint(struct Paint *p);
void copy_paint(struct Paint *src, struct Paint *tar);
Modified: trunk/blender/source/blender/blenkernel/intern/paint.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/paint.c 2012-07-25 13:44:07 UTC (rev 49206)
+++ trunk/blender/source/blender/blenkernel/intern/paint.c 2012-07-25 13:44:59 UTC (rev 49207)
@@ -168,7 +168,7 @@
);
}
-void paint_init(Paint *p, const char col[3])
+void BKE_paint_init(Paint *p, const char col[3])
{
Brush *brush;
Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_image.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_image.c 2012-07-25 13:44:07 UTC (rev 49206)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_image.c 2012-07-25 13:44:59 UTC (rev 49207)
@@ -5312,7 +5312,7 @@
settings->uv_relax_method = UV_SCULPT_TOOL_RELAX_LAPLACIAN;
}
- paint_init(&settings->uvsculpt->paint, PAINT_CURSOR_SCULPT);
+ BKE_paint_init(&settings->uvsculpt->paint, PAINT_CURSOR_SCULPT);
WM_paint_cursor_activate(wm, uv_sculpt_brush_poll,
brush_drawcursor, NULL);
@@ -5602,7 +5602,7 @@
me->mtface = CustomData_add_layer(&me->fdata, CD_MTFACE, CD_DEFAULT,
NULL, me->totface);
- paint_init(&scene->toolsettings->imapaint.paint, PAINT_CURSOR_TEXTURE_PAINT);
+ BKE_paint_init(&scene->toolsettings->imapaint.paint, PAINT_CURSOR_TEXTURE_PAINT);
if (U.glreslimit != 0)
GPU_free_images();
Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_vertex.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_vertex.c 2012-07-25 13:44:07 UTC (rev 49206)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_vertex.c 2012-07-25 13:44:59 UTC (rev 49207)
@@ -1997,7 +1997,7 @@
if (wp == NULL)
wp = scene->toolsettings->wpaint = new_vpaint(1);
- paint_init(&wp->paint, PAINT_CURSOR_WEIGHT_PAINT);
+ BKE_paint_init(&wp->paint, PAINT_CURSOR_WEIGHT_PAINT);
paint_cursor_start(C, weight_paint_poll);
mesh_octree_table(ob, NULL, NULL, 's');
@@ -2574,7 +2574,7 @@
paint_cursor_start(C, vertex_paint_poll);
- paint_init(&vp->paint, PAINT_CURSOR_VERTEX_PAINT);
+ BKE_paint_init(&vp->paint, PAINT_CURSOR_VERTEX_PAINT);
}
if (me)
Modified: trunk/blender/source/blender/editors/sculpt_paint/sculpt.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/sculpt.c 2012-07-25 13:44:07 UTC (rev 49206)
+++ trunk/blender/source/blender/editors/sculpt_paint/sculpt.c 2012-07-25 13:44:59 UTC (rev 49207)
@@ -4212,7 +4212,7 @@
/* Mask layer is required */
ED_sculpt_mask_layers_ensure(ob, mmd);
- paint_init(&ts->sculpt->paint, PAINT_CURSOR_SCULPT);
+ BKE_paint_init(&ts->sculpt->paint, PAINT_CURSOR_SCULPT);
paint_cursor_start(C, sculpt_poll);
}
Modified: trunk/blender/source/blender/editors/space_clip/space_clip.c
===================================================================
--- trunk/blender/source/blender/editors/space_clip/space_clip.c 2012-07-25 13:44:07 UTC (rev 49206)
+++ trunk/blender/source/blender/editors/space_clip/space_clip.c 2012-07-25 13:44:59 UTC (rev 49207)
@@ -389,7 +389,6 @@
}
switch (wmn->action) {
case NA_SELECTED:
- clip_scopes_tag_refresh(sa);
ED_area_tag_redraw(sa);
break;
case NA_EDITED:
Modified: trunk/blender/source/blender/editors/space_image/space_image.c
===================================================================
--- trunk/blender/source/blender/editors/space_image/space_image.c 2012-07-25 13:44:07 UTC (rev 49206)
+++ trunk/blender/source/blender/editors/space_image/space_image.c 2012-07-25 13:44:59 UTC (rev 49207)
@@ -429,6 +429,23 @@
ED_area_tag_redraw(sa);
}
break;
+ case NC_MASK:
+ switch (wmn->data) {
+ case ND_SELECT:
+ case ND_DATA:
+ case ND_DRAW:
+ ED_area_tag_redraw(sa);
+ break;
+ }
+ switch (wmn->action) {
+ case NA_SELECTED:
+ ED_area_tag_redraw(sa);
+ break;
+ case NA_EDITED:
+ ED_area_tag_redraw(sa);
+ break;
+ }
+ break;
case NC_GEOM:
switch (wmn->data) {
case ND_DATA:
@@ -468,8 +485,7 @@
return 1;
}
else if (CTX_data_equals(member, "edit_mask")) {
- Scene *scene = CTX_data_scene(C);
- Mask *mask = BKE_sequencer_mask_get(scene); /* XXX */
+ Mask *mask = ED_space_image_get_mask(sima);
if (mask) {
CTX_data_id_pointer_set(result, &mask->id);
}
@@ -605,12 +621,12 @@
draw_image_grease_pencil((bContext *)C, 0);
{
- Mask *mask = BKE_sequencer_mask_get(scene); /* XXX */
+ Mask *mask = ED_space_image_get_mask(sima);
if (mask) {
int width, height;
ED_mask_size(C, &width, &height);
ED_mask_draw_region(mask, ar,
- 0, 0, /* TODO */
+ sima->mask_info.draw_flag, sima->mask_info.draw_type,
width, height,
TRUE, FALSE,
NULL, C);
Modified: trunk/blender/source/blender/makesrna/intern/rna_space.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_space.c 2012-07-25 13:44:07 UTC (rev 49206)
+++ trunk/blender/source/blender/makesrna/intern/rna_space.c 2012-07-25 13:44:59 UTC (rev 49207)
@@ -123,7 +123,7 @@
{SC_MODE_RECONSTRUCTION, "RECONSTRUCTION", ICON_SNAP_FACE, "Reconstruction",
"Show tracking/reconstruction tools"},
{SC_MODE_DISTORTION, "DISTORTION", ICON_GRID, "Distortion", "Show distortion tools"},
- {SC_MODE_MASKEDIT, "MASKEDIT", ICON_MOD_MASK, "Mask editing", "Show mask editing tools"},
+ {SC_MODE_MASKEDIT, "MASK", ICON_MOD_MASK, "Mask editing", "Show mask editing tools"},
{0, NULL, 0, NULL, NULL}
};
@@ -529,11 +529,14 @@
return rna_pointer_inherit_refine(ptr, &RNA_SpaceUVEditor, ptr->data);
}
-static void rna_SpaceImageEditor_paint_update(Main *bmain, Scene *scene, PointerRNA *UNUSED(ptr))
+static void rna_SpaceImageEditor_mode_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- paint_init(&scene->toolsettings->imapaint.paint, PAINT_CURSOR_TEXTURE_PAINT);
+ SpaceImage *sima = (SpaceImage *)(ptr->data);
+ if (sima->mode == SI_MODE_PAINT) {
+ BKE_paint_init(&scene->toolsettings->imapaint.paint, PAINT_CURSOR_TEXTURE_PAINT);
- ED_space_image_paint_update(bmain->wm.first, scene->toolsettings);
+ ED_space_image_paint_update(bmain->wm.first, scene->toolsettings);
+ }
}
static int rna_SpaceImageEditor_show_render_get(PointerRNA *ptr)
@@ -2041,7 +2044,7 @@
RNA_def_property_enum_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, image_space_mode_items);
RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
- RNA_def_property_update(prop, NC_SPACE | ND_SPACE_CLIP, NULL);
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_CLIP, "rna_SpaceImageEditor_mode_update");
/* grease pencil */
prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
More information about the Bf-blender-cvs
mailing list