Multiple Constraints and Weighting

Using 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.

 

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. At the Select object prompt, select the path curve.
    • 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.
    • 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.

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



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

  8. 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.

 

Look at the glass

  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 Constraints Manager, click Add, and then choose Target to Object.
  4. Select the glass on the small table in the back of the building.
  5. In the View Constraint Manager, click the untitled name, and enter the name Glass.

 

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.
  3. A yellow keyframe marker will appear at that tick.
  4. 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.
  5. Set the weight of the Camera Look Along Walk Path to 0.
    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.

  6. 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 the results.



  7. Use the Camera command to turn on the viewport camera for the Perspective viewport.
  8. 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.
  4. Scrub the Timeline Slider or click the Play button to see the results.



  5. 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.

  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.

  2. Start the BongoMovePivot command
    -or-
    use the Bongo Move Pivot icon.
  3. Move the pivot to the end of the door. See image.

  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.


    Set the rotation to be about 60 degrees.

  6. Select the right-hand door.
  7. Start the BongoMovePivot command
    -or-
    use the Bongo Move Pivot icon.
  8. Move the pivot to the end of the door. See image.

  9. Select the right-hand side door.
    Start the BongoRotate command.
    -or-
    Switch to Rotation mode on the timeline (press Animate) and insert the rotation angle.


    Set the rotation to be -60 degrees.

 

© 2017   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service