3d - Assess to distance.
I've made a little script for Blender. It measures the distance between active object (in 3d view) and the cursor. Use with Maj-SKey-Cursor to Selection.
A tutorial for understand scripts :
http://perso.wanadoo.fr/jb.perin/ScriptPython/TutorialBlenderPython.html(fr)
Here is the script's code :
"""
Name: 'Distance'
Blender: 241
Group: 'Object'
Tooltip: 'Measure the distance between active object and the cursor.'
"""
# The Distance 0.1
# by :
# Pascal Isman (lascapi)
from Blender import *
print "--------------------"
obj = Object.GetSelected()[0]
cur_pos = Window.GetCursorPos()
obj_pos = obj.getLocation()
dist = (cur_pos[0] - obj_pos[0])**2 + (cur_pos[1] - obj_pos[1])**2 + (cur_pos[2] - obj_pos[2])**2
norm = (dist)**.5
print "The distance between ", obj.getName(), "and the cursor is ", norm
And here is the file :
monscript.py(fr).
Creation date : 06/02/2006 @ 19:27
Last update : 19/03/2006 @ 00:20
Category : 3d
Preview
Print the article