# How to rotate an object arround own Z axis and arround another Object Z axis?

I am trying to animate the rotation of dancers , one in the center and 4 others arround a circle. The middle dancer rotates in the Z axis. The 4 others rotate also around their z axes and also around an orbite (imagin the movement of the sun and the planets around it).

For that I use 5 gears, 5 spindels and 5 dancers on the top. Using Parant, the rotation of Spindle 1 rotates the gear1 and dancer1. Using Constraint - Copy rotation - (Z axis), Gear 1 rotates Gears 2 to 5 (invers direction). Using Parant, Gears 2:5 rotate their corresponding spindles and dancers in z axis.

I would like to make the gears , spindels and dancers (2:5) move along the circumference of the circle as well.

I thought of adding a gear with inner teeth so that the model can be printed and functional later on.

I do not see how to produce the movement of dancers 2:5 around dancer 1 at the same time rotating around own z axes.

Thanks for help.

• Hello, could you please show some pictures? It would help to understand Jan 1, 2022 at 12:19
• Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
– Community Bot
Jan 1, 2022 at 14:48
• I think you are trying to reproduce the classic music box dancers. Usually the mechanism for this is hidden. Do you want to show the gears turning, or would the 4 dancers rotating around a center dancer and each rotating around the center dancer be enough? Jan 1, 2022 at 17:04
• Yes it is a music box with all five dancers rotating around their individual z axes. Jan 1, 2022 at 20:20
• The 4 lateral dancers are also moving along the radius made by the central and lateral gears. Jan 1, 2022 at 20:23

It appears you are trying to reproduce the classic music box dancers. Here's one way to do this:

I've used Suzanne as a stand in for your Dancers. The gears are from the Gears addon, and you can modify them to your choice. I've just made them all identical. Each Suzanne is a separate object, as is each gear.

There is one gear bone for each of the four outside gears. One Suzanne and one gear is parented to each of those bones.

The four gear bones are each connected by an axle bone to a rotator bone. The rotator bone is hard to see in the above image, but it is below the rig. Here's the armature in edit mode with everything else hidden:

The rotator bone is parented to the root bone. Rotating it on its local Y axis causes all of the other rotations, except perhaps the central Suzanne. More on her later. The rotator bone is set to YXZ Euler rotation and all other transforms than Y rotation are locked:

All four axle/gear combinations are identical, other than their orientations so I'll just describe axle and gear 0.

Each axle bone is parented to the Rotator bone, and connected.

Each gear bone is parented to the related axle bone, but not connected. Also, it does not inherit roation. Here are its Relations settings:

Each gear bone is set to XYZ rotation and all transforms but Y location are locked:

As you can see, each gear's Y rotation is driven. This is the mechanism that makes the rotation work. Here's the driver for one gear shown in the driver editor:

The driver is a scripted expression and the expression is rotation_euler*2 where rotation_euler, upon inspection, turns out to be the Y rotation of the rotator bone.

The multiplication by 2 is because of the gear ratio. I've set my gears to a 1:1 ratio, so that each outer gear rotates twice for a trip around the inner gear. You'll have to calculate a different ratio.

You can decide whether the central Suzanne rotates the same as the other Suzannes or not. If you parent it to the rotator bone, it will. If you want a different rotation, add another bone, parent it to that bone, and animate the new bone to achieve the rotation you want.

and here's the blend file:

• Thank you Marty Fouts for this clear and detailed answer. Jan 1, 2022 at 20:25
• Using bones is a good idea for the animation. Jan 1, 2022 at 20:26