PAC New Import Method

Status
Not open for further replies.

BlackDenim

Staffer
Staff member
PAC New Import Method
Thank you to Spoder for teaching me this!
Note: This method of importing models is a *better* way of importing and making PACs. The basic concept here is to only import untextured model files through a zip file into PAC, and then use 'material 3d' nested under the imported/untextured model to stream each .vtf texture for that model, one by one, from Dropbox to PAC. This drastically helps load times for people with lower-end PC's, or for large and complicated PACs, on servers where many PACs are being used. This also gives you far, far more control over every single texture for your imported models. This, when combined with the "PAC Texture Downscaling Guide" makes it incredibly easy to add features to textures, update them quickly, and generally keep your PACs organized in such a way that makes them easy to manipulate, and easy to access. This takes a little bit of extra work and can be tedious sometimes, but once you do it a few times, you'll be good. It's definitely worth it, because this is, relatively speaking, the best way to optimize your PAC, and allows you to get much much more out of PAC, without worrying about file-size limits.




1. Preparation
a. Get/install Dropbox.
b. Prepare your PAC file structure.
1. Make a new folder in Dropbox called "PAC Characters"
2. Under that folder, add a folder named your character's name.
3. Add a new folder, for this specific import. (Example: I add each outfit/part as a new sub-folder, under my character folder.)


4. Within that sub-folder, make a folder called "materials to import."​
c. Set up/gather your workshop add-on​
1. This guide assumes that you've already found a workshop addon that has a model that you want to use.​
2. Open up your addons folder.​
3. Make sure that the GMA files (The compressed workshop addon file format, Garry'sModAddon) is set to always open up with GMAD.exe.​
4. Once that's all set up, simply double-click the addon gma file, and it should open up a quick command prompt window, and extract everything into a folder, named the same as the workshop gma file, in the addons folder. This will always extract the contents of the gma directly to a new folder, in whatever folder the gma is already in.​
5. This guide assumes that you know exactly which model you want to use - usually what I do, is test out the models in PAC from their workshop addon, before I decide to decompile it. Open up both your Dropbox folder for the imported model/texture, and the workshop addon, so you can move some things around, easily.​
6. As an example, I've made a new folder in my Ni Tyoko character folder, called "cute scarf," and i've navigated to where the actual, untextured models for the scarf is. Pull only the model files out (You need every single one! Sometimes this is trial-and-error!) and place it inside of that folder you made, for the new outfit/model.​
7. Inside of the new outfit/model Dropbox folder, make or open the "materials to import" folder.​
8. Now, you need to navigate to where the materials for the model that you're importing, is. It should usually have the same modelpath as the model itself, except inside of the materials folder, of that addon that you decompiled into a folder. Just drag all of the proper materials (Sometimes this is a trial-and-error process!) from the decompiled workshop folder, into your "materials to import" folder.​
9. Go back to the Dropbox folder where the models and materials are kept, and highlight all of those model files, right-click, and add it to an archive.​
10. Turn it all into a .ZIP file, with the compression set to "STORE." It has to be exactly like this, for it to work.​



11. Now, you can get rid of the un-zipped model files, to keep your folders clean. Now, your folder structures are all set-up, and prepared to be imported, into PAC.




1. Importing The Model Files
a. Open up Garry's Mod, and get into PAC.​
b. Right-click on your model zip file, and "Copy Dropbox Link."​

c. In your PAC, you should organize things like so, to make it as easy as possible for yourself:​
1. Add an group called "SkeletonAnim" (This is the group that controls your root skeleton, which controls your animations, that's what being set to a character model by an admin controls, this is why we use the base half-life 2 characters for animations.)​
2. After adding the entity under the SkeletonAnims group, make sure that HIDE ENTITY is set to TRUE.​
3. Add another group, call this one something such as the name of the part of the character (head, torso, legs, hands, whatever)​
a. Add a MODEL2 (Experimental Model) inside of that group.​
b. Paste your dropbox link into the model-path for that new model2, and make sure the "dl=0" at the end of the paste link, is changed to "dl=1." After hitting enter, this will load your untextured model into PAC.​
c. You'll wind up with your UNTEXTURED model. If this is a model that's meant to be bone-merged, then set "BONE MERGE" to TRUE. If not, adjust the model into place correctly, depending on where it's supposed to go. If this model is meant to "follow" another part of a model, like if this is a pair of glasses, or a hat, or some sort of accessory - make sure that you set this model's "PARENT NAME" to be the bone that you want to follow, such as Head, or Neck. Sometimes, the bones aren't labelled properly, so this might take some trial and error. Just make sure that the model is "parented" to the correct bone on the model, or else the model won't move correctly, with the part of the body that it's mean to be on. "PARENT NAME" is right below "BONE MERGE."​
 

BlackDenim

Staffer
Staff member
3. Importing The Textures Properly
a. Nested under your imported model, add in a "MATERIAL 3D."



b. When you add the MATERIAL 3D, by default it will automatically target "all" which means that every texture on the model is being targeted. By default, it will show up as a blank, reflective, metallic-like surface. But, what you want to do first, is to change the "MATERIAL OVERRIDE." This allows you to select what specific texture that you wish to target.



c. To get a feel for what texture names listed in the window control what texture on the model, simply click on a few different ones. This will make each specific texture appear that weird, blank, reflective texture, and gives you a good idea of what each one does. In this example, I only have one texture to choose from, but on other models, you may have 5, 10, 20, 30 or more. This includes all of the textures for any bodygroups that come with the model, as well.
d. Once you've selected the specific texture that you need to override, go back to your Dropbox folder, and go inside of the "materials to import" sub-folder. Usually, the texture name in the MaterialOverride window should be the same, or very very similar to the file-name of the VTF file in your dropbox folder.



e. Right-click the VTF file, and press "Copy Dropbox Link."
f. Paste that copied link into the BASE TEXTURE path, with the dl=0 swapped to dl=1. Press enter, and it will stream the texture onto the model.



g. Now, you'll notice that the model will be all weird and shiny, and generally look like plastic. For every MATERIAL 3D you add, you have to scroll down to the "Environment Mask," and remove the file that is in the Environment Mask panel - by default, it's always the Kleiner's Lab reflection file. Just delete it.





h. Now, you have the base-texture loaded into the PAC, via MATERIAL 3D, under the imported model. This is technically, all you need to do, to get the textures working - HOWEVER, there are numerous other small things that you can do, to make this look much better. You don't *have* to - but you should. Keep in mind, you have to repeat this above process every single time you add another MATERIAL 3D. You have to copy the dropbox link to the texture, and stick it in the BASE TEXTURE path, and remove the ENVIRONMENT MASK, for every single MATERIAL 3D.

i. IMPORTANT: Each texture normally has multiple other textures that apply "over" it - this means that for every base texture, there is usually a LightMap/NormalMap - these are textures that look really blue, usually, and control the "depth" of the texture, or if it has wrinkles, adds shadows and lighting to a texture to make it look good. DetailMaps are sometimes included, and usually these are very small textures that show off the actual underlying detail of the texture, whether it's metal, or fabric, or something else. EnvironmentMasks control reflections. Sometimes imported models/textures have all of these textures included, and sometimes they don't, this is how you can tell:

Base Textures - Sometimes called "Diffuse," files sometimes end in _diff, or _d.
Light Maps - Sometimes called "normal maps", files sometimes end in _n or _norm or _normal or _light, or _l.
Environment Mask - sometimes called "cubemaps," or "reflections," files sometimes end in _cube, or _reflection.
Ambient Occlusion - Used for processing the shading from ambient light, sometimes involved with Light Maps, not every model has on, but usually has _ao at the end of the file.

The most important ones to remember are the BASE TEXTURE, and the LIGHT/NORMAL MAPS. MATERIAL 3D doesn't always have a space for every single texture included with a model. Sometimes, they're named really cryptically, and you have to use trial-and-error to test which ones go where. As long as you have the Base and the Light textures/maps, you'll be good. Don't forget to delete the default environment mask.




4. Importing the VMT file
a. This works the same exact way as base textures. Simply right-click the texture's VMT. It should be named the same as the VTF you were importing. Copy the dropbox link, and then paste it into the "VMT" path, at the top of the panels for the MATERIAL 3D you're adding. This will pull all of the data from the VMT file, and change the many many different settings of the MATERIAL 3D, to match it.





5. Importing the Light/Normal/Bump Maps
a. This works the same exact way as base textures. Look for the "_n/_norm/_normal/_light/_bump" VTF file which should be named the same way that your base texture was named. Copy the dropbox link to it, and then drop it into the "BUMP MAP" path. For this, I'm going to use a DIFFERENT file to show the example, because the scarf model doesn't have lightmaps.









Keep in mind, that you need to fill out a Material 3D for every texture that you're going to be using. In theory, this is essentially the same thing that an actual, packed gma mdl does, but you're doing it manually, and in PAC. However, this is the best way to keep PACs well organized, easy to edit/access, and is currently, the best way to optimize your PAC, without getting into Blender territory.
 
Status
Not open for further replies.

Keep us running!

Top Bottom