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

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGermano <germano.costa@ig.com.br>2017-09-23 01:40:58 +0300
committerGermano <germano.costa@ig.com.br>2017-09-23 01:40:58 +0300
commit73c7e3ff1491914a5a6b713950deb1ec758455dc (patch)
tree0136ca2131aef08d6781a074c74b13cce15b3838 /mesh_snap_utilities_line.py
parent67c555a8b193749b6440d2cdcad9961a9949f0b2 (diff)
module snap_context: F8 constrain should not intersect outlocation
Diffstat (limited to 'mesh_snap_utilities_line.py')
-rw-r--r--mesh_snap_utilities_line.py25
1 files changed, 13 insertions, 12 deletions
diff --git a/mesh_snap_utilities_line.py b/mesh_snap_utilities_line.py
index a74c7479..36280911 100644
--- a/mesh_snap_utilities_line.py
+++ b/mesh_snap_utilities_line.py
@@ -204,12 +204,15 @@ def snap_utilities(
if not snp_obj:
is_increment = True
- r_type = 'OUT'
- r_loc = out_Location(rv3d, region, orig, view_vector)
if constrain:
- t_loc = intersect_point_line(r_loc, constrain[0], constrain[1])[0]
- if t_loc:
- r_loc = t_loc
+ end = orig + view_vector
+ t_loc = intersect_line_line(constrain[0], constrain[1], orig, end)
+ if t_loc is None:
+ t_loc = constrain
+ r_loc = t_loc[0]
+ else:
+ r_type = 'OUT'
+ r_loc = out_Location(rv3d, region, orig, view_vector)
elif snp_obj.data[0] != obj: #OUT
r_loc = loc
@@ -239,9 +242,7 @@ def snap_utilities(
#cache.v2d = location_3d_to_region_2d(region, rv3d, cache.vco)
if constrain:
- location = intersect_point_line(cache.vco, constrain[0], constrain[1])
- #factor = location[1]
- r_loc = location[0]
+ r_loc = intersect_point_line(cache.vco, constrain[0], constrain[1])[0]
else:
r_loc = cache.vco
@@ -269,12 +270,12 @@ def snap_utilities(
#else: cache.v2dperp = None
if constrain:
- location = intersect_line_line(constrain[0], constrain[1], cache.v0, cache.v1)
- if location == None:
+ t_loc = intersect_line_line(constrain[0], constrain[1], cache.v0, cache.v1)
+ if t_loc is None:
is_increment = True
end = orig + view_vector
- location = intersect_line_line(constrain[0], constrain[1], orig, end)
- r_loc = location[0]
+ t_loc = intersect_line_line(constrain[0], constrain[1], orig, end)
+ r_loc = t_loc[0]
elif cache.v2dperp and\
abs(cache.v2dperp[0] - mcursor[0]) < 10 and abs(cache.v2dperp[1] - mcursor[1]) < 10: