2004-06-07 01:34:15 +00:00
|
|
|
#!BPY
|
|
|
|
|
|
|
|
""" Registration info for Blender menus: <- these words are ignored
|
2004-07-29 03:05:39 +00:00
|
|
|
Name: 'Fix From Armature'
|
2004-06-07 01:34:15 +00:00
|
|
|
Blender: 232
|
2004-07-27 03:13:45 +00:00
|
|
|
Group: 'Mesh'
|
2004-06-07 01:34:15 +00:00
|
|
|
Tip: 'Fix armature deformation.'
|
|
|
|
"""
|
2004-07-27 03:13:45 +00:00
|
|
|
|
2004-06-10 03:27:46 +00:00
|
|
|
# $Id$
|
|
|
|
#
|
2004-06-07 01:34:15 +00:00
|
|
|
#----------------------------------------------
|
|
|
|
# jm soler 05/2004 : 'FixfromArmature'
|
|
|
|
#----------------------------------------------
|
|
|
|
# Official Page :
|
|
|
|
# http://jmsoler.free.fr/util/blenderfile/py/fixfromarmature.py
|
|
|
|
# Communicate problems and errors on:
|
|
|
|
# http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender
|
|
|
|
#---------------------------------------------
|
|
|
|
# Page officielle :
|
|
|
|
# http://jmsoler.free.fr/util/blenderfile/py/fixfromarmature.py
|
|
|
|
# Communiquer les problemes et erreurs sur:
|
|
|
|
# http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender
|
|
|
|
#---------------------------------------------
|
|
|
|
|
|
|
|
import Blender
|
|
|
|
try:
|
|
|
|
Ozero=Blender.Object.GetSelected()[0]
|
|
|
|
nomdelobjet=Ozero.getName()
|
|
|
|
Mesh=Blender.NMesh.GetRawFromObject(nomdelobjet)
|
|
|
|
Obis = Blender.Object.New ('Mesh')
|
|
|
|
Obis.link(Mesh)
|
|
|
|
Obis.setSize(Ozero.getSize())
|
|
|
|
Obis.setEuler(Ozero.getEuler())
|
|
|
|
Obis.setLocation(Ozero.getMatrix()[3][0:3])
|
|
|
|
scene = Blender.Scene.getCurrent()
|
|
|
|
scene.link (Obis)
|
|
|
|
except:
|
2004-07-27 03:13:45 +00:00
|
|
|
Blender.Draw.PupMenu("Error|Not a mesh or no object selected")
|