Академический Документы
Профессиональный Документы
Культура Документы
Marc Flerackers
March 4, 2011
Contents
Preface iv
I General usage 1
1 The view 2
1.1 Mouse movement . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Keyboard movement . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 View options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3.2 Anaglyphs . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3.3 Wireframe . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3.4 Smooth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Cameras . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.5 Undo, redo and reset . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Modeling 4
2.1 Macro modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2 Detail modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2.1 Face . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2.2 Breasts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2.3 Stomach, pelvis and buttocks . . . . . . . . . . . . . . . . . . 5
2.2.4 Genitals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.3 Micro modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3 Files 6
3.1 Save and Load . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.2 Export . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.2.1 Wavefront (obj) . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.2.1.1 Eyebrows . . . . . . . . . . . . . . . . . . . . . . 7
3.2.1.2 Diamonds . . . . . . . . . . . . . . . . . . . . . . 7
3.2.1.3 Skeleton . . . . . . . . . . . . . . . . . . . . . . . 7
3.2.1.4 Groups . . . . . . . . . . . . . . . . . . . . . . . . 7
3.2.1.5 Subdivide . . . . . . . . . . . . . . . . . . . . . . 7
i
CONTENTS ii
3.2.1.6 Hair . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.2.2 Blender exchange (mhx) . . . . . . . . . . . . . . . . . . . . 7
3.2.2.1 Version . . . . . . . . . . . . . . . . . . . . . . . . 8
3.2.2.2 Expressions . . . . . . . . . . . . . . . . . . . . . 8
3.2.2.3 Rig . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.2.3 Collada (dae) . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.2.4 Quake (md5) . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.2.5 Stereolithography (stl) . . . . . . . . . . . . . . . . . . . . . 8
3.2.5.1 Format . . . . . . . . . . . . . . . . . . . . . . . . 8
3.2.5.2 Subdivide . . . . . . . . . . . . . . . . . . . . . . 8
3.3 Ethnics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4 Posing 9
4.1 Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.2 Poses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
5 Rendering 10
5.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
5.2 Aqsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
5.2.1 Shading rate . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.2.2 Samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.2.3 Skin oil . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.3 Povray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.3.1 Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.3.2 Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.4 LuxRender . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.5 Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.5.1 Dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.5.2 Hair . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.5.2.1 Clump radius . . . . . . . . . . . . . . . . . . . . 11
5.5.2.2 Clump children . . . . . . . . . . . . . . . . . . . 11
5.5.2.3 Multistrand children . . . . . . . . . . . . . . . . . 11
5.5.2.4 Randomness . . . . . . . . . . . . . . . . . . . . . 11
6 Advanced Modeling 12
6.1 Measure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
6.2 Asymmetry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
6.3 Randomize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
7 Settings 13
7.1 Shader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
7.2 Slider behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
7.3 Mouse behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
7.4 Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
7.5 Shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
CONTENTS iii
II Development 15
8 Writing plugins 16
8.1 Plugins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
8.2 GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
8.3 Morph targets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
8.4 Undo-redo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
8.5 Meshes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
8.6 The camera . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
8.7 GUI controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
8.8 Layout guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Preface
This manual, like the MakeHuman software, is under constant construction and will
change with the software. The latest edition can always be found on the makehuman
website. MakeHuman is a 3d modeling tool which is build for one single purpose:
creating a professional 3d human model. The base mesh has gone through many iter-
ations to perfect the topology and all the modifications which are available to the user
are morphs which are modeled by hand by skilled artists. While the software is build
with usability and simplicity in mind, there will always be questions, that’s what Part I
of this manual is for. It is modeled on the application and follows the menu system and
options closely. Part II focuses on developing with MakeHuman, to create your own
plugin and add functionality to the main application.
This manual is provided under an Attribution-NonCommercial-NoDerivs 3.0 Un-
ported (CC BY-NC-ND 3.0) license.
iv
Part I
General usage
1
Chapter 1
The view
1.3.1 Background
The background mode shows an image file on top of the model. This is useful when
the model should resemble an existing sketch, photograph or render. The first time it is
activated, it shows a list of files from the ~/makehuman/backgrounds folder to choose
from. Afterward the background button toggles the background on and off. To choose
another image go to library, background.
2
CHAPTER 1. THE VIEW 3
1.3.2 Anaglyphs
Anaglyphs mode renders the view from two viewpoints in red and cyan. When view-
ing this using red-cyan 3d glasses you can see the model in real 3d. There are two
anaglyphs modes which use a slightly different method to render both views, so it
takes two presses of the button to turn it back off.
1.3.3 Wireframe
Wireframe mode is good to see the topology and how vertices and faces are changed
by certain modifications.
1.3.4 Smooth
Smooth view might be too slow to work with on some systems. It subdivides the
mesh with Catmull-Clark subdivision and keeps this subdivided mesh updated when
modifying the model.
1.4 Cameras
There are two camera viewpoints between which can be quickly toggled, global camera
and face camera.
Modeling
4
CHAPTER 2. MODELING 5
2.2.1 Face
Many facial features like eyes, nose, ears, mouth, jaw, head shape can be modified
using the sliders in the corresponding categories. Face age varies from young to old
and face angle from slanted up to slated down.
2.2.2 Breasts
Breasts have two sliders, size and firmness. Since this is only sufficient for a subset of
shapes, more sliders are planned.
2.2.4 Genitals
The genital slider goes from female to male genitals, initially it is in the center, which
means no genitals.
Files
6
CHAPTER 3. FILES 7
3.2 Export
3.2.1 Wavefront (obj)
Wavefront obj is a good format when you need a simple mesh for an external renderer.
It comes with an mtl file defining the material.
3.2.1.1 Eyebrows
For some uses, like raytracing, the eyebrow geometry causes problems. If this is the
case, uncheck it to avoid it from being exported.
3.2.1.2 Diamonds
The diamond geometry is used to keep track of the skeleton. However in most cases
this is not needed. In case the diamond geometry is desired, check it to export it.
3.2.1.3 Skeleton
This option exports the skeleton in Biovision hierarchical data (bvh) format which is
generally used for motion capture. Note however that the model is not rigged to this
skeleton.
3.2.1.4 Groups
Whether groups are useful depends on the software used. Many importers also give the
option to import the groups or not. Groups can be used to select specific body parts for
modification or deletion. If groups are not desired, uncheck it.
3.2.1.5 Subdivide
If a high poly mesh is needed, and the modeler or renderer used does not have a good
subdivision algorithm, you can check the subdivide option to export a mesh with 4
times the amount of faces, generated with Catmull-Clark subdivision.
3.2.1.6 Hair
If hair is present, it can be exported as a polygon mesh or as curves. Again it depends
on the software which is going to import the file whether mesh or curves is the best
option.
3.2.2.1 Version
Currently it is still possible to export for Blender 2.4, however this may change once
Blender 2.5 is stable.
3.2.2.2 Expressions
If checked, all expressions available within MakeHuman are exported to the mhx, this
makes the export considerably bigger in size.
3.2.2.3 Rig
Two rigs are available, mhx rig or game rig. For posing and animating the mhx rig is
preferred.
3.2.5.1 Format
The binary format is a lot more compact than the ASCII format. However the latter is
provided for compatibility reasons.
3.2.5.2 Subdivide
If a high poly mesh is needed, and the exernal modeler or renderer does not have a
good subdivision algorithm, you can check the subdivide option to export a mesh with
4 times the amount of faces, generated with Catmull-Clark subdivision.
3.3 Ethnics
Ethnics are models which try to closely resemble people from a specific region in the
world. They are model files with a special finishing morph for features which cannot
be created with the tools in MakeHuman. To load an ethnic, the main ethnic is selected,
then one of the sub ethnics of that ethnic. The gender and age are also chosen before
loading. While the these can, theoretically, be modified afterward, it is advised to
choose the gender and age as close as to what you need.
Chapter 4
Posing
4.1 Expressions
To make an expression on the model’s face, choose the expression category on the
right, then drag the slider from the desired expression on the left as much to the right
as needed.
4.2 Poses
9
Chapter 5
Rendering
5.1 General
For rendering, MakeHuman uses one of the installed external renderers. You only need
to install the renderer of your choice.
5.2 Aqsis
Aqsis, a renderman compliant renderer, can be downloaded from http://www.aqsis.org/.
10
CHAPTER 5. RENDERING 11
5.3 Povray
Povray, or the Persistence of Vision Raytracer, can be downloaded from http://www.povray.org/.
5.3.1 Format
There is both support for the older array format and the newer mesh2 format.
5.3.2 Action
Determines whether only the pov files are written or whether Povray is also launched
to render the file.
5.4 LuxRender
LuxRender, a physically based and unbiased rendering engine, can be downloaded
from http://www.luxrender.net.
5.5 Settings
Some of the rendering settings are valid for all renderers. These include the dimensions
of the rendered image and the hair settings.
5.5.1 Dimensions
The width and height of the rendered image
5.5.2 Hair
5.5.2.1 Clump radius
5.5.2.2 Clump children
5.5.2.3 Multistrand children
5.5.2.4 Randomness
Chapter 6
Advanced Modeling
6.1 Measure
Measure has sliders which modify the length and/or circumference of specific body
parts and shows the length and/or circumference of many body parts in centimeters.
You can change the units to inches in Settings. Note that modifying one parameter
might have impact on other measurements too.
6.2 Asymmetry
Sometimes a perfect symmetric model is not what is desired. Asymmetry can make
some features of the model’s face or body asymmetric.
6.3 Randomize
When a lot of different models are needed, or some inspiration is needed, it is some-
times better to let the pseudorandom generator decide how the macro modeling is done.
An existing model can also be modified by randomization of its macro features.
12
Chapter 7
Settings
7.1 Shader
MakeHuman can make use of GLSL shaders to give a better preview of how the model
will look when rendered.
13
CHAPTER 7. SETTINGS 14
7.4 Units
Metric or imperial units can be chosen. Note that imperial units will use inches through-
out the program, also for longer lengths.
7.5 Shortcuts
All shortcuts can be customized.
Part II
Development
15
Chapter 8
Writing plugins
8.1 Plugins
Makehuman has a simple plugin framework which makes it easy to add and remove
features. At startup, MakeHuman now looks for .py files in the plugins folder which are
not starting with an underscore (which makes it easier to disable unwanted plugins).
It loads them one by one and calls the load entry point passing a reference to the
application. The plugin can use this reference to add the necessary GUI widgets or
code to the application.
The rules for plugins are very simple:
• A plugin is a .py file in the plugins folder with a load entry point.
• A plugin only imports core files.
The reason a plugin cannot import other plugins is that it would make it difficult to
know which files belong to which plugin. We still need to define a convention for
shared files beyond the core MakeHuman files. To get started look at example.py or
any of the other plugins to see how you can create your own feature in MakeHuman.
8.2 GUI
The GUI in MakeHuman is still far from finished. Since the first alpha there have been
many changes already and many other will come. This is because when features are
added or modified, we can run out of space, or start to see things differently. Some-
times we experiment to see how a modifier can be manipulated in a different way. For
example in the details and microdetails we chose to have tools manipulating the model
directly instead of using sliders. Another idea for the macrodetails was a multidimen-
sional slider, like a radar chart which would replace all five sliders. It is impossible to
pour the GUI into into its final form while we are still adding functionality and getting
new ideas. However don’t let the lack of guidelines stop you from adding a GUI to
your own plugins. The current GUI API is very usable, and gets more mature every
16
CHAPTER 8. WRITING PLUGINS 17
day. The layout at the moment is a two level tab control. The tabs at the top repre-
sent categories, like modeling, files, rendering. The ones at the bottom are the tasks
in the current category and refine the more broad category in macrodetail, detail and
microdetail modeling, or saving, loading and exporting. So when creating your plugin,
the first thought should be "In which category does it belong?". From experience we
know that it can be a though question to answer. Sometimes the only answer is adding
a new category. This is what we initially did for measurement for example.
1 def load(app):
2 category = gui3d.Category(app, "Measurement")
Next you probably want your own task to implement your feature. While it’s pos-
sible to attach functionality to an instance of gui3d.Task, it’s often easier to derive your
own class. When you create an instance of your class, you pass the parent of your task,
which can either be an existing category
1 def load(app):
2 taskview = HairPropertiesTaskView(app.categories["Modelling"])
In your derived task you will then add the necessary controls to let the user interact.
A good place to see how to use the different controls is the example plugin. You will
see that even if you don’t add any controls, the model is already visible. This is because
the model is attached to the root of the GUI tree. In the onShow event of your task you
might want to reset the camera position, like we do in the save task, or hide the model,
like we do in the load task. Just don’t forget to reset the state when your task gets
hidden in onHide.
1 modifier = humanmodifier.Modifier(
2 "data/targets/macrodetails/universal-stature-dwarf.target",
3 "data/targets/macrodetails/universal-stature-giant.target")
4 modifier.setValue(human, 0.0)
A value between -1.0 and 0.0 will use the dwarf target, while a value between 0.0
and 1.0 will use the giant target. Using 0.0 will remove both targets. While using a
modifier also applies the target, to keep changes interactive other targets are not reap-
plied and normals are not recalculated. Once you have made the necessary changes,
you commit them using human.applyAllTargets. Which does exactly what it says. It
applies all the targets one by one and additionally recalculates the normals. Reapplying
all targets minimizes the size of mathematical error in the final model.
8.4 Undo-redo
One of the first features written was undo-redo. Having this from the start saves us
a lot of time later as we add this functionality to each kind of model modification
immediately. It is important that every modification is undo-able, since just one undo-
able modification would leave the user without the possibility to undo anything. So it’s
crucial that if you write a plugin which modifies the model, you also make undo work.
The Application class has several methods to work with actions. An action is a class
with two methods, do and undo. If the action itself does the modification you can use
app.do to add it to the undo stack. If you did the modification yourself already during
user interaction, you can add the action using app.did. The application won’t call the
do method of the action in that case. If you want to make your own undo-redo buttons,
you can use app.undo and app.redo. To illustrate, here is the action we use to change
the hair color:
1 class Action:
2 def __init__(self, human, before, after, postAction = None):
3 self.name = "Change hair color"
4 self.human = human
5 self.before = before
6 self.after = after
7 self.postAction = postAction
8
9 def do(self):
10 self.human.hairColor = self.after
11 if self.postAction:
12 self.postAction()
13 return True
14
15 def undo(self):
16 self.human.hairColor = self.before
17 if self.postAction:
18 self.postAction()
19 return True
The postAction is a handy way to specify a method to keep your GUI in sync with
the changes. In this case we update the color control to show the correct color when
the user chooses to undo or redo the hair color change.
CHAPTER 8. WRITING PLUGINS 19
8.5 Meshes
When writing exporters, subdivision or polygon reducing algorithms it can be useful
to know how the mesh is stored in Python (the C side has a different compact but
less convenient representation). An Object3D has three important lists: object.verts,
object.faces and object.faceGroups. The first two lists contain instances of Vertex and
Face. The facesGroups contain FaceGroup objects. A FaceGroup specifies the name
of the group and the faces that make up the group. A Face references 3 vertices in
face.verts. A Vert or vertex holds its coordinates in vert.co and normal in vert.no. If we
put all this together, we can write a simple Wavefront object exporter now:
1 f = open(filename, ’w’)
2
3 for v in obj.verts:
4 f.write("v %f %f %f\n" %tuple(v.co))
5
6 for uv in obj.uvValues:
7 f.write("vt %f %f\n" %tuple(uv))
8
9 for v in obj.verts:
10 f.write("vn %f %f %f\n" %tuple(v.no))
11
12 for g in obj.faceGroups:
13 f.write("g %s\n" %(g.name))
14 for fc in g.faces:
15 f.write("f")
16 for v in fc.verts:
17 f.write(" %i/%i/%i " %(v.idx + 1, fc.uv[i] + 1, v.idx + 1))
18
19 f.close()
As you can see, we take the uv values from obj.uvValues. The uv values are ref-
erenced in two places, obj.uvValues holds all the uv values of each vertex by index.
Face.uv is a list with the uv values of each vertex of the face. The reason is that while
normals are per vertex, uv values are per face-vertex, because a vertex can have a dif-
ferent uv depending on which face is drawn.
The properties you’ll use to position the camera are the eye and focus position. The
Application class has a few methods for camera presets, like setFaceCamera to focus
on the face. We’ll look at what this method does to better understand how to position
the camera:
First we get the currently selected human (yes, we do anticipate having more than
one human in the scene).
1 human = self.scene3d.selectedHuman
Next we get the vertices which belong to the head by facegroup names.
2 headNames = [group.name for group in human.meshData.facesGroups if ("head" in
group.name or "jaw" in group.name)]
3 self.headVertices, self.headFaces = human.meshData.getVerticesAndFacesForGroups(
headNames)
We calculate the center of these vertices as this will become our focus point at
which we will look at.
4 center = centroid([v.co for v in self.headVertices])
Now we are ready to set the eye and focus positions. We set the focus to the center
position, and the eye a bit to the back.
5 self.modelCamera.eyeX = center[0]
6 self.modelCamera.eyeY = center[1]
7 self.modelCamera.eyeZ = 10
8 self.modelCamera.focusX = center[0]
9 self.modelCamera.focusY = center[1]
10 self.modelCamera.focusZ = 0
Finally we reset the human’s position and rotation so that our calculations are as
simple as the ones above.
11 human.setPosition([0.0, 0.0, 0.0])
12 human.setRotation([0.0, 0.0, 0.0])
If we would allow the human to be translated and rotated, we would need to take
this transformation into account, as above we calculated the center of the untrans-
formed mesh.
• ToggleButton: A button which has two states, selected and deselected, clicking
the button toggles between the states. Used for making an on/off choice.
• CheckBox: A togglebutton, but with a check box look.
• RadioButton: A button which is part of a group, clicking one of the buttons
selects it and deselects the others. Used for a multiple choice.
• Slider: Used to select a value from a discrete or continous range.
• TextEdit: A one line text field.
• TextView: A label.