animator guide

8
The Independent Magazine for the SolidWorks ® Community TM www.solidmag.com A CONNECTPRESS ® LTD., PUBLICATION A NIMATION S PECIAL E DITION A NIMATION S PECIAL E DITION •A NIMATOR B ASICS •A DVANCED T ECHNIQUES A NIMATOR B ASICS A DVANCED T ECHNIQUES

Upload: david-quiroga

Post on 29-Nov-2014

391 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Animator Guide

The Independent Magazine for the SolidWorks® Community

TMwww.solidmag.com

A C O N N E C T P R E S S ® L T D . , P U B L I C A T I O N

ANIMATIONSPECIALEDITION

ANIMATIONSPECIALEDITION

• ANIMATOR BASICS

• ADVANCED TECHNIQUES

• ANIMATOR BASICS

• ADVANCED TECHNIQUES

Page 2: Animator Guide

S O L I D Solutions

SolidWorks Animator can create animations for anything from dazzling client pre-sentations to adding a multimedia experience to your web page. This is the first arti-cle of a two-part series covering the basics of making your SolidWorks models move.

Open a model that you want to animate, and let’s get started. Go to theAnimation Wizard, which you can access from the Animator menu or theAnimation toolbar. It allows you to create turntable rotations as well as

exploding and collapsing animations of your SolidWorks models (see Figure 1).

Rotate modelAfter choosing Rotate model from the Animation Wizard and clicking Next, you can

choose whether to rotate about the X, Y or Z axis. These axes refer to the coordinates of yourscreen rather than the coordinates of the model. The X-axis being a horizontal line across thecenter of your screen, the Y-axis a vertical line across the center of your screen and the Z-axisa line coming directly out of your screen (see Figure 2). The preview window will show youhow your model will rotate. In SolidWorks 2000, you may also choose Clockwise orCounterclockwise for the direction of the rotation.

The next page of the Animation Wizard allows you to set the duration of the animation aswell as the start time. You can manipulate the start time of the animation to sequence multipleevents accurately. We’ll discuss more about sequencing a little later. For creating your every-day simple rotation, set the duration to how long you want the animation to last and leave theStart Time at 0 seconds. If you check Play animation and click the Finish button, you willsee your rotation animation play in the SolidWorks window. You now have access to the Playbuttons from the animation toolbar, so hit Play and watch your part spin around again.

You may find that the animation displayed on the screen is very choppy. SolidWorksAnimator is probably displaying the animation to the screen at 1 frame per second (FPS). Untilyou record your animation to a file, the Animator will default the display in the SolidWorksgraphics window to 1 FPS. If you look in the lower right corner of the SolidWorks window, youwill see the FPS that SolidWorks is going to use for the display of the current animation (seeFigure 3). This display includes the current frame of the animation (in seconds) as well as the

total animation length. Likewise, the actual time that the anima-

tion played on the screen may not be thesame as the duration that you entered inthe wizard. The duration will be correctwhen the animation is recorded to a file(usually an AVI file). The actual speed atwhich the animation is played in the graph-ics window depends on the complexity ofthe model as well as the power of the graph-ics card being used on your machine.

Explode/CollapseIf the SolidWorks model that you are ani-

mating is an assembly and you have alreadyadded an exploded view to a configurationof that assembly, the Animation Wizard canbe used to animate the exploding or collaps-ing of the assembly. From the first page ofthe wizard, select Explode or Collapseand click Next . The second page is thesame as when animating a rotation. Youcan set the duration of the animation inseconds as well as the start time. CheckPlay animation , and cl ick Finish towatch your assembly explode or collapse inthe SolidWorks graphics window.

Do you want to animate an assemblyexploding and then collapsing in the sameanimation? That’s not a problem inSolidWorks 2000. This is where using the

2

SOLIDWORKSANIMATOR BASICS

ANIMATION 101:SOLIDWORKSANIMATOR BASICS

Brian Hill

Figure 2: Animation Wizard rotation axes.Figure 1: Animation Wizard.

Page 3: Animator Guide

S O L I D Solutions March/April 2000S O L I D Solutions

various intervals along the path. The Create Path dialog shouldopen, giving you the ability to Add Path Point and set the StartTime and Duration for the path (see Figure 5).

Click Add Path Point to add the starting point for the compo-nent’s path. Using the Move Component tool from the SolidWorksAssembly toolbar, move the component to where you would like theend of the path to be and click Add Path Point a second time.Enter a Start time and Duration for this path, and click Done.

At this point if you click Play from the Animation toolbar, youshould see the component move between the two path points youhave specified. To see your component move along a more com-plex path than a straight line, add additional path points betweenyour start and end points.

Creating viewpoint pathsThe viewpoint icon in the Animation Manager can be used to

record view orientation changes (pan, zoom, rotate) that youwould like to incorporate into your animation. These can be usedto simulate a fly-by or a turntable animation. The easiest way tosee how this works is to right click on viewpoint, and selectCreate Path. Click the Add Path Point button to add a startingpoint for the viewpoint path. Using the view orientation tools fromthe VIEW toolbar, zoom in to a portion of your model and addanother path point. Using the view rotate tool (also in the VIEWtoolbar), rotate the view of your SolidWorks model and add anoth-er path point. Zoom back out, and add a final path point.

When you play this animation, you will see that the animatorzooms into a region of your model, rotates the model slightly andthen zooms back out. By adjusting the Start Time of this path, youcan combine this animation path with others in your assembly, soyou can have two things happening at once. For example, you canslowly rotate an assembly while components of the assembly aremoving.

To help you organize the sequencing of all these paths, eachpath has a unique path name and lists the time that this portionof the animation will take place, in the form of (Start time, EndTime) in seconds. At the bottom of the tree in the Animation-Manager is the schedule. The schedule is a sequential list of all ofthe individual animation paths that have been added to theassembly components. It can be used to visualize which parts ofthe animation come first and which come later.

Editing existing pathsIf you need to go back and edit an animation path that you have

already created, r ight c l ick on the path in the AnimationManager, and select Edit Path. This dialog allows you to changethe path name, step through each of the path points you havedefined, edit those points or add additional path points and modi-

Start time setting in the wizard comes into play. The easiest way to dothis is to create the explode animation using the wizard as mentionedabove. When done, re-enter the Animation Wizard and set it to performa collapse. Think back to the values you entered for the duration of theexplode animation. Rather than entering 0 for the Start time of the col-lapse, enter the time when your explode was finished. For example,let’s say you would like your assembly to explode in ten seconds andthen collapse in five seconds. The settings for the explode would be aStart time of 0 sec. and a Duration of 10 sec. The settings for the col-lapse would be a Start time of 10 sec. and a Duration of 5 sec. (seeFigure 4).

If you want to add a pause between the explode and the collapse, allyou have to do is modify the Start time of the collapse accordingly. Ifyou want your assembly to explode, spin around and then collapse, yourun through the wizard three times—each time adjusting the type ofanimation and Start time accordingly

SolidWorks Animator can only work with components at the top levelin the assembly. If you have explode paths defined for subassembly com-ponents, these will not appear in the explode animation. The easiest wayto work around this is to create another copy of your assembly where youhave dissolved all of the subassemblies that you want to animate.

Manually adding component pathsThe Animation Wizard can create simple animations of your

SolidWorks models, but what if you want to make something morecomplex? The Animator enables you to add animation paths manuallyto the components in your assembly. An animation path is what thecomponent will follow as the animation is taking place.

Open an assembly, and find the tab toward the bottom of theFeatureManager with a small green camcorder. It is cal led theAnimationManager. If you click this tab, you will see a familiar tree for-mat with three sections:

❑ viewpoint

❑ list of all the components in the assembly

❑ schedule

To start , r ight c l ick on one of the components l isted in theAnimationManager, and select Create Path. Manually creating pathswith the Animator works on the premise that you manually move thecomponent in the SolidWorks graphics window and add path points at

Figure 3: Animation duration. Figure 4: Sequencing multiple events.

3

Page 4: Animator Guide

S O L I D Solutions

you only have the ability to add paths tocomponents that are in the top level.

In SolidWorks 2000 you can add multiplepaths per component. Let’s say, for exam-ple, you would like a component to move toa set location, pause for a few seconds andthen move to another location. After addingthe path for the first portion of the move-ment, right click on the component in theAnimationManager and select Create Pathagain. Use this path to define the secondpart of the motion of the component, and setthe Start time, such that this path won’tstart animating until a few seconds after thefirst one is complete.

Recording your animation

When you are comfortable with the wayyour animation is playing in the SolidWorksgraphics window, it is time to create the fin-ished product, the AVI file. To record youranimation to an AVI file, click the Recordanimation button from the Animation tool-bar. This will open the Save animation to filedialog box, allowing you to specify the follow-ing options you would like for your AVI file:

❑ Renderer. You can choose theSolidWorks screen or, if you havepurchased PhotoWorks, the PhotoWorksbuffer for your animation. When usingthe SolidWorks screen as the renderer,the Animator will simply use the colorsthat appear in the SolidWorks graphicswindow. If you use the PhotoWorksbuffer as the renderer, the animationwill take much longer to generate (as ithas to use PhotoWorks to render eachframe), but it will take advantage of allthe benefits of PhotoWorks (shadows,texture maps, reflections, etc.).

❑ Frame information. You can set thefps for your animation. Basically, themore frames per second you have inyour animation, the smoother it willappear when it is played on the screen.

❑ Image size and aspect ratio. Theseoptions become active only if you areusing the PhotoWorks buffer as yourrenderer. Using these options, you canexplicitly define the physical size (inpixels) of the AVI file that is output.

❑ Video compression. After clickingSave, the final dialog you willencounter is Video Compression. Thisallows you to specify the videocompressor to be used to create yourAVI file. The AVI file format is acompressed video format that requires a

fy the Start time and Duration of the anima-tion path.

If you would like to edit an existing pointin a path, click the Next or Previous but-tons in the dialog, until the component is atthe point along the path that you would liketo edit. Set the Action pull-down menu inthe Edit Path dialog to Update Current,and reposition the component on the screenas necessary. When you are satisfied withthe new location for the component, clickApply. Similarly, you can delete the currentpath point or add additional path pointsamong existing ones.

Some things to think about when manu-ally creating and editing path points forcomponents:

❑ The Animator will observe the currentmating scheme when animatingcomponents in an assembly. If you havea component that is fully constrained,there is no way that you can move itwith the Move Component tool, sothere is no way to add path points. Youmay have to suppress some of themates in your assembly to get themovement that you want. Note that theonly instance where this does not applyis when performing an explode/collapsewith the wizard.

❑ The animator takes advantage ofdynamic assembly motion. If you haveother components mated to thecomponent you are moving, thesecomponents will move accordinglywhen you animate the motion of thiscomponent.

As mentioned above in the Explode/Collapse section, SolidWorks Animator canonly work with components that are at thetop level in the assembly. Look in theAnimationManager, and you will see that

video compressor to create (compress)and play back (decompress) the data.These video compressors aresometimes referred to as CODECs,which stands forCOmpressor/DECompressor. There arecountless numbers of AVI CODECsavailable for download on the web, andeach uses a different series ofalgorithms for the compression of theanimation frames. Because the CODECis used to create and to play back theanimation, it is essential that themachine you use to view the AVI filehas the same CODEC as was used tocreate the AVI. For this reason, it isusually best to stick with one of thedefault compressors installed with youroperating system. Most CODECs allowyou to specify a Compression Qualitysetting as well; higher values translateto higher quality images, but withincreased file size.

AVI tipsSome things to keep in mind when speci-

fying your AVI options are:

❑ Unless you are using the PhotoWorksbuffer and have explicitly defined anImage Size, the resulting AVI file willbe the same size as your SolidWorksgraphics window. The larger the AVI ison the screen, the larger the file sizewill be. Therefore, it is usually best toreduce the size of the graphics windowbefore creating the AVI.

❑ Don’t go crazy with too many frames persecond. Most feature length films shownin the theater are shot at roughly 24 to30 fps; anything higher and the humaneye can’t really distinguish thedifference. Keep in mind that the moreframes you have in your animation, thelonger it will take to generate (especiallyif you are using PhotoWorks as yourrenderer) and the larger the size of theresulting AVI file will be. In mostsituations you can get decent resultswith settings in the range of 15 to 20 fps.

See part II of this publication for a moreadvanced look at SolidWorks Animator,including how to stretch and deform parts,how to animate a cut-away view and how towork faster.

Brian Hill is a Certified Technical SupportEngineer at SolidWorks Corp., in Concord,Mass. He can be reached at [email protected].

Figure 5: Sequencing multiple events.

4

Page 5: Animator Guide

Advanced Animator Techniques

S O LU T I O N S I I

Color, select Change Color, and assign an assembly componentcolor to the part (see Figure 1). This color will take precedence overthe color that you have assigned to the entire part at the part level.

The next step is to create an animation path that controls thetransparency of the component. To do this, click on the Anim-ationManager tab near the bottom of the FeatureManager,right-click on the component on which you would like to controlthe transparency and select Create Path.

With the Create Path dialog open, add a path point using AddPath Point. Keeping the Create Path dialog open, switch back tothe FeatureManager and access the component color properties

for the component again(r ight-c l ick ComponentProperties, Color). Click onAdvanced button and slidethe Transparency slider allthe way to the right. OK all ofthe component propertydialogs and click Add PathPoint a second time in theCreate Path dialog. Selectthe start time and durationfor the fade-away and clickDone. Click Play on the ani-mation toolbar and there youhave it (see Figure 2).

Remember that this onlyworks for assembly compo-nents that have their colorspeci f ied as an assemblycomponent color. This tech-

nique will not work if the assembly component color isn’t assignedto the component that you are animating.

Note that you also can use the same technique to have an assem-bly component fade from one color to another. Instead of adjustingthe transparency for the second path point, simply change thecolor. This technique is great for showing something heating up or

H ave you ever wanted to animate a cut-away view of yourassembly or fade out an assembly component to see inside acomplex model? Have you even wanted to animate a color

change of an assembly component or stretch and deform yourSolidWorks models? Did you know that you could do all of thesethings and more using the SolidWorks Animator? Curious? Read on!

Animating transparency and colorThis first, and perhaps most useful, technique that we will dis-

cuss is animating the transparency of an assembly component.Have you ever worked with a complex assembly and wished thatyou could get that darn com-ponent out of the way so youcould see the complexmotion of parts inside yourmodel? Using the Sol id-Works Animator you can dojust that.

Through the Sol idWorksAnimator you have the abili-ty to contro l the color ofassembly components(including their transparen-cy) as def ined by theirassembly-level ComponentProperties. Note that thiscontro l only exists at theassembly level . The Ani-mator does not have the abil-ity to control colors at thepart level. Using this exam-ple, we will cover how to animate the outer shell of this cordlesssaber saw so that it’s fading away in color properties.

For the animator to have control over the color properties (color,transparency, etc.) of the shell of the saw, you need to assign anassembly component color to the part. To do this, right-click on thecomponent in the assembly, select Component Properties, select

Brian Hill

Advanced Animator TechniquesFading is easy with a mouse on the right path

ADVANCEDS O LU T I O N S I I

This is the second part in a two-part series on working with the SolidWorks Animator. “Animation 101: SolidWorksAnimator Basics” discussed some of the basic principles of the SolidWorks Animator and offered several examples of how

to make simple animations using the Animation Wizard and manual path creation.

Figure 1: Changing assembly component instance color.

5S O L I D Solutions 5

Page 6: Animator Guide

S O L I D Solutions 6

the depth of a cut or the value of a dimen-sion. In order to animate a cut-away view ofthis assembly we wi l l have to insert adummy part into this assembly. Thisdummy part is a part that does not containany solid geometry; it contains only a planarsurface. Once the dummy part has beeninserted, position it in front of the assemblyusing the Move Component tool.

Next, while still editing the main assem-bly, select the planar surface from thedummy part and create a sketch on it thatyou would like to use for your assembly cut.Using this sketch, insert a blind assemblycut (Insert , Assembly Feature , Cut ,Extrude). Set the depth of the cut suchthat i t comes c lose to the model , butdoesn’t actually cut the assembly. It isimportant that this cut come close to themodel, but not actually cut the components.

At this point we now have a dummy partin the assembly that has a negative volumein f ront of i t . Using the Sol idWorksAnimator, we can move this componentthrough the assembly and have i t cutthrough whatever geometry we want. To dothis, simply right-click on the dummy partcomponent in the AnimationManager taband select Create Path. To create the pathpoints for the component click Add PathPoint, which will add the starting point.Then, using the Sol idWorks MoveComponent tool, move the dummy partcloser to the model so the assembly cut(that was set to a blind distance in front ofthe surface) is cutting through the assembly

to draw attention to a particular componentin the assembly.

As mentioned in “Animation 101: Solid-Works Animator Basics”, if you have pur-chased the photo-realistic rendering add-inPhotoWorks you can create fully renderedanimations that incorporate the photo-real-istic effects possible with this package.Some of these features include: shadows,reflections, refraction, and different materialtextures. If you would like to incorporatethe fading component technique into ananimation that uses PhotoWorks to renderthe animation, make sure you have ApplySolidWorks properties for renderchecked under Photo-Works, Options,Materials. This will force PhotoWorks touse the SolidWorks colors (and transparencysettings) in the rendering. For this to comeout as well as you want, you need to makesure your Solid-Works part colors resemblethe colors of the material that you wouldhave assigned in PhotoWorks.

Animating a cut-away viewRather than fading a component away by

animating its transparency, another methodof opening it up is to animate an assemblycut through your model.

Before we can work on creating the ani-mated cut-away view of this model, weneed to understand some of the limitationsof the Sol idWorks Animator , which isdesigned to animate the motion of compo-nents in an assembly. The animator, howev-er, is not designed to dynamically change

and click Add Path Point a second time.(See Figure 3)

The finishing touch in the animation is tohide the planar surface in the dummy part.To do this, simply right-click on the surfacein the FeatureManager tree and selectHide. Now when you play the animation ofthis dummy part moving through theassembly (with the surface hidden) it willappear that you have created an animatedassembly cut.

Note that SolidWorks allows you to definethe Feature Scope of assembly cuts. Thisfeature allows you to choose which compo-nents get cut by the assembly cut andwhich components are ignored. In thisexample, the desired effect was to see thecomponents that were inside of the engineblock. To prevent these components frombeing cut, they were removed from theFeature Scope list of the assembly cut.

The reason why this technique worked isbecause the SolidWorks Animator performsa limited rebuild on the assembly during thegeneration of the animation.

Stretch that part!Using the same limited rebuild that was

mentioned in the previous section you candynamically change the shape of assemblycomponents that are defined in-context.The assembly that wil l be used in thisexample is a small foam dart gun. Note theblack rubber band toward the top of thisassembly (see Figure 4). This rubber band isdefined in the context of the assembly (top-

Figure 2: Animation transparency.

ADVANCEDS O LU T I O N S I I

Page 7: Animator Guide

7S O L I D Solutions 7

(stretching) as the pull-ring is pulled back. Thistechnique can be used in many situationswhere a component needs to change size dur-ing an animation. Note that this technique islimited to parts that are defined in the contextof the assembly. Equations will not updatebetween frames of an animation; only in-con-text relations will update.

Simulating movementTask: You need to animate a toy truck

assembly driving around the screen.Problem: The mating scheme in the

assembly prevents the truck from beingmoved with the Move Component tool.

Solution: Simulate the movement!Let’s step away from your computer for a

moment and imagine that you are in chargeof filming a TV commercial for a new truck.The producer has requested that the nextshot needs to have the truck speedingstraight at the camera and passing it on theleft. The easiest way to film this shot wouldbe to firmly attach the camera to the groundand have someone drive the truck straightat you as you stood behind the camera andfilmed the shot. Fearing for your life, youcome up with a better alternative: why not

down) so that it will always grow to coverthe distance between the yellow pull-ringand the blue body of the dart gun.

We can see this in the SolidWorks windowby dragging the yellow pull-ring away fromthe body of the dart gun using the MoveComponent tool. Note that after moving thepull-ring, there will be a rebuild icon in theFeatureManager tree. If you hit rebuild atthis point you will see that the rubber bandelongates to solve the in-context relationthat its sketch has with the rest of themodel.

Using this in-context part to our advan-tage, we can use the SolidWorks Animatorto create a component path for the pull-ring,one that pulls it away from the model. To dothis, right-click on the pull-ring componentin the AnimationManager tab and selectCreate Path. To create the path points forthe component, click Add Path Point ,which will add the starting point. Then,using the SolidWorks Move Component tool,move the pull-ring to its final position andclick Add Path Point a second time.

When the animation is played, the in-contextpart (the rubber band) updates between eachframe so it appears to be getting longer

move the camera rather than the truck?Looking through the camera, the image willbe the same: as you run toward the truck itwill appear that the truck is getting closerand closer. No one really has to know thatthe truck never moved.

This same effect can be applied to yourSolidWorks models if for some reason youcannot or do not want to move them withthe Move Component tool. If you look at thetop of the AnimationManager tab of anySolidWorks part or assembly file you will seethat there is a viewpoint icon. This iconallows you to add animation paths to the filethat control the view orientation (pan,zoom, rotate) of the model. To animate theview of the toy truck, and to give the illu-sion that it is driving straight at you, simplyright-click on the viewpoint and selectCreate Path. Using the Zoom In/Out toolfrom the View toolbar, zoom out and awayfrom the truck model so it appears to be farin the distance, and add a path point (byclicking Add Path Point) for the begin-ning of the animation. Next, using theView Orientation tools, zoom into themodel so it appears larger in your screen,and add a final path point. Click Done and

Figure 3:Adding pathpoints todummy part.

Page 8: Animator Guide

play your animation. Note that it appearsthat the truck is driving straight towardyou. By adding additional path points tothis animation path that combine bothzoom and view rotation you can make thetruck appear to drive straight toward you,turn around, back up, or anything else youcan imagine (see Figure 5).

Working fasterCreating a long complex animation can be

a time-consuming task. Here are a few tipsthat should help you get to that final prod-uct faster:

• Take small steps. If your animationinvolves several different events that allhappen at different times, it is usuallyeasiest if you work in small steps. Forexample, if your animation is going tobe 20 seconds long, try working in five-second intervals. Finish each five-second interval, making sure that all ofyour animation paths are synchronizedcorrectly, before moving on to the nextfive-second interval.

• Save PhotoWorks for the end. If youare going to be using PhotoWorks torender the frames of your animation,don’t use it every time you want to testyour animation to see how it isprogressing. When you use PhotoWorksin the animation it has to render eachframe individually and while thiscertainly produces a beautiful result, itis usually a time-consuming process.

• When testing your animation, trycreating several rough-test AVIs tomake sure that everything issynchronized correctly. These AVIsshould be made at a low Frame PerSecond (FPS), so they can be quicklygenerated and evaluated. The moreframes per second in your animationthe smoother the final result, but thelonger it takes to generate the AVI.

Brian Hill is a Certified Technical SupportEngineer at SolidWorks Corp. in Concord,Mass. He can be reached at [email protected].

S O L I D Solutions 8

ADVANCEDS O LU T I O N S I I

Figure 4: In-context part updating.

Figure 5: Simulating movement with view orientation.

MKSAR1100