Jump to content

MODEL{} command


Entropian

Recommended Posts

Hi,

I'm trying to figure out how the MODEL{} command that some mods (e.g. SXT) use in part creation works.  I've done a lot of searching around the forums and I can't seem to find any documentation on how this works.  Can somebody please explain it?

Thanks.

Edited by Entropian
Link to comment
Share on other sites

1 hour ago, Entropian said:

Hi,

I'm trying to figure out how the MODEL{} command that some mods (e.g. SXT) use in part creation works.  I've done a lot of searching around the forums and I can't seem to find any documentation on how this works.  Can somebody please explain it?

Thanks.

Here is some documentation:

https://wiki.kerbalspaceprogram.com/wiki/CFG_File_Documentation#Model_Parameters

 

Link to comment
Share on other sites

Thanks @Nightside, that looks useful but it doesn't completely answer my question.  I should have been clearer in the OP.

Quote

MODEL{} to reference Squad's textures and get a lot of 'bang for buck'

From SXT Continued's OP.  What I'm looking for is exactly how the textures are referenced.  Are they simply copy-pasted into another texture file, or is the command somehow remapping the textures to the part, or is something completely different happening that I'm not thinking of?

Link to comment
Share on other sites

19 minutes ago, Entropian said:

Thanks @Nightside, that looks useful but it doesn't completely answer my question.  I should have been clearer in the OP.

From SXT Continued's OP.  What I'm looking for is exactly how the textures are referenced.  Are they simply copy-pasted into another texture file, or is the command somehow remapping the textures to the part, or is something completely different happening that I'm not thinking of?

Instead of including textures in SXT Continued, the parts are design to reference Squad's textures.  The name of the texture and how it maps to the part is baked into the model file.  The MODEL{} syntax just includes the path to the texture file.

Link to comment
Share on other sites

23 minutes ago, Entropian said:

Thanks @Nightside, that looks useful but it doesn't completely answer my question.  I should have been clearer in the OP.

From SXT Continued's OP.  What I'm looking for is exactly how the textures are referenced.  Are they simply copy-pasted into another texture file, or is the command somehow remapping the textures to the part, or is something completely different happening that I'm not thinking of?

Most parts consist of 3 files. 

.mu - the 3d model of the part

.dds (or other image type) - the texture that is used on the model

.cfg - the "rules" of the part. 

 @Lack's wonderful work on SXT dates from when the game was severely RAM limited. Reusing Squad's textures saves a lot of loading time, and provides visual style  consistency between the mod and existing parts. The MODEL node points to the model and texture file, but the way that texture is wrapped around the 3d model is determined in the .mu file itself.

If you are looking to do something similar you will have to work with 3D modeling software.

Link to comment
Share on other sites

2 minutes ago, Entropian said:

Thanks for your answers @Tonka Crash and @Nightside.  So the .mu can reference multiple textures and objects?  If not, how does the UV map of the object align with the texture?  I know my way around a few 3D modeling software products.

Yes the texture is placed/aligned/wrapped in the 3D software.

that’s about my limit on that subject, you can find more info in the add on development forum.

Link to comment
Share on other sites

If a model defines multiple textures, they can be replaced by a texture = line.  This is used in SXT for those cases where Squad deprecated some old parts.  Would be best to examine the ModuleManager.CacheFile to see the final results as the patches are not always easy to read

Edited by linuxgurugamer
Link to comment
Share on other sites

2 hours ago, Entropian said:

So the .mu can reference multiple textures and objects?  If not, how does the UV map of the object align with the texture?  I know my way around a few 3D modeling software products.

To add to Nightside's answer:
Yes, you can reference multiple textures in the .mu, usually, tho, you reference *one* texture, for each type. ie one diffuse, one emissive, one normalmap, one specular map, etc... *THEN* :

If you want to *permamently* switch a texture, you can edit the .mu file (either in the modelling program, or Unity, or directly, using a hex editor), to specify the new texture file.

If you want texture *switching*, in-game, there are several mods that can do it, as well as the "stock" method. The mods that can do it, can do moar, and offer moar functionailty along with the texture switching, than the "stock" method.
Using these mod/"stock" methods, generally do NOT require messing with the .mu file, and generally do not require messing around in a 3d modelling program or Unity. Switching can all be done via the said mods and config edits and/or ModuleManager patches.

I guess, if you want moar specific help/advice, moar detail on *exactly* what you want to accomplish would help. ;)

Because moar complicated texture switching, can lead you into different Materials and Shaders, and possibly having to switch those, too...
That takes a bit moar knowledge of the .mu/Unity format.

Edited by Stone Blue
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...