Community:Science/Robotics/LinkComponents

提供: wiki
移動先: 案内検索

Creating a Scenario in ORS

The current procedure to build a simulation scene consists of creating a new .blend file, and linking all the desired components for the robots and environment. At the time of this post, simulation scenes are created in the scenarii directory of the ORS project. Robot parts and components are located in the components directory. Some predefined scenes, as well as common scene elements are located in components/scenes.

Linking objects in Blender has several characteristics we have to consider. A linked object will preserve the properties from the source file, but can not be edited directly or parented to other objects in the scene. To create a usable version of a linked object, the current approach is to place it in a separate layer, and to create a duplicate of it in a layer that will be used during the simulation.

To illustrate the work flow with an example:

Assuming the simulation robot will be in layer 1 and the links will be in layer 0.

  1. Go to layer 0, by pressing 0
  2. Import the desired objects
    1. Press ⇧ ShiftF1
    2. Navigate to the .blend file
    3. Select the Object category
    4. Select the objects to be imported, by pressing RMB Template-RMB.png over them
    5. Make sure the following toggle buttons are selected at the bottom of the window: Relative Paths, Link, Active Layer At Cursor
    6. Press the Load Library button at the top right
  3. Make a duplicate of the linked objects with AltD
  4. Press Esc to exit the move command that starts automatically
  5. Move the duplicate to the working layer, by pressing M1
  6. Make any transformations necessary on the duplicate

The linked objects (blue outline when selected) can be duplicated as many times as necessary to create the scene. After making the duplicates, the links can be deleted, and the duplicates will still keep the properties of the link, and be updated when the original file is modified.

Blenderaid links diagram of an assembled robot

Objects can be chain linked from other .blend files. For example in this diagram showing a robot file (center) with several linked components (left). The complete robot itself is linked in a scene (right). Each individual component is then indirectly linked inside the scene, but still preserve their properties from the original file.


Pros

  • Using object links permits keeping a single library of objects and associated scripts
  • Modifying an object in the library will automatically change all instances where it is being used

Cons

  • The mechanic to link and use an object is not simple
  • Linking a complex object requires selection of all individual objects that compose it
  • Linking a group does not work
  • Linked objects can not be immediately used in a dynamic scene
  • Using proxies does not work, since they loose their Game Logic properties

A more detailed description of the current problems with Blender's link functionality can be found here

Examples

Here are two videos showing the process to create first a robot, and then a scenario which includes the robot: http://www.youtube.com/watch?v=YfeWHlKBWIw


http://www.youtube.com/watch?v=LrgJNvNgYR8