Convex Collision Meshes In Blender

So I’m making a modified version of a prop (a mirrored “table_l” desk) in Blender using Crowbar decompilations, and am having some problems with the collision model. I am for whatever reason not able to split it into convex parts properly, and the recompilation just produces a “shrink-wrap” collision which needless to say is effectively unusable for this highly concave prop. The ancient SDW tutorial describes a way to export multiple groups in one model file using a ‘set smooth’ tool, but this seems to have been removed from the new versions of Blender and all I can seem to do is export the collision mesh as multiple files which the compiler will not accept.

How to proceed?

If you have split the collision mesh into separate objects (and applied smooth shading to each of the objects individually), you must group them together before exporting. Simply select all the mesh objects (in Object Mode) and press Ctrl+G to group them together and name the group something like “table_r_static_phys”. You should now be able to export the group as “table_r_static_phys.smd”.

The Smooth tool is under the Edit heading in the Tools tab:

[attach=5789,none,170][/attach]

I’d also recommend making a copy of your collision mesh pieces and putting them in a separate layer before merging them, just in case something goes wrong or you need to adjust it later, which happens often, especially if you have a particularly complex (or small) model - and make sure that any given part of the collision pieces isn’t .5 units thick or less, because otherwise the compile tools will just ignore the $concave command and shrinkwrap it anyway.
Capture.PNG

Went through both of the above and got the same result as before. Notably, despite having scaled the model upward by a factor of 5 I am still getting “WARNING: Model has 2-dimensional geometry (less than 0.500 inches thick on any axis)!!!” errors, which makes me suspect that something else is going on with the model itself. Not sure what that would be, but I’ll keep looking.

EDIT: Recompiled with just the two largest mesh elements and it went fine, so I’m gonna add in convex sections one at a time and see which ones are causing the problem.

Got it to work by scaling the entire model up by a factor of ten instead of five and also changing the units in the export settings from feet to inches. I could probably do more tests to see which issue was actually responsible for the problem, but I’m just happy to see the back of this thing.

One possible source of error could be that you selected the wrong faces in the seam between adjoining pieces when separating the collision mesh pieces, causing the face normals in that part of the mesh to point inwards instead of outwards, with respect to the selected piece of the collision mesh. If you enable display of face normals you can check each piece of the collision mesh and verify that all the normals are pointing outwards. If any of the normals are pointing inwards, you can flip them using the Shading->Normals -> Flip Direction button in the Tool Shelf (after selecting the affected faces.)

[attach=5790,none,1352][/attach]

Founded in 2004, Leakfree.org became one of the first online communities dedicated to Valve’s Source engine development. It is more famously known for the formation of Black Mesa: Source under the 'Leakfree Modification Team' handle in September 2004.