[TOOL] Quick model material swapper
BeigeAlert
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
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.
https://www.dropbox.com/s/187piu1ntfsx7wp/model_material_renamer.py?dl=1
EDIT2: Here's a video demonstration
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!
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
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@uralBornNoobist said: Good question. Yes.
Seriously great work, shame you couldn't have made it a couple of years earlier... haha
Added a video to the OP.
Sorry . I'll try to be 2 years faster with everything else I do.