Robot modelling in Blender

Diederik Verscheure

Herman Bruyninckx


     Herman.Bruyninckx[at]mech.kuleuven.ac.be, 20 SEP 2004
   


Table of Contents
1. Importing and processing a robot model
1.1. Requirements
1.2. Start
1.3. Importing the model
1.4. Dealing with import problems
1.5. Creating vertex groups
1.6. Assigning materials to vertex groups
List of Figures
1-1. Blender window as soon as you start it.
1-2. Layer control toolbox.
1-3. Layer visibility controls.
1-4. Our solid robot model (in Object Mode).
1-5. Our robot model in Edit Mode.
1-6. Adding a new face.
1-7. The Edit Buttons Window button.
1-8. The Mesh Tools panel.
1-9. Creating a new vertex group.
1-10. Naming the new vertex group.
1-11. Naming of the parts of the robot.
1-12. Selecting the appropriate vertices for the vertex group.
1-13. Assigning the vertices to the vertex group.
1-14. The common vertices.
1-15. Assigning the vertices to the vertex group.
1-16. Selecting a vertex group.
1-17. Some faces of other members are not shown when a vertex group is hidden.
1-18. Deformed model.
1-19. Selecting edges.
1-20. Removing unnecessary edges can also remove existing faces.
1-21. The reconstructed model.
1-22. Adding extra faces to close each member.
1-23. The Shading button in the Buttons Window.
1-24. Adding a new material.
1-25. Choosing an appropriate material color.
1-26. The Edit Buttons Window button.
1-27. Selecting the vertex group of which you want to change the color.
1-28. Adding a new material index.
1-29. Selecting the appropriate material index.
1-30. Assigning the appropriate material index.
1-31. Our robot model with colors.

Chapter 1. Importing and processing a robot model

This chapter will guide you through the process of modelling and animating a robot, i.e., a device with rigid links and (mostly) revolute joints, driven by motors on each joint.

We assume that you have read the Interface Chapter and the Quickstart Chapter, and that you understand the conventions used throughout this book.


1.1. Requirements

Relevant to Blender v2.31

  • A model (DXF, VRML 1.0, …) of a robot (preferably in the position known as the “software zero position”) If you do not have a model, you can try this model.

  • Blender 2.33 or higher (not tested with older versions).


1.2. Start

Fire up Blender by double clicking its icon or running it from the command line. Blender will open showing you, from top view, the default set-up: a camera, a lamp and a cube (Figure 1-1). You do not need those immediately, so you can delete them or move them to another layer. We will move them to another layer. Deselect everything by pressing AKEY. Select the cube, the lamp and the camera with SHIFT-RMB and press MKEY. A small toolbox, like the one in Figure 1-2, will appear beneath your mouse, with the first button checked. Check the rightmost button on the top row and then the OK button. This will move the cube, the camera and the lamp to layer 10.

Figure 1-1. Blender window as soon as you start it.

Blender provides you with 20 layers to help you organize your work. You can see which layers are currently visible from the group of twenty buttons in the 3D window toolbar (Figure 1-3). You can change the visible layer with LMB and toggle visibility with SHIFT-LMB.

Figure 1-2. Layer control toolbox.

Figure 1-3. Layer visibility controls.


1.3. Importing the model

Relevant to Blender v2.31

Change to the front view with NUM1. Open the "Load file" window by pressing F1 or selecting Open... from the File menu. Browse to your VRML or DXF model file and load it. If the file is compatible with Blender, your model should now have appeared. You can pan with SHIFT-MMB, rotate with MMB and zoom with CTRL-MMB. Press ZKEY to switch from wireframe view to solid view mode (Figure 1-4). Pressing ZKEY again switches back to the previous mode.

Note

If you can't see anything, it probably means that your model can't be imported by Blender.

Figure 1-4. Our solid robot model (in Object Mode).

Our robot model is a CRS A465 robot with six degrees of freedom.


1.4. Dealing with import problems

Relevant to Blender v2.31

  • It is possible that the model is too large for the Blender coordinate system. The solution is not to scale the model, but to scale the Blender default viewing area. Do this by going to the 3D View window (you most probably are in that window already), select the “View”

  • It can happen that your imported model has some faces left out. The solution is to manually add these faces back. Select your model and press TAB to switch to Edit Mode (Figure 1-5).

    Figure 1-5. Our robot model in Edit Mode.

    Zoom in on the target area. Perhaps you may find it useful to toggle wireframe view mode on or off with ZKEY. Deselect everything by pressing AKEY (once or twice, until everything is purple). Select 3 or more vertices (selected vertices are yellow) with SHIFT-RMB (Figure 1-6) and press FKEY to add a new face. If the new face could not be added, this usually means that you selected (too many) points that are not in the same plane. If the face connects the wrong vertices, you can still undo by pressing U or ALT-U and selecting the appropriate entry from the menu.

    Note

    The Mesh Undo feature was introduced in version 2.3. Pressing UKEY in Edit Mode makes Blender Undo the last Mesh edit. Keep pressing UKEY to roll back changes as long as the Undo buffer will allow, while SHIFT-U re-does changes. ALT-U opens a menu with a list of possible undoes, so that you can easily find the point to which you want to revert to.

    Mesh Undo works only in Edit Mode and only for one mesh at a time. Undo data is not lost when you switch out of Edit Mode, only when you start editing a different mesh.

    Another way to revert to the previously saved state is to press ESC in the middle of an action. This cancels the action, reverting to the previous state.

    It's probably a good idea to save regularly and save to different files, so you are able to revert to an old copy in case something goes wrong.

    Figure 1-6. Adding a new face.

  • Sometimes the model consists of multiple objects. If you want to work with one object, you can join them by selecting the objects and pressing CTRL-J.


1.5. Creating vertex groups

Relevant to Blender v2.31

Our next task is to create several vertex groups and split them cleanly, so each member of the robot can move independently, without causing deformation of the rigid members of the robot model. When using animation, deformation occurs when some vertices belong to the same group. Sometimes it is necessary to double vertices, so each member can be disconnected from the others.

Switch to Edit Mode if you are in Object Mode: select your model with RMB and press TAB. To see the Blender tools that we'll use for this purpose, press the button showing a square with yellow vertices in the Button window header (Figure 1-7), or press F9.

Figure 1-7. The Edit Buttons Window button.

First we will remove all double vertices. This is an important step! Omitting this step may sometimes yield unexpected results! Select everything by pressing AKEY until everything is yellow. Press the Rem. Doubles button in the Mesh Tools panel (Figure 1-8).

Figure 1-8. The Mesh Tools panel.

Next, make sure everything is deselected by pressing AKEY until everything is purple. Create a new vertex group by pressing the New button in the Link and Materials panel (Figure 1-9). Now give the vertex group an appropriate name e.g. "base1" (Figure 1-10). We'll create a vertex group for the base of the robot.

Figure 1-9. Creating a new vertex group.

Figure 1-10. Naming the new vertex group.

We'll also create vertex groups for the other parts of the robot (Figure 1-11). The names that we use here are indicated in the figure. Notice that we create only vertex groups for our members. This is because they consist of only one part. Sometimes the motors are external to the members and it may be useful to create separate vertex groups for those as well.

Figure 1-11. Naming of the parts of the robot.

Now select all vertices that belong to the base of the robot, including the vertices that the base has in common with the next member of the robot (Figure 1-12). In the figure, it is shown that the common vertices are also selected. Now press the Assign button in the Link and Materials panel (Figure 1-13). Vertices can be removed from the vertex group with the Remove button. Sometimes the members of the robot have no common vertices. In that case, you do not need to select any common vertices and you can safely skip the next paragraphs about the common vertices.

TipChecking for common vertices
 

The best way to make sure that there are no common vertices is to select all the vertices of one member, press GKEY and enter an appropriate displacement vector (to switch between Dx, Dy and Dz, press TAB) and press ENTER to confirm. If there are no connecting edges between the selected member and the other members, then there are no common vertices. If there are, you can either delete those edges (which is not always applicable), or follow the procedure described in the next paragraphs. Place the selected member back by pressing GKEY again and entering the opposite vector of the one you just entered.

TipUsing BKEY
 

If you press BKEY twice, you get a circle-shaped cursor. If you hold down LMB and drag the cursor over the vertices, they will be selected. Be aware that all vertices are selected, even those that are located on the back of your model! Press ESC to exit this mode. The size of the circle-shaped cursor can be adjusted by scrolling with the scroll wheel of your mouse. For fine-grained selection, you can use SHIFT-RMB to select the remaining vertices.

Figure 1-12. Selecting the appropriate vertices for the vertex group.

Figure 1-13. Assigning the vertices to the vertex group.

Now deselect everything by pressing AKEY and select the vertices that are common to the base of the robot and the next member (Figure 1-14). The common vertices were already assigned to our vertex group "base1". Now it's time to double them. Press SHIFT-D to double those vertices and press ESC, because you are now in grab mode and we don't need that. Press Remove in the Link and Materials panel to remove the doubled vertices from the "base1" vertex group. Leave the vertices selected and create a new vertex group and name it e.g. "member1" and press Assign (Figure 1-15).

Figure 1-14. The common vertices.

Figure 1-15. Assigning the vertices to the vertex group.

The following now happened. You created a double set of common vertices, removed the doubles from the "base1" vertex group and moved them to the "member1" vertex group. You can verify this by deselecting everything (AKEY), selecting "base1" from the Vertex Groups drop-down menu (Figure 1-16) and pressing the Select button in the Link and Materials panel. Now ofcourse you can't really see if the vertices were doubled. Press HKEY to hide the selected vertices (ALT-H to make hidden vertices visible again). You can still see the common vertices! The "common vertices" are now doubled and split into two groups, one group belonging to "base1", the other belonging to "member1".

Figure 1-16. Selecting a vertex group.

Problems

  • It is possible that some faces of member1 are hidden if you hide the "base1" vertex group (Figure 1-17).

    Figure 1-17. Some faces of other members are not shown when a vertex group is hidden.

  • It is possible that there are still connections between the members. You can see this by pressing GKEY and entering an appropriate displacement vector.

A solution is to displace the "base1" member by pressing Select in the Link and Materials panel, followed by GKEY. You are now in grab mode and can move the "base1" member. It is best to enter a simple displacement vector e.g. Dx = 10.0, Dy = 0.0, Dz = 0.0 (switch between Dx, Dy and Dz with TAB, press ENTER to confirm), so you can move the member back to its original position when you have fixed the problem. Our model now looks deformed (Figure 1-18). Select the edges that should be removed by holding down CTRL-ALT-SHIFT (SHIFT for multiple selection) and selecting the edges with RMB (Figure 1-19). The edges themselves do not change color when selected, but their vertices do. When you have selected the edges to be removed, press XKEY and select Edges from the menu that pops up.

Figure 1-18. Deformed model.

Figure 1-19. Selecting edges.

Now, by removing these unnecessary edges, it's possible that necessary faces disappear (Figure 1-20). The solution is to manually add these faces back (Figure 1-21). Deselect everything with AKEY, select three vertices with SHIFT-RMB and press FKEY to add a face. You may also wish to close each member by adding extra faces (Figure 1-22).

Figure 1-20. Removing unnecessary edges can also remove existing faces.

Figure 1-21. The reconstructed model.

Figure 1-22. Adding extra faces to close each member.

Move back the "base1" vertex group to its original location with GKEY and enter the appropriate vector.

Now repeat the above procedure for each member. The previously common vertices between "base1" and "member1" are already assigned to the correct vertex groups. Now you need to assign the remaining vertices of member1 to the "member1" vertex group.


1.6. Assigning materials to vertex groups

Relevant to Blender v2.31

It's possible to assign materials to vertex groups. We'll show this without going into much detail.

Press the Shading button in the Buttons Window header (Figure 1-23) or press F5. You can add a new material by clicking on the drop-down menu (Figure 1-24) in the Material panel and select ADD NEW. You can give it an appropriate name and select an appropriate color in the Material panel by choosing the RGB values (Figure 1-25).

Figure 1-23. The Shading button in the Buttons Window.

Figure 1-24. Adding a new material.

Figure 1-25. Choosing an appropriate material color.

Now, go back to the Edit Buttons Window by pressing the Editing button (Figure 1-26) or by pressing F9. Select the vertex group for which you want to change the color (Figure 1-27) and press the New button in the Link and Materials panel (Figure 1-28) to add a new material index.

Figure 1-26. The Edit Buttons Window button.

Figure 1-27. Selecting the vertex group of which you want to change the color.

Figure 1-28. Adding a new material index.

The added material index uses the active material. So press F5 to go back to the Shading Buttons Window and select the material that you wish to use from the drop-down menu. If you go back to the Edit Buttons Window by pressing F9, you'll notice that the newly added material index uses the selected material (Figure 1-29). Now select the material index that you want to use for the vertex group. Make sure everything is deselected by pressing the AKEY. Press Select in the Link and Materials panel to select the vertices of the vertex group. Then press Assign

Figure 1-29. Selecting the appropriate material index.

Figure 1-30. Assigning the appropriate material index.

After assigning the appropriate material indexes to the vertex groups, switch to Object Mode by pressing TAB and pressing ZKEY so that you are in solid view mode. Our robot model is looking very realistic already (Figure 1-29)!

Figure 1-31. Our robot model with colors.