Как портировать модели в garry s mod

Обновлено: 02.07.2024

Есть у меня модель (импортировал из другой игры) с текстурами, готова к нему физическая модель и скелет!
Добавляю его в Гмод как НПС. Модель ходит, стреляет. но вот беда! анимация не воспроизводится!
Чтобы использовать стандартную анимацию нужен скелет ValveBiped.
Естественно у модели скелет другой (хотя очень схож).
Сначала я пытался в файлах ragdoll\psymodel\reference.smd (скелет\физическая модель и сама модель соответственно) переименовать кости.
За пример брал модель human\group01\female01
Пронумеровал кости и на основе их местоположения (рисунок в приложении)
Но половину вершин перепутал из-за незнания точных координат (я тупо переводил и по аналогии переименовывал под ValveBiped). десяток костей осталось нетронутыми, несколько не влезло. В результате при старте модель буквально завязана на пять узлов! Да, теперь анимация есть.

В общем, у меня вопрос!

Как полностью импортировать модель в ГМод?
Я вижу два варианта, но не знаю, как их реализовать:

1. Вставить в эту модель скелет ValveBiped и просто подогнать вершины под физическую модель, оставив её нетронутой.
Но как? Есть подозрение, что в этом мне поможет программа XNA Mod Tool + addon ValveSource, но как именно там делать, я пока не разобрался

2. Добавить вместе с моделью собственную анимацию под её родной скелет. Но мне кажется, это сложнее. И я даже не представляю, как это сделать.

New Materials

There can only be one recolorable part per material, or perhaps you want to make a certain part of a model transparent (such as a logo) without affecting the whole texture. Or maybe you want certain parts to have certain effects such as extra reflection. Whatever the reason, adding a material is actually easy.

Click on the plus button to add more materials or minus to remove the material. Assign sets the selected faces to the selected material, Select selects all faces that are assigned to the material, and Deselect deselects all faces that are assigned to the material.

Split Model

Want to make a wristband or a part of a map its own object? After selecting the parts you want to split in Edit Mode, hit P and select the first menu's option (separate by selection). Pressing L while hovering over a vertex will select connecting vertices, helping you select parts of the full object, but it's up to you to practice with selecting areas.

On the contrary, hitting Ctrl+J joins the selected objects.

Как портировать модели в garry s mod



Garry's Mod

28 мая в 14:05 does anyone know how to import mmd models to gmod?
or does someone know of a tutorial that can help me?
I would thank you a lot. Thanks 28 мая в 14:41

I know how to port models and there is a tutorial on youtube. basically once any model gets into blender you can port it. here is a playlist on porting models to sfm just change the crowbar output to gmod instead of sfm

28 мая в 14:41 I will also try to make a guide on it when I get the chance. 28 мая в 14:48 28 мая в 15:02 28 мая в 15:03

I know how to port models and there is a tutorial on youtube. basically once any model gets into blender you can port it. here is a playlist on porting models to sfm just change the crowbar output to gmod instead of sfm

SFM/GMod Porting Tutorial Part 1 (Models)

Do you want to learn how to port models but don't know how? Either because 3D modelling is daunting, you don't know how GMod or SFM works, or you don't know where to get the models in the first place? I hope this tutorial will help guide you through the process.

Please let me know if there are details in the porting tutorial that require more explanation. I'd love to make this as clear as I can for everybody and it's hard to do without remembering how it felt when this was all new (also admittedly pretty late as I write all this so I'm bound to have messed something up).

Tools

A major difficulty with porting is finding the required tools for importing, extracting, and converting, not to mention with free programs. Every tool required are included with links directing you to their source.
Blender (Steam version) is what we'll use. This is not a Blender tutorial though Blender tricks will be shared to help kick-start your modelling knowledge.
We're porting for SFM/Gmod so we'll use the Blender Source Tools. Its installation instructions are found on the website.
We're importing BFRES files so here's the Blender script to use. If you plan to port maps, you probably want to have the KCL importer as well for the collision model. The installation is similar to the Blender Source Tools so refer to its instructions as well.
Crowbar will be used as the model compiler (raw-asset to game-usable converter). There are other options for compilation but this one is the simplest, and can also act as a decompiler if necessary.

Note that you need a SZS extractor (Nintendo.exe) to retrieve the BFRES model from the model files. Just drag the SZS file onto the executable and the work will be done for you. Adding this executable to the Nintendo.exe parameter will allow you to import SZS files directly.

Flexes

Flexes are called "Shape Keys", and they are found in the Data tab.

Shape Keys by Tomato127

Add shape keys using the plus button and remove them using the minus button. The Basis shape key will be the first key added and is simply the default state. A flex can only be edited when its slider is at 1, in case you're experiencing odd issues unable to edit the model. Pressing the tack sets the selected shape key to 1 automatically, allowing you to sort through them and quickly edit as necessary.

Flexes can be whatever you want. The bust adjust slider is created by adding bumps to clothing using Sculpt Mode, for example.

Make sure the flex sliders are all set to 0 before compiling.

All you need is the center of the individual eyeballs, either the actual center of a sphere or the center of the sphere section, and the center point of the eyes as a compilation parameter later. I'm not too sure of easy ways to calculate this, but some models have eye bones and those positions should suffice.

More information are found on the wiki.

Model Import

Menu > Import BFRES. Find the file in the file search. Textures and bones can be imported, and animation support will be added soon. If you have Noesis, you can set its path in the parameter window within the User Preferences to unlock the DDS to TGA option. More information will be given in part 2 of the tutorial.

To view the textures on the models, it's recommended you use the DDS to TGA option as Blender has difficulty loading the DDS files. Textures will only appear in the Cycles Render option.

Model Manipulation


More often than not model manipulation is required for the model to work in a new format. The only one required for GMod and SFM is the maximum number of weight groups a vertex is allowed to be in, which is 3 (in other words every point can be influenced by 3 bones at most). This can be assured by entering Weight Paint mode and select Limit Total on the left menu.

Limit Total by Tomato127



This menu is on the left, in Weight Paint mode. Press T if it doesn't appear

You can leave this step until the very end, but make sure to remember to do it. If you receive a "Too many bone influences per vertex!" error during compilation, it means you forgot this step.

If you want to create models to merge onto the existing Inklings and Octolings, you need to import their bones, which can be done by decompiling the models using Crowbar.

Model Export


More often than not you need to group the model(s) with its skeleton. This allows you to work on multiple parts at once (such as for creating body groups) and choose the exported DMX's name. This is relatively simple to do: just select the models to group and hit New Group. Name the group as you please.

Now comes the exporting! The export function is unusually not placed in the export main menu, but rather as a property of the scene.

Export DMX by Tomato127

The Export Path can be wherever you want, and the default values should suffice for both SFM and GMod. I recommend the DMX format over the SMD format due to its more convenient and up-to-date features. When hitting Export, select the group you have created.

Compilation


Tired? This is the final step, so keep it up! To be able to use the model in-game, it must be compiled into a game-specific format. The compiler requires instructions on how to create a model; these instructions are stored in a QC file. A QC file is really just a text file with a different extension, so create a text file and rename its extension. Every line is a command (empty lines are allowed for organization). Here's a list of important commands:
$modelname path
The path to the exported model, relative to the models folder of the addon, including the mdl extension.
$body bodyname path
The path to the DMX file. There can be multiple of them, or none if they are all body groups (see below). Bodyname can be whatever you like.
$cdmaterials path
The path to the materials, relative to the materials folder of the addon. There can be multiple of them in case of shared resources. The path tends to be "models\" followed by the model path (without the mdl extension) by convention.
$sequence name file
An animation for the model. This is necessary even if there's no animation. I personally use "$sequence idle DMX file".

A list of VMTs for the model's alternate skins ("skin" is actually the name of the texture group but goes unused). The first texture name must be the name of the material within Blender.

A list of DMX files for each model of the body group, or "blank" for no models. The DMX names do not appear in GMod but they do in SFM.
$scale number

In the offset that the model's scaling should change, there's no need to re-import the DMX into Blender just to scale it up; it's simpler to change it here. Make sure this command comes before other commands or else they will not be scaled.

Inkling and gear scale is 4. NPC scale is 3. Scaling can vary from model to model so it's recommended to set the scale here instead of scaling inside Blender.

$model name dmx file .
eyeball name bone X Y Z texture diameter angle unused scale
extra options.
>
Use this instead of $body if you're doing NPCs with controllable eyes. XYZ is the sphere center coordinate for the eyeball (note that using $scale will not fix the XYZ coordinates!). You should read up the $model commands for more options.
$attachment name bone X Y Z

Special position relative to a particular bone, though this is mainly for the eyes. The name is "eyes" and they are normally attached to the head bone. Note that XYZ typed here should actually be X -Z Y of the eye center you calculated earlier.

Example
$modelname "test\folder\box.mdl"
$body body "inputmodel.dmx"
$sequence idle "inputmodel.dmx"
$cdmaterials "models\test\folder\box"
$cdmaterials "models\test\shared"
$texturegroup skin < "oak" >
< "dark_oak" >
>
$bodygroup Sticker blank
studio "Sticker.dmx"
>

Open up Crowbarand find the QC file. Select the game from the drop-down list and hit compile (the UI can be found here). It's that simple.

Note that the models won't have textures! Check out part 2 of the tutorial (link at the top of this page).

Physics collision

It's actually relatively easy: Just split the model and set the weight of each section to their corresponding bone to 1. Model pieces should not overlap to prevent collision glitches, and make sure each object's origin are the same by hitting Ctrl+A and applying location.

If you want to view collisions in GMod, type "vcollide_wireframe 1" in the console.

Туториал по портированию моделей


Это туториал по портированию моделей из игры, как Portal 2 L4D2 т.д. Так что нам понадобится несколько прог, чтобы открыть VPKs.
1. GCFScape (умение пользоваться)
2. VTFEdit
Теперь откройте в папку игры (диск/Portal2/portal2/) и ищите Pak01_dir (открыть его с помощью GCFScape). После того как вы его нашли, вы должны искать только models и materials (так как они отвечают за модели). После того, как вы нашли,переносим на рабочий стол. После того, как вы их перенсили их на рабочий стол перейдите к С:/Steam / SteamApps / UserSteam/ Garrysmod / Garrysmod (пиратка: C:/garry'smod/garysmod И переносите в нёё две папки (models и materials) в папку garrysmod.

Можно ещё также создать папку в addons и туда перенести папки materials и models.

Это для Portal 2.
Чтобы вызвать GLaDOS нужно прописать в консоли prop_dynamic_create npc/GLaDOS/glados_animation.mdl

Если у вас есть например: Easy Animation Tool,Henrys Animation Tool и т.п. Они могут подойти для некоторых моделей (модулей,ГЛаДОС и прочих)

Читайте также: