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>2006-05-15 17:33:30 +0400
committerCampbell Barton <ideasman42@gmail.com>2006-05-15 17:33:30 +0400
commit51eb744807f94b6af89bbf3117014307e9a27429 (patch)
treec1ad610e2c5857f57cc36ffb3cd653b5e1912c99 /release
parent996b594d015573f2aad0223fc913e05705495488 (diff)
BPyImage had a problem with a path being returned as None
BPyMesh would make NAN coords for collapsed edges.
Diffstat (limited to 'release')
-rw-r--r--release/scripts/bpymodules/BPyImage.py5
-rw-r--r--release/scripts/bpymodules/BPyMesh_redux.py6
2 files changed, 9 insertions, 2 deletions
diff --git a/release/scripts/bpymodules/BPyImage.py b/release/scripts/bpymodules/BPyImage.py
index fe67745f5e7..2b14877d475 100644
--- a/release/scripts/bpymodules/BPyImage.py
+++ b/release/scripts/bpymodules/BPyImage.py
@@ -71,7 +71,10 @@ def getExt(name):
# Adds a slash to the end of a path if its not there #
#====================================================#
def addSlash(path):
- if path.endswith('\\') or path.endswith('/'):
+ if not path:
+ return ''
+
+ elif path.endswith('\\') or path.endswith('/'):
return path
return path + sys.sep
diff --git a/release/scripts/bpymodules/BPyMesh_redux.py b/release/scripts/bpymodules/BPyMesh_redux.py
index c97ae1c8562..7c5e04687e1 100644
--- a/release/scripts/bpymodules/BPyMesh_redux.py
+++ b/release/scripts/bpymodules/BPyMesh_redux.py
@@ -136,6 +136,7 @@ def redux(ob, REDUX=0.5, BOUNDRY_WEIGHT=2.0, FACE_AREA_WEIGHT=1.0, FACE_TRIANGUL
v1no= ced.v1.co
v2no= ced.v2.co
length= ced.length
+ between= (v1co + v2co) * 0.5
# Collapse
# new_location = between # Replace tricky code below. this code predicts the best collapse location.
@@ -152,7 +153,10 @@ def redux(ob, REDUX=0.5, BOUNDRY_WEIGHT=2.0, FACE_AREA_WEIGHT=1.0, FACE_TRIANGUL
cv1 = cv1 * length* 0.333
cv2 = cv2 * length* 0.333
- ced.collapse_loc = ((v1co + v2co) * 0.5) + (cv1 + cv2)
+
+ ced.collapse_loc = between + (cv1 + cv2)
+ if ced.collapse_loc.x != ced.collapse_loc.x: # NAN LOCATION, revert to between
+ ced.collapse_loc= between
# Best method, no quick hacks here, Correction. Should be the best but needs tweaks.