[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [44603] branches/meshdata_transfer/source/ blender/editors/object: from first change up until including this: added two buttons to gui,

Ove Murberg Henriksen sorayasilvermoon at hotmail.com
Fri Mar 2 14:33:28 CET 2012


Revision: 44603
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=44603
Author:   cyborgmuppet
Date:     2012-03-02 13:33:14 +0000 (Fri, 02 Mar 2012)
Log Message:
-----------
from first change up until including this: added two buttons to gui,
transfer weight and trtransfer weight all, made the basic structure, redy to implement the contents of the functions in object_vgroup.c

Modified Paths:
--------------
    branches/meshdata_transfer/source/blender/editors/object/object_intern.h
    branches/meshdata_transfer/source/blender/editors/object/object_ops.c
    branches/meshdata_transfer/source/blender/editors/object/object_vgroup.c

Modified: branches/meshdata_transfer/source/blender/editors/object/object_intern.h
===================================================================
--- branches/meshdata_transfer/source/blender/editors/object/object_intern.h	2012-03-02 12:44:34 UTC (rev 44602)
+++ branches/meshdata_transfer/source/blender/editors/object/object_intern.h	2012-03-02 13:33:14 UTC (rev 44603)
@@ -200,6 +200,7 @@
 void OBJECT_OT_vertex_group_copy(struct wmOperatorType *ot);
 void OBJECT_OT_vertex_group_normalize(struct wmOperatorType *ot);
 void OBJECT_OT_vertex_group_normalize_all(struct wmOperatorType *ot);
+void OBJECT_OT_vertex_group_transfer_weight_all(struct wmOperatorType *ot);
 void OBJECT_OT_vertex_group_transfer_weight(struct wmOperatorType *ot);
 void OBJECT_OT_vertex_group_levels(struct wmOperatorType *ot);
 void OBJECT_OT_vertex_group_lock(struct wmOperatorType *ot);

Modified: branches/meshdata_transfer/source/blender/editors/object/object_ops.c
===================================================================
--- branches/meshdata_transfer/source/blender/editors/object/object_ops.c	2012-03-02 12:44:34 UTC (rev 44602)
+++ branches/meshdata_transfer/source/blender/editors/object/object_ops.c	2012-03-02 13:33:14 UTC (rev 44603)
@@ -173,6 +173,7 @@
 	WM_operatortype_append(OBJECT_OT_vertex_group_copy);
 	WM_operatortype_append(OBJECT_OT_vertex_group_normalize);
 	WM_operatortype_append(OBJECT_OT_vertex_group_normalize_all);
+	WM_operatortype_append(OBJECT_OT_vertex_group_transfer_weight_all);
 	WM_operatortype_append(OBJECT_OT_vertex_group_transfer_weight);
 	WM_operatortype_append(OBJECT_OT_vertex_group_lock);
 	WM_operatortype_append(OBJECT_OT_vertex_group_fix);

Modified: branches/meshdata_transfer/source/blender/editors/object/object_vgroup.c
===================================================================
--- branches/meshdata_transfer/source/blender/editors/object/object_vgroup.c	2012-03-02 12:44:34 UTC (rev 44602)
+++ branches/meshdata_transfer/source/blender/editors/object/object_vgroup.c	2012-03-02 13:33:14 UTC (rev 44603)
@@ -20,7 +20,7 @@
  *
  * The Original Code is: all of this file.
  *
- * Contributor(s): none yet.
+ * Contributor(s): Ove M Henriksen
  *
  * ***** END GPL LICENSE BLOCK *****
  */
@@ -75,6 +75,7 @@
 #include "UI_resources.h"
 
 #include "object_intern.h"
+#include <stdio.h>
 
 /************************ Exported Functions **********************/
 static void vgroup_remap_update_users(Object *ob, int *map);
@@ -1176,9 +1177,17 @@
 	}
 }
 
-static void vgroup_transfer_weight()
-{}
+static void vgroup_transfer_weight_all(Object *ob_act, Object *ob_other)
+{
+	/* for each vertex group {vgroup_transfer_weight()} */
+	printf("Not implemented yet!");
+}
 
+static void vgroup_transfer_weight(Object *ob_act, Object *ob_other)
+{
+	printf("not implemented yet!");
+}
+
 static void vgroup_lock_all(Object *ob, int action)
 {
 	bDeformGroup *dg;
@@ -2369,6 +2378,33 @@
 	                "Keep the values of the active group while normalizing others");
 }
 
+static int vertex_group_transfer_weight_all_exec(bContext *C, wmOperator *op)
+{
+	Object *ob= ED_object_context(C);
+
+	vgroup_transfer_weight_all();
+
+	DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
+	WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
+	WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob->data);
+
+	return OPERATOR_FINISHED;
+}
+
+void OBJECT_OT_vertex_group_transfer_weight_all(wmOperatorType *ot)
+{
+	/* identifiers */
+	ot->name= "Transfer Weight";
+	ot->idname= "OBJECT_OT_vertex_group_transfer_weight";
+
+	/* api callbacks */
+	ot->poll= vertex_group_poll;
+	ot->exec= vertex_group_transfer_weight_all_exec;
+
+	/* flags */
+	ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
 static int vertex_group_transfer_weight_exec(bContext *C, wmOperator *op)
 {
 	Object *ob= ED_object_context(C);




More information about the Bf-blender-cvs mailing list