Phys models with blender?

NiklasU

L1: Registered
Apr 19, 2009
34
1
How can I create and export smd phys models out of blender, which are a bit more complicated than one big cube?
So how can I export combined cubes as a phys object?
For example: If I combine 2 blocks to form something like a 'L' and export it, I'll get a colision model looking like a triangle ... Oo
pls help me ...
 

Rexy

The Kwisatz Haderach
aa
Dec 22, 2008
1,798
2,533
For the most part, the general rule for all software is that each of the separate collision parts must actually be separate, whole, solid objects, with smoothing set to maximum*. Your 'L' example would make a triangle because the studiomdl compiler 'shrinkwraps' the .smd you give the .qc to use--it can't handle parts that are concave.

Instead, build the 'L' with 2 convex parts, 1 long for the 'L' stem, and another for the leg. Make sure none of these convex parts share verticies with each other. You may overlap them, but make sure they are indeed separate.

(*denotes that most softwares require a specific smoothing setting to export a working collision mesh .smd, 3ds max needs 1 grouping, lw needs 180 degree smoothing, XSI requires some bs that was no fun to deal with, http://developer.valvesoftware.com/wiki/Collision_mesh).

Having said that, it would awesome if someone with the know how would go step-by-step through the blender process for making collision meshes. I don't use blender, but if you follow the rules of convex pieces, you may be able to figure out the process yourself.
 
Feb 18, 2009
640
629
I know how to export Blender Phys objects. I might go over it in more detail in my tutorial on Blender for TF2 later, but here are the basics. Rexy has outlined the fundamentals so I'll just go over Blender specifically. Each smd you want to export must be a separate object in Blender, so when creating your phys model you need to make it one object or you'll only get part of it. Fortunately, as long as you keep each group of vertices in the object concave and separate, it will export and compile fine. So beck to the L example, The stem would be a cube that you've added in object mode and edited in edit mode, but to make the leg you need to add another cube in edit mode or add it in object mode and combine the 2 objects. Extruding the leg out will cause the compile to shrink wrap it into what you are seeing. You also need to add the command $concave to the $collisionmodel options in the qc, if it isn't there already.

tl;dr? You need to make a number of convex shapes within the object in order to stop shrink-wrapping being a problem. Add $concave to the qc file.
 

NiklasU

L1: Registered
Apr 19, 2009
34
1
I already used seperate objects and joined them in blender ... I think my problem was that I forgot to put $concave in my qc-file.
I'll try that out later ;) thx