Fr/Compiling a model: Difference between revisions
Line 24: | Line 24: | ||
== Creating a QC == | == Creating a QC == | ||
Un fichier QC est simplement un fichier contenant du texte avec l'extension <code>.qc</code>. Vous pouvez le sauvgarder n'importe où, le nommer comme vous voulez, mais pour mieux être organisé, il est recommandé de placer le fichier QC dans le même dossier que les SMDs avec le même nom que les SMDs. | |||
Inside it should be a list of [[:Category:QC Commands|commands]] that tell studiomdl about the location of the model's various SMDs, where the compiled files should be written to (relative to VPROJECT), how to process animations, and potentially much, ''much'' more. You will find all known commands listed at [[:Category:QC Commands]]. | Inside it should be a list of [[:Category:QC Commands|commands]] that tell studiomdl about the location of the model's various SMDs, where the compiled files should be written to (relative to VPROJECT), how to process animations, and potentially much, ''much'' more. You will find all known commands listed at [[:Category:QC Commands]]. |
Revision as of 10:53, 13 July 2009
Les modèles ont besoin d'être compilés pour être utilisés dans Source. Trois éléments interviennent afin d'obtenir un model compilé :
- Plusieurs fichiers SMD decrivants le model. Voir Exporté un modèles pour plus d'informations.
- Un fichier texte QC qui définit comment seront interprétés les fichiers SMD lors de la compilation.
- Studiomdl, le programme fourni avec le SDK pour compiler vos models.
Mise en place
La seule étape que vous devez faire avant de compiler est de choisir le dossier VPROJECT actuel. Les models seront compilés dans le dossier du jeu choisi. Vous pouvez le configurer ainsi :
- Globalement, en selectionnant votre jeu\mod dans la liste de démmarage du SDK.
Template:Dictionary/Bug/fr:Ne fonctionne pas sous Studiomdl et les utilitaires en ligne de commandes à moins d'avoir les droits d'administrateur. [todo tested in ?]
- Pour Studiomdl seulement, en démarrant avec
-game "<chemin complet vers le dossier de votre gameinfo.txt>"
Astuce:La plupart des outils SDK acceptent
-game
.
Syntaxe intelligente
Editer un fichier devient beaucoup plus facile avec un éditeur de texte avancé avec support de la syntaxe. Il y a deux éditeurs avec support de la syntaxe pour les fichiers QC :
Creating a QC
Un fichier QC est simplement un fichier contenant du texte avec l'extension .qc
. Vous pouvez le sauvgarder n'importe où, le nommer comme vous voulez, mais pour mieux être organisé, il est recommandé de placer le fichier QC dans le même dossier que les SMDs avec le même nom que les SMDs.
Inside it should be a list of commands that tell studiomdl about the location of the model's various SMDs, where the compiled files should be written to (relative to VPROJECT), how to process animations, and potentially much, much more. You will find all known commands listed at Category:QC Commands.
Example
File locations
The default location for SMDs is the same folder as the QC file. You can access other locations:
Here is a very simple QC file for a solid model without any animation or special properties (click on each command for details):
$modelname "props_sdk\myfirstmodel.mdl" $body mybody "myfirstmodel-ref.smd" $staticprop $surfaceprop combine_metal $cdmaterials "models\props_sdk" $sequence idle "myfirstmodel-idle.smd" loop fps 15 $collisionmodel "myfirstmodel-phys.smd" { $concave }
You will be able to use this as a template to compile your own model, so swap in your own SMDs and see what happens.
Tutorials
- For physically-simulated objects, see
prop_data
- For characters or player models, see Compiling a character model
- For viewmodels, see Compiling a viewmodel
- For vehicles, see Compiling a vehicle model
- For general help with compiling models, see Category:QC Commands
Compiling
With your text editor
The easiest way to compile a model is with the built-in launch features of advanced text editors.
With a batch file
If you can't (or don't want to) use an advanced text editor, you will be compiling QCs by dragging them onto studiomdl in Windows. You can find the executable file in sourcesdk/bin/[orangebox|ep1]/bin/
.
The process will be easier if you create a .cmd file somewhere more accessible to automate it. This is simply a renamed .txt file containing something like this:
"%sourcesdk%/bin/orangebox/bin/studiomdl" "%1" pause
Drop your QC file onto the CMD as you would studiomdl itself; it's essentially a shortcut to the executable.
Common errors
Error opening <model>! (Check for write enable)
- Studiomdl won't create folders that don't exist; you must manually create a path to your .mdl before compiling.
Costly collision model
Duplicate weightlist pelvisonly
Short conversion out of range
WARNING: (4768124) : ERROR: 'EXCEPTION ACCESS VIOLATION' (assert: 1)
- If you receive
EXCEPTION_ACCESS_VIOLATION
without an error code, try compiling with HLMV running.
- If you receive
SDK samples
The SDK has numerous sample models, including several fully-articulated characters and players. They can be found at sourcesdk_content\<game>\modelsrc\
.
cstrike
- "Urban CT" player model
- Several static props
generic
- A tweaked ValveBiped rig (no meshes)
hl2
- Airboat and Buggy
- Antlion Guard
- Male citizen (only has a few animations)
- Some CS stuff that is probably a duplicate of
\cstrike
's content - Viewmodels for all HL2 weapons
hl2mp
- All with multiplayer animations only:
- Combine soldier
- Metrocop
- Male rebel
See also
- QC
- Category:QC Commands
- studiomdl
- Studiocompiler, a graphical interface for studiomdl
- GUIStudioMDL, another graphical interface
- Highlighting and Compiling QCs with ConTEXT
- Notepad++ VDF languages
Template:Otherlang:fr Template:Otherlang:fr:en Template:Otherlang:fr:ru