1# Test script to compare transform-matrix vlaues in Blender 2# Load in blender text editor, select one or more empties and hit [ALT][P] 3 4# ***** BEGIN GPL LICENSE BLOCK ***** 5# 6# This program is free software; you can redistribute it and/or 7# modify it under the terms of the GNU General Public License 8# as published by the Free Software Foundation; either version 2 9# of the License, or (at your option) any later version. 10# 11# This program is distributed in the hope that it will be useful, 12# but WITHOUT ANY WARRANTY; without even the implied warranty of 13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14# GNU General Public License for more details. 15# 16# You should have received a copy of the GNU General Public License 17# along with this program; if not, write to the Free Software Foundation, 18# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19# 20# ***** END GPL LICENCE BLOCK ***** 21 22import Blender 23from Blender import * 24from Blender.Window import * 25from Blender.Object import * 26from Blender.Mathutils import * 27 28import math 29import struct, string 30from types import * 31 32objects = Blender.Object.GetSelected() 33for object in objects: 34 if object.getType()=="Empty": 35 origin = object.getLocation('worldspace') 36 matrix = object.getMatrix('worldspace') 37 print "Name", object.name 38 print " Origin:", origin[0], " ",origin[1]," ",origin[2] 39 print " Matrix:" 40 print "", matrix[0][0], " ",matrix[0][1]," ",matrix[0][2] 41 print "", matrix[1][0], " ",matrix[1][1]," ",matrix[1][2] 42 print "", matrix[2][0], " ",matrix[2][1]," ",matrix[2][2] 43