Jump to content

TES5edit: Need Help with Batch Edits


PsychoMachina

Recommended Posts

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.

 

Link to comment

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

Link to comment

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.

 

Link to comment

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).

 

 

Link to comment

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

Link to comment

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.

 

Link to comment

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.

Link to comment

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.

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use