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:
authorCampbell Barton <ideasman42@gmail.com>2006-07-07 19:51:32 +0400
committerCampbell Barton <ideasman42@gmail.com>2006-07-07 19:51:32 +0400
commit53efbdd3a3602e4befb65b1fbe5edef80ca4a35a (patch)
tree52fbf8237b1439bb8196f81d50fb9fe1f24f5ec6 /release/scripts/object_apply_def.py
parent10215a8ff485dd0360c7ae6d3d112aa3729a61fd (diff)
Made this script motherball aware-
Metaballs that are numbered are not included - only the un-numbered motherball when getting the mesh data for objects.
Diffstat (limited to 'release/scripts/object_apply_def.py')
-rw-r--r--release/scripts/object_apply_def.py27
1 files changed, 21 insertions, 6 deletions
diff --git a/release/scripts/object_apply_def.py b/release/scripts/object_apply_def.py
index b93a98106cd..6b8d07bc51a 100644
--- a/release/scripts/object_apply_def.py
+++ b/release/scripts/object_apply_def.py
@@ -100,18 +100,33 @@ def apply_deform():
ob_list = Blender.Object.GetSelected()
- if not ob_list:
- Blender.Draw.PupMenu('No objects selected, nothing to do.')
- return
- # Deselect and test for softbody
+ # Assume no soft body
has_sb= False
- for ob in ob_list:
- ob.sel = 0
+
+ # reverse loop so we can remove objects (metaballs in this case)
+ for ob_idx in xrange(len(ob_list)-1, -1, -1):
+ ob= ob_list[ob_idx]
+
+ ob.sel = 0 # deselect while where checking the metaballs
# Test for a softbody
if not has_sb and ob.isSB():
has_sb= True
+
+ # Remove all numbered metaballs because their disp list is only on the main metaball (un numbered)
+ if ob.getType()=='MBall':
+ name= ob.name
+ # is this metaball numbered?
+ dot_idx= name.rfind('.') + 1
+ if name[dot_idx:].isdigit():
+ # Not the motherball, ignore it.
+ del ob_list[ob_idx]
+
+
+ if not ob_list:
+ Blender.Draw.PupMenu('No objects selected, nothing to do.')
+ return
if has_sb: