blender/release/scripts/fixfromarmature.py

40 lines
1.2 KiB
Python
Raw Normal View History

#!BPY
""" Registration info for Blender menus: <- these words are ignored
Name: 'Fix From Armature'
Blender: 232
Group: 'Mesh'
Tip: 'Fix armature deformation.'
"""
# $Id$
#
#----------------------------------------------
# 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:
Blender.Draw.PupMenu("Error|Not a mesh or no object selected")