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:
authorWillian Padovani Germano <wpgermano@gmail.com>2004-08-04 10:16:46 +0400
committerWillian Padovani Germano <wpgermano@gmail.com>2004-08-04 10:16:46 +0400
commit452c8cf838f5616ee750b4e512ceac6809a9a559 (patch)
treef806236705445938335b6dbdd6eecf52b6a49a04 /release/scripts/Axiscopy.py
parent54e1f40024e0525549e6a6bdca432f1c156ae5f9 (diff)
Done.
Scripts: - Jean-Michel Soler probably lost some hours of sleep since Sunday, but he managed to send me the updated path import scripts a few hours ago. My tests with Inkscape .svg and .ps and Gimp worked fine. He also tested a lot and sent me info about what is already supported. I'll send Ton a doc about bundled scripts including this info. Importers: .ai, .svg, .eps/.ps, Gimp 1-1.2.5 / 2.0. - Jean-Michel also contributed his Texture Baker script. - Campbell Barton contributed two new scripts: a mesh cleaner and a vloop skinning / lofting script. He also sent updates to his obj import / export ones. - A Vanpoucke (xand) contributed his Axis Orientation Copy script. And that makes 8 last minute additions. Thanks a lot to the authors and special thanks to JMS and Campbell for their hard work : ). BPython: - tiny addition (I'm forced to call it a showstopper bug ;) so JMS's path import scripts (that actually convert to obj and make Blender load the .obj curves) can use Blender.Load() and not rename G.sce, the default filename. Blender.Load(filename, 1) doesn't update G.sce. Nothing should break because of this, Load(filename) still works fine. - Made Blender complain again if script is for a newer Blender version than the one running it.
Diffstat (limited to 'release/scripts/Axiscopy.py')
-rw-r--r--release/scripts/Axiscopy.py78
1 files changed, 78 insertions, 0 deletions
diff --git a/release/scripts/Axiscopy.py b/release/scripts/Axiscopy.py
new file mode 100644
index 00000000000..bfdb89806cd
--- /dev/null
+++ b/release/scripts/Axiscopy.py
@@ -0,0 +1,78 @@
+#!BPY
+
+""" Registration info for Blender menus: <- these words are ignored
+Name: 'Axis Orientation Copy'
+Blender: 233
+Group: 'Object'
+Tip: 'Copy the axis orientation of the active object to all selected mesh object'
+"""
+
+# $Id$
+#
+#----------------------------------------------
+# A Vanpoucke (xand)
+#from the previous script realignaxis
+#----------------------------------------------
+# Communiquer les problemes et erreurs sur:
+# http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender
+# --------------------------------------------------------------------------
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# Copyright (C) 2003, 2004: A Vanpoucke
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# ***** END GPL LICENCE BLOCK *****
+# --------------------------------------------------------------------------
+
+from Blender import *
+from Blender import Mathutils
+from Blender.Mathutils import *
+
+
+def applyTransform(mesh,mat):
+ for v in mesh.verts:
+ vec = VecMultMat(v.co,mat)
+ v.co[0], v.co[1], v.co[2] = vec[0], vec[1], vec[2]
+
+
+
+
+oblist =Object.GetSelected()
+lenob=len(oblist)
+
+if lenob<2:
+ Draw.PupMenu("Select at least 2 objects")
+else :
+ source=oblist[0]
+ nsource=source.name
+ texte="Copy axis orientation from : " + nsource + " ?%t|OK"
+ result=Draw.PupMenu(texte)
+
+
+ for cible in oblist[1:]:
+ if cible.getType()=='Mesh':
+ if source.rot!=cible.rot:
+ rotcible=cible.mat.toEuler().toMatrix()
+ rotsource=source.mat.toEuler().toMatrix()
+ rotsourcet = CopyMat(rotsource)
+ rotsourcet.invert()
+ mat=rotcible*rotsourcet
+ ncible=cible.name
+ me=NMesh.GetRaw(ncible)
+ applyTransform(me,mat)
+ NMesh.PutRaw(me,ncible)
+ cible.makeDisplayList()
+ cible.rot=source.rot