The MotionManager is an interface that enables you to create animations showing the motion of parts and assemblies based on a timeline. These animations can range from a simple rotating part to complex moving machinery, involving motion constrained by assembly mates or motion driven by motors, springs, gravity, and contact. You can render the animations using PhotoView 360 or show them in a SolidWorks display mode, including RealView.
Collectively, the results of any of the motion capabilities in SolidWorks are called motion studies. Some of the capabilities are more focused on analysis (also called simulation), while others involve simple animation, but all can create movie output.
SolidWorks has three primary methods and two ancillary methods of creating motion in assemblies:
There are two ancillary methods of capturing movies:
To get usable results from these tools, you need to be comfortable with the limits of the technology that SolidWorks provides. Your success with the tools depends heavily on having realistic expectations of their capabilities.
Here's an overview of the terminology used in conjunction with motion in SolidWorks:
If you need a function that's only allowed in another type of motion study, you need to change the motion study type in the drop-down selection box in the upper-left corner of the MotionManager. The default option is Animation, and the other two available options are Basic Motion and Motion Analysis. Motion Analysis is available only if you have SolidWorks Motion turned on in the Tools ➢ Add-ins dialog box, and that's available only if you have SolidWorks Premium or SolidWorks Simulation Professional. You can see the Study Type box in the interface shown in Figure 23.1.
FIGURE 23.1 The major elements of the MotionManager
Another method that you can use to capture screen motion to a movie file is by using the Record Video tool (View ➢ Screen Capture ➢ Record Video). The Record Video tool also appears as a toolbar button on the Screen Capture toolbar. You can use Record Video to record whatever happens in the graphics window, from using the Rollback bar to dynamic assembly motion dragging parts with the cursor.
You can animate the following:
When you animate colors and appearances, simple colors can fade from one to another, but appearances with a texture do not fade; it will simply snap to the next texture at the appropriate time. For example, you can fade red to blue, but you cannot fade marble to fabric. This is also true with fading transparency in an animation that is rendered using PhotoView 360.
You cannot animate the following:
Although you can't animate the changing of part dimensions directly, with some creativity, you can animate in-context changes driven by changing mates. You will see an example of creating a part that is flexible later in this chapter.
You can use these items to drive an animation:
These types of motion are available:
When you think of “physics” in SolidWorks, you may need to adjust some of your expectations; some of the tools don't follow real physics concepts very rigorously. For example, a motor applied to a part in an assembly creates a constant velocity instantly, without regard for inertia. Friction has only a single component rather than the static and kinetic, which exist in real engineering problems. You can simulate static friction with a force and an equation, but it isn't available as a function of friction.
It is often useful to plan an animation that's more involved than just a few moves on the screen. You can do this in a couple of different ways. The easiest way is to write out a list of moves or positions you want to display, with the approximate time of each action or position.
Another way is to use the storyboard technique employed by professional videographers. In this method, you create a series of images to represent the state of the animation at specific points in time. You can use static screen captures from SolidWorks or hand sketches to do this, depending on the complexity of the geometry and animation.
In general, even for simple animations, the better you plan, the better the final product will be. The animation tools in SolidWorks tend to perform much better when you follow a clean workflow, without lots of major editing. This is something you could probably say about almost any process, but the animation tools seem to be particularly sensitive to editing.
The parts of the interface that you will use the most are the key points, the design tree, and the timebar. The filters help you select or view limited sets of items, and the tabs at the bottom enable you to set up alternative studies. Playback speed enables you to change the rate of playback to either view a long animation more quickly or see motion in one area in more detail. The timeline zoom tools enable you to rescale the time interval on the timeline. Figure 23.1 identifies the major elements of the MotionManager.
When recording an animation to a movie file or a series of still images, you can choose from several types of display output. The first and easiest type is the default SolidWorks display, without RealView. This is most appropriate for fast, technical presentations. You might want to use this to demonstrate the function of a particular mechanism or to simply rotate around a model to demonstrate the model in 3D rather than as a flat image or an eDrawing.
You can also turn on RealView and record the animation. If you do this, you should have appropriate appearances in use for individual parts. RealView appearances enable you to use reflective or textured materials on your parts.
The highest-quality images come through the PhotoView 360 renderer. Using PhotoView 360 takes much more time than the other options because each individual frame must be rendered just like a normal PhotoView 360 rendering. PhotoView 360 is beyond the scope of this book because it is not an add-in for SolidWorks Standard.
SolidWorks Visualize is another SolidWorks rendering product. Visualize is a separate stand-alone renderer and is not included in the scope of this book.
You can access the MotionManager interface in the lower-left corner of the graphics window. The Model, 3D Views, and Animation1 tabs enable you to toggle the interface on and off. The Model tab shows the normal SolidWorks interface. The 3D Views tab enables you to capture 3D Views for 3D pdf, Step w/PMI, or eDrawings.
You can add tabs to create multiple motion studies. If you cannot see this interface, you may need to turn on the MotionManager. To do this, right-click a toolbar and select MotionManager from the list of toolbars.
Motion Study Properties within the MotionManager, shown in Figure 23.2, enable you to establish the accuracy or frame rate of the display. Use the gear symbol on the MotionManager toolbar.
FIGURE 23.2 Motion Study Properties enable you to set frame rates and other display quality settings.
The MotionManager enables you to create animations within SolidWorks and output movies as *.avi
files or a series of *.bmp
or *.tga
still images. You can use it with the default (OpenGL) SolidWorks display, RealView display, or in conjunction with PhotoView 360 to create more realistically rendered animations.
You can control the pixel size and frame rate of the recorded animation to help control finished file size, movie quality, and the amount of time it takes to record the animation. You can rotate or fly through single parts or assemblies. You can also make assembly mechanisms move through animating mates, driving them with motors or manually positioning the parts in space.
One of the beautiful things about SolidWorks animations is that you can save them to an eDrawings file. You can send eDrawings to non-SolidWorks users for review, and because the file format is small, you can easily send animations over the Internet.
You can use the Animation Wizard to create simple animations. The Animation Wizard accommodates two types of animations: The first is where a part or assembly is simply rotated on the screen (or camera revolves around part or assembly), and the second uses an existing exploded view from an assembly. You can combine, reorder, reverse, copy, or move both types of animation sequences within a larger animation.
A simple rotating animation is the simplest animation you can create. To create a rotating animation, first click the Animation1 tab at the bottom-left corner of the graphics window. This opens the MotionManager interface. Remember that you can turn the MotionManager on or off in the list of toolbars. (Choose Tools ➢ Customize or View ➢ Toolbars, or right-click any toolbar to access the setting for the MotionManager.)
Click the Animation Wizard icon in the toolbar on top of the MotionManager. Figure 23.3 shows the dialog box that appears, where you can choose options that include Rotate Model, Explode, Collapse, Import Motion From Basic Motion, and Import Motion From Motion Analysis. In this example, all options are grayed out except for Rotate Model. The model that is loaded does not have an exploded view, Basic Motion, or SolidWorks Motion data.
FIGURE 23.3 The first page of the Animation Wizard: Select An Animation Type
After you select the appropriate type of animation and click Next, you select an axis of rotation, the number of rotations, and the direction. An important thing to note here is that the X-, Y-, and Z-axes do not refer to axes of the part; they refer to axes on the screen. Rotating about the X-axis is like holding down the right-arrow key on the keyboard. The sample animation that appears in the upper-left corner of the Animation Wizard, shows what you can expect. It changes direction if you change the option (see Figure 23.4).
FIGURE 23.4 The second page of the Animation Wizard: Select An Axis Of Rotation
The final step in creating the rotating animation is to determine how long the animation will last and at what point in the overall animation it should start. Figure 23.5 shows the Animation Wizard page where you can set these options.
FIGURE 23.5 The third page of the Animation Wizard: Animation Control Options
After you click Finish, the MotionManager will populate the timeline with key points for the Orientation and Camera Views. Instead of rotating the part, the software will rotate the view. It seems like a semantic difference, but when you start working with moving parts in assemblies while changing the view, the difference becomes important. Notice the heavy black line with diamonds in the row for the Orientation and Camera Views in Figure 23.6. Each diamond is a key point that represents a view angle, and the line between the diamonds indicates that MotionManager will interpolate the view between the key points, making the view transition smoothly. You will learn how to create key points later in this chapter.
FIGURE 23.6 Change bars in the MotionManager
To play the animation, click the Play From Start button or the Play button in the MotionManager toolbar. Note also that you can run the Animation Wizard multiple times to create various sequences within a single animation. You can control the start time and duration, which are added to the timeline. You can also edit the key points and even mirror the path.
The sample assembly in the Animations folder of the download materials is named Robot Assembly.sldasm
, and it's saved with an exploded view. You can use this assembly or create your own. If you use this file, you must first create a new motion study for practicing. To do that, right-click on the Animation1 tab at the bottom and select Create New Motion Study.
To use the Animation Wizard to create an animated explode and collapse, first start with an assembly that has an exploded view and activate the Animation Wizard. Remember that exploded views are kept under a configuration in the Configuration Manager. Figure 23.3 shows the first page of the Animation Wizard where you select the animation type. Select the Explode option and click Next. Figure 23.7 shows the second page. (Explode animations skip the second step, which is used by rotate animations.)
FIGURE 23.7 The second page of the Explode Animation Wizard
If you add the explode animation at the end of the rotate animation, the resulting animation does both: rotates then explodes, each in sequence. Later you will learn how to copy and reverse the key points for the explode to make it collapse, and how to adjust key points to make parts move faster, slower, or simultaneously.
You can also edit the animation created by the explode or collapse in the same way you would edit the rotate animation created by the wizard. If you have multiple parts moving at different times, you can edit the sequence so that certain parts move at the same time by marquee selecting (or Ctrl+selecting) a group of key points and moving them along the timeline.
Here's an example of using the Animation Wizard to first rotate a model and then explode and collapse it, along with some simple editing. If you want to follow along with this example, open the Yoke Link.sldasm
assembly from the download materials for Chapter 23. Note that this assembly already has a complete animation, so you need to create a second motion study when you want to try to make your own animation with this assembly.
The first step in creating this animation is to have an explode in place before starting the animation. To do this, start by switching to the ConfigurationManager and then activating the configuration in which you want to create the explode or create a new configuration. Each configuration can hold multiple explodes. In this example, the new configuration is called Example (right-click the name of the part in the ConfigurationManager and select Add Configuration). Figure 23.8 shows a configuration being added.
FIGURE 23.8 Adding a new configuration to the assembly
To add the new explode, right-click the new configuration name and select New Exploded View, as shown in Figure 23.9.
FIGURE 23.9 Adding a new explode
Adding the explode brings up the PropertyManager shown in Figure 23.10. In this PropertyManager, you can create the individual explode steps.
FIGURE 23.10 Detailing the explode steps for this example
Without reviewing the material for explodes in Chapter 13, “Building Efficient Assemblies,” in detail, the general workflow for creating the individual explode steps is as follows:
This example uses six explode steps (step 1 creates two different explode steps):
Now that the explode is complete, make sure the assembly is in its collapsed state (right-click ExplView1 under the configuration name).
Before displaying the MotionManager interface, change the assembly view to the proper orientation. Press the spacebar to display the View Orientation dialog box and select the Animation 1 view. Then close the View Orientation dialog box.
Next, right-click the Animation 1 tab at the bottom-left corner of the SolidWorks window to display the MotionManager interface and select Create New Motion Study. This gives you a fresh start with a new animation timeline. Figure 23.11 shows how to create the new motion study.
FIGURE 23.11 Creating a new motion study
Next, click the Animation Wizard icon in the MotionManager toolbar. The Select An Animation Type window will appear, as shown in Figure 23.3. Select the Rotate Model option and click Next. In the next window, select the Y-axis option and click Next. Remember, in this case, “Y-axis” means the Y-axis of the screen, not of the model. If it were the Y-axis of the model, the assembly would simply spin in place.
In the Animation Control Options window, set the rotation to last 3 seconds and the start time to 0. You'll change these settings later to get some practice making edits to timelines and key points. When you click Finish, you should get the result shown in Figure 23.12.
FIGURE 23.12 Using the Animation Wizard to add key points to the animation timeline
When you’re making an animation, it's nice to have a gap between the start of the movie and the motion of the parts, to give the viewer some time to adjust to what he's seeing on the screen. Of course, if you're making a movie that you want to use as a continuous loop, the gap might interrupt the motion. You could also insert a gap between the end of the motion and the end of the movie, which might make the gap seem more natural.
In any case, you want to add a gap of a second or one-half second at the beginning of this animation. To do this, drag a selection window around the heavy black line and black key points in the Orientation And Camera View row, and then drag them to the right by slightly less than 1 second.
You can now add the explode to the animation. To do this, follow these steps:
FIGURE 23.13 Bringing the explode steps into the MotionManager timeline
Now you will add the collapse, but this time without running the wizard. To accomplish this, follow these steps:
The next step is to zoom in to the looped area of the strap. To do this, you have to first make sure that the view is the same as the last change made to the orientation.
Next, copy the last key point from the rotate motion (Ctrl+drag) to the same time that the collapse finishes. Then move the timebar forward a couple seconds, zoom in so you can see the fork and the looped section of the strap, right-click the timebar in the row for orientation, and select Place Key, as shown in Figure 23.14.
FIGURE 23.14 Zooming in to the flexible area of the strap
There are other ways to place this View Orientation key, such as by enabling the Orientation and Camera Views item. If you enable the Orientation, the MotionManager records every view change you make, so it's cleaner and safer if you just use the RMB ➢ Place Key method instead of enabling the orientation.
Click the Calculate button on the MotionManager toolbar. Notice that when the strap moves up, the part actually shortens. The part will also twist later in the animation when you change the angle of one of the parts. In general, SolidWorks cannot animate flexible parts, but you can use some tricks to make parts appear flexible. You cannot animate part dimension changes, but you can animate mate dimension changes. You do this by using in-context relations and driving mating parts by changing distance or angle mates. Therefore, the appearance of flexibility comes only through animating parts with in-context relations, and maybe some well-thought-out features.
Animating through in-context relations is not available in Basic Motion.
The next item that this movie will animate is the Angle1 mate. If you expand the Mates folder in the FeatureManager, you'll find that it has two folders. One folder is for model mates, and the other is for mates that drive the animation. The only mate in the Animation Mates folder is Angle1.
Start by copying the initial key point for Angle1 from 0 seconds to slightly after the view change just made. Next, move the timebar one more second past the copied key point; you can do this precisely by right-clicking the timebar, selecting Move Time Bar, and then typing in the time to which you want to move it. Then double-click the Angle1 mate and change its value from 45 to 180.
Make the angle mate change from 45 to 180, back to 45, then 0, and then 45 again, with about one-half second for each change. Remember, you can use copied key points to make the multiple 45-degree values. Finish the animation by returning to the original view. To do this, copy the first key point of the orientation and then the last key point (at about 10.25 seconds). Figure 23.15 shows the final result.
FIGURE 23.15 The finished timeline for this animation
This example serves as a demonstration of the overall workflow, while the rest of this chapter offers a detailed discussion of the functions that are available.
This section reintroduces some of the view animation items that you saw earlier in this chapter—that is, tools involved in changing the point of view from which the animation is recorded. The first part of the chapter mostly offered a practical overview of the animation workflow. This section gives you a more thorough knowledge of individual tools for changing and controlling the view. You already understand how the tools combine to make an animation; now you just need to know what tools are available and how they work.
View Animation is an important and even reusable function. For example, you can save an animation where the only things that are animated are the view changes in an assembly, and then you can put any part or other assembly that you want into this pre-created animation. If your PhotoView 360 settings are established (except materials and appearances for the individual parts), you can even create a rendered animation very quickly by reusing existing data.
A great example is when you want to show an assembly spinning on its axis, like a turntable (instead of on the axis of the screen as shown in the Animation Wizard); in this case, you can record a camera following a path focused on a particular point. This is a great animation to set up as a template, so you can reuse it as a quick-and-easy animation boilerplate. This technique is covered later in this chapter.
You can animate view changes in the MotionManager in the following ways:
A key point is a point on the timeline where you tell SolidWorks what state something will be in at a specific time. For example, at 9 seconds, the view will be a front view; this is represented by a diamond along the timeline that contains the information. You can use key points to animate assembly motion, the view, or even properties such as color, transparency, or mate values. We've already done some work with key points in this chapter.
An important fact about using view and camera key points is that the Orientation And Camera Views feature in the MotionManager is locked by default. This means that you cannot change the view in an animation by accident. To unlock it, right-click the Orientation And Camera Views entry, and deselect the Disable View Key Creation option.
If you don't understand why this setting is turned off by default, try working with it turned on for a while as you are learning the software. You may find that, unless you are extraordinarily well organized, you will make many unwanted changes to the view, because you are unconsciously rotating the view to see it better and forgetting that the change is being recorded. This is a very common mistake among users when creating an animation.
You can play back the assembly animation and disable the view changes. To do this, right-click the Orientation And Camera Views item in the MotionManager and select Disable Playback Of View Keys from the menu. Very often when you’re dealing with assembly motion, it helps to see the assembly from a particular point of view. You can't do that if your animation is always changing the view. Remember to deselect this setting before recording the animation to a file.
The timebar is the vertical gray line in the timeline area that denotes the current time that you are editing in the animation. Refer to Figure 23.1, which identifies the major parts of the MotionManager interface. When you make a change to any element that can be animated, that change is applied at the time denoted by the timebar. To make a key point-driven animation, the workflow usually involves moving the timebar, making a set of changes, moving the timebar, making another set of changes, and so on.
To try this out on an assembly, open the Robot Assembly in the Robot Arm folder from the download materials. You can follow along with the existing motion study or create a new one and experiment on your own. Start by making sure the timebar is set to 0 (all the way to the left), and then position the view to start the animation. In this case, display the View Orientation dialog box (press the spacebar) and double-click the view named 1.
Because the Orientation And Camera Views item is disabled, this view change is not recorded. In order to record it, right-click the key point to the right of Orientation And Camera Views, and select Replace Key, as shown in Figure 23.16. This replaces the existing key with the new view orientation.
FIGURE 23.16 Selecting Replace Key to change the view at a View Orientation key point
The view should remain static for a brief time when the animation starts; it might be too confusing to start the animation immediately with the view changing. To create this pause, copy the first key point from the 0-second mark to the 1-second mark. It is as easy as it sounds. Click the key point in the same row as the Orientation And Camera Views, and then Ctrl+drag it to the right to the 1-second mark. This causes the first second of the view to be static.
Next, move the timebar to the 3-second mark, display the View Orientation dialog box again, activate View 2; then right-click where the Orientation row intersects the 3-second column, and select Place Key to make a new key point for the view orientation. The black bar between the 1-second key point and the 3-second key point indicates that the animation will interpolate the view orientation between the two defined points. The MotionManager now looks like Figure 23.17.
FIGURE 23.17 The timeline at the 2-second mark
Remember that the View Orientation dialog box stores both the Orientation and Zoom factor, so when you use View 2, it may be zoomed at a different state; therefore, when the view changes from 1 to 2, it may rotate and zoom in or out slightly. If you want to measure rotation more precisely, it may be a good idea to use the arrow keys rather than something like a 3D mouse.
The next step is to zoom in to the grippers and simultaneously turn the view slightly to give a better view. Before changing the view, though, it would be nice to have another pause to give the viewer the chance to see what's there. To create the pause, click the last key point in the Orientation And Camera Views row and then Ctrl+drag it to the 5-second mark. Then move the timebar to the 7-second mark. Remember that the workflow for copying a particular key is to select and then Ctrl+drag, not just Ctrl+drag. If you Ctrl+drag without making the initial selection, you may be copying other key points that were also selected at the time. The select operation serves two functions: to deselect anything else and to select only the key point that interests you.
After you have the timebar moved to the 7-second mark, use the View Orientation (press the spacebar) to move to View 3. After doing this, zoom in on the grippers using whatever method you use to zoom: Shift+Z, middle mouse button (MMB) scroll, Zoom To Area, Zoom To Selection, Zoom In/Out, or a 3D mouse. After you have made both changes, add the key point to the Orientation change bar in the same way you have done it previously. The rotate and zoom will happen at the same time. The idea is to get a good partial side view of the grippers, such as the view shown in Figure 23.18. Play the animation to see what you have created.
FIGURE 23.18 The timeline at the 7-second mark
When you play the animation, it may appear somewhat jerky. When the MotionManager interpolates between key points, for changing either views or part positions, the default interpolation mode is Linear. This means that it changes between points at a constant speed. This creates the jerkiness because the motion starts and stops abruptly.
To remedy this, the MotionManager offers several interpolation modes. Right-click one of the key points that you have created and select Interpolation Mode at the bottom of the list that appears. Another menu will fly out, as shown in Figure 23.19.
FIGURE 23.19 Selecting Interpolation Mode
The icons for the modes signify how the motion increases or decreases between key points. In any case, curves make smoother motion than lines. Ease In/Ease Out creates the smoothest motion; Ease In works best at the beginning of a change, and Ease Out works best at the end of a change. Snap causes an abrupt change in position from one place the part will move immediately to another location at the next key point. The Linear option causes the part to move at a constant velocity from one point to another.
The default mode is Linear, so if you want to change all four of the key points, you must go through this selection four times, right? No, there's an easier way. You can box-select all four key points, right-click any of the selected key points, and change them all to the Ease In/Ease Out mode. Now play the animation again. Notice how much smoother the view changes are.
When you start to use the MotionManager, you'll probably make mistakes. Don't feel bad; this happens even to seasoned veterans. The difference between you and experienced users is that they know how to deal with mistakes and not panic. The MotionManager does you the favor of recording all your mistakes in the form of adding key points to the change line for either the part position or view orientation. One way to troubleshoot these types of mistakes is to drag the timeline through the key points and identify which key points need to be edited or removed. To edit a key point, you can use options from the RMB menu such as Replace Key, Edit Key Time, select a different view orientation, and so on. To remove a key point, just click it and press Delete.
If you are making an animation that covers a long period of time—say, more than 30 seconds—the key points may be close together and difficult to distinguish from one another. You can use the zoom tools in the lower-right corner of the timeline area to zoom the timeline in or out. Zooming in makes the key points appear farther away from one another, enabling you to select one that might be right on top of another.
The main camera controls you need for animations are Target By Selection, Position By Selection, and Set Roll By Selection, in addition to the Field Of View settings. These settings are available if you click the RMB on the Camera in the Scene, Lights, And Cameras pane of the DisplayManager, and select Edit Camera.
Walk-through is a stand-alone feature, but its functionality is borrowed from the MotionManager for animating a camera along a path. The Walk-through feature is somewhat simplified and intended for large structures where you can go in and around the object. Remember that Chapter 22, “Working with Large Scale Design,” used a very large dump truck with a staircase and an observation platform.
The main weakness of the Rotate Animation Wizard is that it rotates about the screen axis, which appears to make it wobble on the screen, and this typically is not what users have in mind when they ask to rotate the model. Most users envision the “turntable” sort of rotation, where the model rotates about its own axis. Changing the rotation to rotate about the part axis isn't as easy as it probably ought to be, but after you understand the process, you can simplify it. This example involves making the camera revolve around the axis of a part, regardless of the orientation of the part, to show you how to drive a camera along a path. This exercise starts simple and gradually becomes more complex.
The best way to spin the view around the part axis is to make a looped path on a plane perpendicular to the axis. The plane should in most cases be slightly elevated from the base of the model and probably should be circular or at least a smooth, closed-loop spline.
Starting with the robot assembly from the download material (Robot Assembly.sldasm
), move to a top view and open a 3D sketch. When doing prep work like this, it's better to work using the Model tab instead of the MotionManager. This prevents you from creating any unnecessary key points for animatable items.
In the 3D sketch, from the top view, draw a four-point closed-loop spline, as shown in Figure 23.20. This is in a 3D sketch, so you can change the path to nonplanar if you desire.
FIGURE 23.20 Creating a camera path
The path doesn't have to be perfectly circular; in fact, it might be better if it gets closer to the assembly on one side, making it rather kidney-shaped. You can use a circle, ellipse, or closed-loop spline for the path.
Next, press Shift+down arrow to rotate the view 90 degrees, and drag the entire spline up a little bit. Finally, tweak a couple of spline points so the spline goes higher and lower. This will give you a more interesting result than just a straight turntable-rotation animation.
The camera will be attached to this spline. You might also want to have a target point for the camera to follow as it goes around the path. You could place a sketch point inside the joint between the Tower and Arm parts. If the assembly or even a part origin is in a convenient location, you can also use this as a place to point the camera.
After the path exists, exit the sketch and insert a new camera. You can insert a camera by switching to the DisplayManager, the multicolored ball next to the FeatureManager and ConfigurationManager tabs. Then switch to the third icon under the top tabs, which is for lights and cameras. Now right-click the Cameras folder and select Add Camera. Figure 23.21 shows the PropertyManager for the camera.
FIGURE 23.21 The Camera PropertyManager
Notice that when you insert the camera, the SolidWorks graphics window splits into two viewports. The left viewport is your view of the camera, the model, and their surroundings. The right viewport is the view through the camera.
Use the Target Point selection box to aim the camera at a point on the Robot Tower part. If you aim the camera at a moving part, the motion of the camera will seem unnatural, unless the part is moving smoothly. For this assembly, you might consider aiming the camera at a dummy part in the assembly so it's moving in a jerky fashion, following a jaw, for example. You can use a part just floating in space, but generally moving left, right, up, or down as needed without being rigidly connected to any single part of the assembly.
Attach the camera to the spline by selecting the spline in the first Camera Position selection box. If you are at T=0 (the first time key point), make sure the percent position is set to 0.
To get the camera to move around the spline, move the timebar to a position such as 0.4 second, edit the Camera item in the MotionManager (right-click it inside the Lights, Cameras And Scene folder found only in the MotionManager, not in the assembly FeatureManager), and select the Properties option. Then move the Percent slider under Camera Position to about 25 percent. Do this as many times as needed to go all the way around.
If parts of the model go out of the field of view, or you feel that the camera is too far away or too close to the model, you can move the camera or change the lens. To move the camera, exit the camera PropertyManager and edit the 3D sketch.
If you take the animation around more than 360 degrees, you must use a workaround to get it to work correctly. For example, if you use the Percent slider, and go 0-25-50-75-100 and then 25 percent, the animation will reverse direction between 100 and 25. The way to make this happen so the animation maintains continuity is to place keys at both 100 and 0 close enough to one another that the time difference is less than the frame rate of the animation. The frame rate is set in the Motion Study Properties, the icon on the far-right side of the MotionManager toolbar. For a finished animation, the frame rate could be in the neighborhood of 30 frames per second (fps), which means the time for one frame would be 1⁄30 second, or about 0.03 second. Therefore, if 100 percent happens at 2 seconds, you could put 0 percent at 2.01 seconds and the transition would never be seen. This workaround is used widely by people who know the software well.
The same sort of tactic works if you have to go beyond 360 degrees. You must use the zoom tools in the lower-right corner of the MotionManager to be able to see what's going on. Figure 23.22 shows two camera key points very close together in this way. To change the percent position, double-click the key point, and the Camera PropertyManager will become available.
FIGURE 23.22 Working around the 100 percent or 360-degree animation limitation
This chapter briefly discussed key points to introduce the idea; in this section, you will learn how to use them in more detail. You can think of key points as snapshots at particular moments in time. If you say, “At the 4-second mark, the wheel must be 3 inches from the wall,” this statement describes a key point for the position of the wheel. To create a key point for any property, drag the timebar to a new time and make a change to that property. Any of the animatable properties listed earlier in the chapter can create a key point.
The Autokey button on the MotionManager toolbar does for moving components what Disable View Key Creation does for animating view changes. When you have this button pressed, moving parts with the cursor will create a new key point at the current location of the timebar.
Consider this easy and useful example: A customer wants you to make a little animation of a holder for a stethoscope that he will show to a potential client in PowerPoint. The holder opens, the stethoscope slides out, and then the animation reverses.
The assembly and the completed animation timeline are shown in Figure 23.23. This animation uses RealView display, which the customer has said is good enough for his purposes. Using it reduces the render time significantly when compared to using PhotoView 360 to render the animation.
FIGURE 23.23 The stethoscope animation setup
Your first task is to set up the camera. You could do this without a camera, but cameras are a convenient way to store a particular view, along with settings such as lens angle, perspective, camera position, and target. In addition, if you decide to use PhotoView 360 later, cameras are the only way to get depth of field for additional realism. Another advantage of the camera is that you can control the area in view more closely. If you don't use a camera, the area of view is just whatever is available in the viewport. With the camera, you can specify a size and aspect ratio, and the available area is cropped appropriately.
Because the stethoscope model is cut into pieces to enable different parts of it to be positioned, you must position the parts and the camera such that the break between the head and earpieces is not visible. Leave enough open area so that when the stethoscope comes out, it won't run out of the area of view.
It's a good idea to start animations with some stillness; if you start an animation with motion, your viewer may not have time to adjust. A second is usually enough. Expand the Top part
file, click the key point for the Move row at the zero (0) time mark, and Ctrl+drag it to the 1-second mark. This means that the top won't move between 0 and 1 second. Now move the timebar to 2 seconds, and open the top by dragging it up slightly. It should only open about one-half inch.
Now move the timebar to the 5-second mark. Next, you'll purposely create a mistake so you can learn how to correct it. At the 5-second mark, move the stethoscope out of the holder 3 or 4 inches. Try to make sure you don't go far enough that the rubber tube runs into the plastic parts.
Notice that this creates a change bar that shows the position of the scope head part moving continually from time 00.00.00 to time 00.00.05. The motion is supposed to start at the 3-second mark. You can see how to fix this mistake in Figure 23.24.
FIGURE 23.24 Fixing a timeline problem
Click the key point for the motion of the scope head part. Then Ctrl+drag it from the 0-second mark to the 3-second mark.
The animation is essentially done at this point, except that the stethoscope needs to go back into the holder and it must close. You don't have to manually create all the steps to close the device, although you could. It is more efficient to simply copy and reverse the paths that you have already made.
To copy both sets of motion—the top opening and the head sliding out—drag a marquee window around the key points to select them all, and then Ctrl+drag them to the 6-second mark. Notice that this creates the situation shown in Figure 23.25. If you play the animation at this point, it won't be what you want. It will simply stack the same motion on top of the original motion; you want it to be reversed.
FIGURE 23.25 Copying motion of parts
With the newly copied key points still selected, right-click one of them and select Reverse Path. Notice that this shows symmetrical key points.
The animation is almost complete, but it would be better if the second half of the animation went by faster than the first half. To do this, move the key points on the right side of a change bar toward the left. You may want to move both key points for the top part closing so it starts closer to the time when the scope head is back inside the holder. You could even make some of the motion overlap, so the top starts closing before the scope head is fully inside.
Again, if you see a strange effect, such as the scope head not going all the way back to where it belongs, try clicking the Calculate button again. Calculate essentially rebuilds the animation after changes.
To make the motion a little smoother, right-click in an empty space inside the timeline area and choose Select All; then right-click one of the key points and select Interpolation Mode. Click the Ease In/Ease Out option. Click Calculate again to watch the smoother animation.
If you want variable speed, say, for the scope head coming out of the holder (for example, it starts coming out slowly and then speeds up), you need to add at least one more key point. To do this, position the timebar to the left of the middle of the first scope head change bar, and click Place Key. This adds a key point in the existing change bar. This is shown in Figure 23.26. Then move the key point to the right. Make sure the new key point uses the Ease In/Ease Out Interpolation mode. Recalculate and run the animation again.
FIGURE 23.26 Adding and moving a key point in an existing change bar
If you decide that the entire animation is too fast or too slow, you can adjust this easily. Drag the right-most key point on the top row with the Alt key depressed. This will scale the entire animation up or down.
After you're happy with the animation, click the Save Animation toolbar button. This will bring up the Save Animation To File dialog box, shown in Figure 23.27. The options for output formats are
*.avi
, or a *.bmp
or *.tga
series of still images. You could combine the still images to make an animated GIF to use on a website. Other types of output, such as Flash or QuickTime, are not available directly from the SolidWorks software. Movie format converters are available on the Web for this purpose.
FIGURE 23.27 Saving output data for your animation
The options for the renderer are simply the SolidWorks screen or PhotoView 360. This example uses RealView and the SolidWorks screen renderer, which provides sufficient quality for your purposes. The main advantages of PhotoView 360 over RealView are that it offers a better choice of backgrounds, anti-aliasing, and more shadow control.
Image Size And Aspect Ratio options are available only when you don't use a camera. Without the camera, you're at the mercy of the size and shape of the SolidWorks graphics window until you save the animation to a file.
The Schedule button enables you to schedule the output for a more convenient time. You would normally use this option when using PhotoView 360, because rendered animations can take many hours to complete, depending on render settings, length of animation, and the number of the fps.
Frame Information enables you to set the quality of the finished rendering. Low frame rates result in choppy motion. High frame rates are much smoother, but the files may become unmanageably large. High-quality animations generally fall into the 25 to 30 fps range.
Depending on the length of the animation and the other settings, test animations might run in the might run around 10 fps. You might also consider using a specific range of time to test just a part of the animation.
Unfortunately, many of the decisions you make regarding animation quality settings directly relate to the time you have to produce the final movie file. The biggest timesaver is to avoid PhotoView 360. If RealView suits your needs, you're well ahead on time.
When you save the animation, the software prompts you to select a video compressor (codec). Typical options are the Microsoft Video and Cinepak compressors. Sometimes when you record or play back a movie with a particular compressor, you end up with lots of video noise in the movie. If this happens, try another compressor. For example, if you use Microsoft Video for an animation, and it has lots of video noise, you can switch to Cinepak to see if the results are better.
Basic Motion is the functionality formerly known as Physical Simulation. It involves setting motors to turn parts, gravity to move parts and springs, and collisions to create animations that cannot be driven by mates or free motion. It uses a different solver than the rest of the animations in this chapter.
Basic Motion doesn't take into account effects such as momentum, bounce, resistance/friction, viscosity, and reaction forces. To analyze for these effects, you need to use Motion Analysis.
The Study Type selection box appears in the upper-left corner of the MotionManager. You need to use Basic Motion (refer to Figure 23.2) for this example.
Figure 23.28 shows an assembly that demonstrates the gravity and contact functions of Basic Motion. The problem is easy to set up. The part that is to move (the ball) is underdefined, using only one mate to keep it in plane as it moves. The zigzag part uses a Fixed constraint.
FIGURE 23.28 Setting up contact and gravity
When you have added the physical simulation items, the MotionManager design tree looks like Figure 23.29. Editing items such as contact and gravity don't use the interface options that have been available in the rest of the SolidWorks software. Click (select) doesn't bring up a context toolbar; you have to right-click and access the full RMB menu.
FIGURE 23.29 The MotionManager design tree with added items
Because this example goes by so quickly, you may want to use the Playback Speed drop-down menu to get a better look at it. You can also set playback looping options with the drop-down menu to the right of the Playback Speed.
For Contact to be successful (so two parts will not go through each other), it might be necessary to increase the fps of the animation for the Basic Motion. Also, you might have to increase the Geometry Accuracy and the 3D Contact Resolution settings. Remember that SolidWorks calculates the contact for each frame and stops the movement on interference. So, if the parts move fast, but the frames are few, a part might have already gone through the second part, with no contact registered.
The use of motors doesn't necessarily require Basic Motion, but if you include springs, or contact or gravity problems, it does. Torsion springs require Motion Analysis, but linear springs require only Basic Motion. This example (available from the download materials in the Animation folder as ratchet.SLDASM
) shows a motor driving a gear with a ratchet held to the gear teeth by a spring, as shown in Figure 23.30. A swinging ball on a spring is added to show this isn't simple 2D functionality.
FIGURE 23.30 A motor, gear, and ratchet assembly driven by Basic Motion
To set up this example, apply a counterclockwise motor to the inside circular edge of the gear, and select the block as the reference part. In this example, start the motor with a slow RPM (revolutions per minute), move the timebar out a few seconds, and assign a faster speed, so the motor speeds up over time.
The linear spring is easy to apply. Select the locations of both ends. This example has circular bosses on the block and the ratchet to hold the spring.
Two of the most common requests from people learning how to make animations in SolidWorks are animating chains and springs. This is a simple animation, but it uses a couple of tools that you should know about. Earlier in this chapter, the Yoke Link assembly was used to demonstrate how to flex a strap by using in-context relations and a loft. This chain-gear-spring example uses motors to drive a chain, which drives gears and flexes a spring. The spring is a modeled element, not part of Basic Motion. The driving element is a motor. Figure 23.31 shows the assembly ready for animation.
FIGURE 23.31 One simple assembly can demonstrate several animation ideas.
Open the assembly called chain assembly pattern.sldasm
from the material for this chapter from the download site. The assembly consists of the following components:
The chain is achieved with the inner and outer links and a Chain Pattern, and the spring is achieved with an in-context relation. The animation is driven by a single linear motor.
The model is created by first drawing Sketch1, which represents the path of the chain. This consists of lines and tangent arcs. Next, in order for the path to be a single smooth, continuous entity, a second sketch is created and Fit Spline is used to lay a spline over the lines and arcs. A very small tolerance value is used so the curvature comb for the spline looks as close to a line-arc combination as possible.
The interface for creating a Chain Pattern walks you through what to select, depending on what type of chain you are using, and will even locate the links on the path for you.
Without the Chain Pattern, this would require nearly 100 mates to make a functional chain. The Chain Pattern PropertyManager is shown in Figure 23.32.
FIGURE 23.32 Using the Chain Pattern to assemble a chain along a path
The gears are positioned at the centers of the arcs from Sketch1. The tricky part of the gears involves using the Rack-and-Pinion mate to match the linear motion of the end chain link to rotary motion of the gear. Because this is just for an animation, and not a real analysis, idealizing the assembly in this way won't have any adverse effects.
The construction of the spring is to simply use a straight line as an in-context connector between the last link of the chain and Plane1 of the assembly. This line is then used as the path of a sweep with twist enabled, which is a reasonable approximation of a spring for an animation. It doesn't flex for dynamic assembly motion, but it does for an animation.
All that remains is the motor. Figure 23.33 shows how the motor is driven. It's a linear motor, with the Oscillating motion. The Displacement Vs. Time chart shows how much the chain moves during the 6-second animation. You can also see that the chart shows how much the spring extends or retracts.
FIGURE 23.33 Charting the motion of the assembly
Although this assembly and the animation are simple, they demonstrate many of the techniques you need to know to make animations that are more complex. Motors with controllable output are a big part of animating automatic machinery, and making parts appear flexible adds greatly to the realism of an animation.
The Mate Controller is an interface that helps you drive the positions of parts through selected mates. You can use it to create configurations, but configurations are not required to use it. When using motors, it is best to work with underdefined assemblies, but the Mate Controller works best with fully defined assemblies. You can drive the mates using values, a slider, or by visually dragging parts on the screen. This is the tool that I would recommend if you have a lot of mates, a lot of possible degrees of freedom, and multiple moving parts that may not react well to manual dragging (such as an arm with a shoulder joint, elbow joint, wrist joint, and fingers). The interface enables you to lock down certain mates to control where the motion happens, even when you are visually dragging parts on the screen. This is the kind of thing you would do manually by suppressing and unsuppressing mates to enable or restrict movement.
Rather than using configurations to remember positions of the assembly, the Mate Controller allows you to specify and remember positions, which use specific values for multiple mates. This is much simpler than using configurations, and when you are done, you can save all of this information out to configurations, if you want to reuse that position data for drawings, renderings, animations, or other purposes.
It may also be a good idea to build your assembly slightly differently when you plan to use the Mate Controller. Instead of using a Concentric mate for a joint, you might consider using a Limit mate with angles. Using actual values (numbers) gives you more positive control. As usual, it is best practice to name the mates used in the Mate Controller in order to provide some clues about the functions of the mates, such as Rotate Base. If you get them in order, the Mate Controller interface will be set up logically to help you control the motion of the assembly in a certain order.
You can initiate the Mate Controller in one of several ways.
The positions created by the Mate Controller can be renamed and reordered to create an animation. The Mate Controller PropertyManager has an animation interface at the bottom, as shown in Figure 23.34.
FIGURE 23.34 The Mate Controller PropertyManager interface enables you to control motion of the assembly and create animations.
The button shown to the left enables you to collect all of the supported mates in the assembly. The supported mate list is as follows:
If you want to create multiple animations or motion schemes, you can also create multiple Mate Controller features in the assembly.
If you keep your animation relatively simple, the MotionManager tools in SolidWorks Standard should produce adequate results in some situations. If you are using mates to drive motion, be sure to follow best practice recommendations for mates. If you are manually positioning parts, remember to place key points closer together if the motion curvature changes abruptly.
If you are making larger animations and the end product is just an AVI file, it's acceptable to break the animation into smaller bits. This makes each part of the animation much simpler to do, and work can even be delegated to other users or other machines for parallel processing. It may also be beneficial to use post-processing to add captions and narration to your movies; a few words of explanation might be valuable to viewers.