From 5935ef004935b27fc5795349aed32f87cf637049 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 9 Nov 2009 21:03:54 +0000 Subject: 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. --- source/blender/editors/transform/transform_manipulator.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'source/blender/editors/transform/transform_manipulator.c') diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index 0f4848d9120..86e83715da4 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -55,6 +55,7 @@ #include "RNA_access.h" +#include "BKE_action.h" #include "BKE_armature.h" #include "BKE_context.h" #include "BKE_global.h" @@ -185,18 +186,9 @@ void gimbal_axis(Object *ob, float gmat[][3]) { if(ob->mode & OB_MODE_POSE) { - bPoseChannel *pchan= NULL; + bPoseChannel *pchan= get_active_posechannel(ob); - /* use channels to get stats */ - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if (pchan->bone && pchan->bone->flag & BONE_ACTIVE) { - if(test_rotmode_euler(pchan->rotmode)) { - break; - } - } - } - - if(pchan) { + if(pchan && test_rotmode_euler(pchan->rotmode)) { float mat[3][3], tmat[3][3], obmat[3][3]; EulToGimbalAxis(mat, pchan->eul, pchan->rotmode); -- cgit v1.2.3