diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-11-10 00:03:54 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-11-10 00:03:54 +0300 |
commit | 5935ef004935b27fc5795349aed32f87cf637049 (patch) | |
tree | f36022abb03938420606405e9afc841b14d4bd81 /source/blender/editors/screen/screen_context.c | |
parent | 3e2766bc2ee7523ea68caedc5b11e9498ddcbbc1 (diff) |
use armature active bone as a pointer rather then a flag for each bone that needs looking up.
- rna vars arm.bones.active & rna.edit_bones.active
- needed special undo support.
- readfile.c loads.
- duplicate and copy_armature support.
- keep the draw flag, renamed to BONE_DRAW_ACTIVE, only use for openGL drawing.
Note: it may be better to allow active/unselected as with objects.
Diffstat (limited to 'source/blender/editors/screen/screen_context.c')
-rw-r--r-- | source/blender/editors/screen/screen_context.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/source/blender/editors/screen/screen_context.c b/source/blender/editors/screen/screen_context.c index 919cc3f0cfd..c02d86a567e 100644 --- a/source/blender/editors/screen/screen_context.c +++ b/source/blender/editors/screen/screen_context.c @@ -215,7 +215,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult for (pchan= obact->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|BONE_ACTIVE)) + if (pchan->bone->flag & BONE_SELECTED || pchan->bone == arm->act_bone) CTX_data_list_add(result, &obact->id, &RNA_PoseChannel, pchan); } } @@ -224,21 +224,19 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult } } else if(CTX_data_equals(member, "active_bone")) { - bArmature *arm= (obedit) ? obedit->data : NULL; - EditBone *ebone; - - if (arm && arm->edbo) { - for (ebone= arm->edbo->first; ebone; ebone= ebone->next) { - if (EBONE_VISIBLE(arm, ebone)) { - if (ebone->flag & BONE_ACTIVE) { - CTX_data_pointer_set(result, &arm->id, &RNA_EditBone, ebone); - - return 1; - } - } + 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; + } + } + else { + if(arm->act_bone) { + CTX_data_pointer_set(result, &arm->id, &RNA_Bone, arm->act_bone); + return 1; } } - } else if(CTX_data_equals(member, "active_pchan")) { bPoseChannel *pchan; |