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:
authorCampbell Barton <ideasman42@gmail.com>2011-04-20 13:46:45 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-04-20 13:46:45 +0400
commit0da889dff5515ebd2201874c7272398f5dc156b2 (patch)
tree4d1ab1c553d2e9e3b1bb626e33e6918f8dc20293
parente0a81dd1a836f9191685889b72ab01d12d5619c2 (diff)
while looking into [#27057] noticed when the view and the transform center are 0,0,0 it gives NAN values.
-rw-r--r--source/blender/editors/transform/transform_constraints.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c
index 0012334cf92..e5e31a8e319 100644
--- a/source/blender/editors/transform/transform_constraints.c
+++ b/source/blender/editors/transform/transform_constraints.c
@@ -243,7 +243,13 @@ static void axisProjection(TransInfo *t, float axis[3], float in[3], float out[3
sub_v3_v3v3(v, i2, v);
- sub_v3_v3v3(out, i1, t->con.center);
+ sub_v3_v3v3(out, i1, t->con.center);
+
+ /* possible some values become nan when
+ * viewpoint and object are both zero */
+ if(!finite(out[0])) out[0]= 0.0f;
+ if(!finite(out[1])) out[1]= 0.0f;
+ if(!finite(out[2])) out[2]= 0.0f;
}
}
}