Skip to main content
A few steps changed slightly in Blender 2.8x
Source Link
B Layer
  • 238
  • 3
  • 10

Alternative Driver-based Solution

I used this question as an exercise to familiarize myself with drivers. The solution turned out well enough and different enough from the others that I figured I'd post it. I couldn't say whether it has any particular advantage or disadvantage compared to the other driver answer; it's just what I came up with. :)

This is a driver-based solution built on Script Expressions that uses only the primary objects (planet + satellite, no empties or curves).

In preparation use keyframes to animate the "planet" object so it does one rotation around the Z-axis over the course of the animation.

The drivers all target the satellite (Suzanne) and are all based on the planet's rotation. We need at least two: one for the satellite's X location and one for its Y location. If we want the satellite to have a synchronized orbit such that the same side always faces the planet then a third driver targets the satellite's Z rotation.

I created each driver by hovering over the appropriate field in the Object tab in the Properties window, entered Ctrl+D, and selected Manually Create Later (Single). (In 2.8x this will pop a dialog. Just dismiss it by moving mouse away.)

add drivers to object fields

Next, open the Graph Editor (1) (in 2.8x choose Drivers rather than Graph Editor), select one of the drivers from the left panel (2), open the Properties drawer (N) and click the Drivers tab (3).

graph editor steps

Create a variable (4) with these attributes (5):

Type: Transform Channel
Name: planetZRot
Object: Planet
Type: Z Rotation
Space: World

Now copy this variable to the other drivers using the "arrow & clipboard" buttons (6).

Configure each driver to have type Scripted Expression (7). The expressions for each of the drivers are as follows.

  • X Location: 0 + (cos(planetZRot * m)) * r
  • Y Location: 0 + (sin(planetZRot * m)) * r
  • Z Rotation: planetZRot * m

Here m is Srot / Prot, the ratio of the satellite's rotation to the planet's rotation and r is the radius of the orbit.

Result with m=2 and r=3...

render with m=2 r=3

Alternative Driver-based Solution

I used this question as an exercise to familiarize myself with drivers. The solution turned out well enough and different enough from the others that I figured I'd post it. I couldn't say whether it has any particular advantage or disadvantage compared to the other driver answer; it's just what I came up with. :)

This is a driver-based solution built on Script Expressions that uses only the primary objects (planet + satellite, no empties or curves).

In preparation use keyframes to animate the "planet" object so it does one rotation around the Z-axis over the course of the animation.

The drivers all target the satellite (Suzanne) and are all based on the planet's rotation. We need at least two: one for the satellite's X location and one for its Y location. If we want the satellite to have a synchronized orbit such that the same side always faces the planet then a third driver targets the satellite's Z rotation.

I created each driver by hovering over the appropriate field in the Object tab in the Properties window, entered Ctrl+D, and selected Manually Create Later (Single).

add drivers to object fields

Next, open the Graph Editor (1), select one of the drivers from the left panel (2), open the Properties drawer (N) and click the Drivers tab (3).

graph editor steps

Create a variable (4) with these attributes (5):

Type: Transform Channel
Name: planetZRot
Object: Planet
Type: Z Rotation
Space: World

Now copy this variable to the other drivers using the "arrow & clipboard" buttons (6).

Configure each driver to have type Scripted Expression (7). The expressions for each of the drivers are as follows.

  • X Location: 0 + (cos(planetZRot * m)) * r
  • Y Location: 0 + (sin(planetZRot * m)) * r
  • Z Rotation: planetZRot * m

Here m is Srot / Prot, the ratio of the satellite's rotation to the planet's rotation and r is the radius of the orbit.

Result with m=2 and r=3...

render with m=2 r=3

Alternative Driver-based Solution

I used this question as an exercise to familiarize myself with drivers. The solution turned out well enough and different enough from the others that I figured I'd post it. I couldn't say whether it has any particular advantage or disadvantage compared to the other driver answer; it's just what I came up with. :)

This is a driver-based solution built on Script Expressions that uses only the primary objects (planet + satellite, no empties or curves).

In preparation use keyframes to animate the "planet" object so it does one rotation around the Z-axis over the course of the animation.

The drivers all target the satellite (Suzanne) and are all based on the planet's rotation. We need at least two: one for the satellite's X location and one for its Y location. If we want the satellite to have a synchronized orbit such that the same side always faces the planet then a third driver targets the satellite's Z rotation.

I created each driver by hovering over the appropriate field in the Object tab in the Properties window, entered Ctrl+D, and selected Manually Create Later (Single). (In 2.8x this will pop a dialog. Just dismiss it by moving mouse away.)

add drivers to object fields

Next, open the Graph Editor (1) (in 2.8x choose Drivers rather than Graph Editor), select one of the drivers from the left panel (2), open the Properties drawer (N) and click the Drivers tab (3).

graph editor steps

Create a variable (4) with these attributes (5):

Type: Transform Channel
Name: planetZRot
Object: Planet
Type: Z Rotation
Space: World

Now copy this variable to the other drivers using the "arrow & clipboard" buttons (6).

Configure each driver to have type Scripted Expression (7). The expressions for each of the drivers are as follows.

  • X Location: 0 + (cos(planetZRot * m)) * r
  • Y Location: 0 + (sin(planetZRot * m)) * r
  • Z Rotation: planetZRot * m

Here m is Srot / Prot, the ratio of the satellite's rotation to the planet's rotation and r is the radius of the orbit.

Result with m=2 and r=3...

render with m=2 r=3

Added an image of the graph editor with annotations. General clean up.
Source Link
B Layer
  • 238
  • 3
  • 10

Alternative Driver-based Solution

I used this question as an exercise to familiarize myself with drivers. The solution turned out well enough and different enough from the others that I figured I'd post it. I couldn't say whether it has any particular advantage or disadvantage compared to the other driver answer; it's just what I came up with. :)

This is a driver-based solution built on Script Expressions that uses only the primary objects (planet + satellite, no empties or curves). I used this question as a challenge/exercise as I've not used drivers in any way before so I couldn't say whether this approach has any particular strength or weakness versus the other, generally speaking; it's just what I came up with. It seems to be just different enough compared to the other solutions here that I thought I'd post it.

In preparation use keyframes to animate the "planet" object so it does one rotation around the Z-axis over the course of the animation.

The drivers all target the satellite (Suzanne) and are all based on the planet's rotation. We need at least two: one each for satellitethe satellite's X location and one for its Y location. If we want the satellite to have a synchronized orbit such that the same side always faces the planet then a third driver targets the satellitesatellite's Z rotation. 

I created each driver by hovering over the appropriate field in the Object tab in the Properties window, entered Ctrl+D, and selected Manually Create Later (Single).

add drivers to object fields

Next, open the Graph Editor (1), select one of the drivers from the left panel (2), open the Properties drawer with (N,) and click the Drivers tab and create (3).

graph editor steps

Create a variable (4) with these attributes (5):

Type: Transform Channel
Name: planetZRot
Object: Planet
Type: Z Rotation
Space: World

enter image description here

Now copy this variable to the other drivers using the little arrow+clipboard"arrow & clipboard" buttons to the right of Add Variable(6).

Then configureConfigure each driver to have type Scripted Expression (7). The expressionexpressions for each driver is:of the drivers are as follows.

  • X Location: 0 + (cos(planetZRot * m)) * r
  • Y Location: 0 + (sin(planetZRot * m)) * r
  • Z Rotation: planetZRot * m

WhereHere m is Srot / Prot, the ratio of the satellite's rotation versusto the planet's rotation and r is the radius of the orbit.

Result with m=2 and r=3...

enter image description hererender with m=2 r=3

Alternative Driver-based Solution

This is a driver-based solution built on Script Expressions that uses only the primary objects (planet + satellite, no empties or curves). I used this question as a challenge/exercise as I've not used drivers in any way before so I couldn't say whether this approach has any particular strength or weakness versus the other, generally speaking; it's just what I came up with. It seems to be just different enough compared to the other solutions here that I thought I'd post it.

In preparation use keyframes to animate the "planet" object so it does one rotation around the Z-axis over the course of the animation.

The drivers all target the satellite (Suzanne) and are all based on the planet's rotation. We need at least two: one each for satellite X location and Y location. If we want the satellite to have a synchronized orbit such that the same side always faces the planet then a third driver targets the satellite Z rotation. I created each by hovering over the appropriate field in the Object tab in the Properties window, entered Ctrl+D, and selected Manually Create Later (Single).

add drivers to object fields

Next, open the Graph Editor, open the Properties drawer with N, click the Drivers tab and create a variable with these attributes:

Type: Transform Channel
Name: planetZRot
Object: Planet
Type: Z Rotation
Space: World

enter image description here

Now copy this variable to the other drivers using the little arrow+clipboard buttons to the right of Add Variable.

Then configure each driver to have type Scripted Expression. The expression for each driver is:

  • X Location: 0 + (cos(planetZRot * m)) * r
  • Y Location: 0 + (sin(planetZRot * m)) * r
  • Z Rotation: planetZRot * m

Where m is Srot / Prot, the ratio of the satellite's rotation versus the planet's rotation and r is the radius of the orbit.

Result with m=2 and r=3

enter image description here

Alternative Driver-based Solution

I used this question as an exercise to familiarize myself with drivers. The solution turned out well enough and different enough from the others that I figured I'd post it. I couldn't say whether it has any particular advantage or disadvantage compared to the other driver answer; it's just what I came up with. :)

This is a driver-based solution built on Script Expressions that uses only the primary objects (planet + satellite, no empties or curves).

In preparation use keyframes to animate the "planet" object so it does one rotation around the Z-axis over the course of the animation.

The drivers all target the satellite (Suzanne) and are all based on the planet's rotation. We need at least two: one for the satellite's X location and one for its Y location. If we want the satellite to have a synchronized orbit such that the same side always faces the planet then a third driver targets the satellite's Z rotation. 

I created each driver by hovering over the appropriate field in the Object tab in the Properties window, entered Ctrl+D, and selected Manually Create Later (Single).

add drivers to object fields

Next, open the Graph Editor (1), select one of the drivers from the left panel (2), open the Properties drawer (N) and click the Drivers tab (3).

graph editor steps

Create a variable (4) with these attributes (5):

Type: Transform Channel
Name: planetZRot
Object: Planet
Type: Z Rotation
Space: World

Now copy this variable to the other drivers using the "arrow & clipboard" buttons (6).

Configure each driver to have type Scripted Expression (7). The expressions for each of the drivers are as follows.

  • X Location: 0 + (cos(planetZRot * m)) * r
  • Y Location: 0 + (sin(planetZRot * m)) * r
  • Z Rotation: planetZRot * m

Here m is Srot / Prot, the ratio of the satellite's rotation to the planet's rotation and r is the radius of the orbit.

Result with m=2 and r=3...

render with m=2 r=3

Source Link
B Layer
  • 238
  • 3
  • 10

Alternative Driver-based Solution

This is a driver-based solution built on Script Expressions that uses only the primary objects (planet + satellite, no empties or curves). I used this question as a challenge/exercise as I've not used drivers in any way before so I couldn't say whether this approach has any particular strength or weakness versus the other, generally speaking; it's just what I came up with. It seems to be just different enough compared to the other solutions here that I thought I'd post it.

In preparation use keyframes to animate the "planet" object so it does one rotation around the Z-axis over the course of the animation.

The drivers all target the satellite (Suzanne) and are all based on the planet's rotation. We need at least two: one each for satellite X location and Y location. If we want the satellite to have a synchronized orbit such that the same side always faces the planet then a third driver targets the satellite Z rotation. I created each by hovering over the appropriate field in the Object tab in the Properties window, entered Ctrl+D, and selected Manually Create Later (Single).

add drivers to object fields

Next, open the Graph Editor, open the Properties drawer with N, click the Drivers tab and create a variable with these attributes:

Type: Transform Channel
Name: planetZRot
Object: Planet
Type: Z Rotation
Space: World

enter image description here

Now copy this variable to the other drivers using the little arrow+clipboard buttons to the right of Add Variable.

Then configure each driver to have type Scripted Expression. The expression for each driver is:

  • X Location: 0 + (cos(planetZRot * m)) * r
  • Y Location: 0 + (sin(planetZRot * m)) * r
  • Z Rotation: planetZRot * m

Where m is Srot / Prot, the ratio of the satellite's rotation versus the planet's rotation and r is the radius of the orbit.

Result with m=2 and r=3

enter image description here