Vertex colour and paintjobs [SOLVED]

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

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

User avatar
Axeface
Posts: 2979
Joined: Fri, 18. Nov 05, 00:41
x4

Re: Vertex colour and paintjobs [SOLVED]

Post by Axeface » Tue, 8. Dec 20, 21:35

The material would need to be edited in the xmls, I dont think what you see in blender matters at all, only the name of the components (its the name of the object that tells the game which material to use).

Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: Vertex colour and paintjobs [SOLVED]

Post by Max Bain » Tue, 8. Dec 20, 21:37

Axeface wrote:
Tue, 8. Dec 20, 21:35
The material would need to be edited in the xmls, I dont think what you see in blender matters at all, only the name of the components (its the name of the object that tells the game which material to use).
No I think its the other way round, the materials in xmls dont matter. I have tried to edit textures many times in xml with no effect. Or what exactly do you mean with name of object defines name of material?
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link

aurumgallente
Posts: 121
Joined: Sun, 14. Jun 20, 14:45
x4

Re: Vertex colour and paintjobs [SOLVED]

Post by aurumgallente » Thu, 10. Dec 20, 03:45

He means it's not important what texture you will load in Blender, you need texture only because converter refuses to convert if it can't resolve path to the texture image. And for work with UV map if you need to do it. Diffuse texture is defined in material library.

Code: Select all

<property type="BitMap" name="diffuse_map" value="extensions\x2shippack\assets\textures\teladi16" />
I can change my texture at any time without any help of Blender or converter and texture will be changed in the game. If you tried to change textures with no effect it means you do something wrong. In Blender you can only specify collection of material and name of its collection. And vertex colors, of course.

Code: Select all

anim_mainXlod0Xp1Xparanid_01
this part should have material with name

Code: Select all

p1Xparanid_01
which means the game will search paranid_01 material in p1 collection.

Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: Vertex colour and paintjobs [SOLVED]

Post by Max Bain » Fri, 11. Dec 20, 13:17

Thank you for your explanation.

I checked the texture name and the material library and the path and file exists. So the problem must be something else.

Maybe someone has the time to check the model for me? The model should be very simple to add paintjobs. It has only one main part where I want to add a paint job on the whole texture for:

part_mainXlod0XsplitXsp_hulls_01
part_mainXlod1XsplitXsp_hulls_01
part_mainXlod2XsplitXsp_hulls_01
part_mainXlod3XsplitXsp_hulls_01

https://www.dropbox.com/s/w0qcjebx4gxjv ... l.dae?dl=0
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link

aurumgallente
Posts: 121
Joined: Sun, 14. Jun 20, 14:45
x4

Re: Vertex colour and paintjobs [SOLVED]

Post by aurumgallente » Fri, 11. Dec 20, 14:59

Here is your .dae file. And here is a .blend file. I work in Blender 2.8 so backup everything before replacing. Model of the ship has dark red color in the first vertex color channel (it's not me, I added only second channel), it adds visible color to your ship, not the texture. In fact, texture can be white or gray but parts will remain red. Also keep an eye on names of parts and materials, Blender loves to add .002 and .003 to everything, converter will reject period in names, I cleaned it up.

I didn't check how it will look like in game when something has dark red in first channel and red in second one but painting will be visible after you will install one.
Spoiler
Show
Image
Here you can see the ship before I edited it. Dark red color in the single vertex channel "meshid10-color0", it is visible in the game. To add paintjobs I added second one and colored it in pure red in "Vertex Paint" mode (shift+k to paint hole mesh), it is selectable in the top left corner.
Last edited by aurumgallente on Fri, 11. Dec 20, 15:26, edited 2 times in total.

User avatar
Axeface
Posts: 2979
Joined: Fri, 18. Nov 05, 00:41
x4

Re: Vertex colour and paintjobs [SOLVED]

Post by Axeface » Fri, 11. Dec 20, 15:03

The model only has 1 vertex channel and the red isnt even pure red? You need to add a second vertex channel to the lods and paint it pure red in the second channel.
https://i.imgur.com/QhU42vW.png

edit: Aurum got there first.

1st vertex channel should be painted BEFFD0 too (can add pure red in parts if you want the 2 colour setup like vanilla ships). You can leave it dark red if you want but it will tint paintmods that have any opacity. If it were me I would make the diffuse texture greyscale and paint the 1st channel all BEFFD0 green, and add stripes and shapes of red.

Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: Vertex colour and paintjobs [SOLVED]

Post by Max Bain » Fri, 11. Dec 20, 17:21

Oh sorry guys. I uploaded the model before adding the paint job maps.

I did added red ff0000 on the sec map and the green from your first post on separate vertex map and tried that out. But that did not worked.

I will retry with aurums file and see if something is different.
Thx u both.

Edit: still in game there is no paint job visible on the ship :( (I used your dae file)
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link

User avatar
Axeface
Posts: 2979
Joined: Fri, 18. Nov 05, 00:41
x4

Re: Vertex colour and paintjobs [SOLVED]

Post by Axeface » Thu, 17. Dec 20, 12:35

Still not got this fixed Max Bain? If not it must be the material, did you check the materials file to see if there is any differences between your custom mat and the vanilla ones?
Its possible its hardcoded, I'm just not sure. If it is then you could change the ships material to a vanilla SV one and change the UVs.

Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: Vertex colour and paintjobs [SOLVED]

Post by Max Bain » Thu, 17. Dec 20, 19:36

Axeface wrote:
Thu, 17. Dec 20, 12:35
Still not got this fixed Max Bain? If not it must be the material, did you check the materials file to see if there is any differences between your custom mat and the vanilla ones?
Its possible its hardcoded, I'm just not sure. If it is then you could change the ships material to a vanilla SV one and change the UVs.
No, I couldnt make the paintmods to work. I think it is the material, but I wasnt able to add a X4 split texture (they are all in .gz files) into the blender ship model. I also cant see the UV map in this model. Maybe something is broken with it.
I wasnt able to test the renaming of the nodes for texture changes yet because my PC has crashed. Hopefully its just the power suply, but I will see that when the new one arrived.
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link

User avatar
Axeface
Posts: 2979
Joined: Fri, 18. Nov 05, 00:41
x4

Re: Vertex colour and paintjobs [SOLVED]

Post by Axeface » Thu, 17. Dec 20, 21:01

I made a quick vid showing how to change the vertex colours and how to make the split texture show up in blender (how its setup doesnt matter, its just to see it). Hope that helps.
https://youtu.be/V_KucItRMMc

PS, thats the SV split texture. Looks like it wont be much work to make the UV's play nicely with that model.

Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: Vertex colour and paintjobs [SOLVED]

Post by Max Bain » Thu, 17. Dec 20, 21:10

Axeface wrote:
Thu, 17. Dec 20, 21:01
I made a quick vid showing how to change the vertex colours and how to make the split texture show up in blender (how its setup doesnt matter, its just to see it). Hope that helps.
https://youtu.be/V_KucItRMMc

PS, thats the SV split texture. Looks like it wont be much work to make the UV's play nicely with that model.
Thank you! When my pc is fixed I will try that out and let you know.
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link

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

Re: Vertex colour and paintjobs [SOLVED]

Post by BrummBear02 » Fri, 18. Dec 20, 00:05

im think i was the one that colored that red knight when u made that mod, no? that would explain the textures issue because if its still the blend file from me it uses the paths of my PC...
Gebt mir einen Spiegel dann schlage ich ihn mit seinem eigenen Gesicht

Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: Vertex colour and paintjobs [SOLVED]

Post by Max Bain » Fri, 18. Dec 20, 09:47

BrummBear02 wrote:
Fri, 18. Dec 20, 00:05
im think i was the one that colored that red knight when u made that mod, no? that would explain the textures issue because if its still the blend file from me it uses the paths of my PC...
We did it together remotely on my pc but I am pretty sure we never entered a path to a file or added a material or texture. We just used vertex color with a dark red.
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link

Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: Vertex colour and paintjobs [SOLVED]

Post by Max Bain » Sat, 19. Dec 20, 17:01

@Axeface: Sorry for using your thread :(.
I tried what you did in the video but in game it looks like this, no matter what paint mod I install:
Spoiler
Show
Image
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link

User avatar
Axeface
Posts: 2979
Joined: Fri, 18. Nov 05, 00:41
x4

Re: Vertex colour and paintjobs [SOLVED]

Post by Axeface » Sat, 19. Dec 20, 17:59

Edit: Fixed name of material, if you look at stock split ships like the rattlesnake the material has a . instead of an X in there, I dont know why.

Max can you try changing the names of the split hull components to "p1splitXsplit_p1_hulltexture_01"?
For example, on the lod0 to lod3, where it says part_mainXlod0 > part_mainXlod0XsplitXsp_hulls_01 change to part_mainXlod0Xp1splitXsplit_p1_hulltexture_01.

Also change the name of the material to p1split.split_p1_hulltexture_01.

Like highlighted in this pic
https://i.imgur.com/xDEC5Us.png

This should make the model use the SV texture, although I have had problems getting this to work myself. I cant get my engine mod updaded for split because I believe there is a max character limit, and things like part_mainXlod0Xp1splitXsplit_p1_hulltexture_01 are too long.
Last edited by Axeface on Sat, 19. Dec 20, 19:01, edited 2 times in total.

Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: Vertex colour and paintjobs [SOLVED]

Post by Max Bain » Sat, 19. Dec 20, 18:19

You are awesome!

That did the trick :)

Thank you so much!
Spoiler
Show
Image
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link

User avatar
Axeface
Posts: 2979
Joined: Fri, 18. Nov 05, 00:41
x4

Re: Vertex colour and paintjobs [SOLVED]

Post by Axeface » Sat, 19. Dec 20, 18:22

Nice, so the material was the issue. Are the uv's working ok? Its possible the Rebirth split hull texture and the X4 one are the same, which would be nice.

And you should add red to the first vertex channel now, so the 2 tone thing works with the empire themes.

Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: Vertex colour and paintjobs [SOLVED]

Post by Max Bain » Sat, 19. Dec 20, 18:34

Axeface wrote:
Sat, 19. Dec 20, 18:22
Nice, so the material was the issue. Are the uv's working ok? Its possible the Rebirth split hull texture and the X4 one are the same, which would be nice.

And you should add red to the first vertex channel now, so the 2 tone thing works with the empire themes.
The UV maps are perfect.

Maybe I will add some red areas to the color map. Will check how it looks. But the plain green looks already very good :)
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link

User avatar
Axeface
Posts: 2979
Joined: Fri, 18. Nov 05, 00:41
x4

Re: Vertex colour and paintjobs [SOLVED]

Post by Axeface » Sat, 19. Dec 20, 18:35

Max Bain wrote:
Sat, 19. Dec 20, 18:34
Axeface wrote:
Sat, 19. Dec 20, 18:22
Nice, so the material was the issue. Are the uv's working ok? Its possible the Rebirth split hull texture and the X4 one are the same, which would be nice.

And you should add red to the first vertex channel now, so the 2 tone thing works with the empire themes.
The UV maps are perfect.

Maybe I will add some red areas to the color map. Will check how it looks. But the plain green looks already very good :)
Stock split ships dont actually have 2 colours so imo its fine to leave it with 1.

Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: Vertex colour and paintjobs [SOLVED]

Post by Max Bain » Sat, 19. Dec 20, 18:39

Axeface wrote:
Sat, 19. Dec 20, 18:35
Max Bain wrote:
Sat, 19. Dec 20, 18:34
Axeface wrote:
Sat, 19. Dec 20, 18:22
Nice, so the material was the issue. Are the uv's working ok? Its possible the Rebirth split hull texture and the X4 one are the same, which would be nice.

And you should add red to the first vertex channel now, so the 2 tone thing works with the empire themes.
The UV maps are perfect.

Maybe I will add some red areas to the color map. Will check how it looks. But the plain green looks already very good :)
Stock split ships dont actually have 2 colours so imo its fine to leave it with 1.
btw i just tried to add a sec color but it is not possible for me to make a second color without a soft transition from green to red. But I want a sharp edge between green and red like you did on your ship. How dd you do that? Or are these 2 separate objects?
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link

Return to “X4: Foundations - Scripts and Modding”