diff options
author | Ton Roosendaal <ton@blender.org> | 2005-07-11 21:12:33 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2005-07-11 21:12:33 +0400 |
commit | 03c255ac1d4e4bf757bbc00e787f9789d1a02853 (patch) | |
tree | 0b30ffc7db680bde6dc1d0cd52b49747d292d9f6 /source/blender/src/view.c | |
parent | 7d80ffa538ff4ab16a65ff3b6f3f28423a6c4a86 (diff) |
New: Armature editmode/posemode now react correctly to HOME or Numpad-DOT
for viewing all or only selection nicely centered.
Fix: Poses without NLA or Action were reset to restposition on file read
or exit editmode.
Diffstat (limited to 'source/blender/src/view.c')
-rw-r--r-- | source/blender/src/view.c | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/source/blender/src/view.c b/source/blender/src/view.c index 98198fb4565..c15f6211b48 100644 --- a/source/blender/src/view.c +++ b/source/blender/src/view.c @@ -50,14 +50,16 @@ #include "BLI_blenlib.h" #include "BLI_arithb.h" +#include "DNA_action_types.h" +#include "DNA_armature_types.h" +#include "DNA_camera_types.h" +#include "DNA_lamp_types.h" #include "DNA_object_types.h" #include "DNA_screen_types.h" #include "DNA_scene_types.h" #include "DNA_space_types.h" -#include "DNA_view3d_types.h" -#include "DNA_camera_types.h" -#include "DNA_lamp_types.h" #include "DNA_userdef_types.h" +#include "DNA_view3d_types.h" #include "BKE_utildefines.h" #include "BKE_object.h" @@ -1081,11 +1083,26 @@ void centreview() /* like a localview without local! */ max[0]= max[1]= max[2]= -1.0e10; if(G.obedit) { - minmax_verts(min, max); - //minmax_object(G.obedit, min, max); - + minmax_verts(min, max); // ony selected ok= 1; } + else if(G.obpose) { + if(G.obpose->pose) { + bPoseChannel *pchan; + float vec[3]; + for(pchan= G.obpose->pose->chanbase.first; pchan; pchan= pchan->next) { + if(pchan->bone->flag & BONE_SELECTED) { + ok= 1; + VECCOPY(vec, pchan->pose_head); + Mat4MulVecfl(G.obpose->obmat, vec); + DO_MINMAX(vec, min, max); + VECCOPY(vec, pchan->pose_tail); + Mat4MulVecfl(G.obpose->obmat, vec); + DO_MINMAX(vec, min, max); + } + } + } + } else if (G.f & G_FACESELECT) { minmax_tface(min, max); ok= 1; |