Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaia Clary <gaia.clary@machinimatrix.org>2013-07-04 00:31:38 +0400
committerGaia Clary <gaia.clary@machinimatrix.org>2013-07-04 00:31:38 +0400
commit7eed4d5c4fa7e1acd179c1d340987bf735ec2963 (patch)
treef5ea7df8314c0386cca7ab41c2ec907892a024ae /source/blender/editors/object/object_vgroup.c
parent3181c4ecd52bfe894ca31e62ae361429f86c4720 (diff)
Fix Weight Paint(Weight-Transfer): active vgroup does not match active bone when new vgroups where created during transfer
Diffstat (limited to 'source/blender/editors/object/object_vgroup.c')
-rw-r--r--source/blender/editors/object/object_vgroup.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c
index 89989d73049..b0c608a7d7e 100644
--- a/source/blender/editors/object/object_vgroup.c
+++ b/source/blender/editors/object/object_vgroup.c
@@ -67,6 +67,7 @@
#include "BKE_object.h"
#include "BKE_lattice.h"
+#include "DNA_armature_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
@@ -3748,6 +3749,7 @@ static int vertex_group_transfer_weight_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
Object *ob_act = CTX_data_active_object(C);
+ Object *armobj = BKE_object_pose_armature_get(ob_act);
bDeformGroup *dg_src;
int fail = 0;
@@ -3792,6 +3794,16 @@ static int vertex_group_transfer_weight_exec(bContext *C, wmOperator *op)
CTX_DATA_END;
+ /* Ensure active Weight Group is set to active bone
+ * when new groups have been added during Weight Transfer
+ */
+ if (armobj && (armobj->mode & OB_MODE_POSE)) {
+ struct bArmature *arm = armobj->data;
+ if (arm->act_bone && (arm->act_bone->layer & arm->layer)) {
+ ob_act->actdef = defgroup_name_index(ob_act, arm->act_bone->name)+1;
+ }
+ }
+
if (fail != 0) {
return OPERATOR_CANCELLED;
}