Exporting and Rendering Scenes - Sharing Your Work with the World- Blender For Dummies (2015)

Blender For Dummies (2015)

Part IV

Sharing Your Work with the World

image

webextra Visit www.dummies.com/extras/blender for great Dummies content online.

In this part . . .

· Exporting to external formats.

· Selecting a renderer.

· Compositing and editing images and video.

· Visit www.dummies.com/extras/blender for great Dummies content online.

Chapter 14

Exporting and Rendering Scenes

In This Chapter

arrow Exporting to other programs

arrow Comparing renderers

arrow Rendering still images and animations

Working in Blender is great, but eventually, you'll want to make the things you create viewable in places other than Blender's 3D View. You may want to have a printable still image of a scene, or a movie of your character falling down a flight of stairs, or you may want to export the geometry and textures of a model for use in a video game. In these situations, you want to export or render.

Exporting to External Formats

Exporting takes your 3D data from Blender and restructures it so that other 3D programs can understand it. There are two primary reasons why you'd want to export to a 3D file format other than Blender's .blend format. The most common is to do additional editing in another program. For example, if you're working as a modeler on a large project, chances are good that whoever hired you, unfortunately, is not using Blender, so you'll probably need to save it in a format that fits into their pipeline and is understood by their tools.

The other reason for exporting is for video games. Many games have a public specification of the format they use for loading 3D data. Blender can export in many of these formats, allowing you to create custom characters and sets.

warning With only a few exceptions, all of Blender's exporters are scripts written in the Python programming language. Although all the export scripts that ship with Blender support the basic specifications in their respective formats, they may not support all the features. For example, many of the exporters have difficulty getting armature or animation information out of Blender. So keep this limitation in mind, do a lot of testing with your exported files, and, as many open source programmers like to say, “Your mileage may vary.”

To export to a different format, choose File  ⇒  Export and choose the format that you would like to use. A File Browser then appears so you can tell Blender where to save your new file. The left region of the File Browser contains options that are specific to the exporter you chose. Figure 14-1 shows the Export menu with a list of the available file types.

image

Figure 14-1: File ⇒ Export ⇒ Wheeeeeee!

You may note that the export list appears strangely sparse. Most exporters in Blender are implemented as add-ons, the bulk of which are disabled by default. If you're looking for a specific exporter and you don't see it in the File  ⇒  Export menu, go to the Add-ons section of User Preferences (Ctrl+Alt+U) and find the add-on that provides the exporter you need. If the add-on is there, enable it, and the exporter should immediately be available in File ⇒ Export. To make the exporter always available, left-click the Save User Settings button at the bottom of User Preferences.

newversion Blender's Render Engines

Since the last edition of Blender For Dummies was released, Blender has gained a whole new renderer, Cycles. Blender includes both Cycles and the classic Blender renderer, now typically referred to as Blender Internal. Cycles and Blender Internal have massive differences, both in how they work internally and how you work with them in Blender. Whatever the technical differences, the important difference boils down to trade-offs between artist time and computer time.

Cycles is a modern renderer. Ironically, the technology is based on ray tracing, an older rendering method that has become more popular as computers have gotten fast enough to use this technique without taking days to output a single frame. A ray tracer works by shooting imaginary lines, called rays, from the camera to the scene. Those rays intersect or bounce off of materials or lights in the scene. Based on where those rays connect, the renderer calculates the correct color and brightness of materials in the scene. Ray tracing can more accurately depict the behavior of light in a scene than the methods used in render engines like Blender Internal (often called scanline renderers, or hybrid renderers if they try to incorporate some ray tracing).

From the user perspective, the trade-off depends on whether artist time or computer time is more expensive:

· With a ray tracing renderer, it's often very fast and easy to set up lights and materials on objects, because you basically apply your understanding of the physical, meatspace world. However, that typically comes at the cost of having very long render times.

· With a scanline renderer, you can spend a frighteningly long stretch of time tweaking, hacking, and faking lighting and materials, but render times usually are significantly shorter.

Let me throw one more monkey wrench into the mix. One of the key features of Cycles is that it can take advantage of the graphics processing unit (GPU) on certain video cards to accelerate the rendering process (often more than ten times faster than the CPU). This starts to make Cycles a much more well-rounded and compelling choice. But the choice isn't super clear, because Cycles can't take advantage of all GPUs, and many GPUs don't come with sufficient memory for processing large scenes.

If you're just starting out, my recommendation is to forget about trade-offs in speed and focus on the aesthetic. What kind of look are you trying to achieve with your 3D image or animation?

· Are you aiming for the kind of realism you see in a photograph? Cycles usually is a better choice for realism. There's much less frustration, because you won't need to be an expert at the nuanced fakery required by Blender Internal.

· You don't care about realism, and you're interested in taking more artistic license with the way things look (leaning toward the cartoony or the abstract)? Blender Internal may be a better fit for your project.

Decide case by case. In fact, I've used both renderers on a project, then composited the results (using the tools covered in Chapter 15).

Whatever you decide, Chapters 7, 8, and 9 cover how to set up materials, lights, and environments in both Blender Internal and Cycles.

Rendering a Scene

More often than exporting, you probably want to render your scenes. Rendering is the process of taking your 3D data and creating one or more 2D pictures from the perspective of a camera. The 2D result can then be seen by nearly anyone using image viewers or movie players.

remember Rendering is very much like taking a photograph or a movie in meatspace. If you don't have a camera, you can't take a picture. Likewise in Blender, if there's no camera in your scene, Blender doesn't know what to render, so make sure that you have a camera in there. If there is no camera, you can add a camera (Shift+A ⇒ Camera) and set it as the active camera in the scene (Ctrl+Numpad 0).

tip If your scene is complex, the Outliner is a fantastic place to find and select your camera object. Assuming you haven't renamed your camera object, you can use the Search field in the Outliner's header. Type in Camera; if that object exists in your .blend file, it appears. (The Search field is case-sensitive; if you don't know whether you've used uppercase for the first letter of your object, you may be better off searching for amera.)

Creating a still image

Rendering single images, or stills, in Blender is remarkably easy, regardless of the render engine you choose. Blender actually offers three different ways to do it. The fastest way is to simply press the F12 hotkey. Alternatively, you can left-click the Render button in the Render panel of Render Properties or choose Render ⇒ Render Image from the Info editor's header menu at the top of each of the screen layouts that ship with Blender. For details on setting up your materials and lighting for each of Blender's renderers, look at Chapters 7, 8, and 9.

Viewing your rendered images in Blender

Any way you decide to do it, Blender uses its integrated UV/Image Editor to display the rendered output. If you don't have a UV/Image Editor already open in your screen layout, Blender takes the largest area in your screen layout and changes it to the UV/Image Editor while rendering. Of course, some people would prefer a different behavior for displaying renders. Fortunately, available options allow you to change that behavior. The control is a drop-down menu in the Render panel of Render Properties, labeled Display. By default, it's set to Image Editor.

Figure 14-2 shows the Render panel and the four different options you have for where to send your renders. I like to use the default Image Editor setting or Full Screen. The following is a quick description of what each option does:

· Full Screen: This option does the same thing as the Image Editor option, except it also maximizes the UV/Image Editor to the entire Blender window.

· Image Editor: The default. Blender changes the largest area on your screen to a UV/Image Editor and displays your rendered image there.

· New Window: Blender creates a completely new window, populated only with a UV/Image Editor that displays your image.

· Keep UI: Blender doesn't display your render at all if you don't already have a UV/Image Editor available.

This can reduce the resources Blender consumes while rendering, but you don't get to see your render as it progresses.

image

Figure 14-2: To view your renders, choose to use Full Screen, Image Editor, or New Window. If you don't want to view your render, choose Keep UI.

For any of these render options, you can quickly toggle between your regular Blender screen and the render screen by pressing F11.

tip Another cool feature that works regardless of which way you like to see your renders are the render slots (sometimes called render buffers). When you have your render output onscreen in the UV/Image Editor, hover your mouse cursor in that editor and press J. Upon doing so, Blender switches to a different image buffer. The first time, it may seem odd because you just see a blank UV/Image Editor. However, bounce back to your scene (F11) and make a small change. Then render again (F12). Now when you press J on your render, it pops back to your previous render. Press J again, and you're back at your current render. The default behavior is to use J to toggle between two slots, but Blender offers you the ability to swap between up to eight render slots.

To use another render slot, left-click the Slot drop-down menu in the UV/Image Editor's header and pick the slot you want to render to. The next time you render (F12), this slot is filled. Using render slots, you can quickly compare the differences between different renders, cycling forward and backward through the non-empty slots by using J and Alt+J, respectively. Render slots are a great way to see whether you like the changes you've made to your scene.

Picking an image format

Now, you have your image rendered, but you still haven't saved it anywhere on your hard drive. It's not quite available for sharing with other people yet. This, too, is easily remedied, but before you save, you may want to change the file type for your image. Go to the Output panel of Render Properties, as shown in Figure 14-3.

image

Figure 14-3: Output panel in Render Properties.

tip When you save with Blender's File Browser, you also can choose the file type for your image from a drop-down menu in the region on the left side.

This works great if you're in a rush or if you forgot to choose your image format ahead of time. In fact, you don't even need to re-render if you change your image format. Internally, Blender stores your renders in the highest possible quality and only compresses when you save to a specific format (see “Saving your still image” in this chapter).

That said, the Output panel in Render Properties is the preferred way because it gives you a few more options for controlling your saved file. The primary control for choosing the format of your file in the Output panel is a file type drop-down menu. By default, Blender saves renders as PNG (pronounced “ping”) images. If you want to render to a different image format, such as JPEG, Targa, TIFF, or OpenEXR, left-click this drop-down menu and choose your desired file type. Depending on the file type you choose, the options at the bottom of the Output panel change. For example, with the PNG file type, the Compression slider is available for controlling the level of compression in the image.

The BW/RGB/RGBA buttons below the file type drop-down are always visible, and they're pretty important for both animations and stills. They control whether Blender, after rendering, saves a black and white (grayscale) image, a full color image, or a color image with an alpha channel for transparency. Typically, you use one of the latter two. RGB is the most common and is supported by all formats, creating a full color image. On some occasions, however, you’ll want to render with transparency.

As an example, say that you've made a really cool building model, and you want to add your building to a photo of some city skyline using a separate program like GIMP or Photoshop. (You can do it in Blender, too. See Chapter 15.) You need everything that's not your building, including the background of your image, to be rendered as transparent. An alpha channel defines that transparency. The alpha channel is basically a grayscale image that defines what is and is not transparent. Totally white pixels are opaque, and totally black pixels are transparent. Gray pixels are semitransparent.

remember Not all image formats support an alpha channel, such as the JPEG and BMP formats. If you choose one of these file types and have RGBA set, Blender just omits the alpha information when saving. If you want to make sure that your alpha channel is preserved, though, choose one of the following formats: PNG, Targa, TIFF, or OpenEXR.

Setting dimensions for your renders

The Dimensions panel close to the top of Render Properties gives you control over the size of your final render. The X and Y values under the Resolution label set the width and height of your image in pixels. The X and Y values under the Aspect Ratio label are for determining the horizontal and vertical aspect ratio of your image. The ability to adjust aspect ratio is for certain circumstances where you want to render your image with rectangular pixels rather than square ones. Typically, rectangular pixels are necessary only for television formats, so unless you know exactly what you're doing or if you're using a preset, I recommend setting these to the same value. I use 1.000 most of the time.

tip Speaking of presets, Blender offers a number of rendering presets for you to use. These presets are available from a drop-down menu at the top of the Dimensions panel. Choosing any one of them only affects settings in the Dimensions panel, but they're really handy if you know what your final output should be. Using presets is a great timesaver when you know, for example, that you have to render to high-definition video specifications, but you can’t remember the right resolution, aspect ratio, and frame-rate values.

remember Whenever you change the resolution or aspect ratio values in the Dimensions panel, you need to render your scene again (F12) to get it to appear (and save) in the right size. If you're just changing your output file type, you don’t need to re-render.

Saving your still image

After you've adjusted all your settings, rendered, and chosen your output file format, you have just one thing left to do: Save your still. Saving is quick and painless. From the UV/Image Editor, press F3 or choose Image ⇒ Save As, and Blender brings up a File Browser. Here, you can dictate where on your computer you want to save your render. That's it!

warning Remember, if you're rendering a still image, it's not saved anywhere on your hard drive unless you explicitly save it by pressing F3 or navigating to Image ⇒ Save As in the UV/Image Editor. I can't tell you how much time I spent re-rendering images that I forgot to save when I first started using Blender. Hopefully, you can learn from my mistake.

For rendering animations, the steps are similar to rendering stills (see preceding section), but you have a few more considerations. The largest consideration deals with the file type you choose. If, for example, you choose a still image format like JPEG, PNG, or OpenEXR, Blender creates an individual image for each frame in your animation. However, if you choose any of the movie options like AVI, QuickTime, or MPEG, Blender creates a single movie file that contains all the frames in the animation, as well as any sound you use for the animation.

Depending on the movie format you choose, an Encoding panel appears in Render Properties in which you have a second set of choices that enables you to pick the codec, or compression format, you want to use. Figure 14-4 shows the options in this panel.

image

Figure 14-4: The Encoding panel in Render Properties.

The Encoding panel lets you choose which codec you would like to use, and it also offers you the ability to tweak how the actual video gets compressed. More often than not, though, the default settings tend to work pretty well.

Like in the Dimensions panel, a presets drop-down menu appears at the top of the Encoding panel for commonly used configurations. Using this menu automatically enables the proper settings for rendering outputs such as DV, DVD, and web formats (such as h.264).

The Audio Codec drop-down menu lower down the panel gives you similar control over the sound that Blender renders (if the file type supports audio), but arguably the most important thing to remember is to make sure that the Audio Codec drop-down isn't set to None if you want audio to be included with your rendered movie file. The PCM option gives you the best results, but also yields the largest file sizes.

tip Make sure that you test your files if you want other people to be able to view them. I can't tell you how many times I've rendered a movie file that plays just fine on my Linux machine, but won't even open on a Windows or Macintosh machine. It's ugly and makes everyone look bad. So make sure that you try to view the file on as many machines as possible before sharing it with the world.

The other consideration to make when saving an animation is where on your hard drive you intend to store it. Enter this information on the first field of the Output panel. By default, Blender saves your animations to the /tmp directory on your computer. However, you may not have a /tmp directory, or you explicitly may want to save the animation to a different folder on your hard drive. Left-click the file folder icon to the right of this text field and use the File Browser to navigate where you want to save your animation.

So, to render animation, the steps are pretty similar to rendering a still:

1. Set up your render resolution from the Dimensions panel and your file type from the Output panel.

If you've been working on your animation, hopefully you've set it all up already. Although changing the output resolution (the width and height) of the image after you animate isn’t too bad, changing to other frame rates after the fact can ruin the timing of an animation and it gets to be a pain to fix. Set the frame rate from the Frame Rate value in the second block of buttons of the Dimensions panel.

2. Confirm the start and end frames from the Frame Range values in the Dimensions panel.

You probably already made this setting while animating, but double-check these start and end frames to make sure that they're correct. These values also can be set from the Timeline's header.

3. Verify where you want to save your file in the Output panel.

4. Animate by pressing Ctrl+F12.

Also, you can press the Animation button in the Render panel or choose Render ⇒ Render Animation. Your animation immediately starts being created. Now go get a cup of coffee. Rendering an animation can take quite some time.

remember Unlike rendering a still image, which does not save anything to your hard drive until you press F3, rendering an animation automatically saves your renders wherever you stipulate in the Output panel.

Creating a sequence of still images for editing or compositing

In most situations, rendering out a sequence of still images rather than a single movie file makes a lot of sense. One of the biggest reasons for rendering a sequence of stills is for compositing, or combining multiple images together. When you do compositing, you often rely on having an alpha channel that makes everything transparent except for your rendered subject. Most video formats simply don't support an alpha channel, so to accommodate this shortcoming, you render out a sequence of still images in a format that does support alpha, such as PNG.

Another reason that you may want to have a still image sequence rather than a movie file is for editing, or sequencing multiple video and animation clips. To get smaller file sizes, many video codecs throw out large chunks of image data from one frame to the next. The result is a small file that plays well, but is pretty difficult to edit because in editing, you may want to cut on a frame that doesn't have very much image data at all. Using a sequence of still images guarantees that all image data for each and every frame is completely there for smooth editing. Chapter 15 covers both compositing and editing in more detail.

The third reason you may want to render a sequence of still images is largely practical. When rendering to a movie format, what happens if you decide to stop the render and change a small part of it? Or what happens if Blender crashes in the middle of rendering? Or if an army of angry squirrels invade your office and shut down your computer mid-render? Well, you have to restart the whole render process from the start frame. Starting over, of course, is painful, especially if you have to wait multiple minutes for each frame in your sequence to render. If you render by using a sequence of still images, those images are saved the second that they're created. If your render process gets stopped for any reason, you don't have to start rendering again from the beginning. You can adjust the Start value in the Dimensions panel of Render Properties (or in the Timeline) to pick up where you left off and resume the render process.

tip If you choose to save a sequence of still images, you should create a specific folder just for these render files. You're going to create a lot of files. If the animation is 250 frames long and you render to still images, you're going to get 250 individual images saved to your hard drive.