generalshrooms

17 replies · posted

Question on rigging ridged objects attached to deformation

I'm trying to have these buttons behave realistically, but I can't seem to figure out how to do it.

How do I have the buttons accurately move in accordance with the deformation of the rest of the mesh without deforming the buttons themselves?

  • You have to make those buttons - one by one - a child of 3 vertices that are under need or close in the neighborhood of the button. Delete the bones.

    If you parent only 1 vertex the button will not stay aligned during deformation with the mesh, therefore you need 3.

    • Is this the only method? I should have mentioned that this is a game asset and I'm trying to keep the mesh as a single object. Does vertex parenting work in Unity?

  • Don't know Unity.

    What do you mean by keeping the mesh as a single object ? Are the buttons and the vest one object ? If so, you will have to do some weight painting.

    • Same object, separate meshes. My goal was to keep all meshes in one object. But if there are no other options then separating each button is no big deal.

  • In that case, keep the bones and give the buttons a weight paint of 1 to the corresponding bone so they do not deform.

    But how do you manage to keep the bones in place ? You can make vertices parent of the bones, don’t know if that is possible since the mesh usually already is a child of the rig. Never done that before.

  • Just a follow up. Vertex parenting does not work in Unity. I found a Unity addon called MegaFiers that will give me the results I'm looking for, but it cost $150. A bit much for a one-off project so I'm still looking for other methods.

  • crew

    Hey ggeneralshrooms , like Dolores mentioned you could try making sure that every vertex of the button has a weight of 1 to the corresponding bone, and also double check that it has a weight of 0 for every other bone around it. 

    You can do this in edit mode instead of weight paint mode if you'd like, it might make it easier: 

    • This method really doesn't work as there isn't a 1:1 bone to parent too. This would be easy for something like a shoulder pad, where I could do as you mention and the shoulder pad bone would easily be parented to the shoulder bone.

      With these 7 buttons, I can have them weighted at 100% to their closest bones (of which there are 3)but they quickly offset from their intended position on the deforming mesh.

  • crew

    I'm not quite sure I understand what you're asking. Are the buttons not part of the clothing the character has? is the clothing attached to the player mesh? Maybe you can post a video of what you're seeing and possibly an example of something you're trying to replicate. 

    • This is what I'm looking for. I achieved this with vertex parenting but this is not a valid option as it does not translate to Unity. https://streamable.com/wsxgh

      Here's a quick mock up of the issue. https://streamable.com/g27pu

      I colorized it so you could see how the "buttons" deviate from their intended position.


      It's clear to me that the rig is the issue but I don't know how to structure it. Do I need 7 spine bones with linear horizontal weights to match the buttons? example: https://streamable.com/5wnqu

      This seams like a poor way of doing this.

      Any advice is appreciated. 

  • crew

    Have you tried it in Unity? I don't think I've ever had issues with an object like that not working in Unity. If the buttons are attached to the mesh of the character it'll deform with the rest of the character. If the buttons are separate I can see how they would deviate. 

    If you have the model as shown in the first link ready to be used in Unity I can take a look at it and see if it has issues. 

    • Thank you! And yes, I've tried this in Unity. Regardless of their origin points, the buttons end up near the feet of the mesh.

      It's not finished and still has a bunch of issues but it should be complete enough to make a decent assessment.


      http://pasteall.org/blend/index.php?id=49346

    • crew

      ggeneralshrooms Ok I looked at the model, I don't know why the buttons are separate pieces from the rest of the clothing. Like others mentioned these don't need to have their own bones unless they need to be moved independently of each other. If you want it to deform with the rest of the body then they should be combined as part of the rest of the body. I removed all the bones from the body and also joined all the buttons to the rest of the mesh. I tried to use this in Unity but it doesn't look like the mesh and rig were combined so the rig and mesh appear separate: 


      Here I'm trying to test the muscle settings in Unity and the rig is separate from the mesh. Typically when trying to adjust these settings the entire character will be deformed in this state. Also tried it as a generic rig and it didn't work either. 

    • I don't want the buttons to deform with the body, I want them to track to the body with 0 deformation. If I only weight the buttons to the spine bones , I either have buttons that deform or buttons that don't track (or some blend of the two)

    • crew

      ggeneralshrooms Oh I see. Well in that case you could make the buttons a child of the mesh but keep them separate. I noticed in the blend file they were separate but not a child of anything so they would essentially stay in place regardless since nothing else is forcing them to move. You can do this in Blender or in Unity. Bones still wouldn't be needed for the buttons since you're not animating them in any way independently. 

    • jgonzalez That's odd because this is how I uploaded it.
       The buttons are children of the bones, the bones are children of proximate vertices on the body mesh. I included the  "middle man bones" because I though it was necessary to work in Unity. The vertex parenting works fine in Blender but not at all in Unity. Which leads back to my original issue. How do I set up a rig for Unity that allows each button to track to it's correct location in accordance of the body mesh's deformations.

      This addon seems to do the trick but I'm not willing to purchases it for this project alone.  This leads me to believe it can only be done through scripts.

    • crew

      ggeneralshrooms Megafiers isn't going to help with this, I have that asset so I'm familiar with how it works. It isn't a scripting issue either, it's a rigging issue.  There are parts of your rig that are not part of a humanoid rig, but those don't have any issues because they're attached to the main rig. There are a few solutions to this.

      1. Keep the buttons as part of the mesh of the clothing (joined), and ensure proper weight painting is applied to those parts of the mesh so they deform properly. So if a bone in the body would bend in a way that would deform the button then adjust the weight painting to avoid this. This is my preferred method.

      2. Keep the bones on the buttons, but link them to the rest of the rig. The buttons fall to the ground in Unity because they're essentially floating bones. Similar to how you rigged the coattails, those are part of the main rig so should the buttons. I included an image below to show you what I see in Blender:

      I'm willing to bet if you unlinked the eye bones the eyes would fall to the ground in Unity as well.