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.
This commit is contained in:
Ton Roosendaal
2005-07-11 17:12:33 +00:00
parent 7d80ffa538
commit 03c255ac1d
3 changed files with 39 additions and 9 deletions

View File

@@ -511,11 +511,11 @@ void do_all_actions(Object *ob)
/* Do local action (always overrides the nla actions) */
extract_pose_from_action (ob->pose, ob->action, bsystem_time(ob, 0, (float) G.scene->r.cfra, 0.0));
}
else {
else if(ob->nlastrips.first) {
doit=0;
copy_pose(&tpose, ob->pose, 1);
rest_pose(ob->pose, 1);
rest_pose(ob->pose, 1); // potentially destroying current not-keyed pose
for (strip=ob->nlastrips.first; strip; strip=strip->next){
doit = 0;

View File

@@ -1721,7 +1721,20 @@ void minmax_object(Object *ob, float *min, float *max)
DO_MINMAX(bb.vec[a], min, max);
}
break;
case OB_ARMATURE:
if(ob->pose) {
bPoseChannel *pchan;
for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
VECCOPY(vec, pchan->pose_head);
Mat4MulVecfl(ob->obmat, vec);
DO_MINMAX(vec, min, max);
VECCOPY(vec, pchan->pose_tail);
Mat4MulVecfl(ob->obmat, vec);
DO_MINMAX(vec, min, max);
}
break;
}
/* no break, get_mesh will give NULL and it passes on to default */
case OB_MESH:
me= get_mesh(ob);

View File

@@ -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;