Jump to content

PAC4 Experimental Models guide/help thread


Recommended Posts

This thread will be about some of the things I've found around importing experimental models (aka higher quality, low impact models that sometimes bonemerge and contain bodygroups) into PAC.

It will also go over some of the basics for the files contained within addons, and how you might be able to reduce filesizes for your imports.

 

 

First, we'll go over some file types.

 

.vmt

A .vmt is a Valve Material.. Texture?, it isn't really a texture, rather it's a text file that directs some of the advanced options for textures such as bumpmaps, normal maps, reflections etc.

A .vmt is useful for when you're preparing to import a single model from an addon that had multiple models in it. This is because a .vmt will often refer to a number of textures that it calls for

A .mdl file does not generally call directly to a .vft (the normal texture files that -are- actually textures), but rather calls for a .vmt file that then adds multiple textures onto the one piece of the model with advanced texture settings applied.

This means that when you want just a single model from an addon that has multiple models (and thus unnecessary, unused textures that just add filesize), you can use a .vmt to help determine which textures are and aren't necessary for the model you want.

It's also useful to see -where- the textures are supposed to be. It'll show it as "models/assmunch/snaccgirl/face_n" for example. That means it wants to find a texture in "materials/models/assmuch/snaccgirl/" named "face_n.vtf"

 

.vtf

A .vtf is the standard valve texture file. These usually have a number of prefixes, such as "_n", "_d" and "_s"

These are "_normal" for normalmap, aka the bump map (effectively the same). They create the finer details and 'bumps' in the texture, so for example with a cracked wall with normal maps applied, the cracks will react to lighting more realistically, creating the illusion of depth on an otherwise flat surface by applying dynamic shadows depending on where the light is compared to the texture.

_specular for the specular map, aka the texture that directs how reflections are handled on the texture. For example if the model has glass or other highly reflective pieces on it, but you dont' want the -entire- texture to be as reflective as the one piece of glass, the specular map allows you to make only certain parts of a texture be reflective. It also helps to create look of wet or dirty textures.

And lastly, _diffuse map, which is the standard texture that you see on a model. Diffuse maps are the most important, as they're what adds the actual texture while _s and _n are only there to compliment the diffuse map.

 

Sometimes the files wont have any prefixes on them, often this is when there are only diffuse maps.

 

There are a few model files as well, but you really wont be messing with these other than when deleting unnecessary model files. Basically, anything that's named after the model you want, regardless of file type, you'll want. So if there's ass.mdl, ass.dx90 and ass.dx90.vtx, you want -all- of the files named "ass.whatever" to be present.

 

 

Now, organization. As far as I'm aware, you have to keep the original folder structure in your .zip, as mentioned in the vmt section.

So if the model you want to import was located in "models/munchkin/cats/" when you extracted the .gma, then that's where it has to be located in the .zip file you'll eventually upload and load into PAC.

 

 

Imported file type

PAC4's experimental models aren't just imported as folders, or any old compressed file. In fact, it -has- to be a .zip file, and it -has- to be an uncompressed .zip file. If it isn't a .zip or it isn't uncompressed, PAC will bitch and moan at you about how it can't load the model.

In order to make this specific requirement, I personally use 7zip. Once installed, I select both the models and materials folders, rightclick them and go "7zip > add to archive" or "add to file" or whatever it's called in english, then ensure the filetype is set to ".zip" in the popup that opens, and ensure the compression level (or whatever it's called) is set to none, or "save only" or whatever it's called in english.

I really should set the language to english on 7zip..

If both of these are set correctly, PAC will recognize it as a usable file.

 

Tools

I use VTFedit to open and export/import .vtf and .vmt files.

Once installed, you simply doubleclick a .vtf file to open it in vtfedit. You can then export the texture as a more common filetype like .jpg or .png which you can then edit in your photo editing tool of choice.

You can also click "import" and import a common filetype, like .jpg or .png, which will then allow you to make it into a .vtf file. Useful if you want a neat piece of equipment but that bright orange isn't quite your fashion style.

It will also open .vmt's and allow you to edit them like any normal text file. Useful if you want to check what textures are referenced, or if you want to edit what textures are referenced. Say, you don't want to bother with normal maps cos they're fucking 21mb per piece, you can remove the models dependency on said textures by editing them out of the .vmt so you can delete them from the .zip without PAC bitching about missing textures.

 

gmad.exe

In your common/garry's mod/bin/ folder (not to be confused with common/garry's mod/garry's mod/bin folder) there's an executable named "gmad.exe".

If you drag a .gma file (which is what the workshop addon files for Gmod are) onto gmad.exe, it will extract the contents of the .gma into a folder it creates with the same name as the .gma

So if you drag "mikuplayermodel.gma" onto gmad.exe, it will create a folder named "mikuplayermodel" with all the .gma's contents in your addons folder. (or wherever the .gma was located, which should be in your addons folder anyway)

 

 

Bonemerging

Bonemerging is unfortunately a relative uncommon thing for your model to be able to do.

This is because two main criteria have to be met for it to properly bonemerge onto your model.

First; It needs to have the correct bone names. The skeleton for your models have names, such as lefthand, finger11 etc. If the name for the left hand bone on your imported model isn't the same as the name for your playermodels left hand bone, it wont be able merge them together because it doesn't recognize that they're both left hands.

Basically, it reads the names of all the bones on your imported model and attempts to pair them with bones on your playermodel with matching bone names. If these aren't the same, they won't merge.

Second; If the -skeleton- is different, even if the names are the same, it will squish the imported model weirdly onto your playermodel.

For example, if the names are the same, but the spine1 bone on the imported model exists 2feet below where it exists on your playermodel, it will -raise- up the spine1 bone on the imported model to be where it is on your playermodel, and suddenly your torso is weirdly very tall on the import.

This -can- be fixed if you're importing -just- one model and all you want is a full body import. You do this by using PAC's 'bone' feature to edit the placement of the bones into correct locations. With enough fiddling, you can make it look natural.

 

 

 

Finally, What's the advantage?

Well, experimental models have a -much- more efficient rendertime compared to the old .obj imports. The rendertime for a single helmet .obj might be equal to that of an entire full-body experimental import, or even more. Not only that, but experimental imports retain their bodygroups (as is visible with the imported hairs I posted on the PAC Collective), and it retains the advanced textures so it will in general look better than any .obj import, while being less on the rendertime.

Also jigglebones such as on hair is still present.

It basically turns them into a standard gmod addon model, meaning anything you can do to a model in gmod with PAC you can do with the experimental import. Submaterials are also a thing.

 

 

Feel free to post questions and ask for help here, I'll try to assist with any issues or curiosities you may have.

  • Winner 1
Link to comment
  • Dark locked and pinned this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...