From f745564e4ee791e4faf804b09ce975b882f4f8d9 Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Mon, 21 Jul 2014 12:02:05 +0200 Subject: GSOC 2013 paint Yep, at last it's here! There are a few minor issues remaining but development can go on in master after discussion at blender institute. For full list of features see: http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.72/Painting Thanks to Sergey and Campbell for the extensive review and to the countless artists that have given their input and reported issues during development. --- source/blender/editors/interface/resources.c | 57 +++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/interface/resources.c') diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 372ced0a6fd..65c01781d6d 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -35,21 +35,25 @@ #include "MEM_guardedalloc.h" +#include "DNA_brush_types.h" #include "DNA_curve_types.h" -#include "DNA_userdef_types.h" +#include "DNA_mesh_types.h" /* init_userdef_factory */ +#include "DNA_object_types.h" #include "DNA_screen_types.h" #include "DNA_space_types.h" +#include "DNA_userdef_types.h" #include "DNA_windowmanager_types.h" -#include "DNA_mesh_types.h" /* init_userdef_factory */ #include "BLI_blenlib.h" #include "BLI_utildefines.h" #include "BLI_math.h" +#include "BKE_brush.h" #include "BKE_DerivedMesh.h" #include "BKE_global.h" #include "BKE_main.h" #include "BKE_texture.h" +#include "BKE_library.h" #include "BIF_gl.h" @@ -537,6 +541,13 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo cp = ts->preview_stitch_active; break; + case TH_PAINT_CURVE_HANDLE: + cp = ts->paint_curve_handle; + break; + case TH_PAINT_CURVE_PIVOT: + cp = ts->paint_curve_pivot; + break; + case TH_UV_OTHERS: cp = ts->uv_others; break; @@ -871,6 +882,8 @@ void ui_theme_init_default(void) rgba_char_args_set(btheme->tv3d.title, 0, 0, 0, 255); rgba_char_args_set(btheme->tv3d.freestyle_edge_mark, 0x7f, 0xff, 0x7f, 255); rgba_char_args_set(btheme->tv3d.freestyle_face_mark, 0x7f, 0xff, 0x7f, 51); + rgba_char_args_set_fl(btheme->tv3d.paint_curve_handle, 0.5f, 1.0f, 0.5f, 0.5f); + rgba_char_args_set_fl(btheme->tv3d.paint_curve_pivot, 1.0f, 0.5f, 0.5f, 0.5f); btheme->tv3d.facedot_size = 4; @@ -2427,6 +2440,16 @@ void init_userdef_do_versions(void) } } + if (U.versionfile < 272|| (U.versionfile == 272 && U.subversionfile < 2)) { + bTheme *btheme; + for (btheme = U.themes.first; btheme; btheme = btheme->next) { + rgba_char_args_set_fl(btheme->tv3d.paint_curve_handle, 0.5f, 1.0f, 0.5f, 0.5f); + rgba_char_args_set_fl(btheme->tv3d.paint_curve_pivot, 1.0f, 0.5f, 0.5f, 0.5f); + rgba_char_args_set_fl(btheme->tima.paint_curve_handle, 0.5f, 1.0f, 0.5f, 0.5f); + rgba_char_args_set_fl(btheme->tima.paint_curve_pivot, 1.0f, 0.5f, 0.5f, 0.5f); + } + } + { bTheme *btheme; for (btheme = U.themes.first; btheme; btheme = btheme->next) { @@ -2470,4 +2493,34 @@ void init_userdef_factory(void) me->flag &= ~ME_TWOSIDED; } } + + { + Brush *br; + br = BKE_brush_add(G.main, "Fill"); + br->imagepaint_tool = PAINT_TOOL_FILL; + br->ob_mode = OB_MODE_TEXTURE_PAINT; + + br = (Brush *)BKE_libblock_find_name(ID_BR, "Mask"); + if (br) { + br->imagepaint_tool = PAINT_TOOL_MASK; + br->ob_mode |= OB_MODE_TEXTURE_PAINT; + } + } + + { + Scene *scene; + + for (scene = G.main->scene.first; scene; scene = scene->id.next) { + if (scene->toolsettings) { + ToolSettings *ts = scene->toolsettings; + + if (ts->sculpt) { + Sculpt *sculpt = ts->sculpt; + sculpt->paint.symmetry_flags |= PAINT_SYMM_X; + sculpt->flags |= SCULPT_DYNTOPO_COLLAPSE; + sculpt->detail_size = 12; + } + } + } + } } -- cgit v1.2.3 From 256706ce7e88dfa4ec7f5ff215a03aea2aa5e71a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 21 Jul 2014 20:23:17 +1000 Subject: Cleanup --- source/blender/editors/interface/resources.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/interface/resources.c') diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 65c01781d6d..1f66a4a4725 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -2440,7 +2440,7 @@ void init_userdef_do_versions(void) } } - if (U.versionfile < 272|| (U.versionfile == 272 && U.subversionfile < 2)) { + if (U.versionfile < 272 || (U.versionfile == 272 && U.subversionfile < 2)) { bTheme *btheme; for (btheme = U.themes.first; btheme; btheme = btheme->next) { rgba_char_args_set_fl(btheme->tv3d.paint_curve_handle, 0.5f, 1.0f, 0.5f, 0.5f); -- cgit v1.2.3 From f88593df6911f99d576a5b223eb84749e4fce965 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 23 Jul 2014 20:20:59 +1000 Subject: Fix for mixup in startup.blend data init when userprefs.blend was missing Rename UI_init_userdef_factory to BLO_update_defaults_userpref_blend This closely matches BLO_update_defaults_startup_blend so makes sense for them to be together. --- source/blender/editors/interface/resources.c | 58 ---------------------------- 1 file changed, 58 deletions(-) (limited to 'source/blender/editors/interface/resources.c') diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 1f66a4a4725..85836f2d97b 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -35,10 +35,7 @@ #include "MEM_guardedalloc.h" -#include "DNA_brush_types.h" #include "DNA_curve_types.h" -#include "DNA_mesh_types.h" /* init_userdef_factory */ -#include "DNA_object_types.h" #include "DNA_screen_types.h" #include "DNA_space_types.h" #include "DNA_userdef_types.h" @@ -48,13 +45,10 @@ #include "BLI_utildefines.h" #include "BLI_math.h" -#include "BKE_brush.h" #include "BKE_DerivedMesh.h" #include "BKE_global.h" #include "BKE_main.h" #include "BKE_texture.h" -#include "BKE_library.h" - #include "BIF_gl.h" @@ -2472,55 +2466,3 @@ void init_userdef_do_versions(void) // XXX reset_autosave(); } - -/** - * Override values in in-memory startup.blend, avoids resaving for small changes. - */ -void init_userdef_factory(void) -{ - /* defaults from T37518 */ - - U.uiflag |= USER_ZBUF_CURSOR; - U.uiflag |= USER_QUIT_PROMPT; - U.uiflag |= USER_CONTINUOUS_MOUSE; - - U.versions = 1; - U.savetime = 2; - - { - Mesh *me; - for (me = G.main->mesh.first; me; me = me->id.next) { - me->flag &= ~ME_TWOSIDED; - } - } - - { - Brush *br; - br = BKE_brush_add(G.main, "Fill"); - br->imagepaint_tool = PAINT_TOOL_FILL; - br->ob_mode = OB_MODE_TEXTURE_PAINT; - - br = (Brush *)BKE_libblock_find_name(ID_BR, "Mask"); - if (br) { - br->imagepaint_tool = PAINT_TOOL_MASK; - br->ob_mode |= OB_MODE_TEXTURE_PAINT; - } - } - - { - Scene *scene; - - for (scene = G.main->scene.first; scene; scene = scene->id.next) { - if (scene->toolsettings) { - ToolSettings *ts = scene->toolsettings; - - if (ts->sculpt) { - Sculpt *sculpt = ts->sculpt; - sculpt->paint.symmetry_flags |= PAINT_SYMM_X; - sculpt->flags |= SCULPT_DYNTOPO_COLLAPSE; - sculpt->detail_size = 12; - } - } - } - } -} -- cgit v1.2.3 From ab8bcd4038763aeb95b4b956abbafac2a1de0e1b Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 7 Aug 2014 14:35:04 +0200 Subject: Fix T41333: Selected mask points don't stand out visually. Looks like mask points coloring was recently changed, and IMAGE space colors were left uninitialized... Factorized a bit the code about vertex_handle & co too, was quite duplicated. --- source/blender/editors/interface/resources.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/interface/resources.c') diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 85836f2d97b..dbb0235f40f 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -779,6 +779,8 @@ static void ui_theme_space_init_handles_color(ThemeSpace *theme_space) rgba_char_args_set(theme_space->handle_sel_auto, 0xf0, 0xff, 0x40, 255); rgba_char_args_set(theme_space->handle_sel_vect, 0x40, 0xc0, 0x30, 255); rgba_char_args_set(theme_space->handle_sel_align, 0xf0, 0x90, 0xa0, 255); + rgba_char_args_set(theme_space->handle_vertex, 0x00, 0x00, 0x00, 0xff); + rgba_char_args_set(theme_space->handle_vertex_select, 0xff, 0xff, 0, 0xff); rgba_char_args_set(theme_space->act_spline, 0xdb, 0x25, 0x12, 255); } @@ -1136,8 +1138,6 @@ void ui_theme_init_default(void) rgba_char_args_set(btheme->tclip.path_after, 0x00, 0x00, 0xff, 255); rgba_char_args_set(btheme->tclip.grid, 0x5e, 0x5e, 0x5e, 255); rgba_char_args_set(btheme->tclip.cframe, 0x60, 0xc0, 0x40, 255); - rgba_char_args_set(btheme->tclip.handle_vertex, 0x00, 0x00, 0x00, 0xff); - rgba_char_args_set(btheme->tclip.handle_vertex_select, 0xff, 0xff, 0, 0xff); rgba_char_args_set(btheme->tclip.list, 0x66, 0x66, 0x66, 0xff); rgba_char_args_set(btheme->tclip.strip, 0x0c, 0x0a, 0x0a, 0x80); rgba_char_args_set(btheme->tclip.strip_select, 0xff, 0x8c, 0x00, 0xff); -- cgit v1.2.3