Author Topic: new linux xml2g (glexemel)  (Read 5983 times)

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
new linux xml2g (glexemel)
« on: 4 November 2008, 01:42:03 »
Hi I wrote some scripts that makes the handling of xml2g
much more easy. NO MORE DTD is needed next to converted files!

simply call
xml2g mymodel.xml
or
g2xml glestmodel.g3d
wherever you want!

With (un)installscript and precompiled linux 32bit binary!
( you can use your own binaries too ! Rename them to xml2g.bin/g2xml.bin | put them in the glexemel dir | then call included install.sh )

http://www.titusgames.de/glexemel/glexe ... 386.tar.gz

( What is xml2g? https://docs.megaglest.org/Converter )

[attachment deleted by admin]
« Last Edit: 18 June 2016, 15:21:03 by filux »
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

modman

  • Guest
Re: new linux xml2g (glexemel)
« Reply #1 on: 4 November 2008, 02:08:41 »
Hey, could you post the source code for that program?  Maybe I can improve it in some way...

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: new linux xml2g (glexemel)
« Reply #2 on: 4 November 2008, 02:09:49 »
the sourcecode ARE the scripts!
xml2g and g2xml are not changed in any way
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Idanwin

  • Guest
Re: new linux xml2g (glexemel)
« Reply #3 on: 4 November 2008, 03:49:04 »
thx, finally got it working!
however I still have some problems, the Z&X axis have become the ground level (so I have to turn around every of my models) and the bigger problem: There are no textures!

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: new linux xml2g (glexemel)
« Reply #4 on: 4 November 2008, 09:27:08 »
I asume you are not using blender for modelling( I saw this rotation problems when imported from other editors ).
If it's shown correct ( the orientation ) in Blender, it should be exported correctly.

For the texture look here: ( handling of textures )
http://www.glest.org/glest_board/viewto ... 178#p17178

and you should also have a look here:
https://docs.megaglest.org/Blender_Modelling
and especially here:
https://docs.megaglest.org/Glest_Blender_Hints
« Last Edit: 18 June 2016, 19:39:29 by filux »
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Idanwin

  • Guest
Re: new linux xml2g (glexemel)
« Reply #5 on: 4 November 2008, 10:26:02 »
No, I am using blender (2.48 linux 32bit).

About the textures: There is no UV selection mode! (I just split an area, opened UV/Image editor, selected the verticles in edit-mode went to texture paint mode, went back to edit mode, opened the texture and saved it...)

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: new linux xml2g (glexemel)
« Reply #6 on: 4 November 2008, 11:07:19 »
ok, you missed the last part with the material.
Go to object mode, select your object add a material like shown in the video...
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: new linux xml2g (glexemel)
« Reply #7 on: 4 November 2008, 15:40:31 »
Is there a Windows version?
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: new linux xml2g (glexemel)
« Reply #8 on: 4 November 2008, 15:54:10 »
No, but I think you can use cygwin to use it :) ( but that is a bit tricky )
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: new linux xml2g (glexemel)
« Reply #9 on: 6 November 2008, 02:17:07 »
I dont even know what that is, so I guess I'll wait forsomeone to make a window version.

What I want to see is a wizard that imports and exports (directly to g3d) all on its own... I think it might be possible by combining all the existing importers/converters/exporters together somehow...
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

modman

  • Guest
Re: new linux xml2g (glexemel)
« Reply #10 on: 6 November 2008, 05:06:06 »
You have to use command prompt.

And assuming that you know how to program, Titi, is there any was to get a program with an interface that can convert?
Also, I think that's PERL, right, and I have NO knowledge of it, whatever languege it is in.

mictes

  • Guest
Re: new linux xml2g (glexemel)
« Reply #11 on: 6 November 2008, 09:43:28 »
There was an glexemel-gui, but it didnt working. Maybee you can fix it ?

wciow

  • Behemoth
  • *******
  • Posts: 968
    • View Profile
Re: new linux xml2g (glexemel)
« Reply #12 on: 6 November 2008, 16:39:51 »
Windows support is poorer compared to linux. Someone should build the all-in-one Blender to g3d import/export script. It feasible to do this based on the scripts that are available now but someone just has to join them together.

I would suggest a Python script in Blender which can run the exporter feed the info directly to Glexemel and dump the g3d and texture to a folder. If anyone ever makes this I will be happy  :D   :D
Check out my new Goblin faction - https://forum.megaglest.org/index.php?topic=9658.0

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: new linux xml2g (glexemel)
« Reply #13 on: 7 November 2008, 05:08:08 »
Yeah... I'd love that, but I'm no good at pythons. Titi is probably the best at them, but he has a Linux OS, so it might not be Windows Compatible...
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: new linux xml2g (glexemel)
« Reply #14 on: 9 November 2008, 02:14:06 »
Its no python its a bash-shell script. "Bash" is an extension of "sh" the standard unix shell, which (I think) is currently the default for  most ( all?) linux distributions. Its something comparable to the commands in a .bat file, but it can do much much more than windows .bat files can do.
Thats why it will not run in windows.
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

mictes

  • Guest
Re: new linux xml2g (glexemel)
« Reply #15 on: 9 November 2008, 10:49:16 »
I forgott the name, but I read about a programm that allows you to run .sh scripts on windows, too. It's not really a programm, its an extension.
A other possibility:
There are programms which give you the possibility to convert .bat into an executable exe.
Maybee this is possible with .sh scripts, too ?!

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: new linux xml2g (glexemel)
« Reply #16 on: 9 November 2008, 12:01:25 »
That's cygwin, a unix like environment for windows.
http://www.cygwin.com/
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Yggdrasil

  • GAE Team
  • Ornithopter
  • ********
  • Posts: 408
    • View Profile
Re: new linux xml2g (glexemel)
« Reply #17 on: 11 November 2008, 20:40:53 »
or use MSYS:
http://www.mingw.org/wiki/msys

btw, i patched the blender export script to run xml2g right after generating the xml file. i haven't tested it really because i have no model and no time. so can just one try it out.

the patch:
Code: [Select]
[url=http://www1.inf.tu-dresden.de/~s1445051/g3d_xml_exporter_v0.1.7.py.diff]http://www1.inf.tu-dresden.de/~s1445051/g3d_xml_exporter_v0.1.7.py.diff[/url]
Code: [Select]
$ patch g3d_xml_exporter_v0.1.7.py g3d_xml_exporter_v0.1.7.py.diff
and here the patched file:
Code: [Select]
[url=http://www1.inf.tu-dresden.de/~s1445051/g3d_xml_exporter_v0.1.7.py]http://www1.inf.tu-dresden.de/~s1445051/g3d_xml_exporter_v0.1.7.py[/url]
Copy the patched file, the converter 'xml2g' (on Windows 'xml2g.exe') and g3d.dtd in the scripts folder of Blender.
Now you should be able to export "directly" to g3d.

Hope it works and helps.
« Last Edit: 16 April 2016, 08:41:31 by filux »

wciow

  • Behemoth
  • *******
  • Posts: 968
    • View Profile
Re: new linux xml2g (glexemel)
« Reply #18 on: 24 November 2008, 12:23:39 »
Thanks Yggdrasil!! This is fantastic work  :D

I did a simple test on a simple untextured cube and it worked fine. I'll do some further testing with textures/multiple meshes/animations later.

Two small point, Firstly windows users must copy ALL files from their Glexemel directory into the Blender/scripts directory, not just the g3d.dtd file.

Secondly, the script says v0.1.6 in the blender export menu. Is this script built on the old 0.1.6 or the newer 0.1.7 script that Titi made?
Check out my new Goblin faction - https://forum.megaglest.org/index.php?topic=9658.0

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: new linux xml2g (glexemel)
« Reply #19 on: 24 November 2008, 13:53:13 »
oops  :-[ my fault.
I forgot to set the to 1.7 in my script.
I fixed it now....The current one should show up with 0.1.7
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

gameboy

  • Guest
Re: new linux xml2g (glexemel)
« Reply #20 on: 24 November 2008, 18:13:58 »
i tried it but i keep getting the runtime error.

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: new linux xml2g (glexemel)
« Reply #21 on: 24 November 2008, 21:14:28 »
Good job!
This works fine for me Yggdrasil !

BUT:
If there are any problems, like if you forgot to convert quads to triangles for example, you don't see any errors now!
Probably you know a trick how to fix this too? ( is there any trick to show up blenders console messages for example? )
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Yggdrasil

  • GAE Team
  • Ornithopter
  • ********
  • Posts: 408
    • View Profile
Re: new linux xml2g (glexemel)
« Reply #22 on: 25 November 2008, 19:46:21 »
Quote from: titi
BUT:
If there are any problems, like if you forgot to convert quads to triangles for example, you don't see any errors now!
Probably you know a trick how to fix this too? ( is there any trick to show up blenders console messages for example? )
I'm not sure how to reproduce that and if i understood you correctly. Do you want the error messages from glexemel in Blender?

I now catch the error stream from glexemel and show it in a popup menu. Maybe not the best solution but it should at least indicate problems. The links are updated.

Quote from: Yggdrasil
the patch:
Code: [Select]
[url=http://www1.inf.tu-dresden.de/~s1445051/g3d_xml_exporter_v0.1.7.py.diff]http://www1.inf.tu-dresden.de/~s1445051/g3d_xml_exporter_v0.1.7.py.diff[/url]
Code: [Select]
$ patch g3d_xml_exporter_v0.1.7.py g3d_xml_exporter_v0.1.7.py.diff
and here the patched file:
Code: [Select]
[url=http://www1.inf.tu-dresden.de/~s1445051/g3d_xml_exporter_v0.1.7.py]http://www1.inf.tu-dresden.de/~s1445051/g3d_xml_exporter_v0.1.7.py[/url]
« Last Edit: 16 April 2016, 08:41:53 by filux »

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: new linux xml2g (glexemel)
« Reply #23 on: 2 December 2008, 22:20:31 »
COOL! Works perfect!
( Sorry that it took so long to test it! Why does nobody else test it? )

One last little wish:
If you can display the messages of the xml2g call, can you display the console messages of the export script itself too? You often miss important errors which are reported in blenders console. Best of all would be a combined console window. But the current Vresion is already good enough for a new release!
But with this new feature we get a little problem: Do we release 2 scripts from now? One which produces xml files and one which produces .g3d .
Or should I switch to a combined glexemel/script releases ( but what about different operating systems/binaries? )
Any ideas / suggestions?
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Yggdrasil

  • GAE Team
  • Ornithopter
  • ********
  • Posts: 408
    • View Profile
Re: new linux xml2g (glexemel)
« Reply #24 on: 3 December 2008, 18:20:45 »
Quote from: "titi"
One last little wish:
If you can display the messages of the xml2g call, can you display the console messages of the export script itself too? You often miss important errors which are reported in blenders console. Best of all would be a combined console window. But the current Vresion is already good enough for a new release!
Yes, it is possible but i don't think you want the whole output. I did it now only for the triangle warning.
Hint: To get a console window on startup change the command in the menu entry to:

Code: [Select]
xterm -e 'blender -w'(for window mode)

Quote from: "titi"
But with this new feature we get a little problem: Do we release 2 scripts from now? One which produces xml files and one which produces .g3d .
Or should I switch to a combined glexemel/script releases ( but what about different operating systems/binaries? )
Any ideas / suggestions?
I changed the script once more. It now checks if glexemel is available or not. If yes, you have "direct" export, otherwise only the xml is exported. So, you can release it separately.

 

anything