Batch Rename tool has very poor usability

Hi,

after quite a while, I found a practical use case for Batch Rename tool, however it’s usability is so bad it’s really hard to accomplish some really basic task, and borderline impossible to accomplish others.

Here’s a practical example:

When exporting custom collision hulls for static meshes in Unreal Engine 4, the engine uses object names to determine if the object should be treated as collision hull. Blender being the typical unicorn, doing everything in the Blender way uses dot as a separator for number padding, instead of underscore, like pretty much anything else out there, so when you create multiple collision hulls, you end up with something like this:
image

But, Unreal Engine 4 fails to recognize these as custom collision hulls, because their naming convention explicitly requires the number padding to be separated by an underscore:

So, a great job for Batch rename tool I thought. Turns out it fails even at such a simple basic task. I just want to strip the last 4 characters from each name, and then add underscore and number padding:
image

The UI is so cumbersome… The vertical order of the operator determines order, so for example strip punctuation has to be above strip digits, and I can’t even select how many digits I want to strip. Then again I have to keep clicking more buttons to get it right, and then I can finally also add suffix, but there is no way to add number padding? So ultimately, I end up with a failure like this one:
image

At the same time, here’s how it looks in a normal software:
[removed for copyright reasons]

A simple naming tool where I can get the actual batch rename the way I want, with way less clicks.

Can we just get a proper batch rename tool which lets us easily strip custom amounts of characters from the start and the end of the name string, then add custom prefix and suffix and then add number padding without the dot separator?

I mean the current state of the tool is so bad it’s literally faster to just rename even mass amount of objects by hand rather than waste time with the trial/error loop before eventually the Batch Rename tool does something acceptable.

3 Likes

I had to remove a screenshot from the description to avoid possible copyright violations, see https://lists.blender.org/pipermail/bf-committers/2020-July/050616.html.

Please only reference free and open software, or come up with own proposals/mockups to present what you expect the UI to look like.

Agreed, I needed to strip the dot on a number of objects recently and just couldn’t do it. There should be an option to use either dot or underscore for numbering.

Sorry, did not know about that.

Alright, here’s a mockup of what I’d like to see:
image

And here’s a link to the functioning addon according to the mockup above:

I was able to achieve desired result much faster:
image

Something like a simple batch rename tool should not have a learning curve.

5 Likes

I don’t really see the issue here.

If you just want to replace the period with under score you do:
screenshot

And that’s it.

Though if you want to redo the existing padding numbers it needs to be regenerated. That now requires two steps. First batch rename all selected objects and then do a batch rename again to remove the period. This I guess could be a new batch operator that adds numbers starting from the first selected object to the last.

5 Likes

What if there was one than more period in the name? And I wanted to only replace one in front of the number padding.

The fact you need to stack some “modifiers” in the right order and set the up using way too many mouse clicks in a window that will disappear as soon as you click once anywhere outside it is the issue itself. It’s simply poor UX. As I said, something as simple as a simple batch rename tool should not have a learning curve. Yet it has one. An artificially created one.

I’m don’t agree with that…I think it is more useful that you make it to be.

Like this?


This would work fine:
image

And I know that this is a simple case, and there can be instances in which you would have to concatenate different steps to arrive to the solution. In more complex scenarios, regEx can be a good way to go, even if it is a little hard to wrap your head around in the beggining.

Imagine there would be 1999 instead of 10 objects in the example above. Yeah, without regEx you would have to run the tool 2 times, replacing the string you search for from 0 with 1 to change all the objects above 1000. But I don’t think it is bad at all.

1 Like

Yes, exactly. It’s not bad. But not bad != good. This really should be as simple as this:
image
image

No clicking around… no building some sort of “modifier stack”, etc…

Meanwhile here you are trying to come up with even more complex solutions (like regEx) to a trivial problem. Every time an average artist wants to rename just a couple of objects, they should not need to go through these hoops.

BTW, not above 1000 but above 100, in your case, since any object above 099 number padding would not meet the find “.0” criteria.

Of course, not to mention you can always run into something like this:
image

I just think it’s really crazy having to replace trailing number padding by relying on matching part of string (find and replace) and then hoping with crossed fingers that the same part of string is not present multiple times on one of your selected objects.

1 Like

I think single line preview would greatly help in tool like this, I almost never get it right on first (or second) try and have to cancel, change some parameters, try again, etc.

3 Likes

You’re right, I had it right in the draft, the I brainfarted and changed it.

I talked about regEx regarding complex scenarios, not trivial things. I don’t think anybody would argue in favor of using regEx in simple scenarios (maybe somebody who enjoys pain and suffering)

I think you have a very valid point, in the sense that it can definitely be improved, particularly the padding and numbering part. (but still think that calling it very poor is a bit of an exageration, to me it came across as if it were useless…and I don’t think that’s the case)

I think it would be nice to have a preview of how the name of the active object would be after the changes (1), as you configure it. And to be able to reorder the stack on the fly(2), because now if you add one, it is placed at the end. And if you screwed up above, you have to change it all, you cannot place a new intermediate step.
image

I just read this while I was uploading my own response. Yeah, I completely agree. One of the most frustrating parts is to discover the expected result is different of what you get AFTER the change is done, and having to undo it and probably redoing the whole “stack”

2 Likes

@Forester64 @txo

Yes, interactive preview is a great idea. Why didn’t I think of that? :smiley:

I’ve quickly hacked it together in my batch rename tool. It’s available in the same link here:
https://drive.google.com/file/d/1fZ-rjMxCHip0i60g8hkHZlw8ncOKNmBS/view

It uses whatever is active object in viewport to preview the new name :slight_smile:

3 Likes

Is the interactive preview added though? I just downloaded it and tried it out and preview doesn’t seem to be there. :confused:

Oh, yeah, sorry… I’ve made a mistake when I was updating the link. Try again, it should work now :slight_smile:

It’s quickly thrown together though, so some corner cases are not yet fixed. For example if remove first and last make up together more character than the length of the name, then nothing will be displayed. I will replace that with some warning once I get back to it.

Yeah, now it works. Nice, thanks!

The batch rename tool uses regular expressions… it just simply isn’t necessary to change it. regex can do all of that and more. It just takes some time to learn. The solution you’ve come to is the right one – a small, unobtrusive Python addon that doesn’t affect anyone else.

Anyways, in my addon which deals with bone names, I’ve made the separator characters used for different things user-configurable. This could be a simple thing to add to Blender, I suppose. In my addon, it uses a JSON file to do this.

The most absurd thing about this, to me, is that the reason this is necessary is to work around another software’s limitations. All of the softwares that separate with underscores do so because a certain other software simply can’t handle anything else. Blender, however, is smart enough to know that you shouldn’t try to interpret names as code, so it allows any string to be used as a name. I think it’s backwards to foist other, less intelligently designed software’s limitations onto Blender.

Perhaps there should, however, be an export feature for automatically replacing certain characters with underscores, especially in e.g. FBX.

To be honest, even if the underscore was not a mitigation of a limitation, but a simple unwritten standard, even then it would make sense for Blender to align with that standard, instead of being unique. Using dot as a separator instead of underscore doesn’t bring any benefits as far as I can tell, but can cause issues.

1 Like

I proposed something related to this just yesterday, regarding cryptomatte metadata, channels and output file naming in this post. I think it could be made much more flexible, and cross compatible (with another program and standards, I mean), if certain parameters and separators were exposed in the preferences and treated in a more abstract way

I think using the dot as a separator does exactly one good thing - it marks numbers specifically (as underscores are used for left/right markers). But anyways, I think I agree with you here. I just don’t think Blender should change. The solution is to expose the option to the user, so that the user can adapt and change if desired.

Yes. I had the exact same idea. Somewhere, in the preferences, there should be a field to input anything user wants to use as a separator.