[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2136] branches/ivygen/truman_ivy/ ivy_gen_truman.py:
Andrew Hale
TrumanBlending at gmail.com
Tue Jul 19 09:15:09 CEST 2011
Revision: 2136
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2136
Author: trumanblending
Date: 2011-07-19 07:15:08 +0000 (Tue, 19 Jul 2011)
Log Message:
-----------
Modified Paths:
--------------
branches/ivygen/truman_ivy/ivy_gen_truman.py
Modified: branches/ivygen/truman_ivy/ivy_gen_truman.py
===================================================================
--- branches/ivygen/truman_ivy/ivy_gen_truman.py 2011-07-18 23:25:48 UTC (rev 2135)
+++ branches/ivygen/truman_ivy/ivy_gen_truman.py 2011-07-19 07:15:08 UTC (rev 2136)
@@ -410,12 +410,14 @@
# Check if there's an object
if context.active_object is None:
return False
- # Check if the 3D cursor is close
- elif context.active_object.find_nearest(
- context.scene.cursor_location) > 0.001:
- return False
else:
- return True
+ curPos = context.scene.cursor_location
+ nearPos = context.active_object.closest_point_on_mesh(curPos)
+ # Check if the cursor is close enough
+ if (curPos - nearPos[0]).length > 0.1:
+ return False
+ else:
+ return True
def execute(self, context):
# Get the selected object
@@ -459,4 +461,4 @@
if __name__ == "__main__":
- register()
+ register()
\ No newline at end of file
More information about the Bf-extensions-cvs
mailing list