Delgine 3D Tools & Content DeleD Community Edition
Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

batch script plugin.

 
Post new topic   Reply to topic    DeleD Community Edition Forum Index -> DeleD Plugins
View previous topic :: View next topic  
Author Message
se5a
Member


Joined: 03 Feb 2014
Posts: 7

PostPosted: Mon Feb 03, 2014 6:29 am    Post subject: batch script plugin. Reply with quote

So I've got a bunch of .X files that I want to turn into ogre.mesh files.

DeleD has been the first 3d modeling program that seems to be able to do this seamlessly. I've pulled my hair out with blender enough times, may it burn in a fire.

so, what I want to try and do is write a plugin where I can throw a directory full of .x and png files at it, and have it export the ogre.mesh and .material files, rather than doing it manually one by one.

can I do this with a plugin?
I've not written a plugin for anything before, though I'm fairly familiar with C#, I've tried the C# plugin example and that works. I guess I need to figure out how to get one plugin to call another, (to import the .x, then to export the .mesh) if that's possible.
Back to top
View user's profile Send private message
Jeroen
Site Admin


Joined: 07 Aug 2004
Posts: 5324
Location: The Netherlands

PostPosted: Tue Feb 04, 2014 7:58 am    Post subject: Reply with quote

Hi se5a, welcome to these forums! Smile

Glad to see DeleD can help you out here. I lol'ed about your Blender comment actually. It's not the first time I hear remarks like that. Wink

Anyway, calling other plugins from within your own plugin... afaik that's not possible because plugins have no knowledge of eachother. I wonder though: even if it's possible, is it worth the trouble? Don't know how many .x files you have, but if it's only, say, a few hundred, converting them by hand seems the fastest option. Agreed, boring work, but it could be done in a few hours. Getting a stable plugin up and running in the same amount of time seems quite a challenge to me. Anyway, just my thoughts.
_________________
Check out Figuro, our online 3D app! More powerful 3D tools for free.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
se5a
Member


Joined: 03 Feb 2014
Posts: 7

PostPosted: Tue Feb 04, 2014 6:09 pm    Post subject: Reply with quote

ah, I suspected as much, that is a shame.

The problem is not only the large amount to convert, but that our projects is a remake of another game. so we've got a ton of extra art that could be used in the project, but can't really distribute due to copyright etc. however, most our target audience already has the original game, and therfor the the art. if users could convert the art that they already have easily, it solves the problem.

I'll look see if I can use something like AutoHotKey to do what I'm after.
Back to top
View user's profile Send private message
Jeroen
Site Admin


Joined: 07 Aug 2004
Posts: 5324
Location: The Netherlands

PostPosted: Wed Feb 05, 2014 7:19 am    Post subject: Reply with quote

Ah, I see what you mean. So you need a tool that users can use to convert art themselves. Hmm.... if I think of an alternative, I'll let you know!

In the mean time, your project sounds pretty cool. Can you tell us some more about it? I love remake projects! Very Happy
_________________
Check out Figuro, our online 3D app! More powerful 3D tools for free.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
se5a
Member


Joined: 03 Feb 2014
Posts: 7

PostPosted: Wed Feb 05, 2014 6:35 pm    Post subject: Reply with quote

looks like an autohotkey script is going to work. I've already got it starting up DeleD, opening the import plugin and putting text in the textfield with not much effort. just have to get it to request a folder location from the user and iterate through .x files in that folder and I'll be golden.

The game is FrEee, it's a remake of SpaceEmpiresIV/V
https://bitbucket.org/ekolis/freee/
the core stuff is quite far along, we've still got some general stabilty issues to deal with, but other than that it's at a state where it's nearly playable multiplayer wise.

I'm doing the combat engine, I kind of had an idea for a space combat game floating around in my head for a while, and realised that FrEee would be a perfect platform to test out my ideas. so I jumped on the project. the combat is a bit more like SpaceEmpiresV than IV in that it's using 3d models instead of just 2d sprites, and it's realtime rather than turnbased.
It's big feature is that it's newtonian, which I'm keen to see how it will work out in large battles. the player does not get to control the ships individualy but will be able to set ship AI strategies for movement and targeting for each ship design. another feature is that there is a compleate disconnect between the combat engine and the 3d graphics. in SpaceEmpiresV the server processing the turn had to have all the 3d model shipsets. this will not need any 3d models to process the turn, there is no hitbox detection, it's all worked out with tohit dice rolls, then when you view the combat it figures out where to fire a projectile to hit the target or miss it. (This is one reason the player doesnt get to control individual ships, the combat needs to process once before the replay side of things can see what's going in, since the replay needs to be able to look foward in time to see where a ship will be if the shot it's firing *now* will be a hit, this means you don't get that ugly curving bullets effect)
Back to top
View user's profile Send private message
se5a
Member


Joined: 03 Feb 2014
Posts: 7

PostPosted: Wed Feb 05, 2014 11:07 pm    Post subject: Reply with quote

incase somone else wants to do something simular, here's the ahk script:


Code:
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
SetTitleMatchMode 1
FileSelectFile, deled_executible, 3, , Select DeleD, Select DeleD.exe (deled.exe; DeleD.lnk)
if deled_executible =
    {
        MsgBox, You didn't select anything.
        Exit
    }

FileSelectFolder, importFolder, , 0, Select ImportFolder
if importFolder =
    {
        MsgBox, You didn't select a folder.
        Exit
    }

FileSelectFolder, exportFolder, , 3, Select ExportFolder
if exportFolder =
    {
        MsgBox, You didn't select a folder.
        Exit
    }
 

ArrayCount=0   
Loop, %importFolder%\*.x, 0, 0  ; Recurse into subfolders.
{
    ArrayCount += 1
    xfilesArray%ArrayCount% := A_LoopFileName
}

Run "%deled_executible%"

WinWait DeleD
WinActivate DeleD
WinWaitActive DeleD

Loop %ArrayCount%
{

    xfile := xfilesArray%A_Index%
    xfilepath = %importFolder%\%xfile% 
    StringTrimRight, meshfile, xfile, 2
    meshfilepath = %exportFolder%\%meshfile%.mesh
    FoundPos := RegExMatch(meshfile, "_")

    pfix := SubStr(meshfile, 1, FoundPos-1)
   

    WinActivate DeleD
    WinWaitActive DeleD
    Send ^n
   
    Send {ALT down}
    Send p
    Send e
    Send {ALT up}

    WinWaitActive DirectX X Importer for DeleD 3D Editor
    ControlFocus, TEdit2, DirectX X Importer for DeleD 3D Editor
    ControlSetText, TEdit2, %xfilepath%, DirectX X Importer for DeleD 3D Editor
   
    Send {Enter}
   
    WinWaitActive DeleD
   
   
   
    Send {ALT down}
    Send p
    Send o
    Send {ALT up}
   
    WinWaitActive Ogre Mesh Exporter
    ControlFocus, TEdit2, Ogre Mesh Exporter
    ControlSetText, TEdit2, %meshfilepath%, Ogre Mesh Exporter
    ControlSetText, TEdit1, %meshfile%, Ogre Mesh Exporter
    ControlClick, TPanel6, Ogre Mesh Exporter, OK
}
   


it asks for the DeleD exe location(or lnk is fine) then asks for import and export folders.
it then loops through each .x in the import folder, loading the .x and exporting the .mesh and .mat.
seems to be working rather well.


Last edited by se5a on Tue Feb 11, 2014 5:15 am; edited 1 time in total
Back to top
View user's profile Send private message
se5a
Member


Joined: 03 Feb 2014
Posts: 7

PostPosted: Thu Feb 06, 2014 2:52 am    Post subject: Reply with quote

one minor detail.
it's calling all the materials Material1

I can have the prefix field in the export iterate or change something, but that seems messy.

where's it getting the Material1 name from?
I can't see a "material1" string in the .x file
In DeleD in the Materials tab it's got "material1"
but I can't see where to rename it.
Back to top
View user's profile Send private message
Jeroen
Site Admin


Joined: 07 Aug 2004
Posts: 5324
Location: The Netherlands

PostPosted: Mon Feb 10, 2014 6:32 pm    Post subject: Reply with quote

I like your solution with an autohotkey script. Also thanks for sharing it here - i'm sure someone will be helped out with it being posted here. Smile You got it working fully now?

Good job on the remake of SpaceEmpiresIV/V, too. It really seems like a lot of work which can only be achieved by being fully dedicated to the job - which you guys certainly seem to be! Got any screenshots of the game?

Feel free to keep us posted here - it's always cool to see projects like yours develop and grow. Smile
_________________
Check out Figuro, our online 3D app! More powerful 3D tools for free.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
se5a
Member


Joined: 03 Feb 2014
Posts: 7

PostPosted: Tue Feb 11, 2014 5:03 am    Post subject: Reply with quote

yeah sortof, I'm still not sure where it's getting the material names from, or how to change it, but I've changed the prefix to be whatever the ship name is.
so materals come out with names like:
KpiImp_BattleshipMaterial1
or
Ngrath_lightcruiserPDX1_-_Default
a bit untidy, but it works.

here's a quick dirty screenshot of the combat:


and another one zoomed in on the grey ship:


It's not very pretty yet. actualy it's kind of fugly.
I need to find an artist who knows how to make particle systems, and make some better looking thruster effects. as well as weapon firing effects etc. as I mentioned before, the combat is what I've been working on, although the very basics of combat is there (two ships will kill each other) there's still a load of work to do on it, I need to do animations for beams, need to do unit(fighters) launching, and handle combat over planets, at warp points and asteroid fields and storms. there's a number of bugs, I'm not happy with the helm AI and will probibly end up re-writing it(maths is hard yo) and then there's the ability to give ships move and targetign strategies which I've only thought about in a general way, and not really sure how I'm going to impliment it.

The core game is quite far along though, you can design and construct ships, send them places, get them into battles, colonise other planets etc. so overall it's on the cusp of being playable, there's a few stability issues to work out however.

Edit: looks like the forum doesn't want to display images from dropbox, you can rightclick and view though.
Back to top
View user's profile Send private message
Spaddlewit
Member


Joined: 24 Aug 2009
Posts: 244
Location: Florida, United States

PostPosted: Sat Feb 15, 2014 1:38 pm    Post subject: Reply with quote

Have you heard of AssImp? It's useful for converting a lot of formats.
Back to top
View user's profile Send private message Visit poster's website
se5a
Member


Joined: 03 Feb 2014
Posts: 7

PostPosted: Sat Feb 15, 2014 8:08 pm    Post subject: Reply with quote

I was not aware of that no.
a quick look at the website apears that it only exports ogre models as xml so there's another step after that.
still looks like an extreamly handy tool to keep an eye on.

Whats the status of Deled animation exportation?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    DeleD Community Edition Forum Index -> DeleD Plugins All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum