[TOOL] Quick model material swapper

BeigeAlertBeigeAlert Texas Join Date: 2013-08-08 Member: 186657Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, NS2 Map Tester, Reinforced - Diamond, Reinforced - Shadow, Subnautica Playtester, Pistachionauts
edited June 2015 in Mapping
Hey guys, so this is a little python script I threw together just now to make material swapping much easier, and more flexible.  Until now, your only option to change a .model file's material was to change the name of your material to match the length of the existing material, then change the string with a hex editor.  YUK!  Well that's all in the past now.  With this handy utility, you drag+drop a .model file onto it to run it, it'll spit out a list of the materials currently applied to the model, and all you have to do is enter a number (material index) and the new path surrounded by double quotes.  Then just type "SAVE", and it'll save the file with "_modified" added onto the end of it, so you don't go overwriting anything important!

EDIT:  You'll need Python 3 installed.  Version probably isn't too important, not doing anything too advanced with this, but I have 3.1.4 installed for what it's worth.

Choose the model


Drag it onto the script


Enter the new path


Save it


And you are good to go!


https://www.dropbox.com/s/187piu1ntfsx7wp/model_material_renamer.py?dl=1

EDIT2: Here's a video demonstration

Comments

  • MauvaisVitrierMauvaisVitrier France Join Date: 2014-04-10 Member: 195291Members, NS2 Map Tester, Reinforced - Diamond
    This is going to make a mapper's dick rock hard
  • MasterGMasterG gmfbst Join Date: 2003-08-24 Member: 20169Members, Squad Five Blue
    edited June 2015
    Are there any special things that I need to have installed to use this? Because drag+drop doesn't work.

    EDIT: I got it working by installing python 3.4 and then making a batch file to execute the script from.

    Awesome tool, thanks a bunch!!
  • N@uralBornNoobistN@uralBornNoobist Gorge-N-Freeman,2Gorges1Clog Join Date: 2012-12-24 Member: 176138Members
    edited June 2015
    sum of deese commentz off end me as im a young child, full of innocence...yu jus ruined all dat...thanks in advance. and i get warnings for saying thank you 3 times...look at yourself in the mirror and really think about what your doing...this isnt right...this isnt wrong...just another name for another song.
  • BeigeAlertBeigeAlert Texas Join Date: 2013-08-08 Member: 186657Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, NS2 Map Tester, Reinforced - Diamond, Reinforced - Shadow, Subnautica Playtester, Pistachionauts
    MasterG said:
    Are there any special things that I need to have installed to use this? Because drag+drop doesn't work.

    EDIT: I got it working by installing python 3.4 and then making a batch file to execute the script from.

    Awesome tool, thanks a bunch!!
    Huh... should work to just install python.  Not sure why you'd have to make a batch file for it.  Oh and needless to say, it's Windows only.

    N@uralBornNoobist said:
    sum of deese commentz off end me as im a young child, full of innocence...yu jus ruined all dat...thanks in advance. and i get warnings for saying thank you 3 times...look at yourself in the mirror and really think about what your doing...this isnt right...this isnt wrong...just another name for another song.
    Good question.  Yes.
  • MauvaisVitrierMauvaisVitrier France Join Date: 2014-04-10 Member: 195291Members, NS2 Map Tester, Reinforced - Diamond
    sum of deese commentz off end me as im a young child, full of innocence...yu jus ruined all dat...thanks in advance. and i get warnings for saying thank you 3 times...look at yourself in the mirror and really think about what your doing...this isnt right...this isnt wrong...just another name for another song.
    burp
  • ArchieArchie Antarctica Join Date: 2006-09-19 Member: 58028Members, Constellation, Reinforced - Supporter, WC 2013 - Supporter
    Got any videos of it in action(?) i find these most helpful, making some videos myself!
  • Soul_RiderSoul_Rider Mod Bean Join Date: 2004-06-19 Member: 29388Members, Constellation, Squad Five Blue
    Why now Beige? Why Now? hahaha :D

    Seriously great work, shame you couldn't have made it a couple of years earlier... haha :D
  • BeigeAlertBeigeAlert Texas Join Date: 2013-08-08 Member: 186657Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, NS2 Map Tester, Reinforced - Diamond, Reinforced - Shadow, Subnautica Playtester, Pistachionauts
    nizb0ag wrote: »
    Got any videos of it in action(?) i find these most helpful, making some videos myself!

    Added a video to the OP.
    Soul_Rider wrote: »
    Why now Beige? Why Now? hahaha :D

    Seriously great work, shame you couldn't have made it a couple of years earlier... haha :D

    Sorry :( . I'll try to be 2 years faster with everything else I do.
  • 2cough2cough Rocky Mountain High Join Date: 2013-03-14 Member: 183952Members, Reinforced - Shadow, WC 2013 - Supporter
    Well if I knew anything about code, modding... etc... I think this would probably make me jizz a little bit. Nice work there.
Sign In or Register to comment.