Manyrookie 3D animators (and even some veterans) are uncomfortable, perhaps even intimidated, by the spline editor in their animation software. Perhaps they were attacked by balls of colored yarn as children; perhaps they confuse it for a map of the London Underground; or maybe they just can't make sense out of jumble of colored squiggles. Whatever the reason, it's a shame, because the spline editor is a powerful animation tool.
I personally adore working with splines; sometimes I even animate directly in the spline editor without touching my model. By simply knowing what a spline should look like I can predict generally how my object will move, diagnose and fix problems in my animation, and get a jump on my polish phase.
In this two-part tutorial I'm going to try to impart to you some simple rules and concepts to help you better understand the meaning and power of splines (or "function curves", as they are sometimes called). I'll be using Maya's Graph Editor for my examples, but the principles I illustrate here apply to any spline editor for any decent 3D animation program. Hopefully by the end of this you'll be on your way from splinophobe to splinophile!
I'm going to start with the most basic explanations of spline editors just to make sure I don't leave anyone behind. I'll use a simple animated example: a ball moving from one position to another (I'll call the positions "Pose A" and "Pose B").
The red dots between the two poses above show us the spacing of the animation. The ball is translating along the X axis, so I'll load the Translate X channel into the spline editor and examine it.
The horizontal axis of the graph represents Time (measured in frames), and the vertical represents Value (this can be inches, meters, degrees, percent, etc.). The black dots represent the keys I've set, and a red spline passes through all of these keys to show you what is happening between the keys. As the spline travels across the graph from left to right it shows us the value of the X Translation as it moves forward in time. So on frame 1 the ball's Translate X is 0, and on frame 30 it's 10.
Note that I have 4 keys set: 2 for Pose A and 2 for Pose B. This is because I want the ball to hold in a pose at the beginning and the end. The spline between the first two keys and the last two keys is perfectly horizontal, meaning that there is NO movement. This is because the Value is not changing between these keys, only the time is changing. Movement only occurs where there is a change in both value and time (and thus a slope in the spline), in this case, between keys 2 and 3. The steeper the slope, the faster or greater the movement. The more the slope flattens, the slower or lesser the movement. Make sense?
The direction of the spline's slope can tell us something about the direction of the object's movement along the chosen axis, in this case Translate X. Reading from left to right, if the spline is ascending that means the value is increasing and the ball is moving to the right. If the spline is descending, that means the value is decreasing and the thus the ball is traveling to the left. It's not so important to memorize what slope corresponds to which direction; the important thing to note is that a change in the direction of the slope means a change in the object's direction. This will become important when I talk about anticipation and overshoot. Still with me?
The last thing I want to mention is the tangent handles, which appear above in brown. If you've used vector-based art programs like Adobe Illustrator then you're familiar with bezier paths. Splines behave similarly. Every key on a spline has tangent handles that you can lengthen or rotate to affect the shape of the spline as it passes through the key. These are necessary to put the curves into the splines and allow for graceful transitions between your keys without having to manually add a lot of extra in-between keys and breakdowns. You can do away with the tangent handles entirely by converting your keys to "linear" or "held", but this will require more work down the line to get graceful motion and timing. If you wanted to you could key every control on every frame, effectively doing your animation on one's and not allowing the spline tangents to have any influence on your animation. While sometimes this is necessary for fast or precise actions, it is not an efficient way to work and does not take advantage of what the computer is best at: smooth inbetweens.
T-splines allow you to sculpt shapes for conceptual designs. In this tutorial, you use T-splines to create the housing for a reciprocating saw. You begin with a concept sketch of the saw, and create T-spline primitives for the basic structure.
To allow the concept sketch to show through 3D objects in front of the image, select Display Through. The following image shows the concept sketch with opacity set to 50 and Display Through on.
The Edit Form tool can translate, rotate, and scale faces, edges, or vertices in the Sculpt workspace. You can manipulate single elements or groups of elements. For example, here are some ways that you can manipulate a primitive cylinder. (You won't use them all in this tutorial.)
I truly appreciate the time and effort that goes into tutorials, so this is not to bash or complain. Follow along with the video, and you will learn. I just want you to see that there are a few issues which can occur.
This problem arises around the five minute mark.
Draw it now and follow along. We are just going to focus on this one spline. I added in the extra reference dimensions (39mm, and 99mm) so you don't even need the video to lay this out. But, if you are not familiar with adding dimensions to splines, then the video will help.
Well, there are a few options. In the above example, I've managed to reduce the bump, but it is still there. What I did, was remove any of the spline constraints that were not needed (it sort of comes down to a best guess, but if you are the designer, maybe you NEED certain constraints more than others). Then you simply slowly drag the control handles until it "looks better".... Not very scientific, but it helps.
I know the SOLIDWORKS training beats into you head to "FULLY DEFINE YOUR SKETCHES". It is generally good advice, but constraining a spline is like herding cats. If you are going to constrain, then at least get the shape right, then add the dimensions at the end.
Option 2 is to question why we are using a three point spline. Here I have drawn a new two point spline. I left the old three point spline in the background for reference. The results are pretty good, but not ideal. I put in the orange arrows to show where I don't exactly match the original profile (not too critical). And were I fall outside the bounding sketches (worse).
Edit: Having gone through the full tutorial, I see that fully defining the splines is the only way that two people could expect to create the same model. Fully defining splines is great for the tutorial, but not practical (or useful) in a real-world application.
Being able to slightly tweak a spline is often required. Maybe once the design was finalized the splines would be locked down, but more likely, the individual parts would be saved off from the master model, with their references locked, or broken.
To all the students out there, if you have any questions to clarify all things AutoCAD this is a great, welcoming forum. What most don't like to see are questions that sound like they are straight out of a text or test. We want people to learn the program as well as how to draft, and not simply pass a test with answers provided.
I can't express enough my love for splines! I am a drafter for a land surveying company and I use splines all the time. I mainly use them for pools, ponds, creeks, winding sidewalks, etc. It works like a charm...and makes my dwgs look nice and clean. When I come across older dwgs from other people their pools and stuff look nasty compared to mine! I've got SPLINES' back 4 LIFE! lol. yeah im nerdy.
I use spline to draw jewellery design, but I have to trace with 3D pline so I can extrude/sweep it into 3D solid. If there's a tutorial that dig more about spline that will be very helpfull. I guess other beginners agree with me.
One trait that may not be so obvious (certainly in the Degree 2) is that when the basis function shifts from one set of points to the next, that juncture is tangent. The change in curvature, however, is extremely abrupt.
The smoothest drivers, the high price chauffeurs with any luck, would plan each turn in such a way as to slowly accelerate the steering wheel, giving a lot of feedback to the passengers and allow them to brace accordingly. That would be the Degree 5 track.
I do electrical and have never had a need to use spline. The only time I have ever used it was for a survey map I did in school back in the dark ages. We had to do it on the board and in CAD. Preferred CAD!
This example uses Blueprint sidescroller project as a start point and will modify it to the point your character is locked to a spline so that all you are pressing is left and right on the left analogue stick as you can see in the video below (whilst it might look quite crude, the idea is a start point for people to develop from)
1301638 166 KB
This example will fire the trace from the current location to the same location in X and Y, down to a world height of 0
With the Draw Debug Type set to Persistent, we can drop into game and see that the line trace is indeed firing down from the player and hitting anything at 0 height in Z and above (you might need to add more types into the Make Array node based on your level contents or change the Z height to a negative value).
1044464 108 KB
If you hit play you will see that the rotation is only correct whilst running from left to right, but he runs backwards (moonwalks) when going the other direction along the spline. This is the reason we made the Axis Value variable in the previous steps.
3a8082e126