Requesting help for dae conversion

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

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

unheardof
Posts: 20
Joined: Tue, 18. May 21, 22:48
x4

Requesting help for dae conversion

Post by unheardof »

ok ive been trying for awhile now to get the ship models converted to dae so i can use blender to edit them but with no luck
ive dug through all the help that is posted here but all i get is a 2 second pause when running the convertor with out any dae being generated id greatly appreciate any help that any one could provide to resolve this

so far this is what i have done
to keep the paths to the files shorter i have created a folder on my c: drive named ShipAddon that contains
the ship i have named ghost
which i want to convert to dae in it the files included are ghost.xml, GHOST_DATA.ANI, ghost_macro.xml, and a folder ghost_data containing the lods.xmf etc...

path to ghost_macro.xml is as follows: C:\ShipAddon\assets\units\size_s\macros\ghost_macro.xml
path to ghost.xml, GHOST_DATA.ANI, and folder ghost_data is as follows: C:\ShipAddon\assets\units\size_s

have a folder on c: drive C:\XRConverters which contains the convertor
created a bat file named ConvertBAT_import.bat containing this line of txt:
XRConvertersmain.exe importxmf "C:\ShipAddon" "C:\ShipAddon\assets\units\size_s\ghost.xml"
pause
i have tried many different configs of this line of txt to no aval all i get is a 2 second pause then a press any key in a comand prompt after running the bat file have also tried using a bat file with this in it

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

with no luck as well hope someone can shed some light on what might be going wrong
thanks for any help
sprIder
Posts: 135
Joined: Sat, 3. Jul 10, 23:23
x4

Re: Requesting help for dae conversion

Post by sprIder »

The problem might be that the XConverter needs the X4 data to work.

You must first unpack the game files into a folder. For example with the XCatTools to C:\X4unpacked.
Then there should be a folder "extensions" in it. If not, please create it: C:\X4unpacked\extensions
In this extensions folder you put your "ShipAddon" folder.
Now put the files from the XRConverter (XRConverters.dll, XRConverters.h, XRConvertersMain.exe) and your bat file into the X4unpacked folder.

Basically the content of your bat is correct, you just have to rewrite it as follows:

FOR /R "..\X4unpacked\extensions\ShipAddon\assets\units" %%f IN (*.xml) do (
XRConvertersMain.exe importxmf "..\X4unpacked" "%%f"
)
pause

Following would also work:
FOR /R "..\X4unpacked\extensions\ShipAddon\" %%f IN (*.xml) do (
XRConvertersMain.exe importxmf "..\X4unpacked" "%%f"
)
pause


After that it should work. Good luck.
Realspace
Posts: 1637
Joined: Wed, 15. Nov 06, 10:21
x4

Re: Requesting help for dae conversion

Post by Realspace »

That was usefull. I am having similar problems aka I can import but not export from Blender. I'll try the XRConverter way. Not for ships but planets and backgrounds, which have references coded in the xmf so the materials available are quite limited without access to the xmf itself
unheardof
Posts: 20
Joined: Tue, 18. May 21, 22:48
x4

Re: Requesting help for dae conversion

Post by unheardof »

you my friend are my hero it finally worked :D
now i can finally attempt some modeling hooray
unheardof
Posts: 20
Joined: Tue, 18. May 21, 22:48
x4

Re: Requesting help for dae conversion

Post by unheardof »

so i did some editing to an existing ship just some basic noob stuff lol heres a pic of it
Image

now when i try to export the ship back to xml and xmf im getting this error
Node anim_mainXlod0genericXgeneric_p1_hulltexture_01_aged has multiple meshes attached
i have used the object join in blender to combine all the duplicate parts i have copied and repositioned not sure what else im forgeting to do :gruebel: any help would be greatly appreciated
just in case this is what i have in my export bat file

FOR /R "..\X4unpacked\extensions\ShipAddon\assets\units" %%f IN (*.dae) do (
XRConvertersMain.exe exportxmf "..\X4unpacked" "%%f"
)
pause

thanks in advance
sprIder
Posts: 135
Joined: Sat, 3. Jul 10, 23:23
x4

Re: Requesting help for dae conversion

Post by sprIder »

unheardof wrote: Sun, 10. Apr 22, 00:05 you my friend are my hero it finally worked :D
now i can finally attempt some modeling hooray
Glad to hear it.


Without your Blender and your .dae file it will be difficult to help you. Would be good if you can provide them via dropbox or something. And it would be good if you could name your blender version.

The export file looks good though.

P.s. The image thing didn't work so well....
Realspace wrote: Sat, 9. Apr 22, 17:25 That was usefull. I am having similar problems aka I can import but not export from Blender. I'll try the XRConverter way. Not for ships but planets and backgrounds, which have references coded in the xmf so the materials available are quite limited without access to the xmf itself
I don't know how you edit the planets and backgrounds and how far you have already dealt with the peculiarities of the exported .dae (from Blender). But if you take existing planets and backgrounds and adjust them, you could try it like this:

After you have exported the edited files as .dae, open it with an editor, e.g. Notepad++. And also the original. Then you will probably notice that the "heads" of the .dae differ from each other, i.e. the areas

Code: Select all

<library_images>
...
</library_images>
<library_effects>
...
</library_effects>
and

Code: Select all

<library_materials>
...
</library_materials>
Or simply whole parts are missing with the edited.

Partly you can rescue something here, if you copy the suitable sections from the original into the new one and/or set the correct/missing paths and links with the following:

Code: Select all

<library_images>
</library_images>
and

Code: Select all

<library_materials>
</library_materials>
Maybe this will help you.
Last edited by sprIder on Sun, 10. Apr 22, 19:59, edited 1 time in total.
unheardof
Posts: 20
Joined: Tue, 18. May 21, 22:48
x4

Re: Requesting help for dae conversion

Post by unheardof »

sent a link for dropbox to ya sorry bout the pic its in steam galleries seems to work if you copy the url from right clicking then browsing to it
Realspace
Posts: 1637
Joined: Wed, 15. Nov 06, 10:21
x4

Re: Requesting help for dae conversion

Post by Realspace »

sprIder wrote: Sun, 10. Apr 22, 19:44
Realspace wrote: Sat, 9. Apr 22, 17:25 That was usefull. I am having similar problems aka I can import but not export from Blender. I'll try the XRConverter way. Not for ships but planets and backgrounds, which have references coded in the xmf so the materials available are quite limited without access to the xmf itself
I don't know how you edit the planets and backgrounds and how far you have already dealt with the peculiarities of the exported .dae (from Blender). But if you take existing planets and backgrounds and adjust them, you could try it like this:

After you have exported the edited files as .dae, open it with an editor, e.g. Notepad++. And also the original. Then you will probably notice that the "heads" of the .dae differ from each other, i.e. the areas

Code: Select all

<library_images>
...
</library_images>
<library_effects>
...
</library_effects>
and

Code: Select all

<library_materials>
...
</library_materials>
Or simply whole parts are missing with the edited.

Partly you can rescue something here, if you copy the suitable sections from the original into the new one and/or set the correct/missing paths and links with the following:

Code: Select all

<library_images>
</library_images>
and

Code: Select all

<library_materials>
</library_materials>
Maybe this will help you.
Thank you
I think I got my mistake. I opened the xml and isolated the model (e.g. a planet) then tried to export it as single xmf. Not possible in Blender. But, if I am correct, I have to open the entire scene (whole cluster_0X.xml) then modify the single model (aka its references to the material) then export the whole scene always inside the same EXTRACTED CATS. Blender should export the newcluster_xml + the various xmf's in the subfolder...right? Only then I can take the model I need, e.g a planet to which I have applied a different material's set, so leaving the original intact, then use it in another cluster with the new materials. Of course I have to make a backup of extracted cluster before..is it correct?
sprIder
Posts: 135
Joined: Sat, 3. Jul 10, 23:23
x4

Re: Requesting help for dae conversion

Post by sprIder »

unheardof wrote: Sun, 10. Apr 22, 18:22 now when i try to export the ship back to xml and xmf im getting this error
Node anim_mainXlod0genericXgeneric_p1_hulltexture_01_aged has multiple meshes attached
Thanks for your data. I like what you did with the model :D
I knew I had stumbled across this problem myself once.
The problem unfortunately occurs with Blender versions >=2.80 when exporting .dae. In fact, you can effectively counter this if you edit models with Blender 2.79, e.g. 2.79b.
Then please make the right settings for the .dae-export. Very important is the one for UV Textureres (instead of Materials).
Please also have a look here and here.

What is the problem?:
Image
Here are two meshes that are already present when importing the original .dae. So actually everything is fine. But: The newer Blender versions then do something with the .dae when exporting that can't be processed by the XRConverter and thereupon spits out your mentioned error message. The older Blender versions do not create this problem.
At some point I had found this on the forum.

Unfortunately for you, that means you'll have to redo the model again.

Realspace wrote: Sun, 10. Apr 22, 21:39 [...] But, if I am correct, I have to open the entire scene (whole cluster_0X.xml) then modify the single model (aka its references to the material) then export the whole scene always inside the same EXTRACTED CATS. Blender should export the newcluster_xml + the various xmf's in the subfolder...right? Only then I can take the model I need, e.g a planet to which I have applied a different material's set, so leaving the original intact, then use it in another cluster with the new materials. Of course I have to make a backup of extracted cluster before..is it correct?
I think I know what you are trying to say. And you are right about it, as far as I know ;)

You export your game with the XCatTools, e.g. to C:\X4_unpacked, then you run the XRConverter over it and get a merged .dae from the .xml files and their .xmf data. You can import this into Blender and edit it. And it works better and without (complicated?) workarounds, if you import the entire scene, but if necessary edit only individual sections or planets (whatever). That's my experience.
Then export again as .dae with Blender (version <2.80) with corresponding UV textures. This should happen in a (mod) folder that is in the extensions folder of your extracted X4 data. So e.g. X4_unpacked\extensions\NewCluster.
And then you can pick and craft what you need from the newly created .xml file and the associated .xmf data.

I hope, this helps you both.

Return to “X4: Foundations - Scripts and Modding”