From BlenderWiki
If you want to document Blender 2.5 features please edit pages under Doc:2.5/Manual.
If a "2.5" page doesn't exist please copy the text from 2.4x Manual and edit the new page (i.e. you should paste the wikitext from this 2.4x page to this new 2.5x page and then update the latter with 2.5 features)
[edit] Clamp To Constraint
Mode: Object Mode and Pose Mode
Panel: Object Context → Constraints
Hotkey: F7
[edit] Description
Previously, we talked about Follow Path. Now lets talk about the Clamp To constraint.
The Clamp To constraint is a constraint which is particularly useful for moving things along large and complex paths which would otherwise be hard to hand-key smoothly. If you're feeling a little déjà vu, it's because the idea of a Clamp To constraint is very similar to Follow Path, with one main difference.
The difference is this: where Follow Path uses the time IPO of the curve that our constraint is targeting, Clamp To will get the actual position of the object(let's say a switch in some dark and Stygian spiral lock which must be moved back and forth in a combination, instead of the constant paths of the fighter and its pursuers in the example for the Follow Path constraint) and judge where to put the object(switch) by comparing the object's location to the curve it's targeting.
As with most things, of course, there's a bright side and a dark side.
The bright side is that when we're working with Clamp To, it will be easier to see what our object will be doing, since we're working in the 3D view port, in the same window that we're working with, it'll just be a lot more precise than sliding keys around on a time IPO and playing the animation over and over.
The dark(and Stygian) side is that, unlike in the Follow Path constraint, Clamp To doesn't have an option to track our object's rotation (pitch, roll, yaw) to the banking of the targeted curve, but--like our lock, for example, or the armature example further below that--we don't always need rotation on, so in cases like this it's usually a lot handier to fire up a Clamp To, and get the bits of rotation we do need some other way.
All together, what this means is that it'll probably be much easier to animate varied motion across a curve than it might be if we were using Follow Path, but even if it's not easier, it's an interesting alternative, so it can just come down to personal choice.
You don't need to know what Stygian means.
[edit] Options
- Target
- Text box - This is your basic target box, which just displays what your constraint is using as a reference. NOTE: In this case, the target object will have to be a curve object that the constrained object clamps to, so this box only works on curves.
- Main Axis
- This is a button group at the bottom - selecting one of these picks a global axis(x, y, z) for the constraint to use a reference to how far along the curve it's supposed to be. There's no real wrong choice, so just pick the axis that'd be easiest to work with or works best in your current situation--a good idea is picking the axis which the targeted curve is the longest along, so that the global and constrained locations of the object will be more similar to each other--or you can just pick Auto and Blender will make its best guess.
[edit] Example
- Stygian Lock(object)
- .Blend file
This is the Dark and Stygian lock that I've kept going on about, and now you all have to see it. Once again, you don't need to know what Stygian means, but before you all start throwing full wine bottles at your computer screens, looking at the picture on the right should give you a fair idea.
All the fancy design-work aside, though, the face and door are just decoration; the actual animation is done by the Clamp To constraint on the knob. If you watch, you'll see that the motion of it slides around the edge of the disk, goes back and forth, and even stops sometimes, and still manages to keep in a circle. This is the bright side of using a curve. Trying to key this the regular way would probably take much longer, and be much less smooth.
The bright side of, not just using a curve, but actually using a Clamp To constraint in this case--instead of a Follow Path constraint--happens around half-way through the animation. The knob slides all the way around, and then past the face's mouth, and keeps going a little while, before stopping and sliding back. Since the actual curve begins and ends in the figure's mouth, there needs to be an emergency key frame to jump the knob from being near the mouth at the end of the curve, to being near the mouth at the beginning. To do this, we have to visually move the location for both the keys as close to each other as possible, to make the transition smooth, this is something that would be much more difficult with the targeted curve's time IPO.
Note
I decided, in a spur of last-minute inspiration, that the camera would use a Clamp To constraint as well. It may seem a bit belabored, but we might as well go all the way and be consistent. It's a demo file, after all.
|
- Arm(armature)








![[]](/skins/blender/open.png)
