1
$\begingroup$

Background

With Unity, I downloaded this asset (Unity Asset Store link) for a game I am doing. I decided to use the "Army1" soldier for my game, but I needed some animations.
After searching a bit on Google, I found that I needed Blender for doing them and to load the .fbx file on it for adding the rig necessary for models parts to move.

Blender work

When I loaded the model, it already had some bones on it, but those were for moving on a specific way, and did not allowed the model to move on more ways than that one pre-established.
Then, I deleted that rig and followed this (YouTube Rigify tutorial) to learn how to rig from scratch.

Problem

However, when I generated the rig (This is the .blend file), this error appeared:
Screenshot of error appearing just when rig generating button was pressed

Question

I have to say that I am very new to Blender, and a bit to Unity too. Any way I can solve this? Thanks in advance.

$\endgroup$
3
  • $\begingroup$ Perhaps if you can share your file in some way, I can have a look at this. It could numerous things that are causing an error $\endgroup$ Jun 24, 2019 at 23:47
  • $\begingroup$ I completely forgot, sry. I'll share it on a second $\endgroup$ Jun 25, 2019 at 0:49
  • $\begingroup$ Done @MarkJackson. It is just above the screenshot $\endgroup$ Jun 25, 2019 at 0:59

2 Answers 2

1
$\begingroup$

Ok, this was an easy fix.

1) Delete all modifiers on your Body mesh.

2) Click on your body to select it.

3) Shift+Click on your metarig to select that. (metarig and body should both be selected with the metarig being the active object)

4) Press Ctrl+P and select "With Automatic Weights". enter image description here

5) Go to Pose mode and you should be able to move your mesh around with the bones of your rig.

I guess you were trying to manually add an Armature modifier and missing the Ctrl+P part.

enter image description here

WEIGHT PAINTING

Automatic weights work quite well however to finalize the weighting of the armature to the skinned mesh, the weight painting mode can help you adjust and perfect the weighting of bone influence over the surrounding vertices.

enter image description here

Right-clicking on each bone will show you the area of its influence. Red = 1 (full influence) blue = 0 (no influence)

enter image description here

Left-clicking will paint the weights onto the skinned mesh. "F" increases/decreases the brush size. "Shift + F" increases/decreases the brush strength. enter image description here

Different brush types and brush settings can also be changed/adjusted in the Tool panel ("T")

enter image description here

$\endgroup$
6
  • $\begingroup$ Thanks! That worked! If I may ask, how can I avoid some vertices of the soldier not being affected by the rig? It happens, for example. while rotating to the sides the vertical bone placed between the 2 pockets on the soldier's chest. Should I better make another question on the forum for solving that? $\endgroup$ Jun 25, 2019 at 2:24
  • $\begingroup$ That has to do with weight painting. Perhaps I can edit my answer to further explain that. Weighting a mesh with automatic weights does a pretty good job but 90% of the time, you will need to make some changes with weight painting to clean up the weighting of the vertices to the bones. $\endgroup$ Jun 25, 2019 at 8:38
  • $\begingroup$ Sorry for removing the answer mark, but trying it further, I realized that after setting the rig with automatic weights, the error mentioned still appeared when generating rig $\endgroup$ Jun 25, 2019 at 12:08
  • $\begingroup$ Ok, I'm not sure what you're trying to do then. Perhaps what you wanted was to modify the rig from the rigify and transfer the weights across from the rigify rig to a new rig. I would suggest just editing the rigify rig and changing the bone names to be in conjunction with the Unity naming convention and try the parenting again, rather than duplicating the rig and trying to also parent the new rig. A mesh can only be weighted to one armature which also may be the reason for the error. Good luck with your project. dropbox.com/s/wkwcw55dv2rocc2/Soldier.blend?dl=0 $\endgroup$ Jun 25, 2019 at 13:19
  • $\begingroup$ I am trying to do what this guy does at 27:03: youtube.com/watch?v=WpgDjKIxYOA&t=1641s. Instead of generating everything that he has, the error shown in the screenshot on my question appeared $\endgroup$ Jun 25, 2019 at 15:08
1
$\begingroup$

Somehow, your metarig had become corrupted in some way. By deleting the rig and just starting again and being careful with positioning the bones, it should work as expected from the video tutorial that you were following.

***I believe the mistakes you made that could have corrupted were extruding the bones from the foot bone to make extra bones there which swapped the parenting around in a way that conflicted with the python scripting that comes with the Rigify addon.

There was also an elbow bone called Bone that had been created by mistake along the left arm. After trying to generate the rig and coming up with errors, the original metarig, even after undoing it, had become corrupted after that. It's always just better to start again with the rigging process if you suspect any corruption in an object. It saves time in the long run.***

enter image description here

$\endgroup$
1
  • 1
    $\begingroup$ Thanks for answering! I will try again as soon as I can and mark this as correct if it works $\endgroup$ Jun 28, 2019 at 14:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .