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
path: root/source
diff options
context:
space:
mode:
authorGaia Clary <gaia.clary@machinimatrix.org>2013-05-23 20:24:36 +0400
committerGaia Clary <gaia.clary@machinimatrix.org>2013-05-23 20:24:36 +0400
commitf48bab5f06664dfa4b259d57b11803880e261e0e (patch)
tree7cd1312bc8c6015269f8c34cc74ca31fac5d3d9b /source
parentec834f823469aebee0bd58dd6c72a6f1033f3a32 (diff)
Added display of active bone (in 3DView) when weight painting a mesh Object
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c30
1 files changed, 25 insertions, 5 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index c07fa85050c..1b6c6b463cd 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -914,7 +914,8 @@ static void draw_selected_name(Scene *scene, Object *ob, rcti *rect)
Key *key = NULL;
KeyBlock *kb = NULL;
char shapes[MAX_NAME + 10];
-
+ char *bone_name = NULL;
+
/* try to display active shapekey too */
shapes[0] = '\0';
key = BKE_key_from_object(ob);
@@ -928,10 +929,29 @@ static void draw_selected_name(Scene *scene, Object *ob, rcti *rect)
}
}
- if (markern)
- BLI_snprintf(info, sizeof(info), "(%d) %s %s <%s>", CFRA, ob->id.name + 2, shapes, markern);
- else
- BLI_snprintf(info, sizeof(info), "(%d) %s %s", CFRA, ob->id.name + 2, shapes);
+ if (ob->type == OB_MESH) {
+ Object *armobj = BKE_object_pose_armature_get(ob);
+ if (armobj && armobj->mode & OB_MODE_POSE) {
+ bArmature *arm = armobj->data;
+ if (arm->act_bone) {
+ if (arm->act_bone->layer & arm->layer)
+ bone_name = arm->act_bone->name;
+ }
+ }
+ }
+
+ if (bone_name) {
+ if (markern)
+ BLI_snprintf(info, sizeof(info), "(%d) %s %s %s <%s>", CFRA, ob->id.name + 2, bone_name, shapes, markern);
+ else
+ BLI_snprintf(info, sizeof(info), "(%d) %s %s %s", CFRA, ob->id.name + 2, bone_name, shapes);
+ }
+ else {
+ if (markern)
+ BLI_snprintf(info, sizeof(info), "(%d) %s %s <%s>", CFRA, ob->id.name + 2, shapes, markern);
+ else
+ BLI_snprintf(info, sizeof(info), "(%d) %s %s", CFRA, ob->id.name + 2, shapes);
+ }
}
else {
/* standard object */