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: 2944
Joined: Fri, 18. Nov 05, 00:41
x4

Vertex colour and paintjobs [SOLVED]

Post by Axeface » Mon, 24. Feb 20, 00:17

Update: For anyone that would like to know how vertex painting is used in blender for X4.
In the pictures below you can see 2 vertex channels in the bottom right, in this example "meshId15-color0" and "meshId15-color1". The first channel uses green (hex code BEFFD0 approx) and red (FF0000) vertex painting to define where X4 will apply its hue values which are set in the paintmods.xml file. The second channel uses pure red (FF0000) and pure black (000000) to define on which parts of the mesh paintmods will be applied. Red for paintmod, black for no paintmod.
- Thanks Lino!

Image
Image

Here is a video of me working with vertex colours, perhaps it might help some modders https://www.youtube.com/watch?v=YwmZq3Vx_i8

______________


I'm trying to figure out how vertex colours and weights work, and how they interact with paintmods.
Heres a picture of a magnetar imported into blender, the red parts seem to translate to what appears in game - but the green does not so im a bit confused by it.

Are those 2 colours what the game looks for to apply xml hue variables? If so its not working on my custom ship for some reason.

https://i.imgur.com/fZKmiI9.jpg

I also dont understand how weight painting is working, weight controls where paintmods are applied, right? Its not clear how this works to me by just looking at the models.

Edit: Also, sharp edges between different vertex colours in blender are blurred in game.
Last edited by Axeface on Fri, 3. Dec 21, 14:34, edited 13 times in total.

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

Re: [Question] Vertex colour and weight paint

Post by linolafett » Mon, 24. Feb 20, 10:13

The green is the secondary colour which mostly gets disabled via the paintmod by making the paint bright.

the green/red will be hue shifted, correct.
To define where the hue shift (and the rest of the paintmod magic) is applied, we use in 3dsMax the "vertex illum" channel. I dont know how the Blender exporter is set up. Take a look at that second vertex colour channel, if in there is something marked in red. If so, use that channel to define which polies are supposed to have a mod. Red colour = yes, use the mod, back = no, dont use it.
01001100 01101001 01101110 01100101 01110011 00100000 01101111 01100110 00100000 01110100 01101001 01101101 01100101 01110011 00101110 00101110 00101110

My art stuff

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

Re: [Question] Vertex colour and weight paint

Post by Axeface » Mon, 24. Feb 20, 13:14

Thanks a lot that helps. I guess the "meshId15-color1" and "mechId-color2" are the channels, and the second one does indeed have red and black that correlates to where paintmods are applied.

Edit: Works :)
Only thing now is that my sharp lines between the 2 colours in blender are blurred ingame.

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

Re: [Question] Vertex colour and weight paint

Post by linolafett » Mon, 24. Feb 20, 16:31

The blur happens, becasue the exporter interprets the vertex colours as only vertex colours. There might be a way to define it to "per face" vertex colours.
If this is not possible, the only (kind of stupid way) to do it, is to split the edges between the coloured areas to avoid the smooth appearance.
01001100 01101001 01101110 01100101 01110011 00100000 01101111 01100110 00100000 01110100 01101001 01101101 01100101 01110011 00101110 00101110 00101110

My art stuff

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

Re: [Question] Vertex colour and weight paint

Post by Axeface » Mon, 24. Feb 20, 18:23

Thanks, that got the job done! It does effect the lighting/smoothness quite a lot so i'll try to figure something else out.
And the paintmods etc are all working now :D

"If it fits, I sits!"
Image

User avatar
Shuulo
Posts: 1629
Joined: Mon, 14. Apr 08, 17:03
x4

Re: Vertex colour and paintjobs [SOLVED]

Post by Shuulo » Wed, 26. Feb 20, 12:14

I really dig the style of this ship, what it will be? Corvette for Argons? Are you busy with cockpit now?

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

Re: Vertex colour and paintjobs [SOLVED]

Post by Axeface » Wed, 26. Feb 20, 12:43

Shuulo wrote:
Wed, 26. Feb 20, 12:14
I really dig the style of this ship, what it will be? Corvette for Argons? Are you busy with cockpit now?
Glad you like it! And im trying to decide that, this is just a learning experience really so I didnt have anything planned. I'm thinking either a large M (either missile or boarding focused) or even a small L frigate - might end up making it an L just to finish it so i can move onto other things. Oh and its a Centaur.

User avatar
Shuulo
Posts: 1629
Joined: Mon, 14. Apr 08, 17:03
x4

Re: Vertex colour and paintjobs [SOLVED]

Post by Shuulo » Wed, 26. Feb 20, 13:09

Axeface wrote:
Wed, 26. Feb 20, 12:43
Glad you like it! And im trying to decide that, this is just a learning experience really so I didnt have anything planned. I'm thinking either a large M (either missile or boarding focused) or even a small L frigate - might end up making it an L just to finish it so i can move onto other things. Oh and its a Centaur.
Hah, would be cool to see it as M missile ship, limit guns or turrets to just missiles in components file.
Damn, it will conflict with my Centaur in VRO mod :( that is the actual port of X3 model. Are you sure you want it as Centaur? :) I would be happy to make compatability patch for it to work with VRO when released.
And IMO its a bit small for L ship, my Centaur is shorter and much thinner than Behemoth and even so it looks huge comparing to M ships (as your ship is also scaled to fit on M landing pad).

Also, you dont have a crash with collision mesh active? I made a Shrike for teladies out of Crane, but it crashes if collision mesh is there. I wonder if you know how to fight this.

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

Re: Vertex colour and paintjobs [SOLVED]

Post by linolafett » Wed, 26. Feb 20, 13:35

Glad you could make it work :)
01001100 01101001 01101110 01100101 01110011 00100000 01101111 01100110 00100000 01110100 01101001 01101101 01100101 01110011 00101110 00101110 00101110

My art stuff

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

Re: Vertex colour and paintjobs [SOLVED]

Post by Axeface » Wed, 26. Feb 20, 14:01

Shuulo wrote:
Wed, 26. Feb 20, 13:09
Axeface wrote:
Wed, 26. Feb 20, 12:43
Glad you like it! And im trying to decide that, this is just a learning experience really so I didnt have anything planned. I'm thinking either a large M (either missile or boarding focused) or even a small L frigate - might end up making it an L just to finish it so i can move onto other things. Oh and its a Centaur.
Hah, would be cool to see it as M missile ship, limit guns or turrets to just missiles in components file.
Damn, it will conflict with my Centaur in VRO mod :( that is the actual port of X3 model. Are you sure you want it as Centaur? :) I would be happy to make compatability patch for it to work with VRO when released.
And IMO its a bit small for L ship, my Centaur is shorter and much thinner than Behemoth and even so it looks huge comparing to M ships (as your ship is also scaled to fit on M landing pad).

Also, you dont have a crash with collision mesh active? I made a Shrike for teladies out of Crane, but it crashes if collision mesh is there. I wonder if you know how to fight this.
Ive been building it while looking at pics of the x3 centaur, trying to make it a bit reminiscent of it while also trying to fit it with other argon ships. Maybe we could call it Centaur II for VRO? As for the size thats up in the air too, I've been scaling it up and down and seeing how it looks, I tried it as half the size of the Behemoth and it looks pretty cool - once I decide the size i'll change the uvs so the textures dont look too big or small.

As for the collision mesh I have even tried yet. This is a learning experience :| (Scared now).
linolafett wrote:
Wed, 26. Feb 20, 13:35
Glad you could make it work :)
Thanks for your help! (And your awesome meshes that im butchering :mrgreen: ).

User avatar
Shuulo
Posts: 1629
Joined: Mon, 14. Apr 08, 17:03
x4

Re: Vertex colour and paintjobs [SOLVED]

Post by Shuulo » Wed, 26. Feb 20, 14:09

Axeface wrote:
Wed, 26. Feb 20, 14:01
Maybe we could call it Centaur II for VRO?
Not sure if itll make sense to have ships with same name but I and II will be of different size.
Maybe Ill just change the name of my ship to Heavy Centaur than, though also wanted to have real Heavy Centaur model from X3 to be in VRO. Dunno, anyway, we will find the way to make it work if youll decide to release this ship.

User avatar
SirFrancisDrake
Posts: 188
Joined: Mon, 23. Dec 13, 11:24
x4

Re: Vertex colour and paintjobs [SOLVED]

Post by SirFrancisDrake » Wed, 26. Feb 20, 20:35

Maybe Ill just change the name of my ship to Heavy Centaur than, though also wanted to have real Heavy Centaur model from X3 to be in VRO. Dunno, anyway, we will find the way to make it work if youll decide to release this ship.
maybe there is a possibility :wink:

User avatar
Shuulo
Posts: 1629
Joined: Mon, 14. Apr 08, 17:03
x4

Re: Vertex colour and paintjobs [SOLVED]

Post by Shuulo » Wed, 26. Feb 20, 21:31

SirFrancisDrake wrote:
Wed, 26. Feb 20, 20:35
Maybe Ill just change the name of my ship to Heavy Centaur than, though also wanted to have real Heavy Centaur model from X3 to be in VRO. Dunno, anyway, we will find the way to make it work if youll decide to release this ship.
maybe there is a possibility :wink:
your tease is very effective :)

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

Re: Vertex colour and paintjobs [SOLVED]

Post by BrummBear02 » Wed, 26. Feb 20, 21:51

Axeface wrote:
Wed, 26. Feb 20, 14:01
Shuulo wrote:
Wed, 26. Feb 20, 13:09
Axeface wrote:
Wed, 26. Feb 20, 12:43
Glad you like it! And im trying to decide that, this is just a learning experience really so I didnt have anything planned. I'm thinking either a large M (either missile or boarding focused) or even a small L frigate - might end up making it an L just to finish it so i can move onto other things. Oh and its a Centaur.
Hah, would be cool to see it as M missile ship, limit guns or turrets to just missiles in components file.
Damn, it will conflict with my Centaur in VRO mod :( that is the actual port of X3 model. Are you sure you want it as Centaur? :) I would be happy to make compatability patch for it to work with VRO when released.
And IMO its a bit small for L ship, my Centaur is shorter and much thinner than Behemoth and even so it looks huge comparing to M ships (as your ship is also scaled to fit on M landing pad).

Also, you dont have a crash with collision mesh active? I made a Shrike for teladies out of Crane, but it crashes if collision mesh is there. I wonder if you know how to fight this.
Ive been building it while looking at pics of the x3 centaur, trying to make it a bit reminiscent of it while also trying to fit it with other argon ships. Maybe we could call it Centaur II for VRO? As for the size thats up in the air too, I've been scaling it up and down and seeing how it looks, I tried it as half the size of the Behemoth and it looks pretty cool - once I decide the size i'll change the uvs so the textures dont look too big or small.

As for the collision mesh I have even tried yet. This is a learning experience :| (Scared now).
linolafett wrote:
Wed, 26. Feb 20, 13:35
Glad you could make it work :)
Thanks for your help! (And your awesome meshes that im butchering :mrgreen: ).
dont worry about the collision. i most likely can help you with that. the x3 centaur is a special case. stupid little thing.

my english isnt the best and im having trouble to understand what hue values are... can u describe that in different words?
Gebt mir einen Spiegel dann schlage ich ihn mit seinem eigenen Gesicht

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

Re: Vertex colour and paintjobs [SOLVED]

Post by Axeface » Wed, 26. Feb 20, 22:27

Hmm, colour tint? The 'hue' variable in the paintmods.xml file defines the colours that will be applied to the mesh.

Riccardoman
Posts: 155
Joined: Thu, 9. Nov 17, 18:57
x4

Re: Vertex colour and paintjobs [SOLVED]

Post by Riccardoman » Thu, 27. Feb 20, 10:39

Really good interpretation of the argon centaur axeface
The x3 one doesn't translate very well in x4

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

Re: Vertex colour and paintjobs [SOLVED]

Post by Axeface » Thu, 27. Feb 20, 17:31

I'm looking into this blurred edge between two vertex colours in-game issue. We've learnt that we can split the edge to make the colours sharp, or even bevel it to control how 'big' the blur is. But I was looking at the Argon Drill model - it looks like nothing has been done to the model to make its edges sharp (it does have split vertices but only some of them are split, not the whole edge along those sharp lines), yet it looks like this in game - perfectly sharp :gruebel: :gruebel:
Is this some special super power of 3dsmax?

Image

Thanks Riccardoman.

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

Re: Vertex colour and paintjobs [SOLVED]

Post by linolafett » Thu, 27. Feb 20, 17:36

Blender also has this "magic", you just have to figure out how to properly export it.
Sadly i dont really know what the exporter pipeline is for you guys, so i cant really help :(
01001100 01101001 01101110 01100101 01110011 00100000 01101111 01100110 00100000 01110100 01101001 01101101 01100101 01110011 00101110 00101110 00101110

My art stuff

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

Re: Vertex colour and paintjobs [SOLVED]

Post by Axeface » Thu, 27. Feb 20, 17:40

Ah ok, at least I can say its not something i'm doing wrong. Cheers

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

Re: Vertex colour and paintjobs [SOLVED]

Post by BrummBear02 » Thu, 27. Feb 20, 21:14

https://www.nexusmods.com/x4foundations/mods/316

just press P in edit mode after u selected the faces u want to have a different color. then merge the nodes again. then colour it.
Gebt mir einen Spiegel dann schlage ich ihn mit seinem eigenen Gesicht

Post Reply

Return to “X4: Foundations - Scripts and Modding”