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>2006-07-07 22:39:51 +0400
committerWillian Padovani Germano <wpgermano@gmail.com>2006-07-07 22:39:51 +0400
commit8aed0ead0b48f111abc9b7a733b0e0ff2a56011e (patch)
tree72ba49e2a8a2fb03a72df07a80304f9a1a6398ca /release/scripts/Axiscopy.py
parent46110ec06b8fe5b5b0c242d5dd48cfb6a3ff7236 (diff)
Gui:
[ #4581 ] related to scripts window updates, details here: http://projects.blender.org/tracker/index.php?func=detail&aid=4581&group_id=9&atid=125 Scripts updated: -Jean-Michel Soler updated some of his scripts: paths importer (ai, eps, gimp, svg), kml / kmz importer and also updated Axiscopy.py by A Vanpoucke (xand) and the knife script (this version handles multiple materials) by Stefano Selleri and Wim Van Hoydonck. Thanks!
Diffstat (limited to 'release/scripts/Axiscopy.py')
-rw-r--r--release/scripts/Axiscopy.py72
1 files changed, 38 insertions, 34 deletions
diff --git a/release/scripts/Axiscopy.py b/release/scripts/Axiscopy.py
index a6fa2e8b627..f2e07bf626f 100644
--- a/release/scripts/Axiscopy.py
+++ b/release/scripts/Axiscopy.py
@@ -4,7 +4,7 @@
Name: 'Axis Orientation Copy'
Blender: 239
Group: 'Object'
-Tip: 'Copy the axis orientation of the active object to all selected mesh objects'
+Tip: 'Copy local axis orientation of active object to all selected meshes (changes mesh data)'
"""
__author__ = "A Vanpoucke (xand)"
@@ -27,14 +27,16 @@ selection), then select the object whose orientation will be copied from and
finally run this script to update the angles.
Notes:<br>
- Before copying the orientation to each object, the script stores its
-transformation matrix. Then the angles are copied and after that the object's
+ This script changes mesh data: the vertices are transformed.<br>
+ Before copying the orientation to each object, the script stores its
+transformation matrix. Then the angles are copied and after that the object's
vertices are transformed "back" so that they still have the same positions as
before. In other words, the rotations are updated, but you won't notice that
just from looking at the objects.<br>
- Checking their X, Y and Z rotation values with "Transform Properties" in
+ Checking their X, Y and Z rotation values with "Transform Properties" in
the 3D View's Object menu shows the angles are now the same of the active
-object.
+object. Or simply look at the transform manipulator handles in local transform
+orientation.
"""
@@ -45,7 +47,7 @@ object.
#from the previous script realignaxis
#----------------------------------------------
# Communiquer les problemes et erreurs sur:
-# http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender
+# http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender
# --------------------------------------------------------------------------
# ***** BEGIN GPL LICENSE BLOCK *****
#
@@ -58,7 +60,7 @@ object.
#
# 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
+# 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
@@ -75,8 +77,8 @@ from Blender.Mathutils import *
def applyTransform(mesh,mat):
for v in mesh.verts:
- vec = v.co*mat
- v.co[0], v.co[1], v.co[2] = vec[0], vec[1], vec[2]
+ vec = v.co*mat
+ v.co[0], v.co[1], v.co[2] = vec[0], vec[1], vec[2]
@@ -86,30 +88,32 @@ lenob=len(oblist)
error = 0
for o in oblist[1:]:
- if o.getType() != "Mesh":
- Draw.PupMenu("Error: selected objects must be meshes")
- error = 1
+ if o.getType() != "Mesh":
+ Draw.PupMenu("Error: selected objects must be meshes")
+ error = 1
if not error:
- if lenob<2:
- Draw.PupMenu("Error: you must 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 source.rot!=cible.rot:
- rotcible=cible.mat.rotationPart().toEuler().toMatrix()
- rotsource=source.mat.rotationPart().toEuler().toMatrix()
- rotsourcet = Matrix(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
+ if lenob<2:
+ Draw.PupMenu("Error: you must 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 source.rot!=cible.rot:
+ rotcible=cible.mat.rotationPart().toEuler().toMatrix()
+ rotsource=source.mat.rotationPart().toEuler().toMatrix()
+ rotsourcet = Matrix(rotsource)
+ rotsourcet.invert()
+ mat=rotcible*rotsourcet
+ me=cible.getData()
+ #ncible=cible.name
+ #me=NMesh.GetRaw(ncible)
+ applyTransform(me,mat)
+ #NMesh.PutRaw(me,ncible)
+ me.update()
+ cible.makeDisplayList()
+ cible.rot=source.rot