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/space_view3d/view3d_buttons.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/space_view3d/view3d_buttons.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_buttons.c | 31 |
1 files changed, 5 insertions, 26 deletions
diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 2edccacff7a..608a22ea529 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -575,22 +575,15 @@ static void v3d_transform_butsR(uiLayout *layout, PointerRNA *ptr) static void v3d_posearmature_buts(uiLayout *layout, View3D *v3d, Object *ob, float lim) { // uiBlock *block= uiLayoutGetBlock(layout); - bArmature *arm; +// bArmature *arm; bPoseChannel *pchan; - Bone *bone= NULL; // TransformProperties *tfp= v3d->properties_storage; PointerRNA pchanptr; uiLayout *col; // uiLayout *row; - arm = ob->data; - if (!arm || !ob->pose) return; + pchan= get_active_posechannel(ob); - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - bone = pchan->bone; - if(bone && (bone->flag & BONE_ACTIVE) && (bone->layer & arm->layer)) - break; - } // row= uiLayoutRow(layout, 0); if (!pchan) { @@ -691,14 +684,9 @@ static void v3d_editarmature_buts(uiLayout *layout, View3D *v3d, Object *ob, flo uiLayout *col; PointerRNA eboneptr; - ebone= arm->edbo->first; + ebone= arm->act_edbone; - for (ebone = arm->edbo->first; ebone; ebone=ebone->next){ - if ((ebone->flag & BONE_ACTIVE) && (ebone->layer & arm->layer)) - break; - } - - if (!ebone) + if (!ebone || (ebone->layer & arm->layer)==0) return; // row= uiLayoutRow(layout, 0); @@ -821,19 +809,10 @@ static void do_view3d_region_buttons(bContext *C, void *arg, int event) case B_ARMATUREPANEL3: // rotate button on channel { - bArmature *arm; bPoseChannel *pchan; - Bone *bone; float eul[3]; - arm = ob->data; - if (!arm || !ob->pose) return; - - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - bone = pchan->bone; - if(bone && (bone->flag & BONE_ACTIVE) && (bone->layer & arm->layer)) - break; - } + pchan= get_active_posechannel(ob); if (!pchan) return; /* make a copy to eul[3], to allow TAB on buttons to work */ |