FantasyVader

How do I change a model's texture path?

Recommended Posts

I've not the foggiest idea how to get into an MDL or MDX file. I only have Blender and Clip Studio Modeler. I tried to get a plugin for Blender a while ago, but it was incompatible with whichever versions I tried. So it seems like I'm running on dreams here.

Any advice?

Share this post


Link to post
Share on other sites

Textures don't have a path specified in the model, only the filename. By default, vanilla textures are pulled from the appropriate ERF files in \TexturePacks\. However, any texture with the same name in the Override folder will, as the name suggests, override the vanilla texture. If you just want to replace the vanilla texture with an edited one, putting it in the Override is all you need to do.

If you want/need to change the filename, you have two options (well three if you include editing the model in Max/GMax or Blender, but you've ruled that out). You can decompile the model using either MDLEdit or MDLOps. The former will let you edit the name while the model is loaded into memory, the latter will require editing the exported ASCII model in a text editor (which you can also do via MDLEdit). Then the model would need to be recompiled. This is not particularly desirable for character models, because both tools have problems with losing the vanilla vertex normal (i.e. smoothing) data, which can result in shading errors, especially for head models. The other option is to edit the model in a hex editor and change the texture reference/s in the binary model directly. This has the benefit of not breaking the smoothing, since it doesn't alter anything else. Whichever route you go, you place the edited binary models into the Override, alongside your new texture.

Note that there may be additional options, depending on what exactly you are trying to do. In TSL for example, you can override a head texture assignment by editing heads.2da (K1 lacks this provision though). You should provide more information on your objective.

Share this post


Link to post
Share on other sites
11 hours ago, DarthParametric said:

If you want/need to change the filename, you have two options (well three if you include editing the model in Max/GMax or Blender, but you've ruled that out). You can decompile the model using either MDLEdit or MDLOps. The former will let you edit the name while the model is loaded into memory, the latter will require editing the exported ASCII model in a text editor (which you can also do via MDLEdit). Then the model would need to be recompiled. This is not particularly desirable for character models, because both tools have problems with losing the vanilla vertex normal (i.e. smoothing) data, which can result in shading errors, especially for head models. The other option is to edit the model in a hex editor and change the texture reference/s in the binary model directly. This has the benefit of not breaking the smoothing, since it doesn't alter anything else. Whichever route you go, you place the edited binary models into the Override, alongside your new texture.

Note that there may be additional options, depending on what exactly you are trying to do. In TSL for example, you can override a head texture assignment by editing heads.2da (K1 lacks this provision though). You should provide more information on your objective.

Hi, thanks for the response.

I'm particularly looking to change the texture reference for the flowing Revan model, since I was going to combine that with a mod that adds Star Forge robes with modified textures for personal use. Specifically, I'm using the TSL "Masked Revan Star Forge Robes Mod" as a base, since it includes both a disguise for the normal robes, and for a unique set of Star Forge robes. I'm new to modding, so I was looking for a close example to start.

Which program would you recommend for hex editing if that's the case?

Share this post


Link to post
Share on other sites

Since the player's version of the Revan robes has a unique slot in appearance.2da (the J slot), you shouldn't really need to do any model alteration. Assuming this is the mod by Grey_Ghost, a cursory glance at the description seems to indicate it doesn't touch the J models or textures, so you should be able to just duplicate his textures and rename them PMBJ01 for the DS variant and PMBJ02 for the LS variant. That's if you want to use them for the vanilla J models, which is how I interpret the above. If not, you need to provide more precise detail about what you want to do.

Share this post


Link to post
Share on other sites

Thank you for your patience.

From the mod, it had seemed like there were two different versions included: A Star Forge appearance and a Darth Revan appearance. Both with different textures. Likely because both model files had different texture paths.

Basically, I tried to rename, copy and replace the TSL Flowing Revan Robes for over the model that Grey_Ghost used. However, when I equip the sets of armor in game, they both share the same texture. I assume this is because they're identical files, so they are both redirected to N_DarthRevan01.tga. I want to use the Flowing Revan Robes, but I don't want both models to look identical.

I was hoping to find a way to fix that, and redirect the second robes file (Star Forge Model) to the correct texture again (N_StarForgeA01.tga).

I hope this makes sense.

Share this post


Link to post
Share on other sites

The DS robes just use the vanilla Revan texture, N_DarthRevan01. The LS robes use the texture added by the mod, N_StarForgeA01.

What exactly did you rename and replace? The models? You can restore the originals by copying the MDLs/MDXs from the mod's archive and pasting them into the Override folder.

Share this post


Link to post
Share on other sites

Yes, that's what I'm saying. I renamed the models from the flowing robes one, but they both use DS textures.

image.png.8d2f9e6e513e41131a988e49278800f2.png

I renamed the flowing robes model to match the LS model that the mod adds. It works, but the LS model doesn't use the custom texture.
I want to force it to load the custom texture rather than the DS N_DarthRevan01.

Edited by FantasyVader

Share this post


Link to post
Share on other sites

Simply changing a model's filename is bad practice. The model's internal OdysseyBase name will still retain its original name, and this can end up causing conflicts, since this is what the engine uses to instance models in a level.

As to the texture itself, the texture specified in the model is irrelevant in this case, since what texture is actually used in the game is determined by the appearance.2da entry, which overrides anything in the model. If you want the DS model to use the LS texture, you can either edit its appearance.2da row and change the texture specification from "N_DarthRevan" to "N_StarForgeA" (I believe it is using the RaceTex column), or you can simply make a copy of N_StarForgeA01 and rename it N_DarthRevan01.

Share this post


Link to post
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.

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.