Vertex colour and paintjobs [SOLVED]

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

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

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

Vertex colour and paintjobs [SOLVED]

Post by Axeface » Mon, 24. Feb 20, 01: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

______________


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 Thu, 27. Feb 20, 03:00, edited 12 times in total.

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

Re: [Question] Vertex colour and weight paint

Post by linolafett » Mon, 24. Feb 20, 11: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.
01000100 01101111 00100000 01110011 01110000 01101100 01101001 01110100 00100000 01100101 01100001 01110100 00100000 01100011 01101111 01101111 01101011 01101001 01100101 01110011 00111111

My art stuff

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

Re: [Question] Vertex colour and weight paint

Post by Axeface » Mon, 24. Feb 20, 14: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: 2689
Joined: Mon, 26. Mar 12, 14:57
x4

Re: [Question] Vertex colour and weight paint

Post by linolafett » Mon, 24. Feb 20, 17: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.
01000100 01101111 00100000 01110011 01110000 01101100 01101001 01110100 00100000 01100101 01100001 01110100 00100000 01100011 01101111 01101111 01101011 01101001 01100101 01110011 00111111

My art stuff

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

Re: [Question] Vertex colour and weight paint

Post by Axeface » Mon, 24. Feb 20, 19: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: 1200
Joined: Mon, 14. Apr 08, 17:03
x4

Re: Vertex colour and paintjobs [SOLVED]

Post by Shuulo » Wed, 26. Feb 20, 13: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: 1963
Joined: Fri, 18. Nov 05, 01:41
x4

Re: Vertex colour and paintjobs [SOLVED]

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

Shuulo wrote:
Wed, 26. Feb 20, 13: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: 1200
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, 13: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: 2689
Joined: Mon, 26. Mar 12, 14:57
x4

Re: Vertex colour and paintjobs [SOLVED]

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

Glad you could make it work :)
01000100 01101111 00100000 01110011 01110000 01101100 01101001 01110100 00100000 01100101 01100001 01110100 00100000 01100011 01101111 01101111 01101011 01101001 01100101 01110011 00111111

My art stuff

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

Re: Vertex colour and paintjobs [SOLVED]

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

Shuulo wrote:
Wed, 26. Feb 20, 14:09
Axeface wrote:
Wed, 26. Feb 20, 13: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, 14:35
Glad you could make it work :)
Thanks for your help! (And your awesome meshes that im butchering :mrgreen: ).

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

Re: Vertex colour and paintjobs [SOLVED]

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

Axeface wrote:
Wed, 26. Feb 20, 15: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: 152
Joined: Mon, 23. Dec 13, 12:24
x4

Re: Vertex colour and paintjobs [SOLVED]

Post by SirFrancisDrake » Wed, 26. Feb 20, 21: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: 1200
Joined: Mon, 14. Apr 08, 17:03
x4

Re: Vertex colour and paintjobs [SOLVED]

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

SirFrancisDrake wrote:
Wed, 26. Feb 20, 21: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: 267
Joined: Fri, 3. Oct 08, 20:43
x3ap

Re: Vertex colour and paintjobs [SOLVED]

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

Axeface wrote:
Wed, 26. Feb 20, 15:01
Shuulo wrote:
Wed, 26. Feb 20, 14:09
Axeface wrote:
Wed, 26. Feb 20, 13: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, 14: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: 1963
Joined: Fri, 18. Nov 05, 01:41
x4

Re: Vertex colour and paintjobs [SOLVED]

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

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

Post Reply

Return to “X4: Foundations - Scripts and Modding”