[Bf-blender-cvs] [baee9b014ab] master: Outliner: better support for paintcurves ('Blender File' view)

Philipp Oeser noreply at git.blender.org
Mon Mar 4 13:05:36 CET 2019


Commit: baee9b014ab0950db4730439098f35df6ea80291
Author: Philipp Oeser
Date:   Mon Mar 4 11:51:11 2019 +0100
Branches: master
https://developer.blender.org/rBbaee9b014ab0950db4730439098f35df6ea80291

Outliner: better support for paintcurves ('Blender File' view)

- paintcurves were hitting an assert in outliner_add_element()
- missing outliner update when adding a paintcurve
- paintcurves were not showing an icon [they dont have a dedicated icon,
took the one used elsewhere]

Reviewers: brecht

Differential Revision: https://developer.blender.org/D4445

===================================================================

M	source/blender/editors/sculpt_paint/paint_curve.c
M	source/blender/editors/space_outliner/outliner_draw.c
M	source/blender/editors/space_outliner/outliner_intern.h
M	source/blender/editors/space_outliner/space_outliner.c
M	source/blender/windowmanager/WM_types.h

===================================================================

diff --git a/source/blender/editors/sculpt_paint/paint_curve.c b/source/blender/editors/sculpt_paint/paint_curve.c
index bd2fea78a99..6e43c0ab492 100644
--- a/source/blender/editors/sculpt_paint/paint_curve.c
+++ b/source/blender/editors/sculpt_paint/paint_curve.c
@@ -166,6 +166,8 @@ static int paintcurve_new_exec(bContext *C, wmOperator *UNUSED(op))
 		p->brush->paint_curve = BKE_paint_curve_add(bmain, "PaintCurve");
 	}
 
+	WM_event_add_notifier(C, NC_PAINTCURVE | NA_ADDED, NULL);
+
 	return OPERATOR_FINISHED;
 }
 
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index fba5b70392a..044ab8f1b7b 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -1438,6 +1438,8 @@ TreeElementIcon tree_element_get_icon(TreeStoreElem *tselem, TreeElement *te)
 					data.icon = ICON_MOD_MASK; break;
 				case ID_MC:
 					data.icon = ICON_SEQUENCE; break;
+				case ID_PC:
+					data.icon = ICON_CURVE_BEZCURVE; break;
 				default:
 					break;
 			}
diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h
index 0e215c595c1..0851d5ce9f4 100644
--- a/source/blender/editors/space_outliner/outliner_intern.h
+++ b/source/blender/editors/space_outliner/outliner_intern.h
@@ -86,7 +86,7 @@ typedef struct TreeElementIcon {
 	(ELEM(GS((_id)->name), ID_SCE, ID_LI, ID_OB, ID_ME, ID_CU, ID_MB, ID_NT, ID_MA, ID_TE, ID_IM, ID_LT, ID_LA, ID_CA) || \
 	 ELEM(GS((_id)->name), ID_KE, ID_WO, ID_SPK, ID_GR, ID_AR, ID_AC, ID_BR, ID_PA, ID_GD, ID_LS, ID_LP) || \
 	/* Only in 'blendfile' mode ... :/ */ \
-	 ELEM(GS((_id)->name), ID_SCR, ID_WM, ID_TXT, ID_VF, ID_SO, ID_CF, ID_PAL, ID_MC, ID_WS, ID_MSK))
+	 ELEM(GS((_id)->name), ID_SCR, ID_WM, ID_TXT, ID_VF, ID_SO, ID_CF, ID_PAL, ID_MC, ID_WS, ID_MSK, ID_PC))
 
 /* TreeElement->flag */
 enum {
diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c
index 3d79a15a5a0..822f9ec61ac 100644
--- a/source/blender/editors/space_outliner/space_outliner.c
+++ b/source/blender/editors/space_outliner/space_outliner.c
@@ -224,6 +224,11 @@ static void outliner_main_region_listener(
 				ED_region_tag_redraw(ar);
 			}
 			break;
+		case NC_PAINTCURVE:
+			if (ELEM(wmn->action, NA_ADDED)) {
+				ED_region_tag_redraw(ar);
+			}
+			break;
 	}
 
 }
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h
index 7d1e13bb1e4..0f799448561 100644
--- a/source/blender/windowmanager/WM_types.h
+++ b/source/blender/windowmanager/WM_types.h
@@ -246,7 +246,7 @@ typedef struct wmNotifier {
 #define	NC_GEOM				(16<<24)
 #define NC_NODE				(17<<24)
 #define NC_ID				(18<<24)
-/* (19<<24) is free */
+#define NC_PAINTCURVE		(19<<24)
 #define NC_MOVIECLIP			(20<<24)
 #define NC_MASK				(21<<24)
 #define NC_GPENCIL			(22<<24)



More information about the Bf-blender-cvs mailing list