Tuesday, November 24, 2009

2.49b Append and Link

Join my Blender 3D forum, where you can network with other Blender friends and get your Blender 3D questions answered.

Suppose you have created a complicated scene, complete with a neat texture, materials, animations, and whatever else. You might want to reuse the scene, or objects in it, in another blend file. Or, you may be collaborating with others. One person does the textures and materials, another does the animation, a third is setting up the camera, and so on. How can everyone work on his or her own piece of the project and have it all come together in one final blend file? Fortunately, Blender comes to the rescue. Blender has powerful features - called Append and Link - which lets you import all sorts of things from other .blend files into your .blend file. The goal of this tutorial is to show you how you won't have to reinvent the wheel. Instead, you just use Append and Link to reuse what already has been created.

We are first going to create a blend file with some objects, materials, and scenes that you might want to share with others.

1) Select the default cube. The cube has a default material. Go to the F5 (Shading buttons). Click the Generate An Automatic Name button to make the material something descriptive. Blender makes an attempt at creating a realistic name for the material. It's name is now Grey.

2) Add green monkey (Space - Add - Mesh - Monkey). Move the monkey 2 blender units to the right to separate it from the cube. Press F5 (Shading) and click Add New. Make material green (R=0, G=1, B=0). Name the material something descriptive, using the Automatic Name button. The material is now named LightGreen.

3) Create a new, empty scene by going to the Scene list and clicking ADD NEW. Name the scene SphereScene. Move the 3D cursor to the left and add a UV Sphere, with the default settings of 32 rings and 32 segments (Space - Add - Mesh - UVSphere).

4) Save this blend file. Call it SourceFile.blend.

5) Now let's see how to get stuff from that file. Start by going to the default Blender setup. Select File - Load Factory Settings, and accept Erase All. We're going to get rid of everything, not just the default cube, but the lamp and the camera as well. To do this, press the Home key, which shows all the objects. With the default cube highlighted, press the Shift key and right click on the lamp. Then press the Shift key and right click on the camera. Press the delete key and accept the defaults, deleting all the objects. We now have a blank scene, with no objects.

6) To see what objects we can import, go to File - Append or Link, or press Shift F1. Select Object. All the objects in the SourceFile blend file are listed. Select Suzanne. Then click Load Library. Suzanne is appended to the new file. Append is the default mode. Note that she is green because she was green in the source file.

We can change Suzanne's color. With Suzanne highlighted, press the shading buttons (F5) and change her color to red by settng R=1, G=0, and B=0. However, if we press F12 to render, we get the error message "No Camera". That's because we don't have a camera, or a lamp for that matter.

So let's append the lamp and the camera as well. We can append more than one object at a time. Select File - Append or Link. Select the SourceScene. Instead of left clicking, hold the Shift key and right click on the camera. Then hold the Shift key down and right click on the lamp. The lamp and camera text should be highlighted. Click the Load Library button. The camera (named Camera) and lamp (named Spot) are now appended to the file. Press F12 to render. The monkey now renders properly.

7) Let's see how Link differs from Append. Select File - Append or Link, selecting the SourceScene again. Select the Cube (left click). Before loading the cube into the blend file, click the Link button. This will create a link to the cube. Click the Load Library button. The cube is linked into the file. Now let's try to change the cube's color by going to the Shading buttons. Guess what! We cannot do it! We get the message that we cannot edit external libdata.

Link differs from Append in that while Append gives us a copy of the object and lets us change it, Link points back to the source object. By the way, not only can the color can't be changed, but any aspect of the data cannot be changed. A linked object can only be changed at the source. You cannot move it, rotate it, or scale it.

You might use Append to make a copy of an object but to be able to change it in the new blend file. Link is a better choice if you don't want anyone to change the object, such as a building that will have the same characteristics from one file to another.

8) Other things can be appended, such as materials. Let's load the factory settings again to start with the default Blender setup. Select the default cube and press F5 to go to the Shading buttons. Supppose we want to use the green material in the SourceFile. Instead of setting the sliders, we can select File - Append or Link and select SourceFile.blend. Select Material. Choose LightGreen, and click the LoadLibrary button. Now if we click the Materials, we see that LightGreen has been appended. The "O" before it means that there is no object that has that color, i.e. that LightGreen is an "orphan". If we click on it, however, the light green material is assigned to the cube. Now that the light green material has been assigned, the original material (called Material) has the "orphan" designation. An orphan material will be deleted when the file is saved. If you want to keep that material in the file, you need to create a Fake user by pressing the "F" button. You can create a blend file with your favorite materials, to use as a library, and append them as you need them.

9) You can append or link entire scenes. To illustrate, select our source file, choose Scene, and append the SphereScene by clicking on Load Library. The SphereScene is now available. Many other things, such as groups, meshes, and text objects, can be appended or linked.

Using append and link can save you hours of time and allow you to collaborate Blender development with others. You can split the workload and append or link each piece into the final product. I hope this gives you some ideas about how to use this powerful Blender feature. Happy Blendering!