diff options
author | Martin Poirier <theeth@yahoo.com> | 2008-06-18 01:17:11 +0400 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2008-06-18 01:17:11 +0400 |
commit | b4c123c275172eb4f8477ea90c3f68d61565483b (patch) | |
tree | f592fb726f35ecf3697a3a9ce0d32fbe16d013c2 /source/blender/src | |
parent | 272a91f754fd215f2ad9b48ba80fe56ee0564d7a (diff) |
[#14400] Crash on grab/move on axis when nothing selected (patch included)
I used a different fix than the included patch, but that was a pretty nasty crasher (only crash on menu/toolbox, not hotkeys).
Diffstat (limited to 'source/blender/src')
-rw-r--r-- | source/blender/src/transform_constraints.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/src/transform_constraints.c b/source/blender/src/transform_constraints.c index 769ebd2ea97..2d01c2303fc 100644 --- a/source/blender/src/transform_constraints.c +++ b/source/blender/src/transform_constraints.c @@ -550,6 +550,10 @@ void setUserConstraint(TransInfo *t, int mode, const char ftext[]) { void BIF_setLocalLockConstraint(char axis, char *text) { TransInfo *t = BIF_GetTransInfo(); + if (t->total == 0) { + return; + } + switch (axis) { case 'x': setLocalConstraint(t, (CON_AXIS1|CON_AXIS2), text); @@ -566,6 +570,10 @@ void BIF_setLocalLockConstraint(char axis, char *text) { void BIF_setLocalAxisConstraint(char axis, char *text) { TransInfo *t = BIF_GetTransInfo(); + if (t->total == 0) { + return; + } + switch (axis) { case 'X': setLocalConstraint(t, CON_AXIS0, text); @@ -584,6 +592,10 @@ void BIF_setSingleAxisConstraint(float vec[3], char *text) { TransInfo *t = BIF_GetTransInfo(); float space[3][3], v[3]; + if (t->total == 0) { + return; + } + VECCOPY(space[0], vec); v[0] = vec[2]; @@ -622,6 +634,10 @@ void BIF_setDualAxisConstraint(float vec1[3], float vec2[3], char *text) { TransInfo *t = BIF_GetTransInfo(); float space[3][3]; + if (t->total == 0) { + return; + } + VECCOPY(space[0], vec1); VECCOPY(space[1], vec2); Crossf(space[2], space[0], space[1]); |