Jump to content

How to replace the texture of a model


Recommended Posts

Hi,

I'm working on updating the old mod Better Science Labs.

In advance, please understand that I know next to nothing about modeling and graphics.

I'm trying to take the model of the Mk2 Crew Cabin, and put the texture of the Large Crewed Lab over it instead of the crew cabin texture. See the code fragment below:


MODEL
{
model = Squad/Parts/Utility/mk2CrewCabin/model

// The following two lines work with the standard mesh scaled to 2x the height
// to match the size of the Large Crewed Lab
texture = Squad/Parts/Utility/mk2CrewCabin/mk2CrewCabin
scale = 1,2,1

// The following is what I'm trying to make work


// texture = Squad/Parts/Science/LargeCrewedLab/Large_Crewed_Lab
//scale = 1,1,1
}


mesh = model.mu
rescaleFactor = 1

node_stack_top = 0.0, 1.875, 0.0, 0.0, 1.0, 0.0
node_stack_bottom = 0.0, -1.875, 0.0, 0.0, -1.0, 0.0

The commented out code just doesn't work. I did some research, and it appears that there is something inside the model itself which is interfering with what I want to do.

So,

1. Is this something that I can do without too much problem? Can you provide instructions?

or

2. Is there someone who can help me with this?

Thanks in advance

LGG

Link to comment
Share on other sites

The code snippets you're showing are only part of what needs to happen.

The model has something that is referred to as "UV mapping" (the "U" and "V" were chosen since they're near X,Y,Z in the alphabet and additional letters were needed). The UV map is what maps each polygon in the model to a 2D area on the texture. This is different for every model. So the texture from one part almost always will not simply translate to another part, since they're all mapped differently and have different shapes to them.

So unfortunately, this won't work as a drop-in replacement. You'd have to edit and rearrange the texture to suit the mapping that the model expects. Or, you'd have to use both the model AND the texture from the part whose appearance you want to use.

Link to comment
Share on other sites

The code snippets you're showing are only part of what needs to happen.

The model has something that is referred to as "UV mapping" (the "U" and "V" were chosen since they're near X,Y,Z in the alphabet and additional letters were needed). The UV map is what maps each polygon in the model to a 2D area on the texture. This is different for every model. So the texture from one part almost always will not simply translate to another part, since they're all mapped differently and have different shapes to them.

So unfortunately, this won't work as a drop-in replacement. You'd have to edit and rearrange the texture to suit the mapping that the model expects. Or, you'd have to use both the model AND the texture from the part whose appearance you want to use.

I was afraid of this.

My skills are nonexistent in this area. Is there anyone who would be willing to help me out with this?

Thanks

LGG

Link to comment
Share on other sites

Choose something nice and simple.

Something like the FL-R25 RCS Fuel Tank. It's a simple shape and UV map.

All the files are in the folder ../GameData/Squad/Parts/FuelTank/RCSFuelTankR25/

Tricky bit: you need a texture editor that can load .dds files. There is a plugin for the GIMP, and that's all free. There are other options.

Make a copy of the folder and work on the copy. It's worth having your own personal ../GameData subfolder and even better to have a folder for working on files.

The file with the visible texture for that model is named model000.dds

You can change the rectangle to change the texture for the outside of the tank. It's like a sheet of paper that's wrapped around.

When you save the file as .dds, remember compression, and tell the editor prog to create the mipmaps

Best change the name and desription in the .cfg file. Put the revised set of files in a folder in your personal /GameData subfolder, start KSP, and it should be sitting there ready. Check how it looks.

Pay attention to the existing texture. I found that I had to do a vertical flip so that text came out right. That model has some text on the top and bottom of the tank, and you can see how that works out.

(I was making a combined RCS Tank and battery. The part.cfg changes are fairly simple, and I spent an hour or two making a distinctive texture. There's a trade-off between texture-size and detail. I tried to put in too much detail. It ended up looking like a blurred blob.)

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

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...