How To: Export Models, Re-Import. (Blender)

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

Xenon472
Posts: 149
Joined: Fri, 19. Jun 09, 20:07
x4

Re: How To: Export Models, Re-Import. (Blender)

Post by Xenon472 » Fri, 7. Dec 18, 17:04

Binkley-Spacetrucker wrote:
Fri, 7. Dec 18, 03:18
Xenon472 wrote:
Fri, 7. Dec 18, 01:53
I am trying to export some model files and i followed your guide fine untill i run XRConverter command but it does nothing, i both tried running the command from a bat file and writing the comand on the powershell, both times it hung on for a couple of second (so it seem it does something) but then no .dae is created
am i doing something wrong?

p.s the command i am using is: ".\XRConvertersMain.exe importxmf I:\X4 export I:\X4 export\assets\units\size_s\ship_arg_fighter_02.xml"
same problem here.this is on winblows 10
i found a workaround:
make a .bat in the folder you unpacked the cat/dat with the following comands:

Code: Select all

FOR /R "..\<folder name>\assets\units" %%f IN (*.xml) do (
  XRConvertersMain.exe importxmf "..\<folder name>" "%%f"
  )
pause

!!! <folder name> is the folder you unpacked the cat/dat !!!

this bat convert every ship in .dae (if you want to convert other assets change the folder "units" with the name of the folder the asset is located)
(i am really not sure on why this work and doing one model at time does not :? )

Binkley-Spacetrucker
Posts: 3
Joined: Sun, 2. Dec 18, 03:10

Re: How To: Export Models, Re-Import. (Blender)

Post by Binkley-Spacetrucker » Sat, 8. Dec 18, 11:43

Xenon472 wrote:
Fri, 7. Dec 18, 17:04
Binkley-Spacetrucker wrote:
Fri, 7. Dec 18, 03:18
Xenon472 wrote:
Fri, 7. Dec 18, 01:53
I am trying to export some model files and i followed your guide fine untill i run XRConverter command but it does nothing, i both tried running the command from a bat file and writing the comand on the powershell, both times it hung on for a couple of second (so it seem it does something) but then no .dae is created
am i doing something wrong?

p.s the command i am using is: ".\XRConvertersMain.exe importxmf I:\X4 export I:\X4 export\assets\units\size_s\ship_arg_fighter_02.xml"
same problem here.this is on winblows 10
i found a workaround:
make a .bat in the folder you unpacked the cat/dat with the following comands:

Code: Select all

FOR /R "..\<folder name>\assets\units" %%f IN (*.xml) do (
  XRConvertersMain.exe importxmf "..\<folder name>" "%%f"
  )
pause

!!! <folder name> is the folder you unpacked the cat/dat !!!

this bat convert every ship in .dae (if you want to convert other assets change the folder "units" with the name of the folder the asset is located)
(i am really not sure on why this work and doing one model at time does not :? )
did everything as described and it looks like this:
D:\X4Mod\CAT_Export>FOR /R "..\CAT_Export\assets\units" %f IN (*.xml) do (XRConvertersMain.exe importxmf "..\CAT_Export" "%f" )

D:\X4Mod\CAT_Export>(XRConvertersMain.exe importxmf "..\CAT_Export" "D:\X4Mod\CAT_Export\assets\units\size_l\cockpit_arg_l_bridge_01.xml" )

D:\X4Mod\CAT_Export>(XRConvertersMain.exe importxmf "..\CAT_Export" "D:\X4Mod\CAT_Export\assets\units\size_l\ship_arg_l_destroyer_01.xml" )

D:\X4Mod\CAT_Export>(XRConvertersMain.exe importxmf "..\CAT_Export" "D:\X4Mod\CAT_Export\assets\units\size_l\ship_arg_l_miner_liquid_01.xml" )

D:\X4Mod\CAT_Export>(XRConvertersMain.exe importxmf "..\CAT_Export" "D:\X4Mod\CAT_Export\assets\units\size_l\ship_arg_l_miner_solid_01.xml" )

D:\X4Mod\CAT_Export>(XRConvertersMain.exe importxmf "..\CAT_Export" "D:\X4Mod\CAT_Export\assets\units\size_l\ship_arg_l_trans_container_01.xml" )

D:\X4Mod\CAT_Export>(XRConvertersMain.exe importxmf "..\CAT_Export" "D:\X4Mod\CAT_Export\assets\units\size_l\ship_arg_l_trans_container_02.xml" )

D:\X4Mod\CAT_Export>(XRConvertersMain.exe importxmf "..\CAT_Export" "D:\X4Mod\CAT_Export\assets\units\size_l\ship_arg_l_trans_container_03.xml" )

D:\X4Mod\CAT_Export>(XRConvertersMain.exe importxmf "..\CAT_Export" "D:\X4Mod\CAT_Export\assets\units\size_l\ship_arg_l_trans_container_04.xml" )
etc...
not one single .DAE file is produced :(

sobfiggis
Posts: 2
Joined: Sat, 1. Dec 18, 09:51
x4

Re: How To: Export Models, Re-Import. (Blender)

Post by sobfiggis » Sat, 8. Dec 18, 23:22

Binkley-Spacetrucker wrote:
Sat, 8. Dec 18, 11:43
not one single .DAE file is produced
I was having the same issue until I did the following two things.

1: I stopped using directory shorthand for the arguments. Use full paths.

2: remove the trailing backslash for the directory where you unpacked the assets.

Examples:

WORKS:

Code: Select all

.\XRConvertersMain.exe importxmf "C:\Program Files (x86)\Steam\steamapps\common\X4 Foundations\unpacked" "C:\Program Files (x86)\Steam\steamapps\common\X4 Foundations\unpacked\assets\units\size_s\ship_arg_s_fighter_02.xml"
DIDNT WORK (note trailing slash):

Code: Select all

.\XRConvertersMain.exe importxmf "C:\Program Files (x86)\Steam\steamapps\common\X4 Foundations\unpacked\" "C:\Program Files (x86)\Steam\steamapps\common\X4 Foundations\unpacked\assets\units\size_s\ship_arg_s_fighter_02.xml"
DIDNT WORK:

Code: Select all

.\XRConvertersmain.exe importxmf .\unpacked .\unpacked\assets\units\size_s\ship_arg_s_fighter_01.xml

Binkley-Spacetrucker
Posts: 3
Joined: Sun, 2. Dec 18, 03:10

Re: How To: Export Models, Re-Import. (Blender)

Post by Binkley-Spacetrucker » Sun, 9. Dec 18, 01:42

sobfiggis wrote:
Sat, 8. Dec 18, 23:22
Binkley-Spacetrucker wrote:
Sat, 8. Dec 18, 11:43
not one single .DAE file is produced
I was having the same issue until I did the following two things.

1: I stopped using directory shorthand for the arguments. Use full paths.

2: remove the trailing backslash for the directory where you unpacked the assets.

Examples:

WORKS:

Code: Select all

.\XRConvertersMain.exe importxmf "C:\Program Files (x86)\Steam\steamapps\common\X4 Foundations\unpacked" "C:\Program Files (x86)\Steam\steamapps\common\X4 Foundations\unpacked\assets\units\size_s\ship_arg_s_fighter_02.xml"
DIDNT WORK (note trailing slash):

Code: Select all

.\XRConvertersMain.exe importxmf "C:\Program Files (x86)\Steam\steamapps\common\X4 Foundations\unpacked\" "C:\Program Files (x86)\Steam\steamapps\common\X4 Foundations\unpacked\assets\units\size_s\ship_arg_s_fighter_02.xml"
DIDNT WORK:

Code: Select all

.\XRConvertersmain.exe importxmf .\unpacked .\unpacked\assets\units\size_s\ship_arg_s_fighter_01.xml
did it and got the same:

PS D:\X4Mod\CAT_Export> .\XRConvertersMain.exe importxmf "D:\X4Mod\CAT_Export" "D:\X4Mod\CAT_Export\assets\units\size_l\
ship_arg_l_trans_container_05.xml"
PS D:\X4Mod\CAT_Export>

runs for 2 seconds,no error message but NO DAE is produced

User avatar
Lc4Hunter
Posts: 2117
Joined: Sun, 2. Apr 06, 16:15
x3tc

Re: How To: Export Models, Re-Import. (Blender)

Post by Lc4Hunter » Sun, 9. Dec 18, 12:05

I had a bit more time for playing around and converting models to DAE and importing them to 3ds Max works...
The texture coordinates are also ok, i just had to apply the correct texture to the ship... the name of the texture is added to the parts name

Image
Image

I hope this is the same in blender?
It would be great to find a way to load the textures directly during import to the model..

---

Edit: Got it.

If you oben the DAE via Notepad++ it looks like this:
Image

I replaced the path prefix to the complete path:
Image

And this is the result (and yes, the textures look like this...)
Image

User avatar
Zeron-mk7
Posts: 523
Joined: Sat, 23. Feb 08, 13:38
x3

Re: How To: Export Models, Re-Import. (Blender)

Post by Zeron-mk7 » Sun, 9. Dec 18, 18:14

I also tried to importing 3D models in 3DS MAX, but new imported models doesn't appears textures, it doesn't show up :gruebel: .
I converted with online converter asteroid "env_ast_niv_l_01.dae" to OBJ MTL files and now 3DS MAX show textures correctly: screenshot :D
Image

User avatar
Misunderstood Wookie
Posts: 355
Joined: Mon, 15. Mar 04, 09:07
x4

Re: How To: Export Models, Re-Import. (Blender)

Post by Misunderstood Wookie » Mon, 10. Dec 18, 15:21

Zeron-mk7 wrote:
Sun, 9. Dec 18, 18:14
I also tried to importing 3D models in 3DS MAX, but new imported models doesn't appears textures, it doesn't show up :gruebel: .
I converted with online converter asteroid "env_ast_niv_l_01.dae" to OBJ MTL files and now 3DS MAX show textures correctly: screenshot :D
Let me know how the polycount is on those roids mate, those things just tank frame rate in belt rings and I would love to know if the mesh is simply just too complex for what it needs to be. I don't have the time to go tinkering with the meshes right now but if you export the roids for me to OBJ with textures added I will take a look and send back some reworked ones and then you can import them back to engine and tell me what happens around the roid rings.
*modified*
MOD Aspiring Freelancer GameStart
MOD Variety and Rebalance Overhaul Icon Pack
I lost my Hans and should not be flying Solo.
Image

jmattspartacus2
Posts: 73
Joined: Wed, 5. Dec 18, 08:04

Re: How To: Export Models, Re-Import. (Blender)

Post by jmattspartacus2 » Wed, 12. Dec 18, 00:30

I'm fairly new at modelling, and I was wondering, are there particular naming conventions that the game uses to decide how the components of the models are used? Or is it arbitrary?
Also, how are textures attached to models in the game are they referenced in the names of the components?

R_Romach_R
Posts: 48
Joined: Fri, 23. Feb 18, 17:38
x4

Re: How To: Export Models, Re-Import. (Blender)

Post by R_Romach_R » Wed, 12. Dec 18, 21:43

Well, I want to replace paranid destroyer, but I'm stuck after unpacking cat\dat: how do you guys convert .xml.sig to just .xml?

User avatar
Lc4Hunter
Posts: 2117
Joined: Sun, 2. Apr 06, 16:15
x3tc

Re: How To: Export Models, Re-Import. (Blender)

Post by Lc4Hunter » Wed, 12. Dec 18, 22:55

R_Romach_R wrote:
Wed, 12. Dec 18, 21:43
Well, I want to replace paranid destroyer, but I'm stuck after unpacking cat\dat: how do you guys convert .xml.sig to just .xml?
The sig-files are usless. Or i haven´t found the use of them...
Do you already have the XRConverter?

If yes, the syntax is really easy:
XRConvertersMain.exe -importxmf "<EXTRACTEDGAME>" "<PATHTOMODEL>"

Thats it.

For exampe (pathnames are german ;) ):

XRConvertersMain.exe -importxmf "D:\Proggis\X4_Modding\X4_Entpackt" "D:\Proggis\X4_Modding\X4_Entpackt\assets\units\size_s\ship_arg_s_fighter_01.xml"

That command will take a few seconds and create a file with the name "ship_arg_s_fighter_01.dae" in the same directory like the specified xml.

And don´t take a look at the parnid destroyer... i started crying when i saw the model :rant:
Better take a look at the paranid carrier. It´s a modiefied version of the X3s model. Looks great to me :D

R_Romach_R
Posts: 48
Joined: Fri, 23. Feb 18, 17:38
x4

Re: How To: Export Models, Re-Import. (Blender)

Post by R_Romach_R » Thu, 13. Dec 18, 07:08

I'm using win 7 and XRConvertersMain.exe isn't working. All files I unpacked from cat/dat has .sig in them. What am I doing wrong?

P.S.: I never liked paranid capitals, only Nemesis and m3 fighters. Present carrirer not so pretty for me, but it has history...that destroyer doesn't though and so ugly :lol:

User avatar
Misunderstood Wookie
Posts: 355
Joined: Mon, 15. Mar 04, 09:07
x4

Re: How To: Export Models, Re-Import. (Blender)

Post by Misunderstood Wookie » Thu, 13. Dec 18, 08:29

R_Romach_R wrote:
Thu, 13. Dec 18, 07:08
I'm using win 7 and XRConvertersMain.exe isn't working. All files I unpacked from cat/dat has .sig in them. What am I doing wrong?

P.S.: I never liked paranid capitals, only Nemesis and m3 fighters. Present carrirer not so pretty for me, but it has history...that destroyer doesn't though and so ugly :lol:
I only unpack and pack cat files with viewtopic.php?f=181&t=402452
*modified*
MOD Aspiring Freelancer GameStart
MOD Variety and Rebalance Overhaul Icon Pack
I lost my Hans and should not be flying Solo.
Image

R_Romach_R
Posts: 48
Joined: Fri, 23. Feb 18, 17:38
x4

Re: How To: Export Models, Re-Import. (Blender)

Post by R_Romach_R » Thu, 13. Dec 18, 20:11

Lc4Hunter wrote:
Wed, 12. Dec 18, 22:55
R_Romach_R wrote:
Wed, 12. Dec 18, 21:43
Well, I want to replace paranid destroyer, but I'm stuck after unpacking cat\dat: how do you guys convert .xml.sig to just .xml?
The sig-files are usless. Or i haven´t found the use of them...
Do you already have the XRConverter?

If yes, the syntax is really easy:
XRConvertersMain.exe -importxmf "<EXTRACTEDGAME>" "<PATHTOMODEL>"

Thats it.

For exampe (pathnames are german ;) ):

XRConvertersMain.exe -importxmf "D:\Proggis\X4_Modding\X4_Entpackt" "D:\Proggis\X4_Modding\X4_Entpackt\assets\units\size_s\ship_arg_s_fighter_01.xml"

That command will take a few seconds and create a file with the name "ship_arg_s_fighter_01.dae" in the same directory like the specified xml.

And don´t take a look at the parnid destroyer... i started crying when i saw the model :rant:
Better take a look at the paranid carrier. It´s a modiefied version of the X3s model. Looks great to me :D
Well. I did it. With win 7.

1) To unpack cat\dat I moved XRCatTool's files in game folder (All\Games\SteamLibrary\steamapps\common\X4 Foundations for me) and then created there .bat file with:
_______
E:
cd "All\Games\SteamLibrary\steamapps\common\X4 Foundations"
XRCatTool.exe -in 01.cat -in 02.cat -in 03.cat -in 04.cat -in 05.cat -in 06.cat -in 07.cat -in 08.cat -in 09.cat -out "E:\All\Games\SteamLibrary\steamapps\common\X4 Foundations"
pause
_______
It worked for me. Just forget to add some folder in the end to unpack all files into it and they unpacked in game directory.

2) To convert .xml into .dae I moved XRConverters's files to folder "E:\All\Games\SteamLibrary\steamapps\common\X4 Foundations\assets\units\size_l\" (I don't know if it will work with this files in main game folder) and created .bat file with:
______
XRConvertersMain.exe importxmf "E:\All\Games\SteamLibrary\steamapps\common\X4 Foundations" "E:\All\Games\SteamLibrary\steamapps\common\X4 Foundations\assets\units\size_l\ship_arg_l_destroyer_01.xml"
pause
______

It worked for me too.

WARNING!!!
Every mistake in sintaxis will start the .bat file, but it will do nothing. In my attempts I made mistake with "-importxmf". When I checked forums I saw this command as such. But then it did nothing. Right sintaxis is "importxmf" (look up, there right sintaxis for working .bat files).

P.S.: my converter is in "E:\All\Games\SteamLibrary\steamapps\common\X4 Foundations\assets\units\size_l\", but in my .bat file I typed the path to converter as "E:\All\Games\SteamLibrary\steamapps\common\X4 Foundations". Well for some reason it's working :lol:

ZEFFEZ
Posts: 10
Joined: Thu, 6. Sep 18, 06:15
x4

Re: How To: Export Models, Re-Import. (Blender)

Post by ZEFFEZ » Sat, 15. Dec 18, 02:40

Hey guys, I have been trying really hard to get this to work and I did not do this like many did but I did this instead, is there anything i am doing wrong?

XRConvertersMain.exe importxml "C:\Users\zzeff\Desktop\GameFile" "C:\Users\zzeff\Desktop\GameFile\assets\units\here\ship_arg_l_destroyer_01.xml"
pause

Which produces this

Usage: XRConvertersMain <action> <folder with .dat file contents> <.xml/.xac/.dae file>
<action>:
importxac: convert .xac to .dae
importxmf: convert .xml/.xmf to .dae
exportxac: convert .dae to .xac
exportxmf: convert .dae to .xml/.xmf

but nothing happens, any help would be greatly appreciated. Thanks!

R_Romach_R
Posts: 48
Joined: Fri, 23. Feb 18, 17:38
x4

Re: How To: Export Models, Re-Import. (Blender)

Post by R_Romach_R » Sat, 15. Dec 18, 11:18

ZEFFEZ wrote:
Sat, 15. Dec 18, 02:40
Hey guys, I have been trying really hard to get this to work and I did not do this like many did but I did this instead, is there anything i am doing wrong?

XRConvertersMain.exe importxml "C:\Users\zzeff\Desktop\GameFile" "C:\Users\zzeff\Desktop\GameFile\assets\units\here\ship_arg_l_destroyer_01.xml"
pause

Which produces this

Usage: XRConvertersMain <action> <folder with .dat file contents> <.xml/.xac/.dae file>
<action>:
importxac: convert .xac to .dae
importxmf: convert .xml/.xmf to .dae
exportxac: convert .dae to .xac
exportxmf: convert .dae to .xml/.xmf

but nothing happens, any help would be greatly appreciated. Thanks!
Try importxmf instead of importxml, I used it. And what is "here" in your path to .xml?

Post Reply

Return to “X4: Foundations - Scripts and Modding”