Skyrim

About this mod

AutoHotKey script to automat almoste everything (exept fixing the armor)
when converting to another body preset.

Requirements
Permissions and credits
DESCRIPTION VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV

autohotkey script to automat almoste everything (exept fixing the armor)
when converting to another body preset.
it takes around 6-10 sec(not counting manualy fixing the armor) depending on the settings with "timer=0"
to finish converting.

can automaticly convert all meshes (but it dont fix the armor mesh) in the "original meshes" folder by setting 
copybone=1
bdelete=y
bdeletename=
skip=y
repeat=y

only "bdelete=y" and "copybone=1/2/b" uses the mouse and keybord because AutoHotKey cant get info from the meshes "treeview".

if you get Fatal exception error message constantly (it is outfit studio not this script) try increasing "timer=".
or reinstal Outfit Sudio

read the settings and buttons to see what you can change and do V
instructions att the bottom V

DESCRIPTION ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

SETTINGS VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV

[main]
; What template to use (ex template=Unified UNP Special)
; it is the base body typ (uunp, cbbp)
template=Unified UNP Special

; if you want to remake the original _1.nif mesh to fit the template body(remake=r)
; or convert to another presset(remake=c)
; ((remake=r) is good to do if the original mesh dont match the template body
; and need to use the mesh multiple times or if you are making a armor mod)
remake=c

; if ^ =c What body presset to convert to (ex presset=UUNP - UNP)
; it is the body form (unp, unpb)
preset=UUNP - UNP

; --------------------------------
; block the mouse and keybord except "Escape" and "F1"
; when the script is running (block=y/block=n)
; (recomended to be block=y)
block=y

; --------------------------------
; do you want to overwrite the nif if the name alredy exist(overwrite=y)
; or do you want to add a number in the end(overwrite=n)
overwrite=n

; Do you want to change the name of the converted meshes (name=y/name=n)
namechange=n

; If ^ =y manuale(naming=m) or automatic(naming=a) if =m a message box poppup to write the new name in it
naming=a

; If ^ =a do you want to remove(=r) or add(=a) or both(=b) letters from the name (excluding _1.nif)
change=a

; If ^^ =a and ^ =r or =b what letters to remove between beginig(b=0) and end (e=1) from right/(left)(lr=r/lr=l)
; from right dont count with "_1.nif" and ".nif" it removes them before starting to change the name
; the first letter is 0 for (b=) and 1 for (e=) if they are the same it wont remove any letters
; to remove multiple times set a | bettwen the positions (ex lr=l|r b=0|1 e=4|5)
; ( ex "123abc321" (lr=l|r b=0|1 e=4|2) (remove1 = "bc321") (remove2 = "bc3") )
lr=l
b=0
e=4

; If ^^^=a and ^^ =a or =b what letters to add(l=abc) after position(p=0) from (right/left)(lra=r/lra=l)
; from right dont count with "_1" and ".nif" it removes them before starting to change the name
; 0 is before the first letter and 1 is between first and second letter for (p=)
; to add multiple times set a | bettwen the positions (ex lra=l|r p=0|1 l=abc|123)
; ( ex "123abc321" (lra=l|r p=0|1 l=abc|123) (add1 = "abc123abc321") (add2 = "abc123abc321231") )
lra=l
p=0
l=abc

; --------------------------------
; if you want to export mesh with Unweighted Vertices (exportuv=y)
; or move it to unweighted vertices folder(exportuv=n)
exportuv=n

; if ^ =n and (skip=n) (if (skip=y) move mesh to (uvfolder=))
; do you want a message to apper teling you the mesh have Unweighted Vertices
; and pause the script so you can fix it manualy (press (alt+2) to continue)(uvmessage=y)
; or move the original mesh to (uvfolder=) and end it(repeat=n) or start on next one(repeat=y) (uvmessage=n)
uvmessage=n

; -------------------------------- (uses mouse and keybord V)
; automaticly copy bone weights(all of them) to the armor meshes(add hdt to armor meshes)
; (no=(copybone=n)) (end of (alt+1)= (copybone=1)) (begining of (alt+2) if (skip=n) =(copybone=2))
; or both ((copybone=1) and (copybone=2)) = (copybone=b)) ((copybone=b/2) is good when fixing the mesh
; but dont use it when fixing unweighted vertices use (copybone=1/n))
copybone=n

; delete the extra body if the name contain (bdeletename=) (bdelete=y/bdelete=n)
; the name or part of the name of the body to delete (bdeletename=UUNP_outfit)
; (ex name=UUNP_outfit (bdeletename=outfit)
; (to add multiple meshes to remove set a | bettwen the mesh name (ex bdeletename=UUNP_outfit|body)
; (not recomended may delete the wrong mesh (ex bdeletename=U it will delete all meshes with a U in it)
; or not delet the extra body att all because no match was found)
; if (bdelete=y) you can press "alt 3" when a mesh is loaded in outfit studio to test if auto body delete works
; (set "timer=" to around 1000 to se better if the mouse move correctly)
bdelete=n
bdeletename=

; if ^ =y if the mouse is not over the mesh use (xposadd=) and (yposadd=) to move the mouse
; left(xposadd=-123) or right(xposadd=123) and up(yposadd=-123) or down(yposadd=123)
; (yjumpmulti=)changes the distance between the meshes using multiplication
; ((yjumpmulti=1) is default, (yjumpmulti=0 is dont move (so if yjumpmulti= <=0 it becomes yjumpmulti=1))
xposadd=
yposadd=
yjumpmulti=

; -------------------------------- (uses mouse and keybord ^)
; do you whant to skip over the manual check the outfit for error (no need to press (alt+2))(skip=y/skip=n)
; (not recomended even with bdelete=y the extra body may not be deleted and the outfit may need to be fixed)
skip=n

; if ^ =y repeats the script untill no more meshes left to convert(repeat=y)
; if ^ =n repeat from beginning of (alt+2) untill (alt+1) is done (reverse of what skip=y does)(repeat=y)
; or stop when (alt+2) is done (and the mesh) (repeat=n)
repeat=n

; do you whant a message box to apper when to manualy check if the armor fit the presset (alt+1)
; and is done converting the mesh (alt+2)
; if ^ =y will only show when (alt+1) is done
; if ^^ =y will only show when mesh(alt+2) is done
; if both ^ and ^^ is =y or if donemsg=n it dont show a message
; (donemsg=y/donemsg=n)
donemsg=y

; --------------------------------
; Save the original meshes that have been converted to "safolder=" folder (save=y/save=n)(save=n deletes them)
save=y

; do you whant to move all broken _1.nif files to the broken nifs folder (erfolder=) (saveer=y/saveer=n)
; if no delete them
saveer=y

; if ^=y do you whant a message when a broken _1.nif is moved/deleted (mdmessage=y/mdmessage=n)
mdmessage=y

; --------------------------------
; Start bodyslde/outfit studio (start=y/start=n)(start=n you have to have outfit studio open)
start=n

; If ^ =y place a shortcut to bodyslide exe in "\semiauto outfit studio v5\" folder (the same as this file)
; and type in the name of the shortcut in (shortcut=) (ex shortcut=Bodyslide)
; (it may work for you with a direct path to Bodyslide.exe but it did not for me
; (ex shortcut=D:\BodySlide\BodySlide x64.exe) )
shortcut=

; if ^^ =y Fatal exception window comes up do you want it to automaticly restart the script (restart=y/restart=n)
restart=y

; if ^ =y how many times in a row do the fatal exception window come up before starting to rais the
; (timer=) with 10 every time the fatal exception window comes up
; (fatalexceptionlimit=0) it is off
fatalexceptionlimit=1

; if ^^ =y how many times in a row do the fatal exception window come up before ending the script
; (fatalexceptiontimeout=0) it is off
fatalexceptiontimeout=10

; if ^ is not 0 do you want to move the original _1.nif mesh
; to fatal exception folder(fefolder=) (movefe=m) (rfolder= apply to this)
; or end the script (movefe=e)
; or delete the original _1.nif(movefe=d)
movefe=m

; --------------------------------
; remove all subfolders in mesh folders so it looks like
; ("cofolder="\meshfolder\mesh.nif) (rfolder=y/rfolder=n)
rfolder=n

; --------------------------------
; delete all _0.nif and non .nif files in "original meshes"("orfolder=") folder (dfile=y/dfile=n)
dfile=n

; if ^ =n move to "other files"("otfolder=") folder (mfile=y/mfile=n) if mfile=n get error message
mfile=y

; if ^=y remove subfolder for the moved other files (rffolde=y/rffolde=n)
;(same as "rfolder=" but for "other files"("otfolder="))
rffolder=n

; --------------------------------
; if the computer is to slow for the timers in the script raise this (1000 = 1sec)
; (raising it may decrease the amount of "Fatal exception" happening)
timer=0

; --------------------------------
; end script if to much time have passed when runing on the same loop(timeout=y/timeout=n)
; (good if outfit studio freeze)("timer=" affect this to att "timer=0" it takes around 10sec to timeout)
timeout=y

; --------------------------------
; original mesh folder path (ex orfolder=D:\folder original)
; if "orfolder=" goes to (semiauto outfit studio v5\original meshes)
orfolder=

; converted meshes folder path (ex cofolder=D:\folder converted)
; if "cofolder=" goes to (semiauto outfit studio v5\converted meshes)
cofolder=

; saved original meshes folder path (ex safolder=D:\folder saved original)
; if "safolder=" goes to (semiauto outfit studio v5\saved original meshes)
safolder=

; broken nifs folder path (ex safolder=D:\folder broken)
; _1.nif files that cant be opened in outfit studio
; if "erfolder=" goes to (semiauto outfit studio v5\broken nif)
erfolder=

; other file folder path (ex otfolder=D:\folder other)
; all files that are not _1.nif move here
; if "otfolder=" goes to (semiauto outfit studio v5\other files)
otfolder=

; fatal exception folder move mesh that timeout with fatal exception to this folder
; (ex fefolder=D:\folder fatal)
; if "fefolder=" goes to (semiauto outfit studio v5\fatal exception)
fefolder=

; Unweighted Vertices folder if (exportuv=n) move mesh that have Unweighted Vertices
; if "uvfolder=" goes to (semiauto outfit studio v5\unweighted vertices)
uvfolder=

; --------------------------------

; ===============================================================================================
; ===============================================================================================
; ===============================================================================================
; ===============================================================================================
; ===============================================================================================
; ===============================================================================================

[title]
; the window titles of the different windows
; you should not need to change this unless there is a different language than english is in the title
; not case sensitive
; can be the entire title or part of it 1 word or part of a word (the more the better)
; (ex "Outfit Studio" = outfit)

; BodySlide title
tbodyslide=bodyslide

; Outfit Studio
toutfitstudio=outfit studio

; New Project (outfit studio > file > "New Project....")
tnewproject=new project

; NIF Error window title (can not load nif window nif is broken)
terrornif=error

; Select a slider preset (outfit studio > Slider > "Load Preset....")
tsliderpreset=slider preset

; Export project NIF (outfit studio > file > export > "Export nif with reference")
texportnif=export

; Unweighted Vertices error window
tunweightvert=Unweighted

; Fatal exception error window
tfatalexception=Fatal exception

; used when auto deleting mesh body(bdelete=y) VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV

; (because autohotkey cant get info from treeviews.)

; Export shape as an .obj file window used to get the selected mesh name
; (right click mesh in meshes window export > to obj...)
tmeshexport=export

; the Confirm Delete window (select mesh in meshes window export and press the "delete" key
tconfirmdel=delete

; Shape Properties window (dubble click on a mesh in meshes window)
; it comes up when there is no more meshes to check
tshapepro=Shape

; Can't copy weights window
; it comes up when trying to "copy bone" weights off the referenced mesh(green text)
tccweights=weights

; ===============================================================================================
; ===============================================================================================
; ===============================================================================================
; ===============================================================================================
; ===============================================================================================
; ===============================================================================================

SETTINGS ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



BUTTONS VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV

"Escape" = if you press "Escape" "semiauto outfit studio v3" closes and the keybord and mouse block is turned off

"F1" = if you press "F1" "semiauto outfit studio v3" restrarts and the keybord and mouse block is turned off

"Alt+3" = if you press "Alt+3" and bdelete=y it starts a test run of bdelete (auto body delete)
see the (alt+3) = bdelete test.jpg for more details

"Alt+1" = if you press "Alt+1" the iauto armor convert starts to run until
if skip=n runs till done loading preset
if skip=y it runs till mesh is converted and done
"Alt+2 = if you press "Alt+2" and "Alt+1" is done running and skip=n starts the secound and last part
of the auto armor convert

BUTTONS ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


INSTRUCTIONS VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV

0. set the settings in settings.ini to what you want

1. if "start=y" copy the BodySlide shortcut to the "semiauto outfit studio v3" folder
(make sure the "shortcut=" match the BodySlide shortcut name)

2. move the _1.nif meshes you want to convert to "preset=" to the "orfolder="(original mesh) folder
(the program move the other files automatic and if the nif dont have _0.nif or _1.nif only .nif
it will use it as a _1.nif (because not everyone name the converter ready meshes _1.nif)

3. start "semiauto outfit studio v3.exe"

4. read the message that popes up

5. press "Alt+1" to start converting the mesh in "orfolder="(original mesh) folder

if "skip=n" V^VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV

6. wait for another message that popes up

7. if "bdelete=n" remove the extra body(not the green one) in the meshes window

8. check so the armor fit the body if it dont fix it using the tools=
("increase mesh volume in an area" "decrease mesh volume in an area"
"move verticts over plain parallel to the view" "smooth an area of the mesh")

9. if you needed to fix the mesh in 8. reload the preset ("Slider" > "Load Preset..."
choose the preset in the list box (the "Hige Weight" box should be marked) then press ok

10. press "Alt+2"

if "skip=n" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

11. wait for another message that popes up telling you that it is done

12. if "repeat=n" go to 5. if "repeat=y" go to 6. if "repeat=y" and "skip=y" it will continue on its own until
"orfolder="(original mesh) folder is empty or you press "Escape" or "F1"


INSTRUCTIONS ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^