This collection of small script snippets presents handy little routines that are usually too small to put into a proper extension. Use them with the Ruby Code Editor (just paste the code and hit “run”) or make them more permanent as a menu item (see Appendix D in my book).

Every once in a while it’s very useful to be able to precisely control the view in SketchUp. One of those cases is when you are creating a turntable animation video of an object (like the one shown above). The snippet below allows you to set that up by creating pages with defined view parameters.

First, we need to set the eye (view) height. That is best roughly located at the middle of the object, nine feet in my example. Then we are simply creating as many pages as necessary (in SketchUp proper, those are called “Animation Scenes”, of course). I decided to go with four orthogonal views that all point at the object (which for this purpose needs to be located at the origin). A zoom_extents command then makes sure everything is consistently in the view, independent of how far the viewer is away from the object.

As you can see, there are a bunch of parameters that you can experiment with. For example, you can actually set transition times and delay times separately for each page! That is a great feature because it allows you to slow down the animation in parts. And… those settings are not available through SketchUp’s user interface. Furthermore, you can have the camera point up or down as needed (just adjust the second parameter of the camera object). Keep in mind, though, that when you do that, the horizon will move around during the animation.

Once all pages are set up, simply go to File > Export > Animation and create the video (loop to starting scene for a proper turntable animation.

Code Snippet

Reference

Links & Ads

Comments