Getting to Know Blender So. Many. Buttons.
Ok, you probably won't have to use that many buttons. In fact, many of the effects in Blender can be done with python scripting. Since most computational scientists are way more comfortable with code than a bunch of buttons, AstroBlend is designed to maximize automation for the scientist's usage of Blender.
However, there are a few buttons and keyboard tricks that are essential to know. There are others that will make your life easier if you're willing to remember more stuff. Links to further resources will be at the bottom of this tutorial, however here we will just cover the bases of navigation.
Please check out the Getting Started page before you do this tutorial to make sure you have the AstroBlend library installed correctly.
As an aside - if you happen to be an artist checking out this library, you will probably find things to be a little hacky, since many of the functions can be replicated with a few simple button clicks. This is because computational scientists often need to load many data files sequentially and manipulate them in the same way and would rather not have to repeat said simple button clicks many times. However, I am sure this library does some silly and inefficient things, so feel free to drop me a line if you see a better way of doing things.
Running Blender From the Console
The first thing to do is to setup Blender to run from a terminal window. Why would you want to do this? Because otherwise it is hard to parse the error messages that you will receive. On my Mac, I've added the following to my ".bash_profile" file:
alias blender="/Applications/Blender2.72/blender.app/Contents/MacOS/blender -P /Users/jillnaiman/yt-x86_64/yt_blender_import.py"
But wait, what is all that "yt_blender_import.py" noise? Well, Blender can be start up with a script, which is useful if you want to be able to tell Blender where the AstroBlend library is without having to specify it explicitly everytime you use the python console. The exact form of this alias here is specific for those who want to use yt directly in Blender and is actually generated during the yt installation process (more about that in a later tutorial). For now, we can simply have:
alias blender="/Applications/Blender2.72/blender.app/Contents/MacOS/blender -P /Users/jillnaiman/myAstroBlendScript.py"
import sys
sys.path.append('/Users/jillnaiman/astroblend/science')
Blender's Many Windows
If you now open up Blender with your scripting command, you will see a lot of buttons and windows. The main windows you'll see are:
(1) Main 3D window: where all your models and data will appear, along with any light sources and cameras (2) Object Selector: this panel allows you to click and then manipulate the individual objects shown in the 3D window (3) Object Specific Controls: Once you have an object selected, you can manipulate several properties of each object. Some options include changing the color of an object (a 3D model), or rendering an image (with the Camera). (4) Object Specific Stuff: more ways to manipulate objects. You probably won't use this panel. (5) Animation Stuff: Panel for animation, you also probably won't use this.
Since there are a lot of panels we won't be using, it is a lucky thing that creating your own blender layout is so easy. You can create new blender window subdivisions by pulling the little tabs in the window corners (red circle) and changing what each window does (green circle):
I have found that the most useful window setup is the one below which includes a 3D view, a text file editor for short scripts, a python console, and an Image viewer where renders will show up:
This setup is "usual.blend" from the Blender Files Download Page.
You can also further modify your layout, save your favorite layout as your startup layout, and so on. Further information on how to do this can be found in the Modify Your Blender Layout list of resources.
Render Something to Screen
It is often useful to do a quick render of your setup to the screen to see how your images or movie stills are going to look before you go through the trouble of saving them to file. This can be done by pressing the little camera button (red circle) followed by the render button (blue circle), and the rendered image is shown in the Image viewer (aren't you happy we put one in?!):
Note from our 3D layout that the image sort of looks like we would expect - the camera is pointing toward one of the corners of the cube, which is at the forfront of our image, and the lamp that is lighting the scene is behind the cube with respect to the camera, so the furthest corner from us is lit up, the closest side is in shadow.
Run a Script from the Text Window
Another thing that is good to know how to do is run a simple script from the text editor. For example, in the figure below I have the script:
import science
arrow_name = "RedArrow"
arrow_color = (1, 0, 0) # (R,G,B)
arrow = science.Arrow(arrow_name, color=arrow_color)
arrow.location = (3,0,0)
arrow.pointing = (3,0,5)
import sys # get stuff for science!
# add where science lib is stored
sys.path.append("/Users/jillnaiman/blenderScience/astroblend/science/")
This script first appends the Blender path to include the location of AstroBlend's science library to load. It then creates a red arrow, and moves it to 3 Blender Units (BU) along the x-axis, and points it straight up by using a directionally constraining "empty mesh" and placing this empty directly above the arrow. To run the script simply hit the "Run Script" button in the bottom of the text editor window.
One cool thing you should totally play with is moving the empty mesh right above the arrow around and see how the arrow keeps pointing at this mesh. The easiest way to do this is click on the "EmptyRedArrow" object in the "Object Selector" panel in the upper right of Blender and then click on one of the 3 arrows that appears in the 3D viewer.
Also as a final note, in addition to changing the location and pointing direction of your arrow, you can
also change the color with arrow.color
and the name of your arrow with
arrow.name
.
More info about the different objects you can add can be found in the Using Simple 3D Models tutorial, and info about how empty meshes can be used to create directional objects is found in the second tutorial.
Navigating the 3D Space
Finally, you might want to move around your 3D space and get different views of your object, or you may want to move around your camera. There are many hot keys one can use to do just this, but since the rotation and translation of objects can be done via the command line, I will only mention a few different methods.
To move around the 3D space you can use the number pad on your keyboard when the 3D viewer window is active. The image below from here shows what the different keys do:
In addition to rotating, being able to switch to the view your camera sees by pressing "0" is quite helpful.
One other useful thing to know is how to delete things by clicking on them, which is most useful for Camera and Lamp objects. You do this by clicking on the object you want to delete in the list of objects in the Object Selector panel, then put your mouse in the 3D viewer and click "x". Click "delete" when the menu pops up. HOWEVER, there are several reasons why you would want to use the command line to delete your actual 3D models, which are discussed at length under the "Deleting Objects with AstroBlend" section in this tutorial, so BEWARE OF CLICKING TO DELETE 3D MODELS!
There are many additional resources for how to rotate and translate things quickly. A cheat sheet for all this can be found here, and there are many other examples on the interwebs.
It should be noted that things can change from computer to computer, and these are the controls that have worked on my Mac.