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

DuckSoup
Posts: 62
Joined: Fri, 20. Jan 12, 18:08
x3ap

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

Post by DuckSoup » Wed, 5. Dec 18, 04:29

So maybe this is common knowledge, but I want to throw this out there for anyone wanting to play around with the models. In my example, I use Blender, but I have no doubt other tools will work.

First, unpack the game files. You can read more how to do that here: viewtopic.php?f=181&t=402452
For best results, make a copy of your X4 directory somewhere else (Make sure the directory you created has no spaces in the root folder for the game files). From that copy you made, unpack the files to this X4 directory. Once that is complete, it is best to remove the CAT\DAT files. Reason for this is when you make changes to the model you don't want to have to repackage everything. You can load in with loose files, but CAT files get loaded in first. So it's best to just remove the CAT files.

Next, pick up XRConverter: https://drive.google.com/file/d/0B5I84p ... F0Nnc/view
This was used to export X:Rebirth ships, still works with X4. Here's some documentation
viewtopic.php?f=129&t=360045

(Before modifying a ship, make a copy of the .XML of that model)
I put the XRConverter Tool in the root directory of the game. From there I run the following command to export a ships model to .DAE

Code: Select all

XRConvertersmain.exe importxmf D:\<Game_Root_Directory> D:\<Game_Root_Directory>\assets\units\size_s\ship_arg_fighter_02.xml
This will create a .DAE next to the XML file. From here we can go ahead and import into Blender.

https://i.imgur.com/S27t390.png

Yay we imported our model. Now we want to make our changes, and bring it back into the game.

So do to this, we want to make sure to remove the Camera and Lamp before exporting.

Once that is complete, Select File > Export > .DAE

Make sure before you export, you go to Textures, and select "UV Textures" on the bottom left.

Image

With the new .dae created, we need to convert this back to XML.

(Again, make sure you create a backup of the original .xml, or rename it to .xml.old)

Code: Select all

XRConvertersmain.exe exportxmf D:\<Game_Root_Directory> D:\<Game_Root_Directory>\assets\units\size_s\ship_arg_fighter_02.dae
This will generate a new .XML file to be loaded into the game. Replace the original XML with the new one and you should be good to go.


{Images posted directly to the forums should not be greater than 640x480 or 100kb, oversize image now linked - Terre}
Last edited by DuckSoup on Wed, 5. Dec 18, 21:26, edited 4 times in total.

Urillch
Posts: 14
Joined: Sun, 2. Feb 14, 07:43
x4

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

Post by Urillch » Wed, 5. Dec 18, 18:51

Thanks! you linked me to your How To and i got it all squared away!
" It is better to live one day as a lion than a hundred years as a sheep. "

- Italian proverb

lyfesgrafiq
Posts: 13
Joined: Thu, 6. Dec 18, 14:28
x4

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

Post by lyfesgrafiq » Thu, 6. Dec 18, 15:21

Hello, I have a couple questions. When you say "Now we want to make our changes..", what type of changes can be made? Sorry if this is obvious but I've never played any X series games til Foundations, and I've never modded any of their games before. I'm pretty decent with blender and just curious as to how much can be changed.

Also, not sure if it's because I'm new to the forum (or I don't own a copy of XRebirth)... but it says that I don't have permission to download the catalog tool.

Staberind
Posts: 117
Joined: Wed, 5. May 10, 23:32
x4

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

Post by Staberind » Thu, 6. Dec 18, 15:43

Awesome! thanks for this info, its like gold dust to me.
Aladna Hill, Again, AP, 3.1. in the last Game worthy of the "X" title. <<<< X4 might just be changing this. :?:

semTex.
Posts: 5
Joined: Mon, 18. Nov 13, 12:53
x4

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

Post by semTex. » Thu, 6. Dec 18, 16:03

lyfesgrafiq wrote:
Thu, 6. Dec 18, 15:21
Also, not sure if it's because I'm new to the forum (or I don't own a copy of XRebirth)... but it says that I don't have permission to download the catalog tool.
Did you connect you profile with steam (if you purchased the game trough steam) or enterd the gamecode?

lyfesgrafiq
Posts: 13
Joined: Thu, 6. Dec 18, 14:28
x4

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

Post by lyfesgrafiq » Thu, 6. Dec 18, 16:12

semTex. wrote:
Thu, 6. Dec 18, 16:03
lyfesgrafiq wrote:
Thu, 6. Dec 18, 15:21
Also, not sure if it's because I'm new to the forum (or I don't own a copy of XRebirth)... but it says that I don't have permission to download the catalog tool.
Did you connect you profile with steam (if you purchased the game trough steam) or enterd the gamecode?
Thanks much for the help... I didn't connect my pro to steam. :thumb_up:

Lc4Hunter
Posts: 2124
Joined: Sun, 2. Apr 06, 16:15
x3tc

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

Post by Lc4Hunter » Thu, 6. Dec 18, 20:36

Thanks for this at first!
Just one question: Does anyone know an option to import/export DAEs to 3ds Max? In the past i used an additional programm to convert the DAEs to another format which i can import into 3ds Max.
My blender days are... well... a long time ago. I´m better using 3ds Max and i would like to brong some of my babys into game, but at most this little sweet guy :D :D

Image

User avatar
Axeface
Posts: 1931
Joined: Fri, 18. Nov 05, 01:41
x4

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

Post by Axeface » Thu, 6. Dec 18, 20:38

Lc4Hunter wrote:
Thu, 6. Dec 18, 20:36
Thanks for this at first!
Just one question: Does anyone know an option to import/export DAEs to 3ds Max? In the past i used an additional programm to convert the DAEs to another format which i can import into 3ds Max.
My blender days are... well... a long time ago. I´m better using 3ds Max and i would like to brong some of my babys into game, but at most this little sweet guy :D :D

Image
I saw that model on creative universe, its great :)

@OP. Do you hve any advise on how textures/materials work? I remember that the setup in 3dsmax for X3 was a real PITA, no idea about Rebirth. I'de like to try to get the megalodon in X4 :D

DuckSoup
Posts: 62
Joined: Fri, 20. Jan 12, 18:08
x3ap

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

Post by DuckSoup » Thu, 6. Dec 18, 21:32

Axeface wrote:
Thu, 6. Dec 18, 20:38
Lc4Hunter wrote:
Thu, 6. Dec 18, 20:36
Thanks for this at first!
Just one question: Does anyone know an option to import/export DAEs to 3ds Max? In the past i used an additional programm to convert the DAEs to another format which i can import into 3ds Max.
My blender days are... well... a long time ago. I´m better using 3ds Max and i would like to brong some of my babys into game, but at most this little sweet guy :D :D

Image
I saw that model on creative universe, its great :)

@OP. Do you hve any advise on how textures/materials work? I remember that the setup in 3dsmax for X3 was a real PITA, no idea about Rebirth. I'de like to try to get the megalodon in X4 :D
I honestly don't just yet. Once I got the Export\Import working, I had like... a couple hours to work on some stuff before my toddler got sick, so I haven't been able to spend much time on the models. (Now the holidays are coming up....)

Lc4Hunter
Posts: 2124
Joined: Sun, 2. Apr 06, 16:15
x3tc

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

Post by Lc4Hunter » Fri, 7. Dec 18, 00:17

As i remember correctly some Egosoft employes said that they use 3ds max to create models und to export them so i think there has to be a way.
But i think they also said that they have their own tools for that so we can´t expect to find something public that helps.

Making models in 3ds max, exporting them into a format blender likes, importing it to blender and exporting it into DAE and from DAE to the X4 file format is a long way which can cause a lot of problems and errors... :(

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, 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"

User avatar
Axeface
Posts: 1931
Joined: Fri, 18. Nov 05, 01:41
x4

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

Post by Axeface » Fri, 7. Dec 18, 02:14

Lc4Hunter wrote:
Fri, 7. Dec 18, 00:17
As i remember correctly some Egosoft employes said that they use 3ds max to create models und to export them so i think there has to be a way.
But i think they also said that they have their own tools for that so we can´t expect to find something public that helps.

Making models in 3ds max, exporting them into a format blender likes, importing it to blender and exporting it into DAE and from DAE to the X4 file format is a long way which can cause a lot of problems and errors... :(
I dont think you should have any problems if you use OBJ to get your models into blender?
And yeh, they have their own exporter which I dont think they ever released? I cant remember exactly but back when I was making ships for X3 I think we had to wait for a 3rd party exporter.

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

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

Post by Binkley-Spacetrucker » 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

Lc4Hunter
Posts: 2124
Joined: Sun, 2. Apr 06, 16:15
x3tc

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

Post by Lc4Hunter » Fri, 7. Dec 18, 11:00

Ok, now i got it...
I forgot the 3ds max of course is able to import DAE files... :D

Image

User avatar
Perahoky
Posts: 434
Joined: Fri, 22. Aug 08, 16:04
x4

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

Post by Perahoky » Fri, 7. Dec 18, 12:01

I think we should move these tutorials into the egosoft x-wiki
wiki.egosoft.com

Thank you for your tutorial :)
"Hope is the last force i have"
"This is how liberty dies, with thounderous applause"
***Modified***

My X4 priorities:
Gui Improvements, Move tradefilter to lower right corner, more colors
Good Sounds, music, Graphics and effects of XR
Performance improvements
Thanks @EGOSOFT, good X4 progress!

Post Reply

Return to “X4: Foundations - Scripts and Modding”