Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Mulligan Renamer

Discussion in 'Assets and Asset Store' started by edwardrowe, May 19, 2018.

  1. edwardrowe

    edwardrowe

    Joined:
    Feb 11, 2014
    Posts:
    52


    Quickly rename any number of GameObjects or Assets simultaneously with Mulligan Renamer

    Get it on the Asset Store
    Follow the project on Github
    Rename objects by combining operators, including the ability to replace substrings, add prefixes and suffixes, and add counts. You can also use regular expressions to do just about any renaming task you can think of.

    FEATURES:
    ➜ Rename Assets and GameObjects
    ➜ Match and replace patterns using regular expressions
    ➜ Preview results with diff view
    ➜ Combine rename operations for simple or complex renaming tasks
    ➜ Rename all (or some) sprites within a spritesheet

    Please use this forum post for feedback and conversation about the tool. You can also submit issues directly through GitHub Issues.

    Mulligan was developed for and by Red Blue Games.




     
    Mark_01 likes this.
  2. funselektor

    funselektor

    Joined:
    Oct 11, 2013
    Posts:
    105
    This has been a super useful plugin. One question, would you be able to add a setting to "Change Case" to include Camel Case? It would be useful for renaming project folders. Thanks!
     
  3. edwardrowe

    edwardrowe

    Joined:
    Feb 11, 2014
    Posts:
    52
    Thanks for the comment! Glad it's been useful!

    Casing is one of the few ops that I can't use the Regex replacement to do, so this sounds like something I should add. CamelCase sounds useful, but tricky. I basically don't know where words start, unless there's a delimiting character supplied, which might be too complicated.

    The easiest thing to do would be for me to just add a checkbox to Upper and Lower to "change first character only".

    But here's another, more complicated, idea...

    Like you suggested, it would be a new operation in "Modify/Change Case". In addition to Lower and Upper would be CamelCase, and maybe Pascal Case?

    Selecting Pascal or Camel would add another field for "delimiting characters" (maybe, might be too complicated). Space would be the default.

    Inputs:
    CharacterSheets
    My First rocket Ship
    anotherName
    cantDoAnythingaboutthisOne


    Output with Camel:
    characterSheets (lowered first Character)
    my First Rocket Ship (lowers first, uppers first in remaining words which is just Rocket. If you want to remove the spaces, there's an op for that)
    anotherName (unchanged as it's all just one word and lower is the same)
    cantDoAnythingaboutthisOne (also unchanged for reasons above)

    And if we wanted the delimiting characters field, you could add "-" in there, or anything you want, and
    this-would-get-camel would become this-Would-Get-Camel.

    Do you have any thoughts on those?
     
  4. funselektor

    funselektor

    Joined:
    Oct 11, 2013
    Posts:
    105
    Thanks for the quick and informative reply!

    Casing is one of the few ops that I can't use the Regex replacement to do, so this sounds like something I should add. CamelCase sounds useful, but tricky. I basically don't know where words start, unless there's a delimiting character supplied, which might be too complicated.

    This is true, to actually do it you'd have to have some sort of word recognizing algorithm for each language so it's definitely not a simple feature, my bad I didn't think about the implementation enough!

    The easiest thing to do would be for me to just add a checkbox to Upper and Lower to "change first character only".

    This would be a very useful feature.

    Like you suggested, it would be a new operation in "Modify/Change Case". In addition to Lower and Upper would be CamelCase, and maybe Pascal Case?

    Selecting Pascal or Camel would add another field for "delimiting characters" (maybe, might be too complicated). Space would be the default.

    Pascal case is actually what I'm looking for, wasn't aware of that naming convention, but I've been using it this whole time for my naming and wrongfully though it was Camel Case!

    Yes delimiting characters would be great. Here's an example from the folder naming I'm trying to convert to Pascal.
    Having "_" as a delimiting character for Pascal Case would be ideal.

    upload_2019-2-5_12-15-11.png

    Preferred Naming:
    BULL_COW -> Bull_Cow
    BULL_A_POSE1 -> Bull_A_Pose1

    The reason for this request was that I'm working with different freelancers and didn't have specified naming conventions so I'm trying to get them to be consistent.
     
  5. edwardrowe

    edwardrowe

    Joined:
    Feb 11, 2014
    Posts:
    52
    Ok thanks for the images and use cases! Super helpful.

    This is a great suggestion. I've been slowly chipping away at a stability patch so I think I'll include this and get it out hopefully this week.

    Thanks again for the suggestion and for using Mulligan! I'll reply here when the patch goes live.

    And here's a link to the GitHub issue if you want to track it's progress. https://github.com/redbluegames/unity-mulligan-renamer/issues/195
     
    Last edited: Feb 5, 2019
  6. funselektor

    funselektor

    Joined:
    Oct 11, 2013
    Posts:
    105
    Perfect thanks so much!
     
  7. edwardrowe

    edwardrowe

    Joined:
    Feb 11, 2014
    Posts:
    52
    I've made a beta release with this feature. I'm going to test it internally, and if all goes well I'll submit it. If you'd like you can get the beta release here: https://github.com/redbluegames/unity-mulligan-renamer/releases/tag/v1.6.0b1. Should install just like any other asset through Assets/Import Custom Package.

    Regarding BULL_COW, I only made the operation lowercase the *First* letter, unless flagged to Use Pascal casing. So BULL_COW will still be BULL_COW unless first converted to lowercase with the Change Case (now called To Upper or Lowercase) operator. The reason for this is I didn't want to destroy any capitalization users may have wanted to keep, for example char_bootLegger. If I lowercase bootLegger in the To Camel Case operation (resulting in Char_Bootlegger), they won't easily be able to capitalize the L again. Basically CamelCase would be unusable for that use case.

    The tradeoff is just that you'll have to lowercase BULL_COW before camelcasing it.
     
  8. edwardrowe

    edwardrowe

    Joined:
    Feb 11, 2014
    Posts:
    52
    Ok version 1.6.0 is live on the store with the CamelCase operator. Let me know if you have any issues!

    Thanks for the suggestion and for using Mulligan!
     
  9. funselektor

    funselektor

    Joined:
    Oct 11, 2013
    Posts:
    105
    Hey sorry for the late reply, was off the grid and don't get email notifications.
    Thanks so much for adding this functionality, it works perfectly and the "-" & "_" delimiter characters are great as the defaults

    upload_2019-2-22_13-57-30.png
     
  10. edwardrowe

    edwardrowe

    Joined:
    Feb 11, 2014
    Posts:
    52
    Glad to hear! Thanks for reporting back!
     
  11. funselektor

    funselektor

    Joined:
    Oct 11, 2013
    Posts:
    105
    Hey I found an issue with trying to rename things backwards.

    upload_2019-10-2_9-36-19.png
     
  12. edwardrowe

    edwardrowe

    Joined:
    Feb 11, 2014
    Posts:
    52
    First of all I love that you're using Mulligan for this.
    Second I'm sorry it didn't work! Thanks for reporting it, I'll add it to the issues on Github and try to address it in the next patch (which will likely be released in late November, just after we get Sparklite out the door =) )
     
  13. funselektor

    funselektor

    Joined:
    Oct 11, 2013
    Posts:
    105
    It's a time-saver! It would take me 10x as long renaming every single file.
    I did realize that it's kind of intended behaviour with the filesystems, since it's trying to rename a file to an existing file's name. So I just prefixed them with an arbitrary character, reversed numbers and then removed the prefix.

    Didn't realize you guys were making games too, Sparklite looks awesome, good luck with the launch!!
     
  14. edwardrowe

    edwardrowe

    Joined:
    Feb 11, 2014
    Posts:
    52
    Well, technically this should be possible. I rename the files to a temporary name so that they don't overlap during the rename. So it's gonna take a bit for me to dig in to see where that's going wrong. Glad you were able to workaround it, though.

    Yep, thanks! I appreciate your understanding on the delayed support.
     
  15. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746
    Hi there!

    Just bought Mulligan and really pleased with it!

    However, upon importing into 2019.3.7 (also tested in 2019.2.19) via the package manager or asset store, two console errors appear (same error, twice)

    The Mulligan window then is blank when opened, and there are a lot of null reference errors. Doing a rightmouse click -> Reimport on the RedBlueGames folder imports it correclty and everything works great after that. I tested for ages editing my code, which didn't fix anything. Imported Mulligan in an empty project, loads of times, and always get the two errors on first import.
     
  16. edwardrowe

    edwardrowe

    Joined:
    Feb 11, 2014
    Posts:
    52
    Thanks for reporting this issue! It's really nice when people fix something but still take the time to report it so it can be fixed for others.

    I have tried to repro but haven't been able to. So I'll need to try on a fresh install and make sure there's not some stored preference or something that's fixed it for me.

    I'll keep digging, but if you can clarify one thing it would be helpful:

    * Was this a fresh install or an upgrade from a previous version?

    <Edit> Also I created an issue on GitHub for this: https://github.com/redbluegames/unity-mulligan-renamer/issues/251
     
  17. funselektor

    funselektor

    Joined:
    Oct 11, 2013
    Posts:
    105
    Just updated and getting this repeating exception on 2019.2.21f1 when opening the renamer window. Tried deleting the directory and reimporting but same behaviour, so I'll revert for now. Good tool though, use it a few times a week and it saves me so much time.
    upload_2020-5-5_12-14-28.png
     
  18. edwardrowe

    edwardrowe

    Joined:
    Feb 11, 2014
    Posts:
    52
    Thank you very much for the report, @Little_Gorilla . Gonna look into this tomorrow. Hopefully I'll be able to track this and @Carwashh's issue down and update.
     
    funselektor likes this.
  19. edwardrowe

    edwardrowe

    Joined:
    Feb 11, 2014
    Posts:
    52
    @Little_Gorilla I think I've reproduced the issue. If it's what I think it is, quitting and re-opening Unity after updating should fix it.

    * Did you have the Mulligan Renamer window open while updating?

    If this is true, you may also be able to update without an error by closing the window first.

    I'll work on a fix regardless.
     
  20. funselektor

    funselektor

    Joined:
    Oct 11, 2013
    Posts:
    105
    I think I had it open when updating. But I quit and reopened and it still got these errors.
     
  21. edwardrowe

    edwardrowe

    Joined:
    Feb 11, 2014
    Posts:
    52
    Ok - that stumps me a bit, but hopefully the fix I did will work. I've submitted it to the store. It's usually published within a day or so.
     
    funselektor likes this.
  22. ch1ky3n

    ch1ky3n

    Joined:
    Oct 26, 2017
    Posts:
    51
    everything works perfect, except

    somehow it is unable to rename sprite sheet./ atlas

    description says:
    "Rename all (or some) sprites within a spritesheet"

    I was wondering, what do those "some" scenario would be?
     
  23. edwardrowe

    edwardrowe

    Joined:
    Feb 11, 2014
    Posts:
    52
    It should be working - I'm sorry it isn't! The "some" refers to just if you only wanted to rename a few sprites within the sprite sheet. Not the best wording on my part.

    What version of unity are you using? The spritesheet renaming is pretty brittle cause I have to workaround Unity limitations. Each version has the potential to break it.
     
  24. ch1ky3n

    ch1ky3n

    Joined:
    Oct 26, 2017
    Posts:
    51
    I'm using 2020, but yeah, I couldn't figure out on which sprite sheet scenario can and which is not.
    Sometimes you can rename everything and sometimes nothing changes.

    It still a hell of asset though !
     
  25. edwardrowe

    edwardrowe

    Joined:
    Feb 11, 2014
    Posts:
    52
    Thanks for the feedback! I did some tests but couldn't repro. If you encounter this again, please DM me on Twitter @edwardlrowe, and I'll try to get you some immediate QA.

    Renaming sprites in our Spritesheets in Sparklite is the reason I invented this plugin, so I want to make sure that works for you (and everyone).
     
  26. WhiteDoggy

    WhiteDoggy

    Joined:
    Sep 10, 2020
    Posts:
    17
    Hi.

    First of all, Renamer made our process much more effective, so thanks.

    Btw, I have one problem it would be great if you can help us with.


    Background:
    1. Need to change spritesheet and sprite(slices) name.
    2. Dragged spritesheet and slices to renamer.
    3. Except spritesheet, no change has been executed. (sprite slice's name is same)

    What I want:
    I also want to change sprite slice's name as well as spritesheet.

    Case I have tested:
    1. Name is korean (failed)
    2. Name is english (successed)
    3. Name is english but contains ' . ' (failed)

    1.png
    Tested file
    2.png
    setting
    3.png
    renamer setting

    4.png
    result (no changes)
     
  27. edwardrowe

    edwardrowe

    Joined:
    Feb 11, 2014
    Posts:
    52
    Hi! Thanks for sending me a DM.

    And thanks for all the details. Are you ok with sending me the spritesheet file directly? Including the meta file? if not I can try to recreate what you've got and see if I can reproduce it.

    Also can you give me sample text for a file with Korean characters that didn't work?
     
  28. WhiteDoggy

    WhiteDoggy

    Joined:
    Sep 10, 2020
    Posts:
    17
    Alright.
    I couldn't upload the real files that I have used because of company policy. Instead I have attached other files but work just as same.

    1. 'Sample_Good' file that have been succeed.
    2. 'Sample' file that have been failed. it includes '.' in there sprite slice's names.
    3. '한국어' - file named with some random korean. failed.
     

    Attached Files:

    Last edited: Feb 9, 2022
  29. Nixellion

    Nixellion

    Joined:
    Jun 17, 2015
    Posts:
    7
    Hi! Awesome tool, much like Advanced Renamer and my own Renamer for Maya :)

    The only operation I'm missing is - camel case split, to turn something like CamelCaseName into camel_case_name. We are currently refactoring our naming, and switching everything to lower-case for filenames, and Mulligan Renamer can only do 'lowercase', but CamelCaseName turned into camelcasename is just not readable.

    Thanks :)
     
  30. WhiteDoggy

    WhiteDoggy

    Joined:
    Sep 10, 2020
    Posts:
    17


    Hi.
    I think I have found which case changing the name of sprite slices could be fail.

    1. when it includes brackets before '.aseprite', it fails (as shown in video)
    2. It fails when it includes korean.

    However, removing '.asperite' of name without bracket worked fine! You can also check this in video.
     
  31. edwardrowe

    edwardrowe

    Joined:
    Feb 11, 2014
    Posts:
    52
    Ah good suggestion, @Nixellion

    There is a 3 step regex you can use. This assumes you are strictly enforcing upper Camel (as in, you definitely want an _ after every uppercase letter.)

    1. String Replace Op with Regex checked: // This op will add a '_' that you can use to identify splits. Should turn "CamelCaseName" into "_Camel_Case_Name"
    Search For: ([A-Z])
    Replace with _$1

    2. Lowercase everything // Should turn "_Camel_Case_Name" into "_camel_case_name"

    3. Trim first character to remove the leading '_'

    To @WhiteDoggy, I'll be looking into these soon. Thanks for the reports!
     
    Last edited: Feb 17, 2022
  32. WhiteDoggy

    WhiteDoggy

    Joined:
    Sep 10, 2020
    Posts:
    17
    Thanks. still wating :)
     
  33. edwardrowe

    edwardrowe

    Joined:
    Feb 11, 2014
    Posts:
    52
    Hi @WhiteDoggy -

    Ok I've finally looked into this and I've published a fix for the spritesheets that contain () characters on GitHub.

    For the Korean characters, it unfortunately looks like something I can't easily fix. My solution is a bit of a hack, and it would require even more hacks on top to get it to work with special unicode characters, and I would rather not pile on. If Unity improves their Renaming utility to work with Sprites, it should be possible in the future to remove my hack and this would work. But until then, you'll have to limit Sprites to english characters =(. Sorry about that.

    I'll submit the fix to the Unity Asset store soon as well.
     
  34. edwardrowe

    edwardrowe

    Joined:
    Feb 11, 2014
    Posts:
    52
    This bugfix has now also been uploaded to the store. Version 1.7.8.
     
  35. WhiteDoggy

    WhiteDoggy

    Joined:
    Sep 10, 2020
    Posts:
    17
    Hi.
    Sorry I'm late.
    I have checked your bug fixes. and it works like magic.
    Thanks for helping us. :)
     
  36. edwardrowe

    edwardrowe

    Joined:
    Feb 11, 2014
    Posts:
    52
    Great! Glad it's working for you.
     
  37. huulong

    huulong

    Joined:
    Jul 1, 2013
    Posts:
    223
    Hey, I just noticed the asset went from 4 EUR to FREE on the Asset Store (not sure since when). Since the repository has been around for a while, and considering the paragraph on the asset page:

    I deduce the asset store paid version was for developer support. But now it's also free on the asset store, so maybe you could update the paragraph mentioned above to explain that you changed price to free? (and if there is another place to donate, point to that place)
     
  38. edwardrowe

    edwardrowe

    Joined:
    Feb 11, 2014
    Posts:
    52
    Thanks, you're right! I removed the paragraph. (I don't have an avenue to accept donations atm - I'll consider GitHub sponsors if I get more time to support it, but just had a second baby so free time is in short supply :) )

    Thanks for helping me fix the discrepancy!