There’s no way to do it with the built-in tools, but it’s fairly easy to do it with a little python script. Don’t know if anyone has published such a script though… It’s a trivial programming effort.
It wouldn’t be useful to the very vast majority of Blender users I feel.
I too need precision in my drawing but being a cabinetmaker 1/32nd of an inch is about enough.
I have no problem attaining that kind of precision using a series of screens that I set by default (ctrl+u) in all my files. Each has the grid set to its own unit, may it be ‘one foot per blender unit’,
‘one inch per…’, 1/2, 1/4, !/8th and so on
With some ingeniosity and experience it becomes easy but it certainly isn’t obvious from the start.
the results are returned in the dos window, the first three are the distances in the x, y and z direction, and the last number is the distance between the two points.
There are probably better ways to do this, but I hope it helps
You’ll find the empty(ies) next to the lamps, cameras, armatures in the dialog that appears when the space bar or shift+a are pressed.
They are objects that can’t show in the final render. So they can’t be linked to a material/texture but otherwise you can size them, move them rotate them, animater them and the rest.
Among other uses (and they’re very useful!) they are place holders ; sometimes you can set, resize, animate another object’s texture using them ; they’re useful in animation, especially those of armatures…
Selecting an object (turns pink) and pressing ‘N’ brings up a popup window with the position of the purple center spot (and other data).
In edit mode (TAB key) select a vertex (right click on vertex) and press ‘N’.
The popup window will give you the X,Y,Z coords of the vertex RELATIVE TO THE OBJECTS ORIGIN (Sorry about the shouting but its an easy thing to miss :-? ).
so vertex position = object position + vertex values.
All my modeling is for exporting from blender so I ensure all objects are centered on the origin anyway.
But if you’re only interested in the distances you just need to use the object’s scaling factor, you don’t need Loc or Rot.
If you want to be really accurate you can actually move the individual points around in the ‘N’ window, it’s tedious, but extremely accurate, I use it all the time for modelling structures and the like where i know what the dimensions are meant to be.
Thanks for posting the vertex position code. Who (originally) wrote it, and could I adapt it (appropriately credited) to use in an export script please?
I’ve been trying to work it out for a while. I have been trying a different method that appears to only cope with rotation around one axis.
it’s a standard rotation matrix for Linear Transformation theories, so if you want to thank whoever first wrote this, I guess you’d have to dig a 19th century corpse…
If you need some help with vectorial and matricial operations, there’s a python module made mostly by eeshlo (but I helped a little ) that handles that. Just ask me and I’ll e-mail it to you.
I modified the distance script from tuinbels a bit.
Just make a .py file (e.g distance.py) out of it and copy it into your ~/.blender/scritps directory (executeable)
It should be available in the “Object” menu under “Scripts” after a blender restart.
#!BPY
#####################################################################
# blender_distance.py
# This script calculates the distance vector and the distance
# itself between two objects (measured from the basepoint i hope)
# in Blender.
#
# (c) Basic functions by tuinbels under
# https://blenderartists.org/forum/viewtopic.php?p=82923#82923
# Modified and extended by Martin (Pontiac) Buerbaum
#
# The script is currently VERY basic, but if anybody has some
# spare time he is free to modify it.
#
# License:
# The content of this file is under the GNU/GPL license.
# http://www.gnu.org/licenses/gpl.txt
#####################################################################
""" Registration info for Blender menus: <- these words are ignored
Name: 'Distance'
Blender: 235
Group: 'Object'
Tip: 'Calculate the distance between two objects.'
"""
__author__ = "Martin (Pontiac) Buerbaum"
__url__ = ("blender", "elysiun",
"Script's thread in elysiun forum, https://blenderartists.org/forum/viewtopic.php?t=10318")
__version__ = "0.0.2"
import Blender
from Blender import *
import math
from math import *
#import sys
print "<<< Distance calculations >>>"
selected_objects = Object.GetSelected()
if len(selected_objects) >= 2:
dlocx = selected_objects[1].LocX - selected_objects[0].LocX
dlocy = selected_objects[1].LocY - selected_objects[0].LocY
dlocz = selected_objects[1].LocZ - selected_objects[0].LocZ
distance = sqrt((dlocx)**2 + (dlocy)**2 + (dlocz)**2)
Blender.Window.WaitCursor(0)
outputtext = "(dX, dY, dZ); Distance|(%f,%f,%f); %f" % (dlocx, dlocy, dlocz, distance)
Blender.Draw.PupMenu(outputtext)
print outputtext
else:
text_notenoughobjs = "Error!|Not enough objects selected"
Blender.Window.WaitCursor(0)
Blender.Draw.PupMenu(text_notenoughobjs)
print text_notenoughobjs
Does anybody know how to get to the selected vertices/edges from python scripts? That would be quite handy and even easier to use.
Comments and especially improvements welcome
Pontiac