Phys models with blender?

Discussion in 'Mapping Questions & Discussion' started by NiklasU, Aug 13, 2010.

  1. NiklasU

    NiklasU L1: Registered

    Messages:
    34
    Positive Ratings:
    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 ...
     
  2. Rexy

    aa Rexy The Kwisatz Haderach

    Messages:
    1,795
    Positive Ratings:
    2,367
    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.
     
  3. Mick-a-nator

    aa Mick-a-nator

    Messages:
    640
    Positive Ratings:
    314
    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.
     
    • Thanks Thanks x 1
  4. Tehrasha

    Tehrasha L3: Member

    Messages:
    115
    Positive Ratings:
    26
    DvonDrake tells how to add a physics mesh to your model at 07:50 into his Blender tutorial.

    http://www.youtube.com/watch?v=9RTTSACe_eI

    The only this he fails to mention is to use cubes and join them rather than extruding as you go. Apparently that can cause naughty things to happen.
     
  5. NiklasU

    NiklasU L1: Registered

    Messages:
    34
    Positive Ratings:
    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