diff options
author | Ton Roosendaal <ton@blender.org> | 2005-07-23 22:52:31 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2005-07-23 22:52:31 +0400 |
commit | 948f27c0d888bbfe0f10c4350b4269166568b40d (patch) | |
tree | 2d582413b47bdddc8393c1815f8d7a1184bd4367 /source/blender/src/poseobject.c | |
parent | 6e98a38ea2268fdd96acd6c280286001bca949f6 (diff) |
Killed silly modal PoseMode mode! :)
- PoseMode now is a state Armature Objects can be in. So, while in PoseMode
for an Armature, you can just select another Object or Armature.
- The old PoseMode options (transform, insert keys etc) are accessible
with making the Armature Object 'active' (and have object in PoseMode).
- At this moment no multiple Poses can be transformed/edited at the same
time.
- The old hotkey CTRL+TAB, and view3d header menu, still work to set an
Object's PoseMode
It was quite a lot recode, so tests & reports are welcome.
Oh, as a bonus I added Lasso Select for Bones in PoseMode! It selects using
only the line between root and tip of the Bone.
Diffstat (limited to 'source/blender/src/poseobject.c')
-rw-r--r-- | source/blender/src/poseobject.c | 44 |
1 files changed, 16 insertions, 28 deletions
diff --git a/source/blender/src/poseobject.c b/source/blender/src/poseobject.c index 064675281c0..741b38754c8 100644 --- a/source/blender/src/poseobject.c +++ b/source/blender/src/poseobject.c @@ -78,10 +78,8 @@ void enter_posemode(void) if(G.scene->id.lib) return; base= BASACT; if(base==NULL) return; - if((base->lay & G.vd->lay)==0) return; ob= base->object; - if(ob->data==NULL) return; if (ob->id.lib){ error ("Can't pose libdata"); @@ -93,7 +91,6 @@ void enter_posemode(void) arm= get_armature(ob); if( arm==NULL ) return; - G.obpose= ob; ob->flag |= OB_POSEMODE; base->flag= ob->flag; @@ -108,8 +105,6 @@ void enter_posemode(void) if (G.obedit) exit_editmode(1); G.f &= ~(G_VERTEXPAINT | G_FACESELECT | G_TEXTUREPAINT | G_WEIGHTPAINT); - - } void set_pose_keys (Object *ob) @@ -130,41 +125,34 @@ void set_pose_keys (Object *ob) } -void exit_posemode (int freedata) +void exit_posemode(void) { - Object *ob; + Object *ob= OBACT; Base *base= BASACT; - if(G.obpose==NULL) return; - - ob= G.obpose; + if(ob==NULL) return; + ob->flag &= ~OB_POSEMODE; base->flag= ob->flag; - G.obpose= NULL; - - if(freedata) { - setcursor_space(SPACE_VIEW3D, CURSOR_STD); - - countall(); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWHEADERS, 0); - allqueue(REDRAWBUTSALL, 0); - } - else { - G.obpose= ob; - } + countall(); + allqueue(REDRAWVIEW3D, 0); + allqueue(REDRAWOOPS, 0); + allqueue(REDRAWHEADERS, 0); + allqueue(REDRAWBUTSALL, 0); scrarea_queue_headredraw(curarea); } void pose_special_editmenu(void) { + Object *ob= OBACT; bPoseChannel *pchan; short nr; - for(pchan= G.obpose->pose->chanbase.first; pchan; pchan= pchan->next) + if(!ob && !ob->pose) return; + + for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) if(pchan->bone->flag & BONE_ACTIVE) break; if(pchan==NULL) return; @@ -174,11 +162,11 @@ void pose_special_editmenu(void) for(con= pchan->constraints.first; con; con= con->next) { char *subtarget; - Object *ob= get_constraint_target(con, &subtarget); + Object *target= get_constraint_target(con, &subtarget); - if(ob==G.obpose) { + if(ob==target) { if(subtarget) { - pchan= get_pose_channel(G.obpose->pose, subtarget); + pchan= get_pose_channel(ob->pose, subtarget); pchan->bone->flag |= BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL; } } |