When parenting an object to a bone, the object moves

So I’m working on a human model and tried rigging the face. Part of that is parenting the eyes to the head bone. At the beginning everything worked fine, but then I thought it was a good idea to try to use a mesh deform modifier to rig the face. Everything went wrong, I couldn’t get the eyes to move properly along anymore (do you know how this is done correctly or have any tips for rigging a face?). Finally, I just deleted the modifier and tried parenting the eyes again so they would move correctly (because currently they poke through the character mesh when rotating the head). But know this doesn’t work either. When I select the eye in object mode and then the head bone in pose mode and then hit “parent to bone”, the eye moves backwards. I know this is an origin problem (maybe?), because when I try to apply the location to the eye, it also moves, but in this case very far away. I just don’t get how this works. The origin is in the centre of mass in both eyes. Should they be one object? Should the origin be at a different place? But when I try to change the origin, the eye moves also. What did I do wrong here?
Additionally, the whole deform modifier fiasko totally messed up the materials of the eyes and lashes or something, it’s looking very weird now, and one eye looks somehow darker than the other now. I moved the deformer mesh away and set it to not render, but that problem wasn’t there before I created it. And I disabled the compositor. There’s an animation now, maybe that’s the issue? But I’m only rendering the frame zero.

If you could provide me an answer to any of those questions, I would be infinitely happy (:pray::pray::pray:) I’m craving for the slightest suggestion.

And tell me if you need more information or screenshots! The file size is too big to upload here.

The mesh deform doesn’t end up adjusting the eyes. If you want to include the eyes in the mesh deform, use an armature modifier on them instead of bone parenting, and either join to the face object, or give them a copy of the mesh deform.

If you don’t want them deforming, but want their center of rotation changing with the mesh deform, you have to create a non-rendering triangle at the origin that gets mesh deformed, then child-of your bone to that triangle. Or something like that. You have to use workarounds, and I haven’t experimented too much with it. (Or maybe just bludgeon the eyeball back into shape with a corrective smooth, that might work.)

Sometimes parent to bone doesn’t work great. Unparent eyes, keep transform; set skeleton to rest pose; then parent to bone relative.

Mesh deforms don’t mess with materials, although they probably have the possibility of reversing your normals. Setting a mesh deformer to not render doesn’t stop it from affecting your face; you need to mute the mesh deform modifier to do that. Moving the mesh deformer, in object mode, doesn’t do anything unless it’s a dynamic bind (although rotation and scaling transforms can screw it up, so keep your mesh deformer in the same space as your mesh object.)

1 Like

Hi Rainbow Queen,

I created the following notes to help illustrate one method of rigging an eyeball for animation. I don’t know if this exactly addresses all of your questions, but I hope this stand-alone demo illustrates some helpful information. I had also encountered issues with eyeballs jumping to another location when parenting to a bone. The method described below uses the 3d cursor to help control things better.

I’m working on a follow-up variant for you that includes the use of a lattice to deform an eyeball. As soon as I’m done creating those screenshots, I’ll add that version as well. (UPDATE: Done. See next reply.) Adding a deformation lattice to the mix really gave me issues with eyeballs jumping around my scene. I agree it’s likely related to object origins and have a method that overcomes this issue as well. Meanwhile, I hope the following info helpful…

Simple eyeball rigging

NOTE: These notes use Rigify which is not enabled in Blender 2.81a by default. To enable Rigify, go to top menu bar > Edit > Preferences > Add-ons > Search “Rigify” > Check/enable “Rigging: Rigify”.

Delete the default cube.
Add Suzanne mesh.
Delete center eye vertex and the surrounding two loops to open up the eye socket.
Object Mode with nothing selected.
Add UV Sphere
r x 90 enter
s .2 enter
Position in eye socket. It won’t fit very well. This is just a quick demo.
In Edit Mode, select the forward most vertex and next ring or two and sink them back into the eyeball to create iris. This will help make it easier to see eye movement later.
Duplicate eye for other socket

eyeball tutorial 01.png

Select head and both eyeballs, g z 5 enter to lift everything up z-axis by 5 units. This just eases positioning with the rig we’re about to add.

Object mode with nothing selected.Add > Armature > Human meta-rig
While still in object mode, scale body up to match necks
Switching to Edit mode, select all bones above the neck and scale them out to align with the eyeballs. Try to align the base of the eyeball bone to (roughly) the center of the eyeball orb. It doesn’t need to be perfect, we’ll use the cursor to fine tune later.
Don’t worry about legs, torso, arms, mouth, ears or anything else. We’re just focused on the eyeballs for this example.

eyeball tutorial 02.png

Return to Object Mode with the armature selected.
Object Data Properties (running human icon) > click Generate Rig button.
NOTE: If this option is unavailable, it means the Rigify add-on hasn’t been enabled. Go to top menu bar > Edit > Preferences > Add-ons > Search “Rigify” > Check/enable “Rigging: Rigify”.
Use Rigify button to “Generate Rig”. The pointer might not immediately switch to hourglass/wait indicator, but be patient. This may take a few moments.

eyeball tutorial 03.png

The fancy rig will be really small. Scale it up to align with the original armature.
Delete the original armature.

eyeball tutorial 04.png

Object mode, select eyeball, right click, Snap > Cursor to Selected
Select the fancy rig, enter Edit Mode.
Activate the Skeleton Layer for Mechanical bones (MCH labels) eye mechanics. I don’t know the proper term, but it’s the next-to-last layer on the 2nd row of layers. (See pic.)
Edit mode, Select base end ball of rig:MCH-eye.L (Easier to select the whole MCH-eye.L bone then shift de-select the small end ball out front -leaving only the base ball selected.)
Right click > Snap > Selection to Cursor
Remember, the cursor should still be at the center of the eyeball orb.

eyeball tutorial 05.png

Object mode, select eyeball first, Shift-select rig second, Pose Mode, select MCH-eye.L (the whole bone), Ctrl+P > Bone.

eyeball tutorial 06.png

Return to Object Mode, de-select everything
Select the fancy rig, activate the Face Layer. This is the first layer on the 1st row of layers. It can also be accessed by pressing “n” to bring up the slide-in “Rig Layers” menu and selecting “Face”.
With the rig still selected, Enter Pose Mode.
Select the eyeball control circle, grab it with “g” and move it around. the corresponding eyeball should follow the eyeball target circle.

eyeball tutorial 07.png

Repeat for other eyeball and you can use the goggle-shaped “Eyes” control to control both eyes at once.

Hi again,

Finished up the screenshots to help illustrate rigging an eyeball with a deformation lattice. I refer to this as a cartoon style eyeball, but this method could be used for realistic eyes as well. Most real eyeballs are not perfect orbs, and the lattice can help keep an eyeball from breaching the eye socket while moving around during an animation.

Cartoon eyeball rigging with a deformation lattice

NOTE: These notes are similar to process above, but include a few extra steps to support the use of a deformation lattice which may be useful for cartoon styled eyes.

Delete the default cube.
Add Suzanne mesh.
Delete center eye vertex and the surrounding two loops to open up the eye socket.
Object Mode with nothing selected.
Ensure cursor is snapped to World Origin. Right click in 3d view port > Snap > Cursor to World Origin.
Add UV Sphere
r x 90 enter
s .2 enter
Position in eye socket. It won’t fit very well. This is just a quick demo.
In Edit Mode, select the forward most vertex and next ring or two and sink them back into the eyeball to create iris. This will help make it easier to see eye movement later.
Duplicate eye for other socket
Select head and both eyeballs, g z 5 enter to lift everything up z-axis by 5 units. This just eases positioning with the rig we’re about to add.

Select eyeball, right click, Snap > Cursor to Selected
Add > Lattice (added at origin)

eyeball tutorial 08.png

Select lattice, right click, Snap > Selection to Cursor
While still in object mode, S .3 enter
Select eyeball, shift select lattice, Control + P > Lattice Deform
Select lattice, go to Object Data Properties > Increase Resolution U, V and W to 3

eyeball tutorial 08a.png

Select only the lattice and enter Edit Mode.
Adjust the vertices to deform the eyeball into the desired cartoon shape.
Object mode > reposition lattice (and therefore eyeball)

eyeball tutorial 09.png (I’ve hidden the right eyeball to reduce overlap confusion)

In object mode, test the eyeball’s deformation by selecting the eyeball and r, r, move mouse around.
The eyeball is rotating and deforming as expected
Control+Z any eyeball test rotations so the eyeball is pointing straight ahead.

Right click in 3d viewport > Snap > Cursor to world origin

Object mode with nothing selected. Add > Armature > Human meta-rig
While still in object mode, scale body up to match necks
Switching to Edit mode, select all bones above the neck and scale them out to align with the eyeballs. Try to align the base of the eyeball bone to (roughly) the center of the eyeball orb. It doesn’t need to be perfect, we’ll use the cursor to fine tune later.
Don’t worry about legs, torso, arms, mouth, ears or anything else. We’re just focused on the eyeballs for this example.

eyeball tutorial 10.png

Return to Object Mode with the armature selected.
Object Data Properties (running human icon) > click Generate Rig button.
NOTE: If this option is unavailable, it means the Rigify add-on hasn’t been enabled. Go to top menu bar > Edit > Preferences > Add-ons > Search “Rigify” > Check/enable “Rigging: Rigify”.
Use Rigify button to “Generate Rig”. The pointer might not immediately switch to hourglass/wait indicator, but be patient. This may take a few moments.

eyeball tutorial 11.png

The fancy rig will be really small. Scale it up to align with the original armature.
Delete the original armature.

eyeball tutorial 12.png

Object mode, select eyeball, right click, Snap > Cursor to Selected
Activate skeleton layer for eye mechanics
Edit mode, Select base end ball of rig:MCH-eye.L (Easier to select the whole bone then shift de-select the end ball out front.)
Right click > Snap > Selection to Cursor

eyeball tutorial 12a.png

Now it gets a little weird.
Select the fancy rig and activate the Torso layer. This is the 4th Skeleton Layer on the Object Data Properties tab. You can also press “n” in the 3d viewport and use the slide-in Rig Layers menu.

eyeball tutorial 13.png

Object mode, select lattice, Shift-select rig, Pose Mode, select “rig : head” bone, Ctrol+P > Bone.

eyeball tutorial 13a.png

Return to Object Mode.
Select the fancy rig and activate the MCH layer.
Object mode, select eyeball, Shift-select rig, Pose Mode, select MCH-eye.L, Ctrl+P > Bone.
Activate eye controls layer

eyeball tutorial 14.png

The eyeball shifted back into the head a little bit. Other times, the eyeball jumps off to some crazy location. I think it’s jumping to the point at which it was originally parented to the lattice. So, if I was working with the eyeball and deformation lattice off to the side somewhere then moved it into the head, that’s point in space where the eyeball leaps. That’s okay, because here’s the fix:

Object mode > select the eyeball > right click > snap selection to cursor (which was still at the earlier eyeball origin -where the bone base was snapped)
The eyeball seems to move back to where I’d want it.

eyeball tutorial 15.png

Return to Object Mode, de-select everything
Select the fancy rig, activate the Face Layer. This is the first layer on the 1st row of layers. It can also be accessed by pressing “n” to bring up the slide-in “Rig Layers” menu and selecting “Face”.
With the rig still selected, Enter Pose Mode.
Select the eyeball control circle, grab it with “g” and move it around. the corresponding eyeball should follow the eyeball target circle while deforming inside the lattice and remaining properly in the eye socket.

eyeball tutorial 16.png

Thank you so much for answering! :blush: When you say “triangle”, what does that mean? An empty or simpley some sort of mesh that’s set not to render or something else? And “child-of the bone to that triangle”, does that mean parent the triangle to the bone? (I’m not a native speaker and sometimes have problems with the language, and I’m also a beginner at 3D and am not so familiar with all the terms yet :slightly_smiling_face:)

Sometimes parent to bone doesn’t work great. Unparent eyes, keep transform; set skeleton to rest pose; then parent to bone relative.

I did that, but the eye still jumped around …

Mesh deforms don’t mess with materials, although they probably have the possibility of reversing your normals.

I checked the normals, they’re fine. But I found out that the problem lies with the second eye layer (that had a glass shader), it isn’t the shader itself though, no matter what shader I put there, it looks very weird. I found that out by separating those pieces and set the outer piece to not render (the inner eye looked fine). Should I separate those two eye pieces? But it worked fine before, I don’t understand what the problem is …

Setting a mesh deformer to not render doesn’t stop it from affecting your face; you need to mute the mesh deform modifier to do that. Moving the mesh deformer, in object mode, doesn’t do anything unless it’s a dynamic bind (although rotation and scaling transforms can screw it up, so keep your mesh deformer in the same space as your mesh object.)

I already disabled it everywhere before moving it away, I simpley didn’t delete it in case I wanted to try the modifier at a later date.

Thanks again for helping :blush:

Thank you so much for your effort! :blush: I tried both methods. In the first one, the eye still moved a bit out of the socket, was that normal or did I do something wrong? The lattice method gave the desired effect, so I might chose that method. But if I want to animate the whole face in addition to the eyes, how would I parent the mesh to the fancy rig? Just with automatic weights?

1 Like

A mesh set not to render, so that you can deform it with a mesh deform modifier.

No, the other way around. Use a constraint so that the bone can copy the position of the non-rendering triangle, so that it rotates around a mesh-deformed position.

Well, you can always snap cursor to selection, parent, snap selection to cursor. Might require rotation (could use constraints to do that if you need it perfect and it’s off-axis.) Suppose there’s the potential for skew (inherited non-uniform scale) to screw things up too-- you don’t want skew on anything while rigging, you don’t want any unapplied scale whatsoever.

Sounds like a material question, but I’d have to see a file to tell you more.

Thank you so much for your effort!

You’re welcome! :slightly_smiling_face:

I tried both methods. In the first one, the eye still moved a bit out of the socket, was that normal or did I do something wrong?

I have not experienced eye movement using the first method, but perhaps the same corrective step used in the second example will correct the issue. Select the base ball of the MCH-eye bone, right click > snap cursor to selection, select the eyeball, right click > snap selection to cursor.

The lattice method gave the desired effect, so I might chose that method.

Still learning this stuff myself, but having the eyeball contained within a deformation lattice seems like a more predictable solution.

But if I want to animate the whole face in addition to the eyes, how would I parent the mesh to the fancy rig? Just with automatic weights?

In Object Mode, Select the character mesh first, Shift + select the rig second, Control + P > Set Parent To > Armature Deform > With Automatic Weights. While the automatic weights is a good starting point, I’ve found a need to do some weight painting cleanup in some areas to refine the behavior I prefer. For example, some of the torso bones seem to influence a much broader area than I would expect.