PsychoMachina Posted September 17, 2014 Posted September 17, 2014 Is there a TES5edit script or tool that can make batch changes to the paths of the models within a given plugin or master file. For example, say I have a merged hair pack containing 100+ hairs and I decide to organize their folders for simplicity purposes. This would mean I now need to edit, one by one, each model path in the master file. I tried Quick Display to export the values (file path) to a CSV file, edit the values to the new path, and used Quick Change to import the CSV, but the values never change. TIA.
b3lisario Posted September 17, 2014 Posted September 17, 2014 Mouse right click --> Apply script --> list used meshes Are these the exact files you want to edit? I could make a quick edit to that script to edit the nif paths.
PsychoMachina Posted September 17, 2014 Author Posted September 17, 2014 Thanks for responding, B3lisario. Tried the script you mentioned and it only lists .nifs, I'm looking for an efficient method of batch editing the paths to NIFs, TRIs, and TEXTURES. I should have been more specific in my request. I appreciate any help. Thanks.
b3lisario Posted September 17, 2014 Posted September 17, 2014 Based on that script I made another to edit paths for meshes, textures, and tri files. It has some limitations but I think I'll do the job. I don't know Pascal so anything could happen. There are a couple of strings you need to change, lines 13 and 15: oldPath := 'actors\character\SifBody'; newPath := 'folder\another'; Here you put the original path you want to replace and the new path. The "data\meshes\" or "data\textures\" part is not needed. For example to change the paths that point to skyrim\data\meshes\armor\studded\* to skyrim\data\meshes\armor\mymod\replacers\* oldPath := 'armor\studded'; newPath := 'armor\mymod\replacers'; This would change armor\studded\male\gloves_go.nif to armor\mymod\replacers\male\gloves_go.nif and so. Paths not including armor\studded should not be modified. How to use the script. Copy it in "TES5Edit\Edit Scripts" folder. Then mouse right click --> apply scripts --> Replace paths If you didn't modify the strings you can do it the window that shows up. What you put in the variables must be a folder child of meshes or textures folders: OK --> oldPath := 'actors\bear\animations'; Not OK --> oldPath := 'bear\animations'; // this won't work, the script is not fancy enough and it won't find the path to change Backup the esp file Replace paths.7z
nagothm Posted September 17, 2014 Posted September 17, 2014 Helpful little script, thanks B3lisario! (& PsychoMachina for the request)
PsychoMachina Posted September 17, 2014 Author Posted September 17, 2014 It's not working, at least for me. There were no error messages and TES5edit showed... Applying script...Fin[Apply Script done] Processed Records: 4, Elapsed Time: 00:00 ...but the paths are unchanged. Exiting from TES5edit did not give the option to save changes to the master file I'm editing. EDIT Changed the master to a plugin and still no change.
b3lisario Posted September 17, 2014 Posted September 17, 2014 Did you edit lines 13 and 15? What did you put? That output means it found 4 files, but none of them begins with what you did put in oldPath variable (line 13)
PsychoMachina Posted September 17, 2014 Author Posted September 17, 2014 I'm working on the Elin master file, so when changing the path to the body meshes, I tried the following: old path: Actors\2chElin\Femalebody_1.nif new path: Actors\Elin\Femalebody_1.nif old path: Actors\2chElin\Femalebody_1.nif new path: Elin\Femalebody_1.nif Even tried the same without referencing the actual file (i.e., Actors\Elin instead of Actors\Elin\Femalebody_1.nif).
b3lisario Posted September 17, 2014 Posted September 17, 2014 It would be: oldPath := 'Actors\2chElin'; newPath := 'Actors\Elin'; This produces: Actors\2chElin fix\FemaleHands_1.nif --> Actors\Elin fix\FemaleHands_1.nif Actors\2chElin fix\FaceParts\EyeRight.tri --> Actors\Elin fix\FaceParts\EyeRight.tri etc. hundreds of edits Maybe better: oldPath := 'Actors\2chElin fix'; newPath := 'Actors\Elin'; unless you want to keep the fix part ofc
PsychoMachina Posted September 17, 2014 Author Posted September 17, 2014 Update I finally got it working to some degree. Using... oldPath := 'Actors\2chElin';newPath := 'Actors\Elin'; ...did replace the values for some of the headparts, but did not replace the values for the armor addons. Also it would seem target folders with spacing in the name does not work. So any value with, oldpath: Actors\2chElin fix does not get changed. Also, did you mention the new path has to begin with what was begun in the old path? If the old path starts with 'actors' then the new path must start with 'actors'? I asked because I was able to change the original 'Actors\2chElin' to the new 'Elin' (example: 'Actors\2chElin\hairs' changed to 'Elin\hairs'). Either I misunderstood what you instructed or I'm infected with gremlins. ADDITIONAL I'll just go ahead an manually edit the remaining records, but your script did reduce the work load so thank you very much. Your Replace Paths script needs to be uploaded to the Download section. It would be a shame if it eventually gets buried with the other aging posts. Thanks you for your help, give yourself a raise you deserve it.
b3lisario Posted September 18, 2014 Posted September 18, 2014 The spaces doesn't matter in this case, they are like any other character. This works, I tested it myself before posting it. oldPath := 'Actors\2chElin fix'; newPath := 'Actors\Elin'; This modifies also all armor addons. At least in the ElinRace.esm I have. Searches in the script are case-sensitive. You are right, the newPath variable can be any string.
PsychoMachina Posted September 18, 2014 Author Posted September 18, 2014 The spaces doesn't matter in this case, they are like any other character. This works, I tested it myself before posting it. oldPath := 'Actors\2chElin fix'; newPath := 'Actors\Elin'; This modifies also all armor addons. At least in the ElinRace.esm I have. Searches in the script are case-sensitive. You are right, the newPath variable can be any string. That's it. Everything works now. Some of the paths started with 'Actors' while others started with 'actors' so the initial tests had mixed results. Thank you for your help and for your patience.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.