Page MenuHome

Renamer for multiple objects / bones
Closed, ArchivedPublicPATCH

Description

Project: Blender Extensions
Tracker: Py Scripts Upload
Blender: 2.62
Category: Object
Python: 3.2
Script name: object_multi_rename.py
Wiki page: http://wiki.blender.org/index.php/Extensions:2.5/Py/Scripts/Object/object_multi_rename
Dependencies: re, fnmatch
Author(s): Maximilian Eham
Status: Closed
Related: 21681 25242

Features:
- renaming multiple objects at once
- renaming multiple bones at once
- wildcard supprt for searching
- adding prefixes / suffixes
- truncating names from start or end

Setup:
1. Copy "object_multi_rename.py" to "blender\2.55\scripts\addons"
2. Start Blender
3. Open the <User Preferences>
4. Go to the <Add-Ons>-Tab
5. Activate the <Object: MultiRename>-Add-On

Manual:
I recommend having the outliner open and setting it to show the selected objects only, otherwise you won't see anything happen.
You can find the new menu in the toolbar in 3d-View. Select objects or bones that you want to rename, click on <Rename objects> and set the parameters in the lower area of the toolbar in 3d-View.

The wildcards you can use in the <Find String>-field are:
* matches everything
? matches a single character
[sequence] matches a single character in the sequence (example: [0-9] matches a single digit, [a-z] matches the whole ABC in lower case)
[!sequence] matches a single character which is NOT in the sequence

One important thing to understand about this script is that it always works on the original object/bone names, so if you messed up a parameter, say you set <trim end> to a high value so all your objects are called untitled.001 etc, then you can simply lower the value and the original names will reappear.

Event Timeline

The wiki page:
http://wiki.blender.org/index.php/Extensions:2.5/Py/Scripts/Object/object_multi_rename

Sorry for not linking to it to begin with, but I don't know how to edit the original submission.

this is because you're done a tech editor yet :)
adde the link above

is your script similar to this one:
https://svn.blender.org/svnroot/bf-extensions/branches/broken_stuff/object_name_edit.py
?

sorry didn't have the time to test yet

Thanks for adding the link!

Yes, it's pretty much the same with a couple of differences:
Mine isn't broken and it works on bones, but his has some functions for copying names from objects to datablocks and vice versa, plus some functions for dupligroups .

I contacted the author of object_name_edit.py a couple of weeks ago and he offered to merge the functionality of both scripts, but as he has a lot of work to do at the moment this might still take a while.

OK, then I propose this:
- you merge the two scripts and upload the merge here
- if the merge solves his problems and of course adds your features, then you get svn rights and we move that script back to svn in contrib or trunk, depends on the stability of the addon, so you can help maintain and avoid that this goes in broken_stuff/ dir again
- if we keep that name or use yours, or choose a 3rd one, you 2 can decide

I guess he has time to review at least? if not, we will :)
I'm leaving a message to his tracker page too, so he knows

cheers

forgot, I added a "related" field to this tracker with link to the other script, have a look in the fields above

Ok, that's fine with me. I'll let Richard know when I start working on it, so there are no wasted efforts.

assigned to self,

hi guys. i wrote yet another batch renamer, located here atm: http://projects.blender.org/tracker/index.php?func=detail&aid=25242&group_id=153&atid=468
I did a quick test with this script and had some problems on the usability side (funky output if the order in which properties are changed isn't carefully preplanned).
Maybe we can work something out to see if we can't combine the scripts. (my renaming of referenced datablocks and your renaming of bones).
I think the most important thing would be to give your script a popup with confirm to avoid said funky results.

Thanks for testing Florian!
Could you elaborate on the funky output? (You are aware that all the settings only affect the original filename, not the one currently displayed in the outliner, right?)
I noticed one weird thing myself: when you type in a string into the "replace with"-field and have nothing in the "find string"-field then the replacement-string gets put in after every character of the original object name. That`s easy to fix though.
Apart from that I didn't notice any problems with the order of changing properties. Please tell me if I missed something.

Personally I wanted to avoid a popup with confirm because that takes away the interactivity. Though I do admit that the output isn't all that intuitive. What would greatly help would be a interactivley changing list of the resulting object names next to a list with the original object names, so users can see what they had and what they get. The problem is that I don't know how to do something like that while staying consistent with the rest of the blender UI.
Ideas/suggestions for that woudl be greatly appreaciated!

Hi,
Just a Reminder for people to Join the Mail List.
If you have not already, please visit this page:
http://lists.blender.org/mailman/listinfo/bf-extensions-cvs
& join the list.

updatesfor api changes, fix status ect...

Hi,
Due to changes to the api including the merging of bmesh, several addons are outdated.
Please, if you are the author of an addon check your script with blender revision 44256 or newer.
That is builds made After blender 2.62 official release.
I would ask that updates be made to your addon before the Blender 2.63 release.
6-8 weeks away.
This allows time for the api to become more exposed & bmesh to stablize furthur.
If you need help, drop into irc freenode #blenderpython or #blendercoders & feel welcome to ask questions.
At the time of 2.63 release, scripts that are not repaired or in active developement will have their tracker page marked "Closed"
this will not affect your links to the tracker, similar to closing scripts in 2.49b, the page will be still availible & can be re-opened.

Thanks for your understanding & patience during these Exciting Times.
Brendon.

hi, updated the attatchmant to working for 2.62.3
are you still interested in developing this script?

Personally I'm still using it for rigging, but there's no sense in keeping this page alive since the usability problems (the funky results Florian Meyer mentioned) can't really be solved until there is a way to create custom spaces in python, so we could have those interactively changing lists mentioned before, with an outliner like thing showing the "before" and "after" names.
Just close it :)
I'll make a new one when we have custom spaces

ok, I'll close, you can re-open when if you develop the script furthur

Brendon Murphy (meta-androcto) changed the task status from Unknown Status to Unknown Status.Apr 16 2012, 4:58 PM

this is VERY useful for rigging especially. Has anyone tried to contact Campbell regarding support for custom spaces in the blender/python api?