Blender 3D By Example
上QQ阅读APP看书,第一时间看更新

Appending or linking the tables to the scene

Appending and linking lets you peek into a Blender file, dig through its data, and pull that data into another Blender file. Meshes, objects, materials, and other data types can all be linked or appended. We'll use this to link collections from the ch05_table.blend file that we just created to the kitchen.blend file that we made earlier in this chapter. 

When you link data (objects, materials, so on) from one file to another, a dynamic link stays between the source and target files. This means that once a table is in place in the kitchen, we could go back to the table file, change the table, and the link would update to the chairs in the kitchen.

When you append data from one scene to another, the information from the source file is directly brought into the target file as a local copy. Choosing whether to append or link is a matter of complexity and personal choice. If you're working by yourself and a project isn't too complex, appending reduces the number of files you need to maintain. If you're working as a team or need to simplify the setup, use linking. For instance, when animating a character in an environment, it's better to have the character file separate and link a character collection into the environment. 

We've previously used Blender's collections to organize objects for improved visibility. Collections are also a way of organizing Blender objects for instancing. When you instance a collection, it creates a single object that represents all the objects inside it. After linking or appending table collections to the kitchen, we'll add a collection instance.

To do this, follow the steps given here:

  1. In the table file, select all your mesh objects and hit M to move them to a new View Layer collection. 
  2. Rename the collection to table and hit Enter.
  3. Repeat this for your coffee table, putting it in a collection called coffee_table.
  4. Objects can be in multiple collections at once. Hit Shift + M and put the coffee table in the default Collections collection. Now, it's in both collections at the same time.
  5. Use the number line on your keyboard to switch between View Layer collections. These are also visible in the outliner. 
  6. Use Shift + A, then go to Add | Collection Instance and select your table collection. An empty instance appears, representing all the table objects as a single object. 

Now, to link the table collection to our kitchen scene, do the following:

  1. Save the ch05_table.blend file.
  2. Open the kitchen.blend file again.
  3. Go to the File menu and choose Link.
  4. Navigate to your ch05_table.blend file.

Because we are using the Link feature, the ch05_table.blend file will open in the file browser to reveal its data. All of the various data types in this file can be seen as a list of folders—objects, meshes, collections, and so on—as you can see in the following screenshot:

The list of data that can be linked from the ch05_table.blend file

Now, we need to tell Blender what data we are trying to link to the kitchen scene:

  1. Open the folder labeled Collection.
  2. Select the Table collection.

The "Table" collection has been linked into the kitchen.blend scene. The collection is represented by a special type of object called an Empty. Empty objects can be used for several different purposes. In this context the empty object's transforms (location, rotation, and scale) are used to create an instance of the "Table" collection from the ch05_table.blend file so that we can place the table in the kitchen scene. Because this is a linked collection, we can't select the individual objects within the collection, but we can transform the empty object to manipulate the table. We can now use this instance of our table to replace the previz table:

  1. Select the linked empty object.
  2. Move it to match the previz table.
  3. Select the previz table.
  4. Press H to hide the previz table.

Repeat these steps to link the coffee table into the kitchen scene as well.

Up next, we'll create some replacements for our previz chairs.