[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59356] branches/soc-2013-depsgraph_mt: Merging r59350 through r59355 from trunk into soc-2013-depsgraph_mt

Sergey Sharybin sergey.vfx at gmail.com
Wed Aug 21 12:49:30 CEST 2013


Revision: 59356
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59356
Author:   nazgul
Date:     2013-08-21 10:49:30 +0000 (Wed, 21 Aug 2013)
Log Message:
-----------
Merging r59350 through r59355 from trunk into soc-2013-depsgraph_mt

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59350
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59355

Modified Paths:
--------------
    branches/soc-2013-depsgraph_mt/source/blender/editors/mask/mask_edit.c
    branches/soc-2013-depsgraph_mt/source/blender/editors/mask/mask_intern.h
    branches/soc-2013-depsgraph_mt/source/blender/editors/mask/mask_ops.c

Property Changed:
----------------
    branches/soc-2013-depsgraph_mt/
    branches/soc-2013-depsgraph_mt/source/blender/editors/interface/interface.c
    branches/soc-2013-depsgraph_mt/source/blender/editors/space_outliner/


Property changes on: branches/soc-2013-depsgraph_mt
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/ge_dev:58091-58422
/branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/soc-2011-tomato:42376,42378-42379,42383,42385,42395,42397-42400,42407,42411,42418,42443-42444,42446,42467,42472,42486,42650-42652,42654-42655,42709-42710,42733-42734,42801,43872,44130,44141,44147-44149,44151-44152,44229-44230,45623-45625,46037,48089,48092,48551-48552,48679,48790,48792-48793,49076,49087,49292,49294,49466,49894,50052,50126,52854-52856,54573,58822,58989
/branches/soc-2013-dingto:57424,57487,57507,57525,57599,57670,57918-57919,57981,58091,58245,58253,58587,58772,58774-58775,58828,58835,59032
/tags/blender-2.67b-release/blender:57122
/trunk/blender:57395-59349
   + /branches/ge_dev:58091-58422
/branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/soc-2011-tomato:42376,42378-42379,42383,42385,42395,42397-42400,42407,42411,42418,42443-42444,42446,42467,42472,42486,42650-42652,42654-42655,42709-42710,42733-42734,42801,43872,44130,44141,44147-44149,44151-44152,44229-44230,45623-45625,46037,48089,48092,48551-48552,48679,48790,48792-48793,49076,49087,49292,49294,49466,49894,50052,50126,52854-52856,54573,58822,58989
/branches/soc-2013-dingto:57424,57487,57507,57525,57599,57670,57918-57919,57981,58091,58245,58253,58587,58772,58774-58775,58828,58835,59032
/tags/blender-2.67b-release/blender:57122
/trunk/blender:57395-59355


Property changes on: branches/soc-2013-depsgraph_mt/source/blender/editors/interface/interface.c
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/ge_candy/source/blender/editors/interface/interface.c:45070-46163
/branches/ge_harmony/source/blender/editors/interface/interface.c:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber/source/blender/editors/interface/interface.c:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/soc-2011-tomato/source/blender/editors/interface/interface.c:42376,42378-42379,42383,42385,42395,42397-42400,42407,42411,42418,42443-42444,42446,42467,42472,42486,42650-42652,42654-42655,42709-42710,42733-42734,42801,43872,44130,44141,44147-44149,44151-44152,44229-44230,45623-45625,46037,48089,48092,48551-48552,48679,48790,48792-48793,49076,49087,49292,49294,49466,49894,50052,50126,52854-52856,54573,58822,58989
/trunk/blender/source/blender/editors/interface/interface.c:57395-59349
   + /branches/ge_candy/source/blender/editors/interface/interface.c:45070-46163
/branches/ge_harmony/source/blender/editors/interface/interface.c:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber/source/blender/editors/interface/interface.c:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/soc-2011-tomato/source/blender/editors/interface/interface.c:42376,42378-42379,42383,42385,42395,42397-42400,42407,42411,42418,42443-42444,42446,42467,42472,42486,42650-42652,42654-42655,42709-42710,42733-42734,42801,43872,44130,44141,44147-44149,44151-44152,44229-44230,45623-45625,46037,48089,48092,48551-48552,48679,48790,48792-48793,49076,49087,49292,49294,49466,49894,50052,50126,52854-52856,54573,58822,58989
/trunk/blender/source/blender/editors/interface/interface.c:57395-59355

Modified: branches/soc-2013-depsgraph_mt/source/blender/editors/mask/mask_edit.c
===================================================================
--- branches/soc-2013-depsgraph_mt/source/blender/editors/mask/mask_edit.c	2013-08-21 10:17:55 UTC (rev 59355)
+++ branches/soc-2013-depsgraph_mt/source/blender/editors/mask/mask_edit.c	2013-08-21 10:49:30 UTC (rev 59356)
@@ -417,6 +417,9 @@
 
 	/* layers */
 	WM_operatortype_append(MASK_OT_layer_move);
+
+	/* duplicate */
+	WM_operatortype_append(MASK_OT_duplicate);
 }
 
 void ED_keymap_mask(wmKeyConfig *keyconf)
@@ -500,6 +503,9 @@
 	WM_keymap_add_item(keymap, "MASK_OT_shape_key_insert", IKEY, KM_PRESS, 0, 0);
 	WM_keymap_add_item(keymap, "MASK_OT_shape_key_clear", IKEY, KM_PRESS, KM_ALT, 0);
 
+	/* duplicate */
+	WM_keymap_add_item(keymap, "MASK_OT_duplicate_move", DKEY, KM_PRESS, KM_SHIFT, 0);
+
 	/* for image editor only */
 	WM_keymap_add_item(keymap, "UV_OT_cursor_set", ACTIONMOUSE, KM_PRESS, 0, 0);
 
@@ -514,7 +520,6 @@
 
 void ED_operatormacros_mask(void)
 {
-	/* XXX: just for sample */
 	wmOperatorType *ot;
 	wmOperatorTypeMacro *otmacro;
 
@@ -531,4 +536,11 @@
 	WM_operatortype_macro_define(ot, "MASK_OT_add_feather_vertex");
 	otmacro = WM_operatortype_macro_define(ot, "MASK_OT_slide_point");
 	RNA_boolean_set(otmacro->ptr, "slide_feather", TRUE);
+
+	ot = WM_operatortype_append_macro("MASK_OT_duplicate_move", "Add Duplicate", "Duplicate mask and move",
+	                                  OPTYPE_UNDO | OPTYPE_REGISTER);
+	WM_operatortype_macro_define(ot, "MASK_OT_duplicate");
+	otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
+	RNA_enum_set(otmacro->ptr, "proportional", 0);
+	RNA_boolean_set(otmacro->ptr, "mirror", FALSE);
 }

Modified: branches/soc-2013-depsgraph_mt/source/blender/editors/mask/mask_intern.h
===================================================================
--- branches/soc-2013-depsgraph_mt/source/blender/editors/mask/mask_intern.h	2013-08-21 10:17:55 UTC (rev 59355)
+++ branches/soc-2013-depsgraph_mt/source/blender/editors/mask/mask_intern.h	2013-08-21 10:49:30 UTC (rev 59356)
@@ -75,6 +75,8 @@
 
 void MASK_OT_layer_move(struct wmOperatorType *ot);
 
+void MASK_OT_duplicate(struct wmOperatorType *ot);
+
 /* mask_relationships.c */
 void MASK_OT_parent_set(struct wmOperatorType *ot);
 void MASK_OT_parent_clear(struct wmOperatorType *ot);

Modified: branches/soc-2013-depsgraph_mt/source/blender/editors/mask/mask_ops.c
===================================================================
--- branches/soc-2013-depsgraph_mt/source/blender/editors/mask/mask_ops.c	2013-08-21 10:17:55 UTC (rev 59355)
+++ branches/soc-2013-depsgraph_mt/source/blender/editors/mask/mask_ops.c	2013-08-21 10:49:30 UTC (rev 59356)
@@ -1467,3 +1467,110 @@
 	/* properties */
 	RNA_def_enum(ot->srna, "direction", direction_items, 0, "Direction", "Direction to move the active layer");
 }
+
+/******************** duplicate *********************/
+
+static int mask_duplicate_exec(bContext *C, wmOperator *UNUSED(op))
+{
+	Scene *scene = CTX_data_scene(C);
+	Mask *mask = CTX_data_edit_mask(C);
+	MaskLayer *mask_layer = BKE_mask_layer_active(mask);
+	MaskSpline *spline;
+
+	if (mask_layer == NULL) {
+		return OPERATOR_CANCELLED;
+	}
+
+	for (spline = mask_layer->splines.last;
+	     spline;
+	     spline = spline->prev)
+	{
+		MaskSplinePoint *point = spline->points;
+		int i = 0;
+		while (i < spline->tot_point) {
+			int start = i, end = -1;
+			/* Find next selected segment. */
+			while (MASKPOINT_ISSEL_ANY(point)) {
+				BKE_mask_point_select_set(point, false);
+				end = i;
+				if (i >= spline->tot_point - 1) {
+					break;
+				}
+				i++;
+				point++;
+			}
+			if (end >= start) {
+				MaskSpline *new_spline = BKE_mask_spline_add(mask_layer);
+				MaskSplinePoint *new_point;
+				int b;
+
+				/* BKE_mask_spline_add might allocate the points, need to free them in this case. */
+				if (new_spline->points) {
+					MEM_freeN(new_spline->points);
+				}
+
+				/* Copy options from old spline. */
+				new_spline->flag = spline->flag;
+				new_spline->offset_mode = spline->offset_mode;
+				new_spline->weight_interp = spline->weight_interp;
+				new_spline->parent = spline->parent;
+
+				/* Allocate new points and copy them from old spline. */
+				new_spline->tot_point = end - start + 1;
+				new_spline->points = MEM_mallocN(sizeof(MaskSplinePoint) * new_spline->tot_point,
+				                                 "duplicated mask points");
+
+				memcpy(new_spline->points, spline->points + start,
+				       new_spline->tot_point * sizeof(MaskSplinePoint));
+
+				/* Select points and duplicate their UWs (if needed). */
+				for (b = 0, new_point = new_spline->points;
+				     b < new_spline->tot_point;
+				     b++, new_point++)
+				{
+					if (new_point->uw) {
+						new_point->uw = MEM_dupallocN(new_point->uw);
+					}
+					BKE_mask_point_select_set(new_point, true);
+				}
+
+				/* Clear cyclic flag if we didn't copy the whole spline. */
+				if (new_spline->flag & MASK_SPLINE_CYCLIC) {
+					if (start != 0 || end != spline->tot_point - 1) {
+						new_spline->flag &= ~MASK_SPLINE_CYCLIC;
+					}
+				}
+
+				/* Flush selection to splines. */
+				new_spline->flag |= SELECT;
+				spline->flag &= ~SELECT;
+
+				mask_layer->act_spline = new_spline;
+			}
+			i++;
+			point++;
+		}
+	}
+
+	/* TODO: only update edited splines */
+	BKE_mask_update_display(mask, CFRA);
+
+	WM_event_add_notifier(C, NC_MASK | NA_EDITED, mask);
+
+	return OPERATOR_FINISHED;
+}
+
+void MASK_OT_duplicate(wmOperatorType *ot)
+{
+	/* identifiers */
+	ot->name = "Duplicate Mask";
+	ot->description = "Duplicate selected control points and segments between them";
+	ot->idname = "MASK_OT_duplicate";
+
+	/* api callbacks */
+	ot->exec = mask_duplicate_exec;
+	ot->poll = ED_maskedit_mask_poll;
+
+	/* flags */
+	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+}


Property changes on: branches/soc-2013-depsgraph_mt/source/blender/editors/space_outliner
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/soc-2011-cucumber/source/blender/editors/space_outliner:38968,38970,38973,39045,40845
/branches/soc-2011-pepper/source/blender/editors/space_outliner:36831-38987

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list