[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46971] branches/soc-2011-tomato/source/ blender: add missing file from previous commit

Campbell Barton ideasman42 at gmail.com
Thu May 24 15:57:02 CEST 2012


Revision: 46971
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46971
Author:   campbellbarton
Date:     2012-05-24 13:57:02 +0000 (Thu, 24 May 2012)
Log Message:
-----------
add missing file from previous commit 

Modified Paths:
--------------
    branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c

Added Paths:
-----------
    branches/soc-2011-tomato/source/blender/editors/mask/mask_shapekey.c

Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c	2012-05-24 13:52:25 UTC (rev 46970)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c	2012-05-24 13:57:02 UTC (rev 46971)
@@ -987,8 +987,6 @@
 
 		/* animation if available */
 		if (do_newframe) {
-			//MaskObjectShape *maskobj_shape = BKE_mask_object_shape_find_frame(maskobj, (int)ctime);
-
 			MaskObjectShape *maskobj_shape_a;
 			MaskObjectShape *maskobj_shape_b;
 			int found;

Added: branches/soc-2011-tomato/source/blender/editors/mask/mask_shapekey.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/mask/mask_shapekey.c	                        (rev 0)
+++ branches/soc-2011-tomato/source/blender/editors/mask/mask_shapekey.c	2012-05-24 13:57:02 UTC (rev 46971)
@@ -0,0 +1,130 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2012 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation,
+ *                 Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/editors/mask/mask_shapekey.c
+ *  \ingroup edmask
+ */
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_utildefines.h"
+#include "BLI_listbase.h"
+#include "BLI_math.h"
+
+#include "BKE_context.h"
+#include "BKE_curve.h"
+#include "BKE_depsgraph.h"
+#include "BKE_mask.h"
+
+#include "DNA_mask_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_object_types.h"  /* SELECT */
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "ED_screen.h"
+#include "ED_mask.h"
+#include "ED_clip.h"
+
+#include "RNA_access.h"
+#include "RNA_define.h"
+
+#include "mask_intern.h"  /* own include */
+
+static int mask_shape_key_insert_exec(bContext *C, wmOperator *UNUSED(op))
+{
+	Scene *scene = CTX_data_scene(C);
+	const int frame = CFRA;
+	Mask *mask = CTX_data_edit_mask(C);
+	MaskObject *maskobj;
+
+	for (maskobj = mask->maskobjs.first; maskobj; maskobj = maskobj->next) {
+		MaskObjectShape *maskobj_shape;
+
+		maskobj_shape = BKE_mask_object_shape_varify_frame(maskobj, frame);
+		BKE_mask_object_shape_from_mask(maskobj, maskobj_shape);
+	}
+
+	WM_event_add_notifier(C, NC_MASK | ND_DATA, mask);
+	DAG_id_tag_update(&mask->id, 0);
+
+	return OPERATOR_FINISHED;
+}
+
+void MASK_OT_shape_key_insert(wmOperatorType *ot)
+{
+	/* identifiers */
+	ot->name = "Insert Shape Key";
+	ot->description = "";
+	ot->idname = "MASK_OT_shape_key_insert";
+
+	/* api callbacks */
+	ot->exec = mask_shape_key_insert_exec;
+	ot->poll = ED_maskediting_mask_poll;
+
+	/* flags */
+	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+}
+
+static int mask_shape_key_clear_exec(bContext *C, wmOperator *UNUSED(op))
+{
+	Scene *scene = CTX_data_scene(C);
+	const int frame = CFRA;
+	Mask *mask = CTX_data_edit_mask(C);
+	MaskObject *maskobj;
+
+	for (maskobj = mask->maskobjs.first; maskobj; maskobj = maskobj->next) {
+		MaskObjectShape *maskobj_shape;
+
+		maskobj_shape = BKE_mask_object_shape_find_frame(maskobj, frame);
+
+		if (maskobj_shape) {
+			BKE_mask_object_shape_unlink(maskobj, maskobj_shape);
+		}
+	}
+
+	WM_event_add_notifier(C, NC_MASK | ND_DATA, mask);
+	DAG_id_tag_update(&mask->id, 0);
+
+	return OPERATOR_FINISHED;
+}
+
+void MASK_OT_shape_key_clear(wmOperatorType *ot)
+{
+	/* identifiers */
+	ot->name = "Clear Shape Key";
+	ot->description = "";
+	ot->idname = "MASK_OT_shape_key_clear";
+
+	/* api callbacks */
+	ot->exec = mask_shape_key_clear_exec;
+	ot->poll = ED_maskediting_mask_poll;
+
+	/* flags */
+	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+}


Property changes on: branches/soc-2011-tomato/source/blender/editors/mask/mask_shapekey.c
___________________________________________________________________
Added: svn:executable
   + *




More information about the Bf-blender-cvs mailing list