[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [540] contrib/py/scripts/addons/ mesh_relax.py: fix concerning selected state of objects
Fabian Fricke
frigi.f at googlemail.com
Sat Apr 3 15:53:44 CEST 2010
Revision: 540
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-extensions&revision=540
Author: frigi
Date: 2010-04-03 15:53:44 +0200 (Sat, 03 Apr 2010)
Log Message:
-----------
fix concerning selected state of objects
Modified Paths:
--------------
contrib/py/scripts/addons/mesh_relax.py
Modified: contrib/py/scripts/addons/mesh_relax.py
===================================================================
--- contrib/py/scripts/addons/mesh_relax.py 2010-04-03 11:23:11 UTC (rev 539)
+++ contrib/py/scripts/addons/mesh_relax.py 2010-04-03 13:53:44 UTC (rev 540)
@@ -24,7 +24,7 @@
bl_addon_info = {
'name': 'Mesh: Relax',
'author': 'Fabian Fricke',
- 'version': '1.0.1',
+ 'version': '1.0 2010/04/03',
'blender': (2, 5, 3),
'location': 'View3D > Specials > Relax ',
'description': 'Relax the selected verts while retaining the shape',
@@ -32,20 +32,16 @@
'category': 'Mesh'}
"""
-Name: 'Relax'
-Blender: 250
-Tip: 'Relax Mesh'
-__author__ = ["Fabian Fricke"]
-__version__ = '0.90'
-__url__ = [
- "Script, http://frigi.designdevil.de/Scripts/Relax/mesh_relax.py",
- "Author Site , http://frigi.designdevil.de"]
-email__=["frigi.f {at} gmail {dot} com"]
Usage:
Launch from "W-menu" or from "Mesh -> Vertices -> Relax"
+
+Additional links:
+ Author Site: http://frigi.designdevil.de
+ e-mail: frigi.f {at} gmail {dot} com
+
"""
@@ -59,7 +55,12 @@
me_old = obj.data
me_name = me_old.name
- # duplicate the object so it can be used as a target for the shrinkwrap modifier
+ # deselect everything that's not related
+ for o in bpy.context.selected_objects:
+ o.selected = False
+
+ # duplicate the object so it can be used for the shrinkwrap modifier
+ obj.selected = True # make sure the object is selected!
bpy.ops.object.mode_set(mode='OBJECT')
bpy.ops.object.duplicate()
target = context.active_object
@@ -73,7 +74,7 @@
bpy.ops.mesh.vertices_smooth()
bpy.ops.object.mode_set(mode='OBJECT')
- # apply and remove the modifier (Ugly but according to Martin and Campbell it's the right way to do it at the moment.)
+ # apply and remove the modifier
me = obj.create_mesh(True, 'PREVIEW')
obj.data = me
obj.modifiers.remove(sw)
More information about the Bf-extensions-cvs
mailing list