diff options
author | Campbell Barton <ideasman42@gmail.com> | 2006-12-16 01:14:33 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2006-12-16 01:14:33 +0300 |
commit | 827cce172c8c203d85bd2b2f1515d71d2f289adf (patch) | |
tree | 491b231407ee803f210262292def99091c8aa242 /release/scripts/object_batch_name_edit.py | |
parent | 0369f08299e0a3462c697fcc4133f0bca53162c0 (diff) |
update to Axiscopy, more error checking. basic functionality the same.
- Dont allow it to apply the matrix twice to a linked-dupe. (Same as Apply Loc/Size/Rot)
- Make sure that the source object is active, not just the first selected object.
- Use Mesh instead of NMesh.
- use mesh.transform(mat) rather then vert by vert vec*mat
Other scripts had pupBlock changes for better layout.
Diffstat (limited to 'release/scripts/object_batch_name_edit.py')
-rw-r--r-- | release/scripts/object_batch_name_edit.py | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/release/scripts/object_batch_name_edit.py b/release/scripts/object_batch_name_edit.py index b55d3c54cd1..812eee9dfe6 100644 --- a/release/scripts/object_batch_name_edit.py +++ b/release/scripts/object_batch_name_edit.py @@ -46,6 +46,7 @@ from Blender import * global renameCount renameCount = 0 +obsel = Scene.GetCurrent().objects.context def setDataNameWrapper(ob, newname): if ob.getData(name_only=1) == newname: @@ -64,7 +65,7 @@ def main(): def renameLinkedDataFromObject(): # Result 1, we want to rename data - for ob in Object.GetSelected(): + for ob in obsel: if ob.name == ob.getData(name_only=1): return # Alredy the same name, dont bother. @@ -88,7 +89,7 @@ def main(): NEW_NAME_STRING= NEW_NAME_STRING.val Window.WaitCursor(1) - for ob in Object.GetSelected(): + for ob in obsel: if ob.name != NEW_NAME_STRING: ob.name = NEW_NAME_STRING renameCount+=1 @@ -115,7 +116,7 @@ def main(): WITH_STRING = WITH_STRING.val Window.WaitCursor(1) - for ob in Object.GetSelected(): + for ob in obsel: newname = ob.name.replace(REPLACE_STRING, WITH_STRING) if ob.name != newname: ob.name = newname @@ -140,7 +141,7 @@ def main(): PREFIX_STRING = PREFIX_STRING.val Window.WaitCursor(1) - for ob in Object.GetSelected(): + for ob in obsel: ob.name = PREFIX_STRING + ob.name renameCount+=1 # we knows these are different. return RENAME_LINKED.val @@ -162,7 +163,7 @@ def main(): SUFFIX_STRING = SUFFIX_STRING.val Window.WaitCursor(1) - for ob in Object.GetSelected(): + for ob in obsel: ob.name = ob.name + SUFFIX_STRING renameCount+=1 # we knows these are different. return RENAME_LINKED.val @@ -183,7 +184,7 @@ def main(): Window.WaitCursor(1) TRUNCATE_START = TRUNCATE_START.val - for ob in Object.GetSelected(): + for ob in obsel: newname = ob.name[TRUNCATE_START: ] ob.name = newname renameCount+=1 @@ -206,7 +207,7 @@ def main(): Window.WaitCursor(1) TRUNCATE_END = TRUNCATE_END.val - for ob in Object.GetSelected(): + for ob in obsel: newname = ob.name[: -TRUNCATE_END] ob.name = newname renameCount+=1 @@ -217,7 +218,7 @@ def main(): global renameCount Window.WaitCursor(1) - for ob in Object.GetSelected(): + for ob in obsel: newname = ob.getData(name_only=1) if newname != None and ob.name != newname: ob.name = newname @@ -228,7 +229,7 @@ def main(): global renameCount Window.WaitCursor(1) - for ob in Object.GetSelected(): + for ob in obsel: group= ob.DupGroup if group != None: newname= group.name @@ -241,7 +242,7 @@ def main(): global renameCount Window.WaitCursor(1) - for ob in Object.GetSelected(): + for ob in obsel: if setDataNameWrapper(ob, ob.name): renameCount+=1 return 0 |