# Blender clonk

Blender clonk
This tutorial explains how to use the clonk model for Blender.
Important files:
Of course we need Blender! Without Blender we cannot do anything. So if you do not have Blender yet then download and install it from www.blender.org.
Blender installed? Great, so let's continue...
The main file is Clonk.blend. It contains the armature object (skeleton of the Clonk) and the scripts. To create the graphics Anigrab.exe is required which should be in the same directory as the .blend file. Also, to be able to execute the scripts, a python installation is required. It can be downloaded from www.python.org. Then there are four important subfolders:

- In the folder Actions all animations needed for the individual clonks are stored as .anim files.
- The folder Clonk contains .mesh files which contain the meshes of the individual Clonks. In the corresponding .act files the sequence of actions is contained, in the same order as they should appear in the final Graphics.png output.
- The Tools folder contains tools for the animations. These are the tools that the clonk can use for various animations such as shovel or hammer.
- Finally the generated Graphics.png files are stored in the Graphics folder.

Loading the Clonk:
To launch the Render clonk the Clonk.blend file needs to be opened. In the lower right corner the Script GUI becomes visible (user interface of the scripts).
Using "Load Clonk" a Clonk can be loaded from the Clonks subfolder. The button next to it allows to quickly choose a Clonk via a menu.
"Import Mesh" assists in importing a Clonk (see the Import section).
Main menu
In the main menu there are the following buttons:

- Action: allows to edit various settings for the action.
- Clonk: the action list of the Clonk can be edited in this section.
- Save/Load: actions and tools can be saved and loaded from here.
- Render: allows to Render the Clonk.
- Exit: return back to the previous menu to load another clonk.
  Attention: the Clonk will not be saved, any unsaved changes will be lost!

Additionally there is a text entry which allows to specify the path to the temp directory.
Action
By using the drowdown menu at the top various Actions can be chosen. If the armature object is selected the keyframes of the individual bones appear in the action window. In the fields below the Length of the action can be specified, i.e. the number of frames of the action, as well as the Width (X) and the Height (Y) of the individual frame graphics. Additionally up to two Tools to be used by the clonk during the action can be specified. They are mapped to the bones 'Tool1' or 'Tool2', respectively.
Rename allows to rename the action. New creates a new action, either one containing the keyframes of the old action or one that does not. The lower button can be used to save the action. This should always be done when keyframes or other settings of the action have been changed. The action is then saved in the Actions subfolder.
Clonk
The list of the Clonk's actions is shown here. If more than one column are displayed then the columns to the right contain actions which originate from the actions contained in the column to the left of it. Since often there is not enough space to show all actions the window can be made fullscreen by clicking on . Another click on this button restores the original window size again.
To modify the list one can click on an action and then select another one instead. REMOVE removes the action from the list. INSERT inserts a new action above the selected one. Actions with a U in front of them are not yet contained in the list. The separated at the lower end of the list contains the action that is used for the Picture graphics of the Clonk.
Below the BaseZoom can be modified. This is the zoom setting of the camera and is required if a mesh is too big and needs to be displayed smaller, or vice versa. Normally this setting is not needed however. The bottommost button saves the action list and the mesh of the clonk.
Attention: the Clonks must always consist of a single mesh only! If there are two meshes then they can be combined via Ctrl+J.
Also the Clonk always needs to be saved using the script interface instead of the normal save functionality of Blender. However some exotic settings will not be exported this way. So if, after loading, a certain modifier or a certain texture setting is not activated then it is because this feature is not supported.
Save/Load
Here actions and tools can be loaded. In the beginning of loading the clonk only the actions and tools the clonk actually needs are loaded. If more actions from other clonks are needed then they can be loaded using this window. A click on the button allows to select the Action/Tool with the menu system. A click on directly shows a dropdown menu with a list to be selected from.
This menu is also used for saving. An action, a tool or the Clonk can be saved. Actions and Clonks can also be saved in the other submenu (Action or Clonk, respectively). Tools can only be saved here.
The bottommost text entry can be used to change the Clonk name. For example if you have loaded and edited the default Clonk then you can rename it before saving so that the original Clonk is not overwritten.
Attention: the normal saving functionality of Blender can NOT be used to save the Clonk. Please always use the script GUI (the window in the lower right corner).
Render
By clicking on the render button a menu appears. It allows to choose various actions which should be rendered separately. By choosing -All- the whole clonk is rendered.
In another submenu one can choose whether to render with or without overlay. Both makes Blender render both Graphics.png and Overlay.png. Graphics/Overlay only creates one of the two. Both can be rendered into the same graphics by choosing Full. This allows to have a better look at the rendering output.
When rendering every frame is stored in the temp directory. All of them are combined to the final graphics using anigrab. It is stored in the output folder /Graphics/Clonk name/Graphics.png. The action are placed into the graphics in the same order as they appear in the list. The width of the graphics is chosen by the widest action. If multiple actions fit side-by-side then they will be put into the graphics that way. Finally the Picture is stored at some free space or at the end of the graphics. To be able to generate the ActMap of the Clonk conveniently the positions of the actions are stored in another file in the output folder.
If only a single action is rendered then it is still tried to create the whole graphics. So there should be rendered frames of the other animations in the temp directory. This allows to not always having to re-render all actions if only a single action has changed. However in the beginning the whole Graphics need to be rendered so that all frames of all actions are present in the temp directory.
Remark
Generally all materials that start with Overlay* are not rendered for Graphics. For Overlay only the materials starting with Overlay* are rendered. When choosing Full both are rendered. Additionally the color of the material OverlayColor is changed from white to blue when choosing Full.
The Face material is textured using the 'Face' texture in normal animations and is skinned using the 'Face2' texture for the picture. This is required since the high resolution face would be smeared out in the small animations, so a more coarse texture needs to be used.
Tools
Tools are the utilities of the clonk which it can use for various animations. The tools of the standard Clonk are shovel, axe, hammer and bottle. For the knight various weapons can be chosen additionally.
To create a new tool first a matching mesh needs to be created. It is important that the tool only consists of a single mesh. If a mesh has been modeled then it still needs to be positioned correctly no that when used it is correctly attached to the bone. To do so the best way is to set the 'Empty' action for the armature object (or another animation which does not use a tool). Now, above the clonk's head, there are both tool bones at the same position. Now the mesh needs to be aligned so that the point at which the Clonk is to touch the mesh needs to be exactly at the bone position. Ideally, check the result from various perspectives in the end.
Eventually the new tool should have a matching name. The object name and the mesh name should be identical.
Now the tool can be saved via Save/Load and 'Save Tool'. Select the tool from the mesh list which appears. The tool will be saved at /Tools/toolname.mesh.
Import
To import a clonk first Clonk.blend needs to be loaded. Now we need the Clonk mesh to import. This can be loaded from the old file via File->Append or Link. Select the file in the menu that appears, then go to objects and select the object which contains the Clonk. It is important that the loaded Clonk only consists of a single mesh! If it consists or more than one then both need to be selected (shift+right-click) and combined (Ctrl+J). Finally the new mesh needs to be renamed to the name of the Clonk.
Again object name and mesh name should be identical. Then the selected mesh can be imported via a click on 'Import Mesh'. In the Clonk submenu the action of the Clonk can be adapted and the Clonk be saved. Now it can be used the same way as the other Clonks.
Randrian
2008-05