[Bf-blender-cvs] [27ce492edbb] greasepencil-object: Merge branch 'blender2.8' into greasepencil-object
Antonio Vazquez
noreply at git.blender.org
Tue Feb 13 17:51:34 CET 2018
Commit: 27ce492edbb13757cb824a3a6be52d13e9c63f9c
Author: Antonio Vazquez
Date: Tue Feb 13 17:38:38 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB27ce492edbb13757cb824a3a6be52d13e9c63f9c
Merge branch 'blender2.8' into greasepencil-object
Conflicts:
source/blender/editors/space_outliner/outliner_select.c
source/blender/editors/space_view3d/view3d_draw_legacy.c
source/blender/makesrna/intern/rna_sculpt_paint.c
===================================================================
===================================================================
diff --cc source/blender/editors/space_outliner/outliner_select.c
index 10b47a003f4,16f3aeaf110..ce51d1936b2
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@@ -197,38 -193,10 +197,38 @@@ static eOLDrawState tree_element_set_ac
WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
}
}
+
+ /* set special grease pencil modes */
+ if (ob->type == OB_GPENCIL) {
+ WorkSpace *workspace = CTX_wm_workspace(C);
+ wmWindow *win = CTX_wm_window(C);
+
+ /* set cursor */
+ if (workspace->object_mode == OB_MODE_GPENCIL_PAINT) {
+ WM_cursor_modal_set(win, BC_PAINTBRUSHCURSOR);
+ ED_gpencil_toggle_brush_cursor(C, false, NULL);
+ }
+ else if (workspace->object_mode == OB_MODE_GPENCIL_SCULPT) {
+ WM_cursor_modal_set(win, BC_CROSSCURSOR);
+ ED_gpencil_toggle_brush_cursor(C, true, NULL);
+ }
+ else if (workspace->object_mode == OB_MODE_GPENCIL_WEIGHT) {
+ WM_cursor_modal_set(win, BC_CROSSCURSOR);
+ ED_gpencil_toggle_brush_cursor(C, true, NULL);
+ }
+ else {
+ WM_cursor_modal_set(win, CURSOR_STD);
+ ED_gpencil_toggle_brush_cursor(C, false, NULL);
+ }
+ /* set workspace mode */
+ workspace->object_mode_restore = workspace->object_mode;
+ workspace->object_mode = OB_MODE_GPENCIL_PAINT;
+ ED_object_base_activate(C, view_layer->basact); // XXX
+ }
- if (ob != scene->obedit)
+ if (CTX_data_edit_object(C)) {
ED_object_editmode_exit(C, EM_FREEDATA | EM_FREEUNDO | EM_WAITCURSOR | EM_DO_UNDO);
-
+ }
return OL_DRAWSEL_NORMAL;
}
diff --cc source/blender/editors/space_view3d/view3d_draw_legacy.c
index c835b798817,aeb2cd11e39..0e70a589ae0
--- a/source/blender/editors/space_view3d/view3d_draw_legacy.c
+++ b/source/blender/editors/space_view3d/view3d_draw_legacy.c
@@@ -1671,17 -1602,8 +1672,17 @@@ static void view3d_draw_objects
draw_dupli_objects(eval_ctx, scene, view_layer, ar, v3d, base);
}
if ((base->flag & BASE_SELECTED) == 0) {
- if (base->object != scene->obedit) {
+ if (base->object != obedit)
draw_object(eval_ctx, scene, view_layer, ar, v3d, base, 0);
+
+ /* draw grease pencil */
+ if (base->object->type == OB_GPENCIL) {
+ /* allocate memory for saving gp objects */
+ gp_cache = ED_gpencil_allocate_cache(gp_cache, &gp_cache_size, gp_cache_used);
+ /* add for drawing later */
+ ED_gpencil_add_to_cache(gp_cache, rv3d, base, &gp_cache_used);
+ }
+ }
}
}
}
@@@ -1692,16 -1614,8 +1693,16 @@@
/* draw selected and editmode */
for (base = view_layer->object_bases.first; base; base = base->next) {
if ((base->flag & BASE_VISIBLED) != 0) {
- if (base->object == scene->obedit || (base->flag & BASE_SELECTED)) {
+ if (base->object == obedit || (base->flag & BASE_SELECTED)) {
draw_object(eval_ctx, scene, view_layer, ar, v3d, base, 0);
+
+ /* draw grease pencil */
+ if (base->object->type == OB_GPENCIL) {
+ /* allocate memory for saving gp objects */
+ gp_cache = ED_gpencil_allocate_cache(gp_cache, &gp_cache_size, gp_cache_used);
+ /* add for drawing later */
+ ED_gpencil_add_to_cache(gp_cache, rv3d, base, &gp_cache_used);
+ }
}
}
}
diff --cc source/blender/makesrna/intern/rna_sculpt_paint.c
index 497d05d17b3,06c0260d08f..32b9ba1a218
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@@ -110,8 -108,7 +111,9 @@@ const EnumPropertyItem rna_enum_symmetr
#include "BKE_pointcache.h"
#include "BKE_particle.h"
#include "BKE_pbvh.h"
+ #include "BKE_object.h"
+#include "BKE_gpencil.h"
+
#include "DEG_depsgraph.h"
More information about the Bf-blender-cvs
mailing list