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

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

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

Ojump
Posts: 29
Joined: Sat, 17. May 14, 20:56
x4

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

Post by Ojump » Mon, 17. Dec 18, 11:21

Hi, i'm currently trying to export a DAE file back to xml (after some mesh modification of a ship), but get some errors for the conversion.

First I got this one :
Expected attribute "texcoord" at element "texture"
Which have been easily fixed by adding the attribute in all the texture flags of the DAE file. But I'm struggling on the next one :
Node part_mainXlod0XgenericXgeneric_tech_01 has multiple meshes attached
Any idea on what I can do to to solve this one ?

(I use Blender so far for the modifications)

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

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

Post by ZEFFEZ » Tue, 18. Dec 18, 06:43

I am having trouble with the thing as well, converting back to xml does not seem to work well, I have managed to scale a ships size by a certain factor but ALL of my other edits seem to be missing for some reason :gruebel:

I have noticed that if I turn an .xml into a .dae and then WITHOUT making any edits turn that .dae back into an .xml I get something different. The conversion back to .xml from .dae seems to be bugged.

killerog
Posts: 3464
Joined: Fri, 28. Oct 05, 16:31
x4

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

Post by killerog » Tue, 18. Dec 18, 11:42

Ojump wrote:
Mon, 17. Dec 18, 11:21
Hi, i'm currently trying to export a DAE file back to xml (after some mesh modification of a ship), but get some errors for the conversion.

First I got this one :
Expected attribute "texcoord" at element "texture"
Which have been easily fixed by adding the attribute in all the texture flags of the DAE file. But I'm struggling on the next one :
Node part_mainXlod0XgenericXgeneric_tech_01 has multiple meshes attached
Any idea on what I can do to to solve this one ?

(I use Blender so far for the modifications)
Paste an image of what yoru blender navigation window thingy (or what ever its called) with all the child elements on show.

Should have something like this (in 3dsmax) taken from my tutorial on this.

https://imgur.com/H8FkoPw.jpg


{Images posted directly to the forums should not be greater than 640x480 or 100kb, oversize image now linked - Terre}
Image

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

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

Post by ZEFFEZ » Wed, 19. Dec 18, 07:19

This is what im looking at
Image

https://ibb.co/mcLkLbN

jim_baem
Posts: 22
Joined: Wed, 5. Jul 17, 22:12
xr

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

Post by jim_baem » Sat, 12. Jan 19, 00:51

Я произвел некоторые исправления в 3D Max с растянутой текстурой на модели Теладианского контейнеровоза и конвертировал модели обратно в игру. Все сработало, но корабль стал красным там где должен накладываться модификатор раскраски корпуса. (На верхней картинке ванильная модель, на нижней исправленная в 3D Max)
Spoiler
Show
ImageImage
Кто нибудь с этим сталкивался и как решил проблему?


Automatic translator Yandex into English language:

I made some fixes in 3D Max with a stretched texture on the model Taldinskogo of the container ship and converted the model back into the game. Everything worked, but the ship became red where the hull coloring modifier should be superimposed. (On the top picture vanilla model, on the bottom corrected in 3D Max)
Spoiler
Show
ImageImage
Somebody faced it and how solved the problem?

BrummBear02
Posts: 308
Joined: Fri, 3. Oct 08, 20:43
x3ap

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

Post by BrummBear02 » Sun, 27. Jan 19, 04:11

Hello everyone.

I try to make changes to models for quite some time now but somehow my game keeps crashing.

a simple example is my ship "Koha". I make a copy of the Discoverer and rename relevant stuff to Koha. Create a component and wares and macros file. some T file.
Then i start the game, the Koha shows up in the wharf. If i now go and make a .dae file out of the discoverer with the converter, load it into blender, export the model without changes to koha.dae and convert it back to .xml and a data folder...
the game crashes when i try to build the ship.

another try was this: i made made changes to the new koha model to narrow down what i can change. i left all files untouched and only changed part_main-lod0.xmf
so i also only replaced that file. the changes show up in the wharf and i can look at it. but as soon as i build the ship the game crashes.

I guess im messing up when exporting from blender... but i dont know where. all i do is klick on export, choose .dae and change Materials to UV Textures. Any ideas?
Gebt mir einen Spiegel dann schlage ich ihn mit seinem eigenen Gesicht

vrod
Posts: 133
Joined: Tue, 29. Sep 09, 19:03
x4

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

Post by vrod » Wed, 30. Jan 19, 14:20

Lc4Hunter wrote:
Sun, 9. Dec 18, 11: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
I am trying hard to replicate this, but failing.

I can import a model (and yes, I have updated the DAE file with the full pathname to the textures). Still no textures.

ANy ideas?

thanks

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

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

Post by Zeron-mk7 » Fri, 1. Feb 19, 07:04

vrod wrote:I can import a model (and yes, I have updated the DAE file with the full pathname to the textures). Still no textures.
I was the same problem, textures of imported DAE files doesn't show up, I don't know why :gruebel: , for me only solution was this.
Image

vrod
Posts: 133
Joined: Tue, 29. Sep 09, 19:03
x4

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

Post by vrod » Fri, 1. Feb 19, 12:56

Lc4Hunter wrote:
Sun, 9. Dec 18, 11: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


I can duplicate the final picture you have, however I was expecting the ship to come out in color with more textures.

Am I missing something?

thanks.

linolafett
EGOSOFT
EGOSOFT
Posts: 3321
Joined: Mon, 26. Mar 12, 14:57
x4

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

Post by linolafett » Fri, 1. Feb 19, 16:49

Just as short info:
The ships are coloured via vertex colours. The atlas textures are just black and white.
01001100 01101001 01101110 01100101 01110011 00100000 01101111 01100110 00100000 01110100 01101001 01101101 01100101 01110011 00101110 00101110 00101110

My art stuff

Axel6430
Posts: 14
Joined: Fri, 4. Jan 19, 11:35
x4

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

Post by Axel6430 » Mon, 4. Feb 19, 18:15

Hello there!

I'm trying to re-skin existing NPC character models and add those models to the roster, to get additional NPC skin and clothing colors for more diversity.

To do so, I've used the Export/Import utility mentioned in this thread to convert .xac to .dae, before editing the suffix in the materials node to refer to a new material I've created via a material_library.xml diff file.

However, I'm running into issues with the .xac <-> .dae conversion. Simply converting a body model from .xac to .dae then back to .xac somehow changes the filesize (from 638kb for the original to 762kb for the converted-back-and-forth version).
Putting the untouched, original (but renamed) .xac in my extensions folder works fine, and the NPCs that refer to this body model show up properly.
However, doing the same thing with the converted-back-and-forth version crashes the game. The debug log shows this message before the crash:

Code: Select all

[MCore::LogCallback Level 0x04] *** PERFORMANCE WARNING*** Mesh for node 'ar_f_body_04' in geometry LOD 0 uses more than 50 weight(s) per vertex. Forcing CPU skinning for this mesh.
Does anyone here know what's going on? I suppose there's a way to make XRConvertersMain.exe work properly on this one? :gruebel:

(Also, if anyone knows how to make the materials used by a specific .xac point towards a new material without touching the file itself, I'm interested as well)

User avatar
KrYcHokE
Posts: 259
Joined: Wed, 2. Dec 15, 13:15
x4

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

Post by KrYcHokE » Mon, 4. Feb 19, 19:53

It never worked for xac, you should to open xac files in hex editor and edit material and textures names

Axel6430
Posts: 14
Joined: Fri, 4. Jan 19, 11:35
x4

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

Post by Axel6430 » Tue, 5. Feb 19, 14:57

That seems to do the trick! Thanks.

What compression scheme should I use when exporting the new textures to .dds, though? No matter what I choose, the new texture is 4 or 5 times the original's size, and that's without mip-mapping. Sounds to me like that would take a toll on performance...

Darkfire1
Posts: 128
Joined: Sun, 18. Jan 04, 15:05
x4

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

Post by Darkfire1 » Sun, 17. Mar 19, 20:52

Can anyone stream / record themselves adding a ship model from xr into x4?
X3 TC Ship Index
Community Ship Pack Mod
X2 The Threat - X3 R - X Terran Conflict

BrummBear02
Posts: 308
Joined: Fri, 3. Oct 08, 20:43
x3ap

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

Post by BrummBear02 » Mon, 18. Mar 19, 02:22

depending on the model this would take several hours or, if S or M sized, days for a sloppy port. read up my tutorial on creating your own ship for dummies. it covers most of the porting process for L and XL ships.
Gebt mir einen Spiegel dann schlage ich ihn mit seinem eigenen Gesicht

Darkfire1
Posts: 128
Joined: Sun, 18. Jan 04, 15:05
x4

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

Post by Darkfire1 » Mon, 18. Mar 19, 16:32

I am visual step by step learner lol... But if I had the bandwidth I would try to do it my upload is less than 1meg.

I was able to get both rebirth and x4 unpacked. Got the titurel in blender added a gun and engine, shield, for testing purposes. Part of what I couldnt find was what was the minimum needed parts wise to have the ship work in game, do you have to make a bridge for it to work?




Exported and tried to use the converter and got the texture errors, which I assume I hadnt told it UV only.

I think a reaver mod would be interesting to give the game some life, hence my Titurel being the first ship!
X3 TC Ship Index
Community Ship Pack Mod
X2 The Threat - X3 R - X Terran Conflict

Darkfire1
Posts: 128
Joined: Sun, 18. Jan 04, 15:05
x4

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

Post by Darkfire1 » Mon, 18. Mar 19, 16:36

BrummBear02 wrote:
Mon, 18. Mar 19, 02:22
depending on the model this would take several hours or, if S or M sized, days for a sloppy port. read up my tutorial on creating your own ship for dummies. it covers most of the porting process for L and XL ships.
Also why isn't your guide in the list stickied by the mods? Having trouble searching to find it
X3 TC Ship Index
Community Ship Pack Mod
X2 The Threat - X3 R - X Terran Conflict

BrummBear02
Posts: 308
Joined: Fri, 3. Oct 08, 20:43
x3ap

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

Post by BrummBear02 » Mon, 18. Mar 19, 21:28

i dont know.

this is my unfinished tutorial
viewtopic.php?f=181&t=414274

here you can also find some answers
viewtopic.php?f=181&t=414599
Gebt mir einen Spiegel dann schlage ich ihn mit seinem eigenen Gesicht

Ateiri
Posts: 1
Joined: Tue, 21. Sep 10, 11:00

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

Post by Ateiri » Fri, 27. Sep 19, 18:41

Any idea why it could not worked?
There are no logs about errors, absolutely nothing.

Code: Select all

c:\Program Files (x86)\Steam\steamapps\common\X4 Foundations>XRConvertersmain.exe importxmf "C:\Program Files (x86)\Steam\steamapps\common\X4 Foundations" "C:\Program Files (x86)\Steam\steamapps\common\X4 Foundations\extensions\ashipmod\dev\assets\units\size_xl\units_sco_xl_capital_destroyer_2.xml"

BrummBear02
Posts: 308
Joined: Fri, 3. Oct 08, 20:43
x3ap

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

Post by BrummBear02 » Fri, 27. Sep 19, 21:24

Ateiri wrote:
Fri, 27. Sep 19, 18:41
Any idea why it could not worked?
There are no logs about errors, absolutely nothing.

Code: Select all

c:\Program Files (x86)\Steam\steamapps\common\X4 Foundations>XRConvertersmain.exe importxmf "C:\Program Files (x86)\Steam\steamapps\common\X4 Foundations" "C:\Program Files (x86)\Steam\steamapps\common\X4 Foundations\extensions\ashipmod\dev\assets\units\size_xl\units_sco_xl_capital_destroyer_2.xml"
go and read my tutorial i linked in the post right above yours.
Gebt mir einen Spiegel dann schlage ich ihn mit seinem eigenen Gesicht

Post Reply

Return to “X4: Foundations - Scripts and Modding”