Multiple Constraints and Weighting

The Object and View Constraint Managers can apply multiple constraints causing the object or view to be affected by several different constraint conditions at the same time. Initially, these constraints will have equal weighting and Bongo will constrain the object evenly between the constraint conditions.

Keyframed position can also have a weighting in the final position of the object if it is raised from its initial zero weight. This value is set per keyframe in the Edit Keyframe dialog box.

Weighting is useful when an object or view is multiply constrained. Keyframes can alter the weighting of the constraints at a given tick, moving the object away from or towards constrained conditions during the course of the animation. Any value above zero causes the object to be affected by that constraint. Weights are measured relative to the weights of other constraints. For example, a constraint weighted at 10 will have half the effect of another constraint weighted 20 at the same tick.

Common uses for weighting and multiple constraints include:

  • Creating an animation with several walkthrough paths.
  • Setting up a camera or object that looks at several objects in turn while moving along a predefined path.

Constraint Tips:

  • Child objects are limited in the types of constraints they can accept. For example object to pivot constraint won’t work for child objects.
  • It can be difficult to see what is happening with view constraints, particularly when adding parameter keyframes along the length of a path curve. Use Rhino’s Camera command to turn on the viewport camera to see where the camera is.

Tutorial: Using view constraints to walk through a building

Views can be constrained to curves and object pivots. You can use this feature to create a walk through animation, a turntable animation, or to cause the camera to focus on a particular object (or several objects) during the course of the animation.

In this section, you will use Bongo view constraints to animate walking though a building. You can specify where you want to walk and objects to look at while we walk. You can also open doors as we approach them.

Set up the walk path

The first thing we want to do to start this animation is to establish a path for the animation to follow. We are going to walk through the doors into the building ending up at the small table in the back.

Open the example model

  1. Open the model WalkThrough.3dm.
  2. From the Bongo menu or toolbar, open the Timeline and Animation Manager.

Walk Path

Draw a curve to follow

  1. From the Rhino Curve menu, choose Freeform, and then choose Interpolate Points.
  2. In the Top viewport, pick a series of points that will guide the viewport camera path through the building as illustrated. By default this path will be drawn on the ground (construction plane).
  3. Move the curve up 72 inches, so it is about at eye height.

Constrain the view to follow the curve

  1. Click in the Perspective view to activate it.
  2. From the Properties tab, choose Bongo View Constraints.
  3. In the View Constraints Manager dialog box, click Add, and then from the menu, choose Look Along.
  4. Select the curve near the end where you would like the animation to start. This sets the direction the animation will follow.
  5. In the View Constraints Manager dialog box, click the name of the path, and enter the name Walkpath. View Constraints

The viewport is automatically Animation Enabled. The curve object is automatically named Walkpath in Rhino Properties. Yellow keyframe markers are added to the Timeline at ticks 0 and 99.

Scrub the Timeline Slider or click the Play button to see what the animation now looks like.

Want to see how the camera moves?
Use the Camera command in Rhino to turn on the viewport camera for the Perspective viewport.

Now when you scrub the Timeline Slider or click the Play button, you can see the path of the camera in the Top, Front, and Right viewports.

Look at objects as you walk

You can see that the animation probably does not yet do exactly what you want it to do. During the animation, the point of view is always directly in front of the you as if you were looking straight ahead and facing the direction you are walking. This is not very natural. Normally, as we walk, we look at objects around us. In this section, you will add constraints to objects so the camera will turn and look at various objects as we walk through the building.

To do this, in addition to the Look Along constraint created in the previous step, we will add targets to look at while the camera is moving along the path. These targets will take priority over the view along the path. After adding the target in the View Constraints Manager, a new keyframe will be added to the Timeline and weighted values will be assigned to targets. This will give us control over the focus of the animation. You can then prioritize the constraints and focus the animation on a particular object for a portion of the animation.

Look at the stair

  1. Click in the Perspective view to activate it.
  2. Select the Perspective view and from the Properties tab, choose Bongo View Constraints.
  3. In the View Constraint Manager dialog box, click Add, and then choose Target to Object.
  4. Select the spiral staircase.
  5. In the View Constraint Manager, click the untitled name, and enter the name Stair.' Target to stair

Add a keyframe for looking at the stair

At this point, since the weights of all the constraints are the same, the constraints have no effect. The constraints must be weighted so that each constraint will take priority over the others at the time in the animation when you want the change of view to be effective.

  1. Move the Timeline Slider until you can see inside the building.

  2. Right-click the Timeline at the current tick, and from the menu, choose Add View Keyframe > View(s) > Perspective > Precalulated. A yellow keyframe marker will appear at that tick.

  3. Double click the new keyframe marker, and from the tree, choose Perspective > Constraints > Target to Pivot Glass. Set the weight of the Glass to 0.

  4. Set the weight of the Camera Look Along Walk Path to 0.

    Stair Constraint

    This sets the priority for aiming the camera toward the stair much higher than the priority for aiming along the path or at the glass.

  5. Select keyframe 99 in the Keyframe Editor and under Constraints set the weight of the Camera Look Along Walk Path to 0.

Scrub the Timeline Slider or click the Play button to see what the animation now looks like.

  1. Use the Camera command to turn on the viewport camera for the Perspective viewport. When you scrub the Timeline Slider or click the Play button, you can see the movement of the camera in the Top, Front, and Right viewports.

End the animation looking at the glass

  1. Double-click the keyframe marker at tick 99 and and from the tree, choose Perspective > Constraints > Target to Pivot Glass. Set the weight of the Glass to 100. If the Constraints option is grayed out, check the check box to activate it.
  2. Set the weight for the Target to Stair to 0 at tick 99.
  3. This starts taking your view away from the stair and starts moving the view toward the glass.

Scrub the Timeline Slider or click the Play button to see the results.

Use the Camera command to turn on the viewport camera for the Perspective viewport.

Now the animation ends with the camera aimed at the glass.

Opening the doors as you pass through

The animation will look much better if you animate the doors to open as you enter the building.

Move to the position where you want the doors to start opening

  1. Move the Timeline Slider to the tick where you want the doors to start to open. Open Doors
  2. Select the two doors.
  3. Right-click the Timeline at the current tick (29), and from the menu choose Object Keyframe, and then choose Add Keyframe > Selected Object(s) > Precalculated. This sets the point where the doors will start to move.

Open the doors

  1. Select the left-hand door.
    Open Left Door
  2. Start the BongoMovePivot command or use the Bongo Move Pivot icon. Move Pivot
  3. Move the pivot to the end of the door. See image.
    Move Door Pivot
  4. Select the left-hand side door.
  5. Start the BongoRotate command or switch to Rotation mode on the Timeline (press Animate) and insert the rotation ange. Rotate Mode
  6. Set the rotation to be about 60 degrees.
  7. Select the right-hand door.
  8. Start the BongoMovePivot command or use the Bongo Move Pivot icon.
  9. Move the pivot to the end of the door. See image.
    Move Door Pivot
  10. Select the right-hand side door.
  11. Start the BongoRotate command or switch to Rotation mode on the timeline (press Animate) and insert the rotation angle. Rotate Mode
  12. Set the rotation to be -60 degrees.