2 registered members (AndrewAMD, monarch),
1,432
guests, and 8
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: automating import/save as
[Re: lemming]
#412576
11/29/12 14:16
11/29/12 14:16
|
Joined: Oct 2008
Posts: 513
Carlos3DGS
OP
User
|
OP
User
Joined: Oct 2008
Posts: 513
|
thanks for that! Great idea!!! I have downloaded and installed it, but I have no experience with this program. I have created what the program would be in lite-c
void main()
{
STRING* model_obj = "";
STRING* model_mdl = "";
int count;
for(count=1;count<=482;count++)
{
//BUILD IMPORT AND EXPORT FILENAME STRINGS
str_cpy(model_obj,"EarthHEX");
if(count<10)
{
str_cat(model_obj,"00");
}
else if(count<100)
{
str_cat(model_obj,"0");
}
str_cat(model_obj,str_for_int(NULL,count));
if(count==1||count==17||count==33||count==49||count==65||count==81||count==97||count==113||count==129||count==145||count==161||count==177)
{
str_cat(model_obj,"p");
}
str_cpy(model_mdl,model_obj);
str_cat(model_obj,".obj");
str_cat(model_mdl,".mdl");
//IMPORT OBJ
keys_import_obj();
insert model_obj text; //<------------
keys_import_finalize();
//EXPORT MDL
keys_export_mdl();
insert model_mdl text; //<------------
keys_export_finalize();
}
}
any help on the lines "insert model_obj text;" and "insert model_mdl text;" would be great. also the keystroke functions I am not sure how to make it in this program, but they would look something like this: void keys_import_obj() { ALT F I M M M M M M ENTER }
void keys_import_finalize() { ENTER ENTER }
void keys_export_mdl() { ALT F A }
void keys_export_finalize() { ENTER } any help with this would be great
|
|
|
Re: automating import/save as
[Re: Carlos3DGS]
#412591
11/29/12 17:07
11/29/12 17:07
|
Joined: Oct 2008
Posts: 513
Carlos3DGS
OP
User
|
OP
User
Joined: Oct 2008
Posts: 513
|
I finally understood all the syntax and how the program works... The above Lite-c example is finally done and working in AutoHotkey Script language:
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Recommended for catching common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
;Comment initialize variables
count := 1
model :=
;Comment wait wile selecting MED window
Sleep 10000 ;Comment 10 seconds
;Comment the start of the loop
Loop
{
;Comment open "import obj" menu by pressing "ALT f i m m m m m m ENTER"
Send {Alt}fimmmmmm{enter}
Sleep, 300 ;Comment 1/4th of a second
;Comment insert obj file name
Send EarthHEX
if count < 10
Send 0
if count < 100
Send 0
model = %count%
Loop, parse, model
{
Send %A_LoopField%
}
if (count=1||count=17||count=33||count=49||count=65||count=81||count=97||count=113||count=129||count=145||count=161||count=177)
Send p
SendRaw .
Send obj
;Comment finalize import pressing "ENTER" twice
Send {enter}
Sleep, 250 ;Comment 1/4th of a second
Send {enter}
Sleep, 250 ;Comment 1/4th of a second
;Comment open "save as mdl" menu by pressing "ALT f a"
Send {Alt}fa
Sleep, 250 ;Comment 1/4th of a second
;Comment insert mdl file name
Send EarthHEX
if count < 10
Send 0
if count < 100
Send 0
model = %count%
Loop, parse, model
{
Send %A_LoopField%
}
if (count=1||count=17||count=33||count=49||count=65||count=81||count=97||count=113||count=129||count=145||count=161||count=177)
Send p
SendRaw .
Send mdl
;Comment finalize "save as mdl" by pressing "ENTER"
Send {enter}
Sleep, 250 ;Comment 1/4th of a second
;Comment loop back to the start of loop or stop loop
count++
if count > 482
break
}
Thankyou very much for showing me this program! I can now start automating anything I want in any program! And using alt+tab commands... tedious workflow between different programs can be automated too! (for example load a .wing file in wings3d, export as .obj from wings3d, alt+tab to med, import .obj in med, save as .mdl from med, alt+tab back to wings3d, repeat a million times withought ever having to browse through menus, files, press a key or click the mouse...) I love it!!! Thanks a million times!!!
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|