Editing models with a shared TPL - Son of Persia's tutorial
Apr 7, 2017 13:13:00 GMT 10
DeⓧiaZ, Son of Persia, and 3 more like this
Post by Mr.Curious on Apr 7, 2017 13:13:00 GMT 10
I noticed there is this awesome texture tutorial buried deep in another thread and thought it would be useful to have this handy tutorial available in plain sight, so here it is. All credit goes to the original author Son of Persia who has dedicated much of his time developing these awesome tools for us to mod RE4UHD. Thank you my friend for all you have contributed to this community!
A more recent explanation of the phenomenon of shared TPL files can be read in my BIN tool tutorial HERE.
Due to frequent problems/issues and requests I decided to post this mini tutorial for editing models with a shared TPL file.
As you might already know, in this game some models inside a UDAS archive use a shared TPL file for accessing textures.
A very common example is gloves/knife models that usually share TPL file with body model.
Thus if you update original TPL file when creating a new model, the other models that use the shared TPL file will access new/incorrect textures and that would be the source of problem.
To prevent this you have to :
1- Extract all models that share a TPL file.
2- Create/edit your new/custom model and export it to SMD/MTL formats.
3- Open original extracted MTL file(s) of (other) model(s) that share TPL file with your custom model in a text editor and copy/paste all of their content(if all of the original extracted MTL files are the same, copy the content of one of them, otherwise you must copy the content of all of them) to the end of MTL file of your custom model(the MTL file you exported after editing/creating your custom model).
4- You can also assign new textures to other model(s) that use shared TPL file and after exporting their SMD/MTL files, copy/paste the content of new custom MTL file(s)(if all of the new MTL files are the same, copy the content of one of them, otherwise you must copy the content of all of them) to the end of your custom model's MTL file(instead of using original extracted MTL files like step 3).
5- Generate your custom model's BIN and TPL files using BIN generator tool.
6- Now it's time to generate new/updated BIN model files for the models that use a shared TPL file with your custom model. To do so you have two choices :
a- If you also assigned custom textures to these models, then must use a new generated SMD file in addition to main custom model's edited MTL file to generate new BIN files for them.
b- If not, just use original extracted SMD files of that models(inside extracted UDAS archive's folder) in addition to main custom model's edited MTL file to generate new BIN files for them.
7- Rename new, custom textures according to generated TCS file and copy all of them to model's texture pack and repack, then copy it to "ImagePack(HD)" folder(s) of RE4 UHD.
8- Since all models use a shared TPL file, you just need to use one of the generated TPL files(all new TPLs are the same now).
Just take the main custom model's one and copy it in addition to all new BIN files to UDAS archive's folder and repack, then copy it to "Em" folder of RE4 UHD.
Now it's example time, I know guys .
Let's assume we want to edit the body of pl0b model, that is ada's mercenaries model(like what that has been a pain in zero's ass)
So here is where we go :
1- We generate/edit a new custom model. For example we use ada's RE6 model and after assigning all of it's textures(including specular/bump/opacity maps), export it to SMD/MTL formats.
Remember to assign the textures correctly to the model. To check it out, after exporting custom MTL file :
a- All diffuse textures must have map_Kd prefix.
b- All specular textures must have map_Ks prefix.
c- All bump maps must have map_Bump prefix.
d- All opacity maps must have map_D prefix.
Let's say we have a model with all of the above types of textures, then in exported MTL file we must have :
newMTL ada_panty.dds
illum 2
Kd 0.800000 0.800000 0.800000
Ka 0.200000 0.200000 0.200000
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
Ns 0.000000
map_Kd ada_panty.dds
map_Ks ada_leg_specular_map.tga
map_Bump ada_leg_bump_map.tga
map_D ada_leg_opacity_map.tga
IMPORTANT NOTICE : If exported MTL file was not exactly like what I said, you must re assign textures to the model and re export a correct MTL file OR correct all texture prefixes in a text editor. Otherwise the model will not look like what you wanted/intended in game.
2- Since in this example we know that all gloves models use a shared TPL file with body model, we simply open one of the gloves original extracted MTL files in a text editor and copy all of it's content to the end of our custom MTL file generated in step 1.
3- Or we can import ALL gloves models into a 3D application, assign new custom textures to them and then export them all to SMD/MTL formats and then copy the contents of one of the new exported MTL files to the end of our custom MTL file generated in step 1.
NOTICE : If for example you have a knife model that also uses a shared TPL file with body model, you must also copy the content of it's(original/updated) MTL file to the end of custom MTL file generated in step 1.
4- Generate new BIN, TPL file for ALL gloves(and maybe knife) and custom body model using BIN generator tool. You must use custom body model's edited MTL file for all of them when using BIN generator tool.
for example you can type the following commands in BIN_Generate.bat file to run BIN generator tool.
RE4_UHD_BIN_Generator.exe pl0b_000.SMD pl0b_000.MTL 0100000b 35
RE4_UHD_BIN_Generator.exe pl0b_013.SMD pl0b_000.MTL 0100000b 35
RE4_UHD_BIN_Generator.exe pl0b_014.SMD pl0b_000.MTL 0100000b 35
RE4_UHD_BIN_Generator.exe pl0b_015.SMD pl0b_000.MTL 0100000b 35
RE4_UHD_BIN_Generator.exe pl0b_016.SMD pl0b_000.MTL 0100000b 35
RE4_UHD_BIN_Generator.exe pl0b_017.SMD pl0b_000.MTL 0100000b 35
pl0b_000.SMD is the custom body model and pl0b_013-17 are gloves models.
Remember if you assigned new textures to gloves, you must use new exported SMD's for generating new BIN files otherwise use original extracted SMD files of gloves inside UDAS archive folder.
5- Rename new generated pl0b_000.TPL file to pl0b_001.TPL and copy it in addition to all other generated BIN files to UDAS archive's folder and repack it.
6- Rename new, custom textures according to generated TCS file(s)(all generated TCS files must be the same) and copy all of them to model's texture pack and repack it.
Congratulations, after going through all these DAMN steps, finally you are done .
Finally you can enjoy your flawless port.
I very well understand that due to all of these steps/pains, It would be way too obvious that many modders simply leave importing custom models into RE4 UHD and stick with easier one's like RE4 2007, RE5, REV or RE6.
But it's what it is and you already have the required tools/knowledge to do it. It's your personal call to do it or not.
And I very well know it would be a complete pain in the ass .
A more recent explanation of the phenomenon of shared TPL files can be read in my BIN tool tutorial HERE.
Editing models with shared TPL
by Son of Persia
by Son of Persia
Due to frequent problems/issues and requests I decided to post this mini tutorial for editing models with a shared TPL file.
As you might already know, in this game some models inside a UDAS archive use a shared TPL file for accessing textures.
A very common example is gloves/knife models that usually share TPL file with body model.
Thus if you update original TPL file when creating a new model, the other models that use the shared TPL file will access new/incorrect textures and that would be the source of problem.
To prevent this you have to :
1- Extract all models that share a TPL file.
2- Create/edit your new/custom model and export it to SMD/MTL formats.
3- Open original extracted MTL file(s) of (other) model(s) that share TPL file with your custom model in a text editor and copy/paste all of their content(if all of the original extracted MTL files are the same, copy the content of one of them, otherwise you must copy the content of all of them) to the end of MTL file of your custom model(the MTL file you exported after editing/creating your custom model).
4- You can also assign new textures to other model(s) that use shared TPL file and after exporting their SMD/MTL files, copy/paste the content of new custom MTL file(s)(if all of the new MTL files are the same, copy the content of one of them, otherwise you must copy the content of all of them) to the end of your custom model's MTL file(instead of using original extracted MTL files like step 3).
5- Generate your custom model's BIN and TPL files using BIN generator tool.
6- Now it's time to generate new/updated BIN model files for the models that use a shared TPL file with your custom model. To do so you have two choices :
a- If you also assigned custom textures to these models, then must use a new generated SMD file in addition to main custom model's edited MTL file to generate new BIN files for them.
b- If not, just use original extracted SMD files of that models(inside extracted UDAS archive's folder) in addition to main custom model's edited MTL file to generate new BIN files for them.
7- Rename new, custom textures according to generated TCS file and copy all of them to model's texture pack and repack, then copy it to "ImagePack(HD)" folder(s) of RE4 UHD.
8- Since all models use a shared TPL file, you just need to use one of the generated TPL files(all new TPLs are the same now).
Just take the main custom model's one and copy it in addition to all new BIN files to UDAS archive's folder and repack, then copy it to "Em" folder of RE4 UHD.
Now it's example time, I know guys .
Let's assume we want to edit the body of pl0b model, that is ada's mercenaries model(like what that has been a pain in zero's ass)
So here is where we go :
1- We generate/edit a new custom model. For example we use ada's RE6 model and after assigning all of it's textures(including specular/bump/opacity maps), export it to SMD/MTL formats.
Remember to assign the textures correctly to the model. To check it out, after exporting custom MTL file :
a- All diffuse textures must have map_Kd prefix.
b- All specular textures must have map_Ks prefix.
c- All bump maps must have map_Bump prefix.
d- All opacity maps must have map_D prefix.
Let's say we have a model with all of the above types of textures, then in exported MTL file we must have :
newMTL ada_panty.dds
illum 2
Kd 0.800000 0.800000 0.800000
Ka 0.200000 0.200000 0.200000
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
Ns 0.000000
map_Kd ada_panty.dds
map_Ks ada_leg_specular_map.tga
map_Bump ada_leg_bump_map.tga
map_D ada_leg_opacity_map.tga
IMPORTANT NOTICE : If exported MTL file was not exactly like what I said, you must re assign textures to the model and re export a correct MTL file OR correct all texture prefixes in a text editor. Otherwise the model will not look like what you wanted/intended in game.
2- Since in this example we know that all gloves models use a shared TPL file with body model, we simply open one of the gloves original extracted MTL files in a text editor and copy all of it's content to the end of our custom MTL file generated in step 1.
3- Or we can import ALL gloves models into a 3D application, assign new custom textures to them and then export them all to SMD/MTL formats and then copy the contents of one of the new exported MTL files to the end of our custom MTL file generated in step 1.
NOTICE : If for example you have a knife model that also uses a shared TPL file with body model, you must also copy the content of it's(original/updated) MTL file to the end of custom MTL file generated in step 1.
4- Generate new BIN, TPL file for ALL gloves(and maybe knife) and custom body model using BIN generator tool. You must use custom body model's edited MTL file for all of them when using BIN generator tool.
for example you can type the following commands in BIN_Generate.bat file to run BIN generator tool.
RE4_UHD_BIN_Generator.exe pl0b_000.SMD pl0b_000.MTL 0100000b 35
RE4_UHD_BIN_Generator.exe pl0b_013.SMD pl0b_000.MTL 0100000b 35
RE4_UHD_BIN_Generator.exe pl0b_014.SMD pl0b_000.MTL 0100000b 35
RE4_UHD_BIN_Generator.exe pl0b_015.SMD pl0b_000.MTL 0100000b 35
RE4_UHD_BIN_Generator.exe pl0b_016.SMD pl0b_000.MTL 0100000b 35
RE4_UHD_BIN_Generator.exe pl0b_017.SMD pl0b_000.MTL 0100000b 35
pl0b_000.SMD is the custom body model and pl0b_013-17 are gloves models.
Remember if you assigned new textures to gloves, you must use new exported SMD's for generating new BIN files otherwise use original extracted SMD files of gloves inside UDAS archive folder.
5- Rename new generated pl0b_000.TPL file to pl0b_001.TPL and copy it in addition to all other generated BIN files to UDAS archive's folder and repack it.
6- Rename new, custom textures according to generated TCS file(s)(all generated TCS files must be the same) and copy all of them to model's texture pack and repack it.
Congratulations, after going through all these DAMN steps, finally you are done .
Finally you can enjoy your flawless port.
I very well understand that due to all of these steps/pains, It would be way too obvious that many modders simply leave importing custom models into RE4 UHD and stick with easier one's like RE4 2007, RE5, REV or RE6.
But it's what it is and you already have the required tools/knowledge to do it. It's your personal call to do it or not.
And I very well know it would be a complete pain in the ass .