Fixed bug #8514, sculpt: pivot last and undo

Undoing in sculpt mode correctly returns to previous pivots now.
This commit is contained in:
Nicholas Bishop 2008-03-21 01:10:32 +00:00
parent 734db8cbff
commit b7bdc6c7a1
4 changed files with 9 additions and 8 deletions

@ -59,9 +59,6 @@ typedef struct SculptSession {
struct RadialControl *radialcontrol;
/* For rotating around a pivot point */
vec3f pivot;
struct SculptStroke *stroke;
} SculptSession;

@ -468,6 +468,10 @@ typedef struct SculptData
/* Settings for each brush */
BrushData drawbrush, smoothbrush, pinchbrush, inflatebrush, grabbrush, layerbrush, flattenbrush;
/* For rotating around a pivot point */
float pivot[3];
short brush_type;
/* For the Brush Shape */
@ -486,10 +490,10 @@ typedef struct SculptData
/* Symmetry is separate from the other BrushData because the same
settings are always used for all brush types */
char symm;
/* Added to store if the 'Rake' setting has been set */
char rake;
char pad[7];
char pad[3];
} SculptData;
typedef struct Scene {

@ -1231,7 +1231,7 @@ void init_brushaction(BrushAction *a, short *mouse, short *pr_mouse)
/* Set the pivot to allow the model to rotate around the center of the brush */
if(get_depth(mouse[0],mouse[1]) < 1.0)
VecCopyf(&sculpt_session()->pivot.x, a->symm.center_3d);
VecCopyf(sd->pivot, a->symm.center_3d);
/* Now project the Up, Right, and Out normals from view to model coords */
unproject(zero_loc, 0, 0, 0);
@ -1692,7 +1692,7 @@ void sculpt(void)
}
else {
do_symmetrical_brush_actions(a, mouse, mvalo);
unproject(&ss->pivot.x, mouse[0], mouse[1], a->depth);
unproject(sd->pivot, mouse[0], mouse[1], a->depth);
}
if(modifier_calculations || ob_get_keyblock(ob))

@ -579,7 +579,7 @@ void viewmove(int mode)
use_sel= 1;
VecCopyf(ofs, G.vd->ofs);
VecCopyf(obofs,&sculpt_session()->pivot.x);
VecCopyf(obofs, sculpt_data()->pivot);
Mat4MulVecfl(ob->obmat, obofs);
obofs[0]= -obofs[0];
obofs[1]= -obofs[1];