P3D Texture Swap Utility by Mike Schell
This utility will allow users to change the texture file assignments inside of an unencrypted P3D file.
The utility will accept texture file types of .paa, .pac, and .jpg. File name lengths are not important as this utility rewrites the .P3D file and it's boundries as necessary. Only MLOD .P3D files will work with this utility. You must use the “unpack-sqm” utility to unencrypt these files. The “unpack-sqm” utility and instructions for creating add-ons can be found at here. (note: this was the oldschool thinking before more information was gathered about P3D format).
I have done very minimal beta testng, and the file contains limited error handling. If you get an error or your P3D will not work in game, double check to ensure you followed the instructions below exactly as written. If this does not remedy the problem you can drop me an e-mail with a short description of your error/problem at: email@example.com. Enjoy.
I plan to add more features in the near future. If I can code a .PAA/.PAC parser I would like to add a preview pane and export texture option into the utility. Any help or suggestions you can offer with this project are welcome, you can contact me at the same address given earlier.
This tutorial assumes you have followed all precautions mentioned above.
Load up the P3D Texture Swap Utility and select “Open .P3D” from the File menu. Navigate to the P3D file you will be using as your template (P3D files are found in your Data3D folder) and select it. Depending on the size of the P3D file it may take a few seconds to open the file. Once the file is open you will see a list of texture files on the left hand side of the utility. This is a list of all the textures used in the P3D file.
Now that you know which textures are used in your P3D file you will need to create your own set of corresponding .JPG's for any textures you will be changing. If you need to know what the original .paa/.pac looks like (for sizing and placement reference) you can load it in OFP's breifing screen by some quick editing of the breifing file's HTML. Once you have your set of JPG replacement textures created move on…
If you've closed the P3D Texture Swap Utility, reopen it by performing step 1 again. Now, select one of the textures from the right hand list by clicking on the texture name. When you click the texture you will see it's name appear in the “Default File” textbox to the left of the texture list. Under this box is another textbox labeled “Replacement” and a small button with an ellipsis (“…”) on it. This textbox holds the replacement texture file's name. If you click on the “…” button a directory dialog will appear allowing you to navigate to and select your replacement texture. Once you have opened your replacement texture it's name will be displayed in the “Replacement” textbox.
Repeat this procedure for each texture you are changing and continue to the next step when you are finished.
This step is very important. Under the “Replacement” textbox is another textbox labeled “Texture Folder”. This textbox is used to define the folder where your textures will be found in your add-on. This textbox requires an entry.
Example: You have created an addon for a new version of the M16 rifle you have placed all the texture files for your addon in thesame folder as the other files for the addon. The folder is called “NewM16”. In this case the “Texture Folder” Textbox should read: “NewM16\” (without the quotes, but making sure to include the backslash).
If instead you have decided to organize your addon's files a little better by creating another folder inside your “NewM16” folder called “GunTextures” then your “Texture Folder” textbox should read “NewM16\GunTextures\” (again, without the quotes, but making sure to include the backslashes).
Whatever the folder set-up, ensure that the path structure you define here is the same path structure that you are using when you PDO the file. Otherwise the engine will not be able to find your textures.
You get the point. :)
Once you've swapped out all the textures you need to, and defined the “Texture Folder” field, you are ready to save. Select “Save .P3D” from the File menu and navigate to the desired save location. IMPORTANT: DO NOT SAVE THE P3D FILE OVER ITSELF (i.e. Overwrite). DOING SO WILL CORRUPT IT. (I'm too lazy to code a fix for this right now, heh).
Save the file and exit (The file may take a few seconds to save). If you haven't already setup the correct folder structure for your addon (defined in step 4) and move your texture files there.
Finish the addon, PBO, and enjoy.
If you are using a P3D file that you obtained by DePBOing an unofficial addon (i.e. not created by BIS) it is already in MLOD format, these can be loaded straight into the utility.
If you are not replacing some of the textures in the file it is not necessary to “redefine” the same .paa/.pac file in that textures “Replacement” field. A blank field will suffice.
Note that this util is very old, it comes with cumbersome EXE installer. We would say that this util is here for information purposes only, but if youre interested, download below.
Download p3dutil.rar - 2.6mb.