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:
authorCampbell Barton <ideasman42@gmail.com>2010-10-08 03:17:14 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-10-08 03:17:14 +0400
commitafa1bf33fb48db48fb909e4853094f2d962f8327 (patch)
tree5a98ee0fcbc60a9d5702d0fb22e88cf73797851c /source/blender/editors/screen/screen_context.c
parentc52c10d1781825290d56d27551b6a51b4ab85b40 (diff)
bugfix [#21610] alt-r for bone (reset rotation) doesnt work in weight painting mode
pose operators now run in weightpaint mode when the weight paint objects pose armature is in pose mode.
Diffstat (limited to 'source/blender/editors/screen/screen_context.c')
-rw-r--r--source/blender/editors/screen/screen_context.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/source/blender/editors/screen/screen_context.c b/source/blender/editors/screen/screen_context.c
index fbc83b1de65..b619398d985 100644
--- a/source/blender/editors/screen/screen_context.c
+++ b/source/blender/editors/screen/screen_context.c
@@ -209,14 +209,15 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
}
}
else if(CTX_data_equals(member, "visible_pose_bones")) {
- bArmature *arm= (obact) ? obact->data : NULL;
+ Object *obpose= ED_object_pose_armature(obact);
+ bArmature *arm= (obpose) ? obpose->data : NULL;
bPoseChannel *pchan;
- if (obact && obact->pose && arm) {
- for (pchan= obact->pose->chanbase.first; pchan; pchan= pchan->next) {
+ if (obpose && obpose->pose && arm) {
+ for (pchan= obpose->pose->chanbase.first; pchan; pchan= pchan->next) {
/* ensure that PoseChannel is on visible layer and is not hidden in PoseMode */
if ((pchan->bone) && (arm->layer & pchan->bone->layer) && !(pchan->bone->flag & BONE_HIDDEN_P)) {
- CTX_data_list_add(result, &obact->id, &RNA_PoseBone, pchan);
+ CTX_data_list_add(result, &obpose->id, &RNA_PoseBone, pchan);
}
}
CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION);
@@ -224,15 +225,16 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
}
}
else if(CTX_data_equals(member, "selected_pose_bones")) {
- bArmature *arm= (obact) ? obact->data : NULL;
+ Object *obpose= ED_object_pose_armature(obact);
+ bArmature *arm= (obpose) ? obpose->data : NULL;
bPoseChannel *pchan;
- if (obact && obact->pose && arm) {
- for (pchan= obact->pose->chanbase.first; pchan; pchan= pchan->next) {
+ if (obpose && obpose->pose && arm) {
+ for (pchan= obpose->pose->chanbase.first; pchan; pchan= pchan->next) {
/* ensure that PoseChannel is on visible layer and is not hidden in PoseMode */
if ((pchan->bone) && (arm->layer & pchan->bone->layer) && !(pchan->bone->flag & BONE_HIDDEN_P)) {
if (pchan->bone->flag & BONE_SELECTED || pchan->bone == arm->act_bone)
- CTX_data_list_add(result, &obact->id, &RNA_PoseBone, pchan);
+ CTX_data_list_add(result, &obpose->id, &RNA_PoseBone, pchan);
}
}
CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION);
@@ -258,10 +260,11 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
}
else if(CTX_data_equals(member, "active_pose_bone")) {
bPoseChannel *pchan;
+ Object *obpose= ED_object_pose_armature(obact);
- pchan= get_active_posechannel(obact);
+ pchan= get_active_posechannel(obpose);
if (pchan) {
- CTX_data_pointer_set(result, &obact->id, &RNA_PoseBone, pchan);
+ CTX_data_pointer_set(result, &obpose->id, &RNA_PoseBone, pchan);
return 1;
}
}