Pages: [1]
  Print  
Author Topic: Making a MDR model with Blender 2.66a  (Read 13252 times)
fromhell
Administrator
GET A LIFE!
**********

Cakes 35
Posts: 14520



WWW
« on: February 10, 2017, 07:28:08 PM »

NOTE: THIS TUTORIAL WILL NEED MORE CLARITY AND CORRECTIONS AND I WISH A PROGRAMMER COULD DRIVE BY AND WRITE A PROPER io_export_mdr.py ONCE AND FOR ALL

Tools you'll need:
- Blender 2.66a (or maybe a version that doesn't regress this pipeline. Only 2.66a is tested, you're on your own for later versions)
- Blender IQM export scripts
- Noesis (for turning the IQMs to MDR)

WHY MDR?
- Internal LODs (which we cannot produce at the moment)
- Compressed efficient prebaked skeletons
- Tags
- The format works without issues and doesn't suffer premature implementations

WHY NOT MD3?:
- MD3 takes up a lot of memory, and even more if you have LOD meshes
- MD3s have a higher chance of crashing the game.
- The Blender MD3 exporters are buggy and regress easily. The biggest bug right now is the lack of bounding box exports (leading to models disappearing easily around corners)

WHY NOT IQM?:
- Broken implementation
- Inefficient format for the target platforms and specs
- Lacks LOD and tag features
- IQM's use in this case is only for being a consistently-written-and-maintained skeletal exchange format that has no major Blender issues.

STEP 0: Do art, make model, etc.
Assuming you're an artist you already know how to do this. HOWEVER there are still guidelines/limits you should be aware of:
- 1000 vertices per object/surface
- No more than vertex weights than 2 per vertex (IIRC)
- Triangles only
- There's a limit on surfaces usable.  OA3 models are stricter on this (if you're blending/animating nothing, stick to one texture/surface)

Assuming your model and skeleton are facing forward to the FRONT view and is scaled properly (TODO: put units of scale here, heights etc, floor unit)

STEP 1: Bind the model to a skeleton
This is required if you're making a model that uses tags or is animated at least.
IMPORTANT Note that YOU MUST HAVE YOUR FIRST ANIMATION FRAME BE YOUR BASE POSE otherwise you'll get messed up bones everywhere!

STEP 2: Make tags where appropriate

Since you will use IQM as an exchange format to MDR and it supports only bones, you'll need to make tags out of bones. To do this you must make single bones that have their tail towards the right while in the front view.

If you have a weapon, you have to make a tag_flash at the end of your weapon's muzzle or point. If your gun has a spinning component, add a tag_barrel.

If you have a player, you must have tag_torso on your lower (legs/waist/hips) armature, a tag_weapon in the hand of your upper armature (torso/arms/neck) and a tag_head on the neck of your upper armature.

If you've used Rigify with your player model, you must name these tags with a DEF- prefix, as well as duplicating these tag bones with an ORG- prefix to allow the de-rigify button to export them.

STEP 3: Name your object and material appropriately

The IQM exporter can export srufaces based on object names with their assigned skin based on material names. For everything that isn't a player a material name is required for the skin path.  For a player it's okay to have the material named "null" to avoid additional unneccessary skin loading as the game code reads .skin files and assigns textures automatically.

STEP 4: Apply modifiers and export

If you have modifiers on your model already (i.e. Mirror, Sharp Edges, Triangulation) you'll have to apply them before exporting. DO NOT APPLY THE ARMATURE MODIFIER. Don't forget to Undo the applied modifiers changes immediately after doing so. The IQM export can't apply them automatically.


STEP 5: Convert to MDR

Using Noesis, a closed source tool of absolute swissarmyknife model format excellence you can use it to take our new IQM into a more game appropriate format
I'd advise writing a batch or script file to do this more conveniently.

The following block of code is my personal batch file for exporting a player model.
Code:
rem Process to MDR for skeletal animation and high poly model cache
\path\to\noesis.exe ?cmode upper.iqm temp_upperfx.iqm -bakeanimscale   -stripper -idxopt -idxsort  
\path\to\noesis.exe ?cmode temp_upperfx.iqm upper.mdr  -rotate 0 90 0  -stripper -idxopt -idxsort  -mdrbtag "tag_weapon;tag_weapon" -mdrbtag "tag_head;tag_head" -mdrbtag "tag_flag;tag_flag"
\path\to\noesis.exe ?cmode lower.iqm temp_lowerfx.iqm   -bakeanimscale  -stripper -idxopt -idxsort
\path\to\noesis.exe ?cmode temp_lowerfx.iqm lower.mdr  -stripper -idxopt  -rotate 0 90 0 -idxsort -mdrbtag "tag_torso;tag_torso"
\path\to\noesis.exe ?cmode head.iqm head.mdr  -stripper -idxopt -idxsort -bakeanimscale
\path\to\noesis.exe ?cmode headhi.iqm headhi.mdr  -stripper -idxopt -idxsort -bakeanimscale

headhi.iqm is a high detail head model with movable eyes. This is done for backwards compatiblity with legacy mods that do not support the eye system.

The reason for making an additional temp iqm is to bake scales and to get around some MDR exporting bugs.

STEP X: Players: Animation.cfg / Eyes.cfg
This is going to be hell to explain and teach i'll type this later. Not to mention there's additional (optional) animations in OA3 :\
« Last Edit: January 15, 2018, 02:53:37 PM by fromhell » Logged

asking when OA3 will be done won't get OA3 done.
Progress of OA3 currently occurs behind closed doors alone

I do not provide technical support either.

new code development on github
Pages: [1]
  Print  
 
Jump to: