Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, 7th_zorro, Ayumi), 749 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
automating import/save as #412529
11/28/12 15:58
11/28/12 15:58
Joined: Oct 2008
Posts: 513
Carlos3DGS Offline OP
User
Carlos3DGS  Offline OP
User

Joined: Oct 2008
Posts: 513
Is there any way to create some sort of batch process for med?
I have around 500 *.obj files and selecting "import wavefront obj", then "save as" 500 times is a pain in the arse...

If it is not possible in med, do you guys know any free program that can do this?
I have tried a few programs that supposedly can do this but with no sucess. I tried "ModelConvertterX" but apparently it needs some flight simulator x files that are not free to download. I also tried "3D Object Converter" but the mdl batch feature is disabled for non registered users, so that program is not an option either.

Anyone know how to automate the process through MED or can point me to any free program capable of obj to mdl batch conversion?


"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1
Re: automating import/save as [Re: Carlos3DGS] #412550
11/28/12 22:52
11/28/12 22:52
Joined: Nov 2011
Posts: 274
de
lemming Offline
Member
lemming  Offline
Member

Joined: Nov 2011
Posts: 274
de
I don't know a software to do this, but what about using Autohotkey and sending keystrokes to MED?

Re: automating import/save as [Re: lemming] #412576
11/29/12 14:16
11/29/12 14:16
Joined: Oct 2008
Posts: 513
Carlos3DGS Offline OP
User
Carlos3DGS  Offline 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
Code:
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:
Click to reveal..
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


"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1
Re: automating import/save as [Re: Carlos3DGS] #412591
11/29/12 17:07
11/29/12 17:07
Joined: Oct 2008
Posts: 513
Carlos3DGS Offline OP
User
Carlos3DGS  Offline 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:
Code:
#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!!!


"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1