First commit for the transform coding for me!
- fixed warnings in compile (transform.h struct defines) - drawPropCircle was on wrong location in editmode - removed prop circle drawing for old transform (sorry, but we're going to move soon anyway!) - removed spaces from transform.c
This commit is contained in:
@@ -4360,7 +4360,6 @@ void draw_object(Base *base)
|
||||
}
|
||||
dtx |= OB_DRAWWIRE; // draws edges, transp faces, subsurf optimal, vertices
|
||||
}
|
||||
if(ob==G.obedit && (G.f & G_PROPORTIONAL)) draw_prop_circle();
|
||||
}
|
||||
else {
|
||||
Material *ma= give_current_material(ob, 1);
|
||||
@@ -4403,7 +4402,6 @@ void draw_object(Base *base)
|
||||
|
||||
if(ob==G.obedit) {
|
||||
drawnurb(ob, editNurb.first, dt);
|
||||
if((G.f & G_PROPORTIONAL)) draw_prop_circle();
|
||||
}
|
||||
else if(dt==OB_BOUNDBOX) draw_bounding_volume(ob);
|
||||
else if(boundbox_clip(ob->obmat, cu->bb)) drawDispList(ob, dt);
|
||||
@@ -4427,7 +4425,6 @@ void draw_object(Base *base)
|
||||
break;
|
||||
case OB_LATTICE:
|
||||
drawlattice(ob);
|
||||
if(ob==G.obedit && (G.f & G_PROPORTIONAL)) draw_prop_circle();
|
||||
break;
|
||||
case OB_ARMATURE:
|
||||
draw_armature (ob);
|
||||
|
||||
@@ -4140,13 +4140,13 @@ void make_trans_verts(float *min, float *max, int mode)
|
||||
|
||||
}
|
||||
|
||||
/* now only in use by drawimage.c */
|
||||
void draw_prop_circle()
|
||||
{
|
||||
if (G.f & G_PROPORTIONAL) {
|
||||
float tmat[4][4], imat[4][4];
|
||||
|
||||
if(G.moving) {
|
||||
|
||||
BIF_ThemeColor(TH_GRID);
|
||||
|
||||
mygetmatrix(tmat);
|
||||
|
||||
@@ -99,6 +99,8 @@
|
||||
#include "blendef.h"
|
||||
#include "mydevice.h"
|
||||
|
||||
#include "transform.h"
|
||||
|
||||
extern ListBase editNurb; /* originally from exports.h, memory from editcurve.c*/
|
||||
/* editmball.c */
|
||||
extern ListBase editelems;
|
||||
@@ -708,7 +710,15 @@ int gesture(void)
|
||||
if(curarea->spacetype==SPACE_IPO) transform_ipo(i);
|
||||
else if(curarea->spacetype==SPACE_IMAGE) transform_tface_uv(i);
|
||||
else if(curarea->spacetype==SPACE_OOPS) transform_oops('g');
|
||||
else transform(i);
|
||||
else {
|
||||
#ifdef NEWTRANSFORM
|
||||
if(i=='g') Transform(TRANSLATION);
|
||||
else if(i=='s') Transform(ROTATION);
|
||||
else Transform(RESIZE);
|
||||
#else
|
||||
transform(i);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
|
||||
@@ -247,7 +247,7 @@ void createTransCurveVerts()
|
||||
BezTriple *bezt;
|
||||
BPoint *bp;
|
||||
int a;
|
||||
int proptrans= 0;
|
||||
//int proptrans= 0;
|
||||
float mtx[3][3], smtx[3][3];
|
||||
|
||||
count = allocTransData();
|
||||
@@ -351,11 +351,11 @@ void createTransLatticeVerts()
|
||||
int count = 0;
|
||||
BPoint *bp;
|
||||
float mtx[3][3], smtx[3][3];
|
||||
|
||||
int mode = 0; /*This used for proportional editing*/
|
||||
/*should find a function that does this. . . what else is this used for? I DONT KNOW!*/
|
||||
int a;
|
||||
int proptrans= 0;
|
||||
//int proptrans= 0;
|
||||
|
||||
bp= editLatt->def;
|
||||
|
||||
|
||||
@@ -411,9 +411,8 @@ void createTransEditVerts()
|
||||
EditMesh *em = G.editMesh;
|
||||
EditVert *eve;
|
||||
float mtx[3][3], smtx[3][3];
|
||||
|
||||
/*should find a function that does this. . .*/
|
||||
int proptrans= 0;
|
||||
// int proptrans= 0;
|
||||
|
||||
// transform now requires awareness for select mode, so we tag the f1 flags in verts
|
||||
if(G.scene->selectmode & SCE_SELECT_VERTEX) {
|
||||
@@ -1316,19 +1315,20 @@ int Rotation(TransInfo *t, short mval[2]) {
|
||||
/* ************************** TRANSLATION *************************** */
|
||||
|
||||
void initTranslation(TransInfo *t) {
|
||||
int x, y;
|
||||
// int x, y;
|
||||
t->num.idx_max = 2;
|
||||
t->transform = Translation;
|
||||
x = G.vd->area->v1->vec.x;
|
||||
y = G.vd->area->v1->vec.y + (G.vd->area->headwin?28:1);
|
||||
warp_pointer(t->center2d[0] + x, t->center2d[1] + y);
|
||||
|
||||
t->imval[0] = t->center2d[0];
|
||||
t->imval[1] = t->center2d[1];
|
||||
//x = G.vd->area->v1->vec.x;
|
||||
//y = G.vd->area->v1->vec.y + (G.vd->area->headwin?28:1);
|
||||
//warp_pointer(t->center2d[0] + x, t->center2d[1] + y);
|
||||
|
||||
//t->imval[0] = t->center2d[0];
|
||||
//t->imval[1] = t->center2d[1];
|
||||
}
|
||||
|
||||
int Translation(TransInfo *t, short mval[2]) {
|
||||
float vec[3], tvec[3], *smtx = NULL;
|
||||
float vec[3], tvec[3];
|
||||
int i;
|
||||
char str[70];
|
||||
TransData *td = t->data;
|
||||
|
||||
@@ -37,6 +37,9 @@
|
||||
|
||||
/* ************************** Types ***************************** */
|
||||
|
||||
struct TransInfo;
|
||||
struct TransData;
|
||||
|
||||
typedef struct TransCon {
|
||||
char text[50]; /* Description of the Constraint for header_print */
|
||||
float mtx[3][3]; /* Matrix of the Constraint space */
|
||||
|
||||
@@ -292,6 +292,7 @@ void drawConstraint() {
|
||||
|
||||
}
|
||||
|
||||
/* called from drawview.c, as ane xtra per-window draw option */
|
||||
void drawPropCircle()
|
||||
//void drawPropCircle(TransInfo *t)
|
||||
{
|
||||
@@ -302,10 +303,16 @@ void drawPropCircle()
|
||||
|
||||
BIF_ThemeColor(TH_GRID);
|
||||
|
||||
/* if editmode we need to go into object space */
|
||||
if(G.obedit) mymultmatrix(G.obedit->obmat);
|
||||
|
||||
mygetmatrix(tmat);
|
||||
Mat4Invert(imat, tmat);
|
||||
|
||||
drawcircball(t->center, t->propsize, imat);
|
||||
|
||||
/* if editmode we restore */
|
||||
if(G.obedit) myloadmatrix(G.vd->viewmat);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user