Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Poirier <theeth@yahoo.com>2005-05-02 06:18:13 +0400
committerMartin Poirier <theeth@yahoo.com>2005-05-02 06:18:13 +0400
commit61f2736ec36154f5832c11ae5d018e6eaf89a3b2 (patch)
treeae4c589272b3065c36134a976496bc9b793e15dc /source/blender/src/transform_constraints.c
parent01a053f98975665d65a608a396fe2d6eedb2f454 (diff)
Local axis constraint external call. Had to do it in a very hackish way which highlight a design problem in the code. To solve it (and would solve other problems too), we'd have to split off the initialisation function. Not terribly hard to do but I'm overwhelmed with work...
Push/Pull had a problem with constraints enabling/disabling. Fixed Restablished infinite line for constraint draw (when not using manipulator) as discussed in meeting.
Diffstat (limited to 'source/blender/src/transform_constraints.c')
-rwxr-xr-xsource/blender/src/transform_constraints.c52
1 files changed, 42 insertions, 10 deletions
diff --git a/source/blender/src/transform_constraints.c b/source/blender/src/transform_constraints.c
index 7611041cddd..1c67e272146 100755
--- a/source/blender/src/transform_constraints.c
+++ b/source/blender/src/transform_constraints.c
@@ -541,6 +541,42 @@ void setConstraint(TransInfo *t, float space[3][3], int mode, const char text[])
t->redraw = 1;
}
+void BIF_setLocalAxisConstraint(char axis, char *text) {
+ TransInfo *t = BIF_GetTransInfo();
+
+ strncpy(t->con.text, text, 48);
+
+ switch (axis) {
+ case 'X':
+ t->con.mode = (CON_AXIS0|CON_APPLY);
+ break;
+ case 'Y':
+ t->con.mode = (CON_AXIS1|CON_APPLY);
+ break;
+ case 'Z':
+ t->con.mode = (CON_AXIS2|CON_APPLY);
+ break;
+ }
+}
+
+void BIF_setLocalLockConstraint(char axis, char *text) {
+ TransInfo *t = BIF_GetTransInfo();
+
+ strncpy(t->con.text, text, 48);
+
+ switch (axis) {
+ case 'x':
+ t->con.mode = (CON_AXIS1|CON_AXIS2|CON_APPLY);
+ break;
+ case 'y':
+ t->con.mode = (CON_AXIS0|CON_AXIS2|CON_APPLY);
+ break;
+ case 'z':
+ t->con.mode = (CON_AXIS0|CON_AXIS1|CON_APPLY);
+ break;
+ }
+}
+
void setLocalConstraint(TransInfo *t, int mode, const char text[]) {
if (t->flag & T_EDIT) {
float obmat[3][3];
@@ -650,11 +686,10 @@ void BIF_drawConstraint(void)
window_to_3d(vec, (short)(mval[0] - t->con.imval[0]), (short)(mval[1] - t->con.imval[1]));
VecAddf(vec, vec, tc->center);
-// drawLine(tc->center, tc->mtx[0], 'x', 0);
-// drawLine(tc->center, tc->mtx[1], 'y', 0);
-// drawLine(tc->center, tc->mtx[2], 'z', 0);
+ drawLine(tc->center, tc->mtx[0], 'x', 0);
+ drawLine(tc->center, tc->mtx[1], 'y', 0);
+ drawLine(tc->center, tc->mtx[2], 'z', 0);
- draw_manipulator_ext(curarea, t->mode, 'c', 2, tc->center, tc->mtx);
glColor3ubv(col2);
glDisable(GL_DEPTH_TEST);
@@ -668,16 +703,13 @@ void BIF_drawConstraint(void)
}
if (tc->mode & CON_AXIS0) {
- draw_manipulator_ext(curarea, t->mode, 'x', 0, tc->center, tc->mtx);
-// drawLine(tc->center, tc->mtx[0], 'x', DRAWLIGHT);
+ drawLine(tc->center, tc->mtx[0], 'x', DRAWLIGHT);
}
if (tc->mode & CON_AXIS1) {
- draw_manipulator_ext(curarea, t->mode, 'y', 0, tc->center, tc->mtx);
-// drawLine(tc->center, tc->mtx[1], 'y', DRAWLIGHT);
+ drawLine(tc->center, tc->mtx[1], 'y', DRAWLIGHT);
}
if (tc->mode & CON_AXIS2) {
- draw_manipulator_ext(curarea, t->mode, 'z', 0, tc->center, tc->mtx);
-// drawLine(tc->center, tc->mtx[2], 'z', DRAWLIGHT);
+ drawLine(tc->center, tc->mtx[2], 'z', DRAWLIGHT);
}
}
}