[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [44563] branches/meshdata_transfer/source/ blender/editors/object:
Ove Murberg Henriksen
sorayasilvermoon at hotmail.com
Wed Feb 29 20:46:33 CET 2012
Revision: 44563
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=44563
Author: cyborgmuppet
Date: 2012-02-29 19:46:31 +0000 (Wed, 29 Feb 2012)
Log Message:
-----------
M source/blender/editors/object/object_vgroup.c
M source/blender/editors/object/object_ops.c
M source/blender/editors/object/object_intern.h
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-02-29 18:06:25 UTC (rev 44562)
+++ branches/meshdata_transfer/source/blender/editors/object/object_intern.h 2012-02-29 19:46:31 UTC (rev 44563)
@@ -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(struct wmOperatorType *ot); /*cyborgmuppets experimental test */
void OBJECT_OT_vertex_group_levels(struct wmOperatorType *ot);
void OBJECT_OT_vertex_group_lock(struct wmOperatorType *ot);
void OBJECT_OT_vertex_group_fix(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-02-29 18:06:25 UTC (rev 44562)
+++ branches/meshdata_transfer/source/blender/editors/object/object_ops.c 2012-02-29 19:46:31 UTC (rev 44563)
@@ -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); /*cyborgmuppets experimental test*/
WM_operatortype_append(OBJECT_OT_vertex_group_lock);
WM_operatortype_append(OBJECT_OT_vertex_group_fix);
WM_operatortype_append(OBJECT_OT_vertex_group_invert);
Modified: branches/meshdata_transfer/source/blender/editors/object/object_vgroup.c
===================================================================
--- branches/meshdata_transfer/source/blender/editors/object/object_vgroup.c 2012-02-29 18:06:25 UTC (rev 44562)
+++ branches/meshdata_transfer/source/blender/editors/object/object_vgroup.c 2012-02-29 19:46:31 UTC (rev 44563)
@@ -1176,6 +1176,8 @@
}
}
+static void vgroup_transfer_weight()
+{}
static void vgroup_lock_all(Object *ob, int action)
{
@@ -2367,6 +2369,33 @@
"Keep the values of the active group while normalizing others");
}
+static int vertex_group_transfer_weight_exec(bContext *C, wmOperator *op)
+{
+ Object *ob= ED_object_context(C);
+
+ vgroup_transfer_weight();
+
+ 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(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_exec;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
static int vertex_group_fix_exec(bContext *C, wmOperator *op)
{
Object *ob= CTX_data_active_object(C);
More information about the Bf-blender-cvs
mailing list