diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-11-10 16:20:32 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-11-10 16:20:32 +0300 |
commit | 1f2fe7ec1409298527d757cb395358bc02d494c1 (patch) | |
tree | 34bc4365ef932ff5bb5db167640d80ff16af86d0 /source/blender/editors/screen | |
parent | af2e6c38e99024d5055e66e2aea75de61c3280e9 (diff) |
fix for own error in active bone commit, wasnt checking object type was an armature
also fix for warning with printf
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r-- | source/blender/editors/screen/screen_context.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/source/blender/editors/screen/screen_context.c b/source/blender/editors/screen/screen_context.c index c02d86a567e..31827e1b9c0 100644 --- a/source/blender/editors/screen/screen_context.c +++ b/source/blender/editors/screen/screen_context.c @@ -224,17 +224,19 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult } } else if(CTX_data_equals(member, "active_bone")) { - bArmature *arm= (obact) ? obact->data : NULL; - if(arm->edbo) { - if(arm->act_edbone) { - CTX_data_pointer_set(result, &arm->id, &RNA_EditBone, arm->act_edbone); - return 1; + if(obact && obact->type == OB_ARMATURE) { + bArmature *arm= obact->data; + if(arm->edbo) { + if(arm->act_edbone) { + CTX_data_pointer_set(result, &arm->id, &RNA_EditBone, arm->act_edbone); + return 1; + } } - } - else { - if(arm->act_bone) { - CTX_data_pointer_set(result, &arm->id, &RNA_Bone, arm->act_bone); - return 1; + else { + if(arm->act_bone) { + CTX_data_pointer_set(result, &arm->id, &RNA_Bone, arm->act_bone); + return 1; + } } } } |