Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

How to make a mesh not deform when animating?

Discussion in 'Animation' started by C10110, Nov 10, 2014.

  1. C10110

    C10110

    Joined:
    Jan 19, 2013
    Posts:
    55
    Hello all!

    I have a question about a way to go about making a character move a certain way in Unity. I wasn't sure if I should post here or the Blender forums, I thought I would try here first.

    So. You know how a humanoid mesh deforms as it moves after you rig it? Like, an arm will literally bend and or twist so that it looks organic. My question is: How do you go about deformation with *non* organic characters?

    I have a robot, and I don't want his metal arms and legs literally bending as he moves. Maybe I should take a look and see how Robot Kyle is rigged, just thought of that. But do you guys know what I mean? He should only be bending at the joints, the, for example, forearm shouldn't move or deform at all, if it's in theory solid metal.

    Any ideas? Thanks for your time.
     
  2. Mecanim-Dev

    Mecanim-Dev

    Unity Technologies

    Joined:
    Nov 26, 2012
    Posts:
    1,675
    Hi angelus,

    This is what we call rigid skinning, basically you only have one mesh per bone/transform, each mesh are deformed only by this bone/transform.
     
  3. C10110

    C10110

    Joined:
    Jan 19, 2013
    Posts:
    55
    Hey!

    I am so sorry, I haven't logged in awhile, been busy with learning and not having any problems for once haha. Thank you for the info! I'm glad it's a simple process. See you around the forums, and thanks for your time :)
     
  4. BBeck

    BBeck

    Joined:
    Jan 12, 2014
    Posts:
    57
    Rigid animation (as I suppose opposed to rigid skinning) "generally" doesn't use bones/armatures. I mean you can, but if you create an object mesh in blender and then create sub objects and "parent" them to the main object, because they are separate objects - they each will have their own transform even though no bones or armature has been created.

    I haven't tried to use such a model in blender but I've animated such models in other environments such as XNA. Generally the animation is done through code.

    What you want is probably skinned animation. I think the difference is in how you skin it, not in what type of animation to use. You could model a robot as a single mesh with skinned animation. As long as each vertex is 100% assigned (weighted) to ONE bone it is not going to stretch. A big part of skinning is assigning multiple bones to a vertex and then weighting the percentage of influence of each bone. That's what controls the stretch. If you set it to one bone for the weighting it will follow that bone very rigidly.

    Now to complicate this, if there is a shared triangle or face between two vertices in separate body parts the triangle or face is going to deform when the two vertices move away from one another. So, you're going to have to fix that. You could either put it in a spot where its hidden and not seen, or separate the two vertices. Or if the two vertices are close enough together it may be difficult to even see that a miniscule triangle is deforming.

    In that case, I might do something similar to rigid animation where I made each part a completely separate mesh. The difference here is that I would use bones. I would use an armature. In rigid animation, there's no armature but rather a parent-child relationship between meshes. For this, you don't need the parent-child relationship because the armature will hold the model together when its skinned and rigged. Likewise, the transforms of each mesh will be unused. The bones/armature become the transforms.

    Anyway, at that point you no longer have any connection between the two pieces. So there are no triangles to deform because there are no shared triangles.

    You could also have a single mesh and merely delete the triangles, but this might leave openings in the mesh which is generally frowned upon. You could probably draw new faces to cover up the openings and still have a single mesh. As long as the bones are weighted 100% to one piece, that piece will move rigidly.
     
    Last edited: Dec 7, 2014