Jump to content

[1.12.x] Recolour Collection


ZZetho

Recommended Posts

On 7/25/2024 at 9:36 PM, ZZetho said:

Textures Unlimited Recolouring Tutorial pt1 (minimum viable product).

I threw this together in like an hour so there's definitely stuff i forgot about, please tell me if you have problems.

More info can be found on the Textures Unlimited Wiki.

I use paint.net and notepad++ but any text editor and image editor should work fine.

You need to have both Module Manager and Textures Unlimited installed to do this.

You also should install the mod Part info in PAW to get part names more easily

This wont work for parts that have texture variants (though it can be done), if variants don't change the texture it should be fine.

First of all go into GameData/000_TexturesUnlimited/GeneralConfiguration and set exportUVs to true, once you have launched the game at least once this will create a folder "expotedUVMaps" in your ksp install folder (one level up from gamedata) which contains the info for every texture that every part uses as well as any other properties that the part has (eg: shininess).

Next create a folder in gamedata, this will be where all of the recolour stuff will go, inside your recolour folder make three .cfg files (make a .txt file then rename it to .cfg) one is for texture sets one is for the default (un-recoloured) textures of parts and one is for recolouring the parts so name them accordingly.

Also create some folders in here, these will hold the recolour textures and default textures for if parts don't have them. Just copy the folder named "Default" from any of my recolours to get the default textures.

File tree should look something like this:

os0sM55.png

Copy the following into the texture sets file:

  Reveal hidden contents

// texture sets that are copied to create the default and recolour texture sets //

KSP_TEXTURE_SET:NEEDS[TexturesUnlimited&NearFutureLaunchVehicles]
{
    name = NFLV_Default
    title = Squad
    recolorable = false

    MATERIAL
    {
        mode = create
        
        shader = KSP/Emissive/Bumped Specular
    }
}

// create red green and blue if they dont exist already //

KSP_COLOR_PRESET:NEEDS[TexturesUnlimited]
{
    name = absolute_red
    title = Absolute Red
    color = 255,0,0
    specular = 0
    metallic = 0
}
KSP_COLOR_PRESET:NEEDS[TexturesUnlimited]
{
    name = absolute_green
    title = Absolute Green
    color = 0,255,0
    specular = 0
    metallic = 0
}
KSP_COLOR_PRESET:NEEDS[TexturesUnlimited]
{
    name = absolute_blue
    title = Absolute Blue
    color = 0,0,255
    specular = 0
    metallic = 0
}

KSP_TEXTURE_SET:NEEDS[TexturesUnlimited&NearFutureLaunchVehicles]
{
    name = NFLV_Paint
    title = Bob Ross Paints
    recolorable = true
    
    MATERIAL
    {
        mode = create
        
        shader = TU/Metallic
        
        keyword = TU_RECOLOR
    }
    COLORS
    {
        mainColor = absolute_red
        secondColor = absolute_green
        detailColor = absolute_blue
    }
}

Change "NearFutureLaunchVehicles " to the name of whatever mod you are recolouring (the name of its folder inside gamedata).

For each of the texture sets change name to something unique.

xcmHBrf.png

Copy the following into your default file:

  Reveal hidden contents

// default texture template //
@PART[partName]:FOR[000_TU_NFLV_000]:NEEDS[TexturesUnlimited&NearFutureLaunchVehicles]
{
    MODULE
    {
        name = KSPTextureSwitch
        sectionName = Appearance
        currentTextureSet = NFLV_Default
        textureSet = NFLV_Default
    }
}
+KSP_TEXTURE_SET[NFLV_Default]:NEEDS[TexturesUnlimited&NearFutureLaunchVehicles]
{
    @name = NFLV_Default
    @MATERIAL
    {        
        texture = _MainTex,
        texture = _BumpMap,
        texture = _Emissive,
        
        PROPERTY
        {
            name = _Shininess
            float = 0.4
        }
    }
}

First of all change "NearFutureLaunchVehicles" to the name of the mod you are recolouring. Change 000_TU_NFLV_000 to 000_TU_somethingThatIdentifiesWhatModIsBeingRecooloured_000. Change currentTextureSet, textureSet and @name from NFLV_Defalt to something else. Change the NFLV_Default in +KSP_TEXTURE_SET[NFLV_Default] to whatever you called the first texture set in the texture sets file (NFLV_Default in the previous pic). Change the partName in @PART[partName] to the internal name of whatever part you are recolouring, assuming you have Part info in PAW you can click on "Copy Part Name" in the right click window of a part.

To fill in the rest of the missing bits you'll need to open that exportedUVMaps folder from earlier and navigate to whatever part you want to recolour and open its ModelData.txt file. In here you will find the mesh(s) that the part is made of and the path to the textures they use, copy these texture paths into the default texture sets file, each part needs a _MainTex and a _BumpMap, _Emissive is optional, remove it if the part doesnt have one. If the part has no bump map use the one found in that Default folder you copied earlier.

ModelData also shows what properties are applied to meshes, if there are any, copy the properties name and value into the property node. if there are multiple properties copy the node (from PROPERTY { to } ) and put them one after another (though i've never encountered part with anything other than shininess).

rBCK2da.png

Some parts have multiple meshes, this is fine unless they use different textures, if they do come back later for when i make a part two of this tutorial or try a different part. you can ignore any meshes called flagTransform though.

Once you've done this once for a part from a mod you can copy it and only change the parts that are different between parts, the partName, the currentTextureSet textureSet and @name should be unique per part and the textures will of course be different.

If multiple parts use the same textures you can do multiple parts at the same time, put their internal names one after another in the partName box with commas separating them.

Great job! if you did everything right when you launch the game the part should look absolutely indistinguishable from what it did previously (it should also have a selection box with no other options than "Appearance" in its right click menu). If it didn't work check the common issues section at the bottom of this post.

Now we need to recolour it.

Copy the following into your recolour file:

  Reveal hidden contents

// recolour template //
@PART[partName]:FOR[999_TU_NFLV_Recolour_000]:NEEDS[TexturesUnlimited&NearFutureLaunchVehicles]
{
    @MODULE[KSPTextureSwitch],0
    {
        textureSet = NFLV_Paint
    }
    %MODULE[SSTURecolorGUI]
    {
        %name = SSTURecolorGUI
    }
}
+KSP_TEXTURE_SET[NFLV_Paint]:NEEDS[TexturesUnlimited&NearFutureLaunchVehicles]
{
    @name = NFLV_Paint
    @MATERIAL
    {
        vector = _DiffuseNorm,0.75,0.75,0.75
        vector = _MetalNorm,0.55,0.55,0.55
        vector = _SmoothnessNorm,0.55,0.55,0.55
        
        texture = _MainTex,
        texture = _BumpMap,
        texture = _Emissive,
        texture = _MetallicGlossMap,
        texture = _MaskTex,
    }
}

Change partName, the NFLV bit of 999_TU_NFLV_Recolour_000, NearFutureLaunchVehicles (name of the mod being recoloured) and the textures _MainTex, _BumpMap and _Emissive to the same as whatever they were in the previous default file. Change textureSet and @name in the same way as last time but use a different unique name. Change NFLV_Paint to whatever you called the paint texture set in your texture sets file. Some parts use the transparency of _MainTex as a gloss map, if the main texture is partially transparent this is likely the case and it can be used as _MetallicGlossMap, if it isn't then you will have to make your own.

RIyqNcU.png

Now is the point where we actually get to do some recolouring. I will be using paint.net for this part.

Open the original texture and recolour it, it should be split into four areas, a purely red, purely green, and purely blue section that do not overlap, anti aliasing should be off so there are no semi-red semi-green ect pixels. Any part of the image that isn't being recoloured should be pitch black, these parts will retain their original textures on the final part.

If you need to make a _MetallicGlossMap it doesn't matter what colours you use, the glossiness is based on how transparent the texture is (more transparent = less glossy).

!! important!!  save the recolour as a .png, when you do this is needs to be flipped vertically compared to the original texture.

Once these textures are done save them somewhere in your recolour folder and set _MaskTex to the path to the recolour texture from GameData. eg: "texture = _MaskTex,TU_NearFutureSpacecraft/Textures/EnginePods/engine-pod-01_paintTU_NearFutureSpacecraft/Textures/EnginePods/engine-pod-01_paint" don't include the file extension (.dds). If you copy the path from the top bar of file explorer you'll have to change the \'s to /'s.

Back in the recolour file we now change the vectors, these are essentially the average value of a property in the red green and blue areas of the recolour texture. the only one to worry about for now is the _DIffuseNorm vector, this is the average brightness of each of the areas.

u0fipv7.png

0.75 is a pretty good value for stock white areas but you'll want to change it if the red, green or blue areas are particularly dark or bright. The exact value doesn't really matter, it its really far off the recoloured areas will appear to dark or bright compared to other parts.

There is a proper way to calculate these that can be found on the Textures Unlimited Wiki if you want.

Assuming you did everything right (and i wrote this tutorial correctly) when you launch the game the parts you want recoloured should now have that option.

 

Common issues (that i had):

- Parts appear solid grey / Recolours are solid red / Parts have weird shadows.

This is because the _MainTex / _MaskTex / _BumpMap did not work, check the file path specified in the default / recolour file is correct, that the textures are being applied to the correct part.

 - Parts are mirror-shiny.

_MetallicGlossMap is completely opaque, check it is the right format (BC3 sRGB DX 10+) / file path is correct (same as above).

 - Some bits of parts have the wrong texture applied to them.

This is either because that part is made of multiple meshes with different textures, i will explain how to solve this sometime in the future  or because the recolour texture has not been flipped.

Hey, what do I do if there are actually multiple meshes with multiple textures? For example Restock mk1-3pod has a hatch, and a flag. They all require their own texture since... they look ugly

Edit: I think I figured out, I looked at UncleMateo's config for drop tanks, and the solution seems to be copy +KSP_TEXTURE_SET times how much meshes are there, then to each one add mesh = I_NEED_THIS and excludeMesh = I_DONT_NEED_THIS, excludeMesh = flag, and obviously add texture for all of them, am I correct?

Edit Edit: yup it worked, just needed to plug in mesh and excludeMesh nearby textures and worked like a charm :D

Edited by MrShelter
Edit Edit
Link to comment
Share on other sites

I made a simple customizable TURD config maker based of @ZZetho's tutorial! https://github.com/likeproblem/TURD_ConfigMaker

I would be very happy if it helps you to create configs even if marginally faster :)

Uses latest python, and can be customized by editing all txt files

Just launch, input all variables(you can default them if you want so!) and select mode: init, add, and meshify(very specific mode explained in main.py)

Please tell me if it worked, what to improve etc!

Link to comment
Share on other sites

7 hours ago, Bobbejans said:

i have a question. is turd/recolour support being made for restock?

other than that keep up the great work. i have no modding skills so this seems like witchcraft to me:huh:

OrbitalPhoenix seems to be doing it... but I tried to contact him, no result, so welp, I started doing my own:P

Mainly because I always wanted to learn how it's done

Link to comment
Share on other sites

2 hours ago, Hank Kerman said:

When I installed the mod, the parts were  just purely red, with no other colors.  Same issue with Uncle Mateo's Coriolis Space Systems recolor

Put it into the Gamedata folder, NOT the TURD folder. Had the same issue but I read the installation instructions. 

Link to comment
Share on other sites

2 minutes ago, Davidinc2008 said:

Put it into the Gamedata folder, NOT the TURD folder. Had the same issue but I read the installation instructions. 

Agreed, the texture paths are very goofy, especially with these TURDs, some choose to place them until TURD, some outside.

Link to comment
Share on other sites

3 hours ago, Davidinc2008 said:

Put it into the Gamedata folder, NOT the TURD folder. Had the same issue but I read the installation instructions. 

Thanks for the help, got NF Spacecraft and NF Aero to work. Not Coriolis, but that is Uncle Mateo's mod.

Link to comment
Share on other sites

Is there a way to implement both +KSP_TEXTURE_SETS under one selector? Because doing two separate bodies, Appearance and Endcap, is very inconvinient(just imagine having to recolor two groups for single fuel tank!)

Edit: also is there a way to filter not only by mesh, but also by material? One of pods have two hatches using DIFFERENT TEXTURES(aka materials too). If I add one of them, it will screw up other one:mad:

Edited by MrShelter
moar question
Link to comment
Share on other sites

3 hours ago, MrShelter said:

Is there a way to implement both +KSP_TEXTURE_SETS under one selector?

Kind of, instead of using a KSPTextureSwitch module you have to use the part variant module. There's some examples of this in the making history recolour, which edits the variant module to add some recoloured variants that use multiple texture sets (the mastodon engine recolour for example).

Edited by ZZetho
whoops nevermind
Link to comment
Share on other sites

13 hours ago, ZZetho said:

Kind of, instead of using a KSPTextureSwitch module you have to use the part variant module. There's some examples of this in the making history recolour, which edits the variant module to add some recoloured variants that use multiple texture sets (the mastodon engine recolour for example).

Is that only method? Because if I do so, and engine has variants for example, I would be bloating variant menu very, very heavily, since I need to still change meshes(just look how much Restock Kodiak variants it has, entire 10 variants!)

Link to comment
Share on other sites

4 hours ago, MrShelter said:

Is that only method? Because if I do so, and engine has variants for example, I would be bloating variant menu very, very heavily, since I need to still change meshes(just look how much Restock Kodiak variants it has, entire 10 variants!)

As far as i know yes, this is why i prefer to use a few texture switcher modules each for a few different meshes on a part, an engine for example might have a texture switcher for the engine itself one for the engine mount and one for the shroud, these might each be made of multiple meshes but as long as the meshes referenced in a textures set all use the same textures it will work fine. The texture switchers change the textures of the meshes of the part while the part variants (if the part has them) might add or remove meshes from the part. This is assuming the variants don't also change the textures in which case yes you will need a recolour variant for each default variant.

The variants method also only seems to work with the stock part variants module and not things like b9 part switch variants (i haven't been able to get them to work at least). It also does this thing where if you change a part from one recoloured variant to another it doesn't keep its colours and goes back to being red / green / blue.

Link to comment
Share on other sites

9 minutes ago, ZZetho said:

As far as i know yes, this is why i prefer to use a few texture switcher modules each for a few different meshes on a part, an engine for example might have a texture switcher for the engine itself one for the engine mount and one for the shroud, these might each be made of multiple meshes but as long as the meshes referenced in a textures set all use the same textures it will work fine. The texture switchers change the textures of the meshes of the part while the part variants (if the part has them) might add or remove meshes from the part. This is assuming the variants don't also change the textures in which case yes you will need a recolour variant for each default variant.

The variants method also only seems to work with the stock part variants module and not things like b9 part switch variants (i haven't been able to get them to work at least). It also does this thing where if you change a part from one recoloured variant to another it doesn't keep its colours and goes back to being red / green / blue.

Thanks, I guess I will stick to "classic" partswitcher for now, sorry users, you have to deal with amount of meshes restock has ¯\_(ツ)_/¯(seriously, but how much hatches and endcaps you have to reference??)

Edited by MrShelter
grammar never change
Link to comment
Share on other sites

Here's a neat tip I found for models with high mesh count using same texture: flip your texture workspace vertically, it will neatly align with svgs found inside exportedUVMaps(each svg file is its own mesh, allowing for easy identification):wink:

Link to comment
Share on other sites

I'm making a recolour config for Restock :)

still very, very rough, and only 4 parts(lol, it takes so much time, who uv mapped them??)

https://imgur.com/a/BK4bnBF

https://github.com/likeproblem/RestockRecolour I uploaded it to github, and I try to color as much parts as possible, but it is very tedious, so I would appreciate if anybody could help too :)

Link to comment
Share on other sites

The near future launch vehicles recolour is done!*

https://github.com/ZZetho/TU_NearFutureLaunchVehicles/tree/v1.0

68747470733a2f2f692e696d6775722e636f6d2f

Most of the parts have multiple different recolour variants (as in the bits that are red / green / blue change).

I'm not entirely happy with the cargo bay recolours so if you have any suggestions I'd love to hear them.

*except for the fairings because i don't know how to recolour them and the structural tubes because (after a week of trying stuff) i think they might just be impossible.

Link to comment
Share on other sites

6 hours ago, ZZetho said:

The near future launch vehicles recolour is done!*

https://github.com/ZZetho/TU_NearFutureLaunchVehicles/tree/v1.0

68747470733a2f2f692e696d6775722e636f6d2f

Most of the parts have multiple different recolour variants (as in the bits that are red / green / blue change).

I'm not entirely happy with the cargo bay recolours so if you have any suggestions I'd love to hear them.

*except for the fairings because i don't know how to recolour them and the structural tubes because (after a week of trying stuff) i think they might just be impossible.

Looking forward to this being on CKAN. Thanks so much!

Question: Is there a reason the recolor for Near Future Aeronautics is not on CKAN like the other are?

Link to comment
Share on other sites

9 hours ago, SheepDog2142 said:

Question: Is there a reason the recolor for Near Future Aeronautics is not on CKAN like the other are?

No, i think i just forgot to add it.

Link to comment
Share on other sites

Textures Unlimited Recolouring Tutorial pt2 (meshes).

Part one:

You should first have a basic understanding of module manager syntax (what all the symbols do), you can find that on the module manager wiki.

First of all, Every part in KSP is defined by a config (.cfg) file, this determines all of the properties of the part, including its model.

Every part has at least one (and usually only one) model (.mu) that determines what shape the part is, defined by either "mesh = SomeModel.mu" or 

MODEL
{
        model = Mod/PartsOrSomething/EnginesAndWhatnot/SomeModel
}

Every model contains at least one mesh, each mesh uses exactly one material to determine what the mesh looks like (multiple meshes can use the same material).

Materials contain a set number of textures that determine what meshes that use this material will look like.

ie: meshes are shapes that have materials painted on to them which are then combined to form a model that, when combined with some properties in the config file, makes a part.

"To draw something in Unity, you must provide information that describes its shape, and information that describes the appearance of its surface. You use meshes to describe shapes, and materials to describe the appearance of surfaces."

  - the Unity manual "Materials introduction".

For example:

qCwfodc.png

You can find the meshes of a part by finding the part's ModelData.txt file mentioned in the last part of this tutorial. It contains the name of every mesh as well as the full details for the material that is used for that mesh, including which shader the material uses which will be important later.

ModelData.txt for the Nerv nuclear engine:

7fjfFzX.png

In this case we have three meshes (engine, obj_gimbal and fairingL) and two materials (NTR and ntrfairing), with two of the meshes using the same material.

What we want to do is to make our own materials and have the meshes of a part be able to switch between the default textures and recolour ones. To do this we need to add a KSPTextureSwitch module, something that is added by Textures Unlimited which allows the texture set of a part to be changed. A texture set is effectively just a material plus some other properties (such as if they are recolourable or not), two of them were made near the start of part 1 of this tutorial, these are used as a template that can be copied and edited. Parts don't come with a texture set so we have to make our own, this includes fully recreating the material that the part originally used (the default texture set) and making at least one recolourable texture set. If two meshes use the same material then they can use the same texture switcher, if not they must use different texture switchers.

CwDhM6s.png

To do this the template texture sets that are defined in the TextureSets config file are copied and edited to have the properties / textures we want (see part 1). By default a texture set's material is applied to every mesh in a part, to prevent this the meshes that the material should / shouldn't be applied to can be specified in the MATERIAL node in a texture set by using "mesh = MeshThatShouldBeUsingThisMaterial" to apply a material to only those meshes (whitelist) and "excludeMesh = MeshThatShouldlntBeUsingThisMaterial" to apply a material to every mesh except those meshes (blacklist). Usually you should only be using one or the other of these for each texture set. You can often tell what meshes are by their name, if that fails you can open the model in blender, the objects will have the same names. A tutorial on how to do that (this also gives colliders but these can be ignored). If that too fails your next best hope is the Debug Stuff mod, turn on Labels to see the names of meshes (and also a bunch of other stuff).

Another thing to look out for is materials that use different shaders, in ModelData the shader that each material uses is specified, for the default texture set to look the same as the original texture the shader has to also be the same. The shader that the template default texture set uses is "KSP/Emissive/Bumped Specular" (so if that's what the material you're trying to recreate uses you don't have to do this) and can be changed with "@shader = SomeShader" in the MATERIAL node, don't change the shader in the recolour texture set.

For example:

cIByG02.png

At this point, when you launch the game the part that is being recoloured should have multiple texture switches which each control the recolouring of a portion of the part.

Things of note:

- It is possible to leave a mesh completely untouched, if every material excludes it then it will keep its original textures, this is used for meshes that should never be recoloured, for example the meshes that flags go on or meshes used for particle effects (Shader Name : KSP/Particles).

- You don't have to use one texture switcher for a group of meshes that all use the same material, you can split them up into different switchers so they are independently recolourable if you'd like.

- Many meshes may use the same texture set if they all use the same materials. This means that the meshes of multiple parts can be recoloured at once by using @PART[part1,part2,part3], keep in mind that this will add KSPTextureSwitch modules to each of the parts so if you add another KSPTextureSwitch module to one of the parts to recolour a mesh that uses a unique material then when you add the recolour texture set in the recolour config file it will not be the first KSPTextureSwitch  any more so the number after @MODULE[KSPTextureSwitch] will not be a zero any more.

- If multiple models (.mu) are being recoloured, either because multiple parts are being recoloured or a part is made of multiple models, the whitelist / blacklist from mesh =  and excludeMesh = is only applied per-model, meaning that there are situations where it makes sense to have both mesh = and excludeMesh = in a single material (use this material for only these meshes in one model and all meshes except these in another model), assuming the models have no meshes with the same name (have a look at the generics section in the default and recolour files of my near future launch vehicles recolour for examples).

- You can add as many recolour texture sets as you want to a texture switcher by putting more than one "textureSet = SomeTextureSet" in a @MODULE[KSPTextureSwitch] node (have a look at the fuel tanks section in the recolour file of my near future launch vehicles recolour for examples).

Common issues:

- The number after @MODULE[KSPTextureSwitch], is wrong, this makes switchers have too many / two few options as texture sets are added to the wrong one. The number corresponds to which number KSPTextureSwitch module is being edited. Modules are numbered in the order they were created, starting from zero, so the third one would be number 2.

- Texture sets have the same name, make sure every texture set has a unique name.

Link to comment
Share on other sites

6 hours ago, ZZetho said:

Textures Unlimited Recolouring Tutorial pt2 (meshes).

Part one:

You should first have a basic understanding of module manager syntax (what all the symbols do), you can find that on the module manager wiki.

First of all, Every part in KSP is defined by a config (.cfg) file, this determines all of the properties of the part, including its model.

Every part has at least one (and usually only one) model (.mu) that determines what shape the part is, defined by either "mesh = SomeModel.mu" or 

MODEL
{
        model = Mod/PartsOrSomething/EnginesAndWhatnot/SomeModel
}

Every model contains at least one mesh, each mesh uses exactly one material to determine what the mesh looks like (multiple meshes can use the same material).

Materials contain a set number of textures that determine what meshes that use this material will look like.

ie: meshes are shapes that have materials painted on to them which are then combined to form a model that, when combined with some properties in the config file, makes a part.

"To draw something in Unity, you must provide information that describes its shape, and information that describes the appearance of its surface. You use meshes to describe shapes, and materials to describe the appearance of surfaces."

  - the Unity manual "Materials introduction".

For example:

qCwfodc.png

You can find the meshes of a part by finding the part's ModelData.txt file mentioned in the last part of this tutorial. It contains the name of every mesh as well as the full details for the material that is used for that mesh, including which shader the material uses which will be important later.

ModelData.txt for the Nerv nuclear engine:

7fjfFzX.png

In this case we have three meshes (engine, obj_gimbal and fairingL) and two materials (NTR and ntrfairing), with two of the meshes using the same material.

What we want to do is to make our own materials and have the meshes of a part be able to switch between the default textures and recolour ones. To do this we need to add a KSPTextureSwitch module, something that is added by Textures Unlimited which allows the texture set of a part to be changed. A texture set is effectively just a material plus some other properties (such as if they are recolourable or not), two of them were made near the start of part 1 of this tutorial, these are used as a template that can be copied and edited. Parts don't come with a texture set so we have to make our own, this includes fully recreating the material that the part originally used (the default texture set) and making at least one recolourable texture set. If two meshes use the same material then they can use the same texture switcher, if not they must use different texture switchers.

CwDhM6s.png

To do this the template texture sets that are defined in the TextureSets config file are copied and edited to have the properties / textures we want (see part 1). By default a texture set's material is applied to every mesh in a part, to prevent this the meshes that the material should / shouldn't be applied to can be specified in the MATERIAL node in a texture set by using "mesh = MeshThatShouldBeUsingThisMaterial" to apply a material to only those meshes (whitelist) and "excludeMesh = MeshThatShouldlntBeUsingThisMaterial" to apply a material to every mesh except those meshes (blacklist). Usually you should only be using one or the other of these for each texture set. You can often tell what meshes are by their name, if that fails you can open the model in blender, the objects will have the same names. A tutorial on how to do that (this also gives colliders but these can be ignored). If that too fails your next best hope is the Debug Stuff mod, turn on Labels to see the names of meshes (and also a bunch of other stuff).

Another thing to look out for is materials that use different shaders, in ModelData the shader that each material uses is specified, for the default texture set to look the same as the original texture the shader has to also be the same. The shader that the template default texture set uses is "KSP/Emissive/Bumped Specular" (so if that's what the material you're trying to recreate uses you don't have to do this) and can be changed with "@shader = SomeShader" in the MATERIAL node, don't change the shader in the recolour texture set.

For example:

cIByG02.png

At this point, when you launch the game the part that is being recoloured should have multiple texture switches which each control the recolouring of a portion of the part.

Things of note:

- It is possible to leave a mesh completely untouched, if every material excludes it then it will keep its original textures, this is used for meshes that should never be recoloured, for example the meshes that flags go on or meshes used for particle effects (Shader Name : KSP/Particles).

- You don't have to use one texture switcher for a group of meshes that all use the same material, you can split them up into different switchers so they are independently recolourable if you'd like.

- Many meshes may use the same texture set if they all use the same materials. This means that the meshes of multiple parts can be recoloured at once by using @PART[part1,part2,part3], keep in mind that this will add KSPTextureSwitch modules to each of the parts so if you add another KSPTextureSwitch module to one of the parts to recolour a mesh that uses a unique material then when you add the recolour texture set in the recolour config file it will not be the first KSPTextureSwitch  any more so the number after @MODULE[KSPTextureSwitch] will not be a zero any more.

- If multiple models (.mu) are being recoloured, either because multiple parts are being recoloured or a part is made of multiple models, the whitelist / blacklist from mesh =  and excludeMesh = is only applied per-model, meaning that there are situations where it makes sense to have both mesh = and excludeMesh = in a single material (use this material for only these meshes in one model and all meshes except these in another model), assuming the models have no meshes with the same name (have a look at the generics section in the default and recolour files of my near future launch vehicles recolour for examples).

- You can add as many recolour texture sets as you want to a texture switcher by putting more than one "textureSet = SomeTextureSet" in a @MODULE[KSPTextureSwitch] node (have a look at the fuel tanks section in the recolour file of my near future launch vehicles recolour for examples).

Common issues:

- The number after @MODULE[KSPTextureSwitch], is wrong, this makes switchers have too many / two few options as texture sets are added to the wrong one. The number corresponds to which number KSPTextureSwitch module is being edited. Modules are numbered in the order they were created, starting from zero, so the third one would be number 2.

- Texture sets have the same name, make sure every texture set has a unique name.

Lets go part two!

I honestly didn't encounter a lot of parts which use more than one model, but usually it doesn't change at all, like fuel tanks add end caps, I just use mesh =

Also I didn't even think of parts having different shaders, thanks for pointing out! I will need to check if everything's right

Edited by MrShelter
grammar
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...