PlaneShift

Fan Area => Fan Art => Topic started by: Cherppow on December 18, 2006, 06:00:57 pm

Title: Simple Modeling School
Post by: Cherppow on December 18, 2006, 06:00:57 pm
Hey hey,

I'd like to start a thread that encourages people to try out modeling and maybe even get interested in it. A place where people can ask questions about 3D, share modeling tips and of course post fan-art models. You don't have to be a 3d-guru to be able to create usable and enjoyable models. Everyone can do it! :) All you need is a little patience, imagination and a bucket of tools. To the start here I've made a small tutorial to those who've never tried creating 3D before, but who are interested in trying it out.



 *****

Lesson 1: Tools
 This is the dull part. Tools are important, however. Every artist has his/her tools. Our tools will be the computer programs. There is a good list of different modeling and painting programs in Guide to 2D/3D Contribution (http://hydlaa.com/smf/index.php?topic=11028.0)-thread. You can choose the programs which suit you the best. However, for the examples here I'll be using Blender and Gimp; They're free, cross-platform programs that can handle plenty of different tasks.

1.1 Setting up Blender
 Download and install Blender (http://www.blender.org/cms/Home.2.0.html) for your operating system. Check installation guide (http://download.blender.org/documentation/html/chapter_installation.html) if needed. After installation Blender is ready to run.

1.2 Setting up Gimp
 Download GimpToolKit (GTK+) and Gimp, both available at www.gimp.org (http://www.gimp.org/). Install the GTK first, then install Gimp.

1.3 Setting up Blender2crystal
 If we are to export our models to PlaneShift, we're going to need an exporter. PlaneShift uses Crystal Space 3D (http://www.crystalspace3d.org/) engine, and their preferred Blender exporter is Blender2crystal, so I recommend that one. Blender2crystal requires Python (http://python.org/) to function correctly, so download and install it. In addition, Windows users should download the XML package for Python (http://pyxml.sourceforge.net/). Finally, download and install Blender2cystal (http://b2cs.delcorp.org/index.php/Main_Page). More precise installation instructions for the exporter can be found at Blender2crystal installation (http://b2cs.delcorp.org/index.php/Installing) page.

*edit*
1.4 Setting up CEL and CS
 The new version of blender2crystal exporter requires Crystal Space (CS) and Crystal Entity Layer (CEL) to function properly. I warmly recommend downloading them using the link on blender2crystal homepage (http://b2cs.delcorp.org/index.php/ArtistInstall#Get_Software). They provide a pre-compiled version of these software that have been tested with the exporter, so installation is quite easy, and it will save you of a lot of trouble later on, in the exporting phase. The link points to a zip package, currently named "pycelstart-7.8.zip". Download it to a temp directory, and unzip it's contents to a directory where you want your Crystal Space installed. Note that it will create an additional pycelstart7.8\ directory upon unzip. Personally I installed it in c:\program files\. Finally we need to set CRYSTAL and CEL environment variables. These simply hold the path to the corresponding programs. On WinXP open Control panel-System-Advanced-Environment Variables. Add a new system variable, called CRYSTAL, and give it a value "c:\program files\pycelstart7.8\cs" (or where you unpacked the zip). Remember to add the cs\ subdirectory to the end. Then add another environment variable, this time with name CEL and value "c:\program files\pycelstart7.8\cel". Click ok, and you're ready to go. Again check blender2crystal homepage (http://b2cs.delcorp.org/index.php/RegularInstall#Environment_variables) for better instructions.

End of Lesson 1: Tools


 *****


Lesson 2: Getting started with Blender
 Start Blender. Feel free to play around a bit at first, let your curiosity take control. You can return to the starting point at any time using ctrl+x. You'll propably feel a bit disoriented at first (I know I do), the controls feel weird and you don't seem to be able to do much at all. Don't let that depress you, let's start from the the very basics. Press ctrl+x to revert all changes. You should see this:
(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/blender_00.png)

2.1 Screen composition
Hmm, what is all that?

The screen is divided into three sections.
 - At the top there is Info Window. This window holds the "main menu" in the left and some numerical data about your current scene at the right.
 - In the middle you see the 3D View Window. This serves as your eyes to the current scene. Most of the editing takes place in 3D View. Currently there are three objects; the pink rectangle which is the default cube. It's pink because it's selected. Then there's a lamp, marked by black dot with few circles around it, and finally a camera is peeking from the lower edge. But let's leave them for now.
 - At the bottom you'll find the Buttons Window. There you'll find all possible settings for your currently selected object, its material, animation, lighting and so on.

 Note that all windows have headers and they can actually be changed to any type of window you want. Also be sure to check tooltip if you wonder what something does.

Here are the main items again.
(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/blender_01.png)

2.2 Headers

Let's take a closer look at the window headers. They're very useful. Here is the 3D View's header:
(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/blender_03.png)

 - At the left you see the icon showing this windows type, and a drop-menu where the type can be changed. Go ahead and try it. Change the window type to UV/Image Editor, and then back to 3D View. Note how the header changes to represent options available in each window type.

 - Next left you'll see View, Select and Object menus. Go ahead and check what each menu contains.
   - View-menu has different options for current view. We are currently in Top view mode, meaning we are looking directly down. Let's select "Camera" from the View-menu, this moves our view to the camera object. Click it and notice how the view changes. Now go back to Top view by selecting "Top" from the View-menu.
   - From the Select-menu you can edit which objects are selected and which are not. Let's try deselecting everything. Click "Select/Deselect" all from the Select-menu. You'll notice how the pink rectangle disappears to indicate that the default cube was deselected. Now click the "Select/Deselect" again. Notice how all the objects are now selected. If something is selected "Select/Deselect all" will deselect everything, if nothing is selected it will select everything. For now, let's select the cube again. You can do this by right-clicking on it in the 3D View.
   - Object-menu holds commands for modifying the currently selected object. Try selecting "Delete" and click "Erase selected Object(s)" to confirm the deletion. The cube disappears from the view and is deleted. Let's get it back though. Click ctrl+x to get back to the start.

   Note that menus also display the keyboard shortcuts where they're available. You don't have to memorize them now, but they'll become useful later on.



- Next in the header is the Mode drop-menu. We're currently in Object mode, meaning we can select and modify whole objects. Brief description of each mode:

   - "Object Mode" is where whole objects are selected, moved around and deleted.
   - "Edit Mode" is where modeling takes place; there we modify our mesh.
   - "UV Face Select" is where a meshes (sur)face texturing, appearance and functionality is controlled.
   - "Vertex Paint" is where extra colour and static shadows can be painted into meshes vertices.
   - "Texture Paint" is where you can paint and modify the texture image assigned to the selected mesh.   
   - "Weight Paint" is where you apply weight to vertices, used in animation calculation and skeleton-based movement.


- Next is the Viewport Shading selector. With this you can change how the view is drawn. We're currently in solid draw mode.

- Next in the line is Rotation/Scaling pivot selector and "RotateObject centers only"-button.

- Next is the "3D transformation manipulator" controls.

- Third from right are two sets of buttons. These are the layer controls. Much like in a painting program, you can create objects in different layers. You can then hide and show only the layers you're currently working on, or check the overall image by viewing all layers simultaneously. This helps especially when working on large number of models.

- Second item from the right, the lock image, sets the layers and camera to be unique and appear in this scene only.

- The rightmost button renders the window.

 If you right-click on the header, a menu appears. There you can choose where the header appears, or hide it completely. If you hide the header, you can get it back by right-clicking the window border and selecting "Add header". This also reveals another useful option: window splitting. By choosing "Split Area", you can divide any area into two. With middle mouse click you can change the split direction horizontal or vertical. You can also drag the edges to scale the windows to your liking.


2.3 Mouse buttons
 One of the reasons why Blender controls confuse a newcomer is the mouse button setup. Once you get to understand them however, they become very powerful tool. I'd categorize the buttons like this:

Left mouse button:
   Click, Accept action

Middle mouse button:
   Move, Turn, Switch

Right mouse button:
   Select object, Cancel action

In 3D View you move the 3D cursor with left click, you move the view around with middle mouse and select objects with right click. Holding down left or right mouse will pop up a toolbox. We'll explore that later.
 Control and shift are important help buttons here. Combined with mouse button, they give useful extra functionalities. In general:

Shift:
   Slow move, Add to selection
Control:
   Snap to grid move, Add new

 In some situations there's also ctrl+shift-combinations and combinations with alt, but don't worry, you don't have to learn them now.
 To an extent, you can customize the mouse buttons. Try dragging the Info Window border down and select the "View & Controls"-tab. You can choose the settings you prefer. For example I prefer Turntable view rotation over the Trackball one.


2.4 Toolbox

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/blender_02.png)

 You can open the toolbox either by holding down left or right mouse button over the 3D View, or by pressing spacebar. This is a collection of menus that will allow you to access most wide variety of tools. Note that some of the options there depend on what you have selected. In Object mode you'll have different tools than in Edit mode. Here are some useful tools:

   - Add-Mesh, Lamp, Camera: Used to create whole new object(s).
   - Edit-Duplicate: Duplicates the currently selected object(s).
   - Select-Inverse: Selects everything not selected.
   - Transform-Grab/Move: The main move function. Moves selected object(s) around.
   - Transform-Rotate: The main rotation function. Rotates selected object(s) around the rotation/scaling pivot.
   - Transform-Scale: The main scaling function. Scales the selected object(s) toward the rotation/scaling pivot.
   - View-Ortho/Perspective: Switches between Orthogonal and Perspective view modes. Both are useful in different situations.
   - Render-Render: Renders the camera view. Main render function.

The other tools have uses too of course, but with just the ones mentioned above you can already do a lot. Also note that most of the tools have keyboard shortcuts marked after them. Now would be a good time to memorize some of these. For example try using the following on your keyboard G=Grab, R=Rotate, S=Scale. I warmly recommend using Blender with one hand on the mouse and other on the keyboard.

For more comprehensive introduction to Blender check out Blender Quickstart (http://www.blender.org/cms/Quickstart.434.0.html).

End of Lesson 2: Getting started with Blender


 *****


Lesson 3: Edit mode
 First clear any mess you've made with ctrl+x. Now it's time to enter Edit mode. Do this now either from the 3D View header Mode selector, or from Toolbox-Edit-Enter Editmode. It is here that you shape your model. Note that the default cube on the 3D View has changed. It's still pink, but it's bordered by yellow lines and yellow dots on the corners. The dots are called Vertices, points in space. By connecting two points you can make a line (edge); by connecting three you can make a plane (face). Those are the basic construction blocks of modeling: Vertices, Edges and Faces.

 Now then, let's have a look at that cube of ours. First I want you to turn on the Perspective view mode. You can do this from the Header View-menu if you've forgotten. Then rotate the view around the cube a bit by holding down the middle mouse button. View is very important in modeling. Correct view can save you a thousand mistakes.

3.1 Selecting vertices

 Now that we know we're really dealing with a cube and not just a pink rectangle, let's start working on it. All the cube's vertices are yellow; they're all selected. Hmm? But pink was selected, was it not? Yes it was, in Object mode. However, in Edit mode the colour convention is a bit different. Here yellow marks selected, while pink marks unselected. Try it out, right click a vertex to select it. This will deselect all the other vertices and leave just the one you clicked, yellow. Go ahead and select few others. Notice how the previous always unselects leaving only the one you click selected. To select multiple vertices, hold down shift key, or Box select with B-key.

 There's this contraption of arrows that seems to follow your selection. It's called "3D transform manipulator". You can read more about it in Blender homepage (http://www.blender3d.org/cms/3D_Transform_Manipulators.574.0.html), but for now, let's turn it off. Do this by clicking the hand icon in the 3D View header.

Here are the main items again:
(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/blender_04.png)


3.2 Select modes

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/blender_05.png)

 Let's look at the 3D View header again. When we entered Edit Mode, a few new buttons appeared there. At the right, there is a set of four buttons. These control the select mode. Until now we've been in "Vertex select" mode, in which we can select and move individual vertices. In addition there is the "Edge select" mode and the "Face select" mode. Go ahead and try the other two modes. Try selecting few Edges and then few Faces. The fourth and final button limits selecting to visible vertices/edges/faces only. Try turning it on now. Notice how the cube becomes solid, and you no longer see the backside of the cube. In this mode you can't accidentally select items that are on the back your object. It's especially useful when working on complex object that overlaps itself many times. You can leave the Limit selection to Visible turned on for now.

 
3.3 Hide
 Sometimes when using grab-command (G-key), you accidentally hit H-key. This hides your current selection, and can cause a lot of confusion. Don't worry though, hide isn't same as delete, and you can reveal hidden items with alt+H. Go ahead and select a part of your cube and press H. Then unhide with alt+H. You can also hide multiple items, they all come back when you unhide. Although not too useful with simple models such as cube, hide can really save your day when you're working eg. inside walls.


3.4 Undo

 Mistakes happen to everyone sooner or later. You can't always start anew with ctrl+x when you make a mistake, so let's check the undo tool. You can change undo tool settings in the "User Preferences"-window, "Edit methods"-tab. Keyboard shortcuts for undo are:

 - ctrl+z, U = undo
 - ctrl+shift+z, shift+U = redo
 - alt+U = undo history

 Go ahead and try undoing your last actions, then redo them again, until no more redo is available.
 
End of Lesson3: Edit mode
Title: Re: Simple Modeling School
Post by: Cherppow on December 18, 2006, 06:07:56 pm
 *****


Lesson 4: Modeling
 All right. I hope you were listening before, because we're speeding up a bit. If you feel unsure, feel free to check the previous lessons again. Rather than going through all the commands, I'll try learn-as-we-go approach, just modeling and explaining a bit what happens and why. Let loose the modeling animal in You!

4.1 Banana

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/modeling_monkey.png)
This is Manny the modeling monkey. He's trying to create one of his favourite models. A banana. :)

He starts with the cube and enters edit mode. There he box selects B the two lowermost vertices, and extrudes E them four times. Being the smart monkey that he is, he uses ctrl to snap each portion equal in size. His model now looks like this:

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana01.png)

Next he starts to shrink the ends of the banana. He selects the topmost vertices and scales S them down. Manny starts screaming and tossing pieces of keyboard around! What, why are the vertices leaving a trail! Stupid program.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana02.png)

Manny goes to eat a banana. Cherppow arrives and checks the scene. Rotating the view a bit reveals the flaw in Manny's plan.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana03.png)

The poor thing had used top view all the time, and didn't realize he had "Limit selection to visible" on. Thus only the topmost vertices of the cube were selected, extruded and scaled. Always know what you have selected.

Judging the situation, it's easier to start over than try to fix the current model. ctrl+x When extruding whole faces, it helps to use Face select mode. Do this and extrude the side face of the cube four times. You'll end up with the shape that Manny was after.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana04.png)

Next turn in the top view numpad 7 and the orthographic view numpad 5. Disable "Limit selection to visible" and switch back to vertex select mode. Box select B the topmost pair of vertices. Scale S them down to 0.2.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana05.png)

Go on by selecting and scaling the second pair of vertices from top to 0.8. Leave the 3rd pair as is. Scale fourth pair to 0.9 and fifth to 0.5 and the lowermost vertices to 0.2. Look around the model, it should look like this.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana06.png)

Return to top view numpad 7. Box select B the topmost and lowermost vertices. Enable proportional edit O and check that it's falloff is set to "Smooth Falloff". Grab G the selection. While on grab, use the mouse wheel to control the size of the falloff. Try to match the size in the picture, about 2/3 of the banana length. Then move the selection 2.0 to the right. Use ctrl to snap to grid. Notice how the nearby unselected vertices follow. This is what proportional edit does.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana07.png)

It's starting to look right, but not there yet. Let's smooth the thing a bit. Select all A vertices and press W to bring up the specials menu. Choose "Smooth". Do this two times. After smoothing twice the model should look similar to this:

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana08.png)

Go back to top view numpad 7 and orthogonal view numpad 5. With proportional edit still on, select the lowermost line of vertices and grab them 1.0 to the left. You should now turn off the proportional edit O.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana09.png)

Select the topmost row of vertices and rotate R them 40 degree clockwise.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana10.png)

Only few small tweaks left. Let's flatten the banana somewhat. Select all A and scale S to 0.8 along Z-axis. You can lock the axis either by middle mouse button or by keyboard Z. Deselect all A. Finally let's add little more roundness. It's a bit tricky, so follow closely. Switch to Edge select mode. Go in top view numpad 7 if not already and check that you have "Limit selection to visible" turned off. Box select B twice. This will send you into paint selection mode, where you can add select items by painting. Left mouse selects, middle mouse deselects and right mouse exits this mode. Draw over all the horizontal lines, so they get selected, but leave the banana borders deselected. If you've succeeded, the selection should look like this.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana11.png)

Press W to bring up specials menu, and choose "Subdivide Smooth" 1.0 is ok amount here. I'd say the model is ready. However, let's get a render out of it. Place your view in nice position and snap the camera to your view with ctrl+alt+ins. Try to get the whole fruit into picture. Render F12. Here's my render:

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana12.png)

Not quite "surely eadible" yet. Let's work on the material just a bit. Exit Edit mode. Select the banana if not already selected. See the Buttons window. Under Link and Materials you see the name of our banana factory (Datablock) and instance (Object). Rename both to "banana". A little down there's Two buttons, "Set Smooth" and "Set Solid". These control the mesh smoothing for the object. Click "Set Smooth" button and notice how the jagged edges on the banana disappear.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana13.png)

Switch on to Shading panel. There, under Links and Pipeline you see the Material currently linked to the object. Rename the material to "ma_banana". On the next tab, Material, you can choose the base color of the material. It's currently light grey, change it to bright yellow by clicking on the color box. Finally under Shaders-tab change the reflection amount to 1.0 and the degree of specularity to 0.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana14.png)

Try rendering again. Looks better. It could use an unique texture, but we'll get to that later. Here's my banana ensemble. I duplicated the object a couple of times, and moved them around. You can duplicate objects with shift+D. You can save your work with F2.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana15.png)(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/modeling_monkey.png)

Manny returns and steals your models! This concludes our tutorial for now. I hope you enjoyed it and again, feel free to ask questions and post suggestions.

End of Lesson 4: Modeling
Title: Re: Simple Modeling School
Post by: josephoenix on December 18, 2006, 06:22:01 pm
(http://josephoenix.ps-mc.com/kickass.png)

I think that says it all ;]

Great work on those lessons, I hope they inspire some more PS'ers to try out 3d :] And I also hope that we'll see some more of those lessons in the future :D

josePhoenix
Title: Re: Simple Modeling School
Post by: dying_inside on December 19, 2006, 08:19:07 am
Yuck. I dislike modeling in blender with a passion.
The only thing I use it for is file format conversions and the decimator tool.
Apart from that I prefer wings. I find it much much nicer to use.
But each to their own.
Title: Re: Simple Modeling School
Post by: Idoru on December 19, 2006, 09:07:24 am
Im impressed, Blender has always made me want to cut my hands off so I dont get tempted to start trying to understand it. I have always found 3DStudio and Maya to be much more user friendly. Although the price tag tends to be not so friendly  ;D

I might actually have a go at blender now and see if I can make a banana :)
Title: Re: Simple Modeling School
Post by: ThomPhoenix on December 19, 2006, 11:39:50 am
Wow, that's an unbelievably good guide, Cherppow!  \\o//
When I get started on Blender again I will most definately use it :)

 :thumbup:
Title: Re: Simple Modeling School
Post by: rast on December 19, 2006, 03:33:21 pm
This is awesome cherpow!

I've just started moving from moddeling in wings to blender, and i'm actually finding blender easier to use at the moment for what i'm doing (relatively high poly stuff - wings slows down for me when i get over 1000 polygons).

Personally i've learned blender just from moddeling things in wings then importing them into blender and then tweaking them a bit. Eventually though you get to a point where you think "wait, perhaps if i model the meshes in blender it would speed the whole process up". Scarily, it does.

But anyhows, hope to see more turorials soon :)
Title: Re: Simple Modeling School
Post by: Quitarias on December 19, 2006, 04:27:27 pm
nicely done cherpow these tutorials made me wana take up 3D again  :thumbup:
Title: Re: Simple Modeling School
Post by: Cherppow on December 19, 2006, 07:20:55 pm
Thanks for the comments and contributions everyone.

Here's the next part. :)

*****


Lesson 5: UV map


 Manny wants prettier bananas. He decides to apply a texture image to the model's surface. He opens Gimp and creates a new image, 256x256 pixels in size. Being the smart monkey that Manny is, he knows that bananas are yellow, and have some black on the ends. Here's what he draws on the picture:

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/modeling_monkey.png)(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana16.png)

He saves the file as banana.png and goes back to Blender. There he splits the 3D view in half and changes the other half into UV/Image editor. He also opens his newly drawn texture into the UV/Image editor from the Image-menu. His screen looks like this:

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana17.png)
 
With the banana selected, Manny enters UV Face select mode from the 3D view header. He also notices that his 3D view is currently in "Solid" draw mode, and doesn't show any textures. He uses the "Viewport Shading"-drop menu to change the draw method to "Textured". Hmm, no texture still. Seeing that all of the banana's faces are selected (pink), he goes to UV/Image editor side again, to select texture image for these faces. To do this, Manny selects his banana texture from the image drop-menu there. Manny's tail twitches! What is that?! The banana looks awful! Stupid program. Manny presses the reset button for a dozen times and goes to eat a banana.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana18.png)

Luckily Cherppow has removed the reset wiring from inside the computer case. Hmm, this time Manny actually did pretty good job. The only flaw is how he has UV mapped the faces. Or rather that he did not do any UV-mapping, he just used the default one. What is UV map then? It is a set of coordinates that indicate which part of the texture is used on which faces on the model. U and V come from the coordinate axis on the image. While x, y and z are already used in the model space, u and v (in some cases also the third axis w) are used on the texture.

So what can we do about it? Let's take a look at the banana again. It appears to have some kind of chessboard texture, although the image we used as texture certainly wasn't such. This is due to the default UV map. By default all the faces are mapped to show the whole texture. If we look at an individual face closer, we can see that this is just what is happening.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana19.png)

Ok, now to fix the mapping. Blender has good tools for editing UV maps. We'll be using one of the automated scripts to generate a map for us, and then fine tune the results by hand a bit. First though, let's select all the faces in the banana. All the Edit mode's selection tools also work in UV Face selection mode. After you've all the faces selected, go into UV/Image editor header and select "Archimap UV Projection Unwrapper" under UVs-menu. This will popup the unwrapper window. In the unwrapper, disable the "Stretch to Bounds" option. That is used to enlargen the UV map to better fill the image, but it will also distort the face shapes a bit, so let's not use that. Then click ok.

*edit*
In the new Blender 2.43 Archimap unwrapper is integrated, instead of separate script. It can be accessed through UV Calculation menu (U-key) while in UV Face Select mode. The name has also changed, to "Unwrap (smart projections)".

 The result should be more or less like this:

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana20.png)
(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana21.png)

We now have a more decent UV map for our model, but it can be improved. To do this, we'll first need to identify the pieces the automatic unwrapper made for us. Editing the UV map by hand isn't going to do us much good if we don't know what UV represents what face. Let's identify the second piece from the left first. Select the whole piece. Do this by hovering the pointer over it and pressing L. L-key is the shortcut for linked select. Now grab the piece and move it around a bit, but don't accept the move, just wiggle the piece around and then cancel with right mouse. If you look at the 3D view, nothing happened during the move. Let's change that; turn on the "Update automatically"-option under View-menu. Now try grabbing the UV piece again. Wee! Seeing how the UV changes affect the model in real time, is a good help in UV-mapping. Now we've also identified the first piece, which is the topside of the banana. Do the same for the other pieces, to identify them too. Here's what I found out:

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana22.png)

How to improve the UV map then? The three things a good UV map does are:
 1) It makes the texture look good on the model
 2) With as little texture space as possible
 3) While leaving the texture as easy to make as possible
If we look at number one and our model we can say that aye, it looks good. However, on rule number two we have a problem: there's plenty of unused room in our image. Rule number three doesn't really count in our case, since we have pre-made texture by Manny. However, if we didn't have a texture yet, and had to draw one based on our UV map, the third rule would be important too.

 So, let's improve the use of our texture space. One devious way to do this, is by overlapping the UV pieces. This makes the overlapping pieces look similar on the model of course, since they use the same part of the texture, but in most cases that doesn't show too much. If we look at our UV map, clearly every piece has a similar counterpart; the top and bottom, sides and ends. This is because our banana is pretty symmetrical. We can use this to our advantage. Link select L the whole bottom piece and mirror M it along x-axis. Then move the piece over it's pair, so that it overlaps it perfectly. You can zoom in with middle mouse and use shift for precision. The result should look like this:

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana23.png)

Do the same trick with the rest of the pairs: Move right side over left side and low end over top end. Remember to mirror each piece you move. The sides and ends don't match each other perfectly, but don't let that bother you, just overlap them as well as you can. Here's what you should end up with:

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana24.png)

 The UV map is starting to look good. However, there is a small problem that the unwrapper made for us. Try selecting all the UV pieces A. Now grab and wiggle them around, but again don't accept the move, instead look at the model. Try turning your 3D view so you can see the left side of the banana, and then move the UVs around again. Hmm, it moves to different direction than the rest of the faces. The reason for this is that its UV-map is upside down... or rather it is the only piece that is not upside down! No panic though, first, let's just put them all upside down. Link select L the left side UV piece which is different way than the others. Be sure that you've selected the left piece and not right piece, it's a bit difficult now that thy're overlapping. You can always test-grab to check which piece is currently selected, as long as you don't accept the move. When you have the left piece, mirror M it along x-axis and then along y-axis. Now if you select all the pieces and grab them, you'll see that the texture flow on the model is much more unified. Finally select all A UV pieces and mirror them along y-axis. All right, problem fixed. Should look like this:

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana25.png)

Let's continue with touching up the UV map. To save more space, the top and bottom pieces could be mirrored along x-axis, so they'd better fit with the side pieces. You can either mirror both pieces separately, or select them both and mirror them together. Remember that you can add to selection by holding down shift. This also works with linked selection. After mirroring, you can move them a bit closer to the other pieces. Grab the top and bottom piece and move them 7.0 to the right. While grabbing, you can simply give numbers with the keyboard and move will snap to that value. You can control the axis by middle mouse, or with x and y keys. In this case we move horizontally, so x is the correct axis.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana26.png)

Let's move the end pieces at a better position. Select and grab G the tiny things. Move them -96 along x-axis, to the left that is. Then -243 along y-axis, meaning down. Finally, if we look at the 3D view (black areas especially), we can notice that the right side piece is a little higher than the other ones. Go select it's UV piece and move it -5 along y-axis. Try to match the results here:

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana27.png)

Pretty good. Now what exactly did we gain? There's still a lot of empty space in our image, even more than before actually. A good question. We didn't gain anything yet. However, now our UV map is so small it can fit to a smaller image, and that's just what we're going to do. Open Gimp if you've closed it and open the banana texture. Select Crop tool and click on the image to open the crop information window. Type in the values in the image below, they will cut a 128x256 piece from the middle of our 256x256 image. The result is the second image and our new texture, half the size or the original.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana28.png) (http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana29.png)

Save the cropped image. You can close Gimp and move back to Blender and in UV/Image editor. Select all the faces and load the new texture. As you load the new, different shaped image, you'll notice that the UV map shrinks along x-axis. Blender tries to keep the scale same through image changes, and now with an image of half the width, our UV mapping becomes 50% thinner. This is no problem though, since we know how the aspect ratio changed. To fix the problem select all A UV pieces and scale S them along-x axis x to 2.0.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana30.png)

Leave the UV Face select mode, and return to Object mode. You can also close the UV/Image editor, either turn it into another 3D view, or join it with the existing one. Rotate your view around the banana and find a nice angle, then snap the camera and render.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana31.png)

Treachery and doom! All our texturing for nothing!? Even Manny would laugh at us. :( Don't give up hope yet. We still have to apply the texture file to the banana material. See the buttons window "Texture"-tab and add new texture. Then switch to "Map Input"-tab which just appeared. There, choose "UV" as map input method. Finally go to "Texture buttons" with the button on the header or with F6. There we can choose the settings for the texture we just created. Change texture type to image. From the image-tab which appears, select the banana texture image from image drop menu. Now that the image is set, click the small car icon next to texture name "Tex". This will automatically create a name for the texture, using the image filename.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana33.png)
(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana32.png)

Now then, render F12. Here's my render. I duplicated the fruit a couple of times again and used Sun-type lamp. You can change this in "Lamp buttons" area. Remember to select the lamp first though.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana34.png) (http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/modeling_monkey.png)

Umm, well. Looks like our texture artist could have been a little less hasty. :) We'll have to touch it up later. This is the end for UV mapping part, the rest is image manipulation.

End of Lesson 5: UV map
Title: Re: Simple Modeling School
Post by: Induane on December 19, 2006, 11:52:19 pm
Cherppow these are excellent guides!  I have been working on a site for such things for PS'ers.  I'd love to apply these to my site:

http://vaalnor.mine.nu/psdoc/ (http://vaalnor.mine.nu/psdoc/)

As you can see I'm low on blender tutorials :D 

Somehow in my haste  I forgot to actually ask if it would be ok to format these guides for my site?
Title: Re: Simple Modeling School
Post by: Ralleyon on December 20, 2006, 02:06:04 pm
And by the way of Induane, here's a link from his documentation site which deals with the installation of the following programs on a Windows platform: Blender, Blender2Crystal, CrystalSpace, Python24, PyXML, PythonImagingLibrary

http://vaalnor.mine.nu/psdoc/?q=node/24

@Cherppow: Amazing tutorial! Thank you for your efforts.  :thumbup:
Title: Re: Simple Modeling School
Post by: Erik on December 22, 2006, 10:15:58 am
Quote
don't have to be a 3d-guru to be able to create usable and enjoyable models.

Ohw...?
Title: Re: Simple Modeling School
Post by: Robinmagus on December 28, 2006, 12:27:15 am
Hey mate. Decided to try, but I messed up :O When I do the extrude thing, the new boxes aren't solid...when I switch views, I discover that they're just two lines. No color or bottom line like yours. I think I missed something :O

(http://img291.imageshack.us/img291/2333/blendermessup1bw8.th.jpg) (http://img291.imageshack.us/my.php?image=blendermessup1bw8.jpg)


EDIT: Oh wait, I selected corners diagonally across from eachother. damnit. lemme try again.

EDIT2: VICTORY!!!

(http://img84.imageshack.us/img84/3103/blendervcitory1sg7.th.jpg) (http://img84.imageshack.us/my.php?image=blendervcitory1sg7.jpg)

EDIT3: Now he tells me it's wrong :/

EDIT4: *sigh* My next problem. Only the first and last boxes will do the curve thing.

(http://img151.imageshack.us/img151/5460/blendermessup22it1.th.jpg) (http://img151.imageshack.us/my.php?image=blendermessup22it1.jpg)

I assume it's something to do with that falloff radius, but I have no idea about how to work with that thingy. Advice,tips, etc. will be appreciated.
Title: Re: Simple Modeling School
Post by: Nikodemus on December 28, 2006, 08:06:31 am
If you have problems with making faces, remember you can select 3 or 4 vertices and press "F" to make a face.
Title: Re: Simple Modeling School
Post by: Jauffre Martin on January 08, 2007, 10:56:08 am
I assume it's something to do with that falloff radius, but I have no idea about how to work with that thingy. Advice,tips, etc. will be appreciated.

Try checking this site here for information (and a small tut) about the falloff readius.
http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro/Mountains_Out_Of_Molehills
I'd also suggest looking around at the rest of it. There's some pretty cool tutorials in there.
Title: Re: Simple Modeling School
Post by: Cherppow on January 08, 2007, 06:15:42 pm
Hi again,

Thanks for the contribution everyone! Especially thanks for everyone who posted nice tutorial links.

To Erik:
Erik you guru! Come back to us, we need the Sunshine. *bows*

To Robinmagus:
Thanks for pointing those out, I modified the guide slightly. In the edit4 you're propably right, only the selected vertices move because the falloff radius is too small to reach the next vertices. You can grow the range with Page Up or with mouse wheel. Judging from your screenshot you have the proportional edit enabled, so you should see a circle once you enlarge the radius a bit. Just make the circle about same size as in this picture, and the other vertices start to move too.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana07.png)


 *Edit*


*****


Lesson 6: Drawing a texture

Let us continue by making a more realistic skin to the banana. Instead of using Manny's makeshift texture, let's create a new one from the scratch. Start Blender and open the banana model. Select the banana and go into UV/Image editor. From the UVs menu there, choose "Save UV Face Layout..." option. A query window will appear, asking some values for the output.
- The topmost value is the size of the image in pixels.
- The second value controls line width of the faces.
- Wrap button controls how the faces outside the image borders will be handled; either wrapped to appear from the opposite edge, or scaled down so they fit in.
- All Faces button toggles whether all faces will be drawn on the layout, or just the ones selected.
- Ob button causes the object name to be added in the front of the output filename.
- Edit button enables one to launch an external image editor program straight away.
- The last field is used for the external edit program path.

Here are quite suitable options for the banana texture. Set the same values and click OK. Then select suitable directory and filename, preferably "banana01a", and click Save UV Image.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana35.png)


I don't know about you, but I can't remember the path to where I installed Gimp, so I have to start it manually. Start Gimp and open the UV image layout we just created. It should be there as .tga if you've not changed the default output settings in Blender. Result should look like this:

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana36.png)

We have a problem again. The export script in Blender only saves square images, and ours was a rectangle. Luckily we still remember the original resolution: 128x256. We should scale the image right away to prevent further confusion. Right click the image area in Gimp and select Tools-Transform Tools-Scale... a window will appear asking scale values. Unlock the aspect ratio from the chain icon, and change the width from 256 to 128. Finally hit Scale.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana37.png)

The result resembles the UV map of our banana. Now we know what to draw where. Onward to find a realistic banana image! A good source is the Image*After (http://www.imageafter.com/)-website. It provides textures of many categories, free for both personal and commercial use. I searched the foods section and found these interesting banana peels (http://www.imageafter.com/image.php?image=b13food000.jpg). Copy the image and paste it to your Gimp. As you can see the image is quite large. Scale it down to 18%.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana38.png)

Next we need to rotate the image 90 degree counter-clockwise. Select Tools-Transform Tools-Rotate... and input -90 as angle. Now copy the rotated image to the clipboard, typical shortcut ctrl+c. Select the image with the UV face layout again and paste the clipboard there. Banana peel image appears as a floating selection. While the pasted selection is floating, create a new layer (Right mouse-Layer-New Layer), this will promote the current selection to layer, while keeping it's original size (which is larger than the current image). Finally open the layers tab in Gimp. You'll see two layers there: Pasted layer and Background. Change the Mode of the "Pasted Layer" to Multiply, this enables you to see the UV layout through it. The image should now look like this:

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana39.png)

Next we need to place the peels with our UV map. First flip the whole layer horizontally. Move the twin peel to the center of the image with move tool. Finally rotate the layer 5 degree counter-clockwise. Try to match this:

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana40.png)

Open the layers tab again, and change the Pasted layer mode back to normal. Then save the texture as banana01a.tga. Gimp warns that tga cannot save multiple layers, but it's ok, as we only need the visible layer for now. Just click "Export". Start Blender again if you've closed it. Select the banana object and enter UV Face select mode F and open the banana01a.tga in the UV/Image editor. Situation looks like this:

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana41.png)

One advantage of texturing your own models is that you have the ability to modify the UV layout to match your texture. This is often faster than modifying your texture to match the UV-map. Don't go too far though, if you mess up the uv-map completely, creating additional skins will be close to impossible. In our case however, only slight modification is needed. First select the side pieces and move them 10 to the right and rotate them -1.5. Then select the six middlemost UVs of the top and bottom sides (as seen in the image) and move them 12 to the right. This will distort the texture a bit, but not noticably.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana42.png)

Select the three topmost and three lowermost UVs of those pieces and move them 14 to the left. Finally select the tiny end pieces and move them 18 to the right. Your uv map should look like this:

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana43.png)

Exit UV Face select mode F and render F12.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana44.png)

Oh yeah, have to change that material pointer too. Check the buttons window, texture buttons. Change the image to banana01a.tga. Render.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana45.png)

It's a banana. Manny arrives and does the funky banana dance. You should save your work now, before Manny eats it. Here is my final render.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana46.png)(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/modeling_monkey.png)

That's the end of Drawing a texture. Manny thanks for your interest and bananas. More advanced tips later perhaps.

End of Lesson 6: Drawing a texture
Title: Re: Simple Modeling School
Post by: Cherppow on January 15, 2007, 05:00:03 pm
Lesson 7: Exporting to PlaneShift
 
Time has come to test the model in PlaneShift. Start Blender and open the banana model. Let's just export it and see how it looks. If you've installed Blender2Crystal properly in the first lesson, you'll have a "CrystalSpace" option in File-Export menu. Click it and wait for the exporter window to open. Select the library option, as we're creating an item and not a level. Choose suitable export directory and push Export. I get a python script error and the exporter disappears.

*edit*
If you do not get an error and the export runs through fine, you should congratulate yourself; you're either lucky or know what you're doing. You should still change the object type to genmesh from the overlay gui, but you don't have to mess with the renderloop. Then export the object again, as library, and jump to 7.1.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana47.png)


If we take a look at the console program, we see a long list of traceback. The last item is the most interesting:

Code: [Select]

 "...line 273, in get_material_shaders steps = b2cs.prop.global_keys["renderloops"][rloop].getSteps() KeyError: 'standard'"

I'm no coder, but it seems to point that something is amiss in the renderloop 'standard'. We need to change that. First open the overlay interface of the blender2crystal. You can do this from View-Space Handler Scripts-Event:blender2crystal.py. Finally click on your 3D view to open the exporter on that window. A large grey box appears to fill your view. That's the export, jammed due to the error. Double click on it to close. Now you should see the normal overlay gui. Change the object type to genmesh:
 
(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana48.png)

Onward to change the renderloop then. Select the square painting from the top row, there we can change sector settings. We also see a renderloop option there. It's currently "not set". Click the value to change it and choose "ambient" from the popup menu. (This doesn't affect anything really, since we're only exporting a single object library.)
 
(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana49.png)
 
Continue by clicking the gear icon on the top row. This brings up the exporter main screen. Click the "create library" button and the export should run through.
 
(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana50.png)



7.1 Tweaking by hand
If you check the export dir, there is a world.zip packed file. Open it and you'll see it has tree files in it:
 
- banana01a.tga (texture)
- library (so called worldfile)
- genbanana (banana model file)
 
Ok, let's get the model in PS then. Open your PS install directory. Go into /art/things dir and copy all the export files there. First let's get rid of the worldfile, since libraries don't need them. Open the "library" on a text editor. It's not very long. Mine is like this:
 
Code: [Select]
<?xml version='1.0' encoding='UTF-8'?>
<library>
  <plugins>
    <plugin name='genmeshfact'>crystalspace.mesh.loader.factory.genmesh</plugin>
  </plugins>
  <shaders/>
  <textures>
    <texture name='banana01a.tga'>
      <file>textures/banana01a.tga</file>
    </texture>
  </textures>
  <materials>
    <material name='ma_bananabanana01a.tga'>
      <texture>banana01a.tga</texture>
    </material>
  </materials>
  <sounds/>
  <library>factories/genbanana</library>
</library>

There are two things of interest there:
 
    <plugin name='genmeshfact'>crystalspace.mesh.loader.factory.genmesh</plugin>
 
Which links a plugin named 'genmeshfact' to a certain crystalspace mesh loader. And
 
    <material name='ma_bananabanana01a.tga'>
      <texture>banana01a.tga</texture>
    </material>
 
Which links a material named "ma_bananabanana01a.tga" to a texture named "banana01a.tga".
 
Next open "genbanana" in text editor. It's a bit longer file, but most of it is coordinate data, which we don't have to go into. The first few lines are of interest here.
 
Code: [Select]
<library>
<meshfact name='genbanana'>
<plugin>genmeshfact</plugin>
<zuse/>
<params>
<material>ma_bananabanana01a.tga</material>

The first tag "library" defines that this is a library. The meshfact-tag defines name for this object factory. Next we have a plugin tag that specifies what type of mesh this is. Next is zuse-tag which is the Z-Buffer render mode for this object. Then there is params tag, and inside, material tag, which defines the texture. Let's replace the plugin and texture with the ones found in the earlier file:
 
Replace
<plugin>genmeshfact</plugin>
with
<plugin>crystalspace.mesh.loader.factory.genmesh</plugin>
 
and replace
      <material>ma_bananabanana01a.tga</material>
with
      <material>banana01a.tga</material>
 
Then let's delete the line
<zuse/>
alltogether and just let CS use the default.
 
Last but not least, change the meshfact name
<meshfact name='genbanana'>
to
<meshfact name='banana'>
 
The model file is starting to look good. Might be a good time to save your changes. You can also delete the file named "library", we don't need it anymore. Next step is to replace an existing PS item model with our custom one. I have selected shortsword as the item to replace, because I know I my character has that item in his inventory. If I open the shortsword01a.spr from PS/art/things/weapons.zip in a text editor, it looks like this:
 
Code: [Select]
<meshfact name="weapons#shortsword01a">
   <plugin>crystalspace.mesh.loader.factory.sprite.3d</plugin>
  <params>
    <material>/planeshift/weapons/shortsword01a.dds</material>
    <frame name="stand0">
...

We see certain differences with our "genbanana" file. Most importantly:
 
<meshfact name="weapons#shortsword01a">
and
<material>/planeshift/weapons/shortsword01a.dds</material>
 
Let's add those changes to the genbanana. The banana file should now look like this:
 
Code: [Select]
<library>
<meshfact name="weapons#shortsword01a">
<plugin>crystalspace.mesh.loader.factory.genmesh</plugin>
<params>
<material>/planeshift/weapons/banana01a.tga</material>
...

Note that I left the material to point to the banana texture. Finally save the genbanana file and close the text editor. Rename "genbanana" to "shortsword01a.spr". Take a backup copy of the original PS shortsword01a.spr! Then copy the both custom files, banana01a.tga and shortsword01a.spr, into PS/art/things/weapons.zip. Run Planeshift normally and find yourself a shotsword.
 
(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana51b.png)
 
 
Well it is exported, although the fruit is over 9,5 meters long and poorly aligned. More about fine tuning the results later. This is the end of the exporting lesson.
 
End of Lesson 7: Exporting to PlaneShift
Title: Re: Simple Modeling School
Post by: ThomPhoenix on January 15, 2007, 05:04:58 pm
I knew it would work out! :)
Title: Re: Simple Modeling School
Post by: Cherppow on January 16, 2007, 07:33:59 pm
*****


Lesson 8: Exporting conventions

The banana was no good. The biggest problem was humongous size, but also orientation and position was wrong. Why? The answer is as simple as "we made it such". The mistakes are in our model, which is kind of good, because we can easily fix them as long as we have the source. And that we do. Open banana.blend in Blender.

First, let's check the size. In PlaneShift we use size convention 1 unit = 1 meter. There are several ways to view your objects size in Blender, let's take a look at one of them. In object mode select the banana and press N-key. This will open a Transform Properties window. You can see four sets of numbers.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana52.png)

- Loc-values show the location of this object along the three axis of space. To be exact, they point where the object's origin is located.
- Rot-values show the rotation of the object.
- Scale-values show if the object has been scaled outside edit mode.
- Dim-values state the dimensions of the object.

In our case dimension values are of importance. These values are in units (=meters). Our banana is 9.537 meter long, 2.605 meter wide and 1.595 meters thick. I'd say 30cm is a realistic target size here. A quick calculation reveals that the banana should be scaled down to 0.0315 of it's current size. We could scale it right away, in object mode, but that would only scale the current one instance of the object. So let's be smart and enter edit mode for scaling. There we can edit the actual factory, which is used by all possible instances of this object. Hit TAB to enter edit mode. Select all A vertices and scale S the banana to 0.0315. Once scaling you can type the value in with keyboard. Pretty tiny, huh? Press TAB again to exit edit mode. Open the Transform Properties window again if you closed it. Check the values now, should look like this:

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana53.png)

30 x 8,2 x 5 cm a fine specimen it is. Now the size is fixed, let's move on to position. Currently the banana is not centered. For PlaneShift weapons and handheld items, objects should be centered so that the handle is in coordinate space origin 0,0,0. So, let us move the banana to the middle of space. One way is to go into edit mode and move all the mesh manually, however, Blender also provides a shortcut for this. See the buttons window Editing panel for a button named "Centre". As the tooltip explains, this will center the objects data to the objects origin. Click it. Zoom in to the banana a bit to get a better look. Should look like this:

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana54.png)

Pretty good, however... The handle is not quite at the origin. We'll have to tweak it by hand after all. Enter edit mode TAB, select all A and grab G them 0.02 along x-axis. You can use top view Numpad 7 to help.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana55.png)

Good. Now the only thing left is the orientation. In PlaneShift weapons and handheld items should face towards Blenders negative y-axis, and have topside pointing up. Our banana needs to be rotated in two ways. Still in editmode and all vertices selected? Good. Go into top view Numpad 7 and try rotating R them a bit. As you can see our handle position would get messed up again. Cancel the rotate. We need a different rotating pivot. To be exact, we want our banana to rotate around the handle point, that way it'll remain stationary no matter how we rotate. Change the rotation/scaling pivot .-key to "3D Cursor". Now to snap the 3D cursor to 0,0,0 open View-View Properties window and type in zero to all the 3D Cursor values. 

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana56.png)

Now then, try rotating all the vertices. Nice moves. Go in top view mode Numpad 7 if not already and begin rotate R. While rotating, hit R again to go in trackball mode. Rotate the banana to values -90 and -90. The banana's front should now be pointing down, and the thin top end towards you.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana57.png)

Finally, let's tilt the banana a bit forward, since it's a curved object and not straight like swords and such. This reduces how much the upper end of the banana will be overlapping the thumb. I don't think this is in any official rules, but practice has shown it works. While in top view, rotate the banana 15 along x-axis.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana58.png)


Exit edit mode and save your work. It's time to export and try the object in-game. Check previous lesson how to open the exporter overlay gui, if you've closed it. Check that object type is set to genmesh, and renderloop something else than "not set". Then click "create library".

Go into your export directory and unzip the world.zip there. You'll get three files again. Copy them to PlaneShift/art/things/ directory. I'll replace the existing shortsword again. I still have the older banana model as .spr in the directory, so I can use that as a reference. I also have the old banana texture already in weapons.zip, so I only need the new genbanana-file. Modify the new genbanana-file to begin like this:

Code: [Select]
<library>
<meshfact name="weapons#shortsword01a">
<plugin>crystalspace.mesh.loader.factory.genmesh</plugin>
<params>
<material>/planeshift/weapons/banana01a.tga</material>

Save it and rename it to "shortsword01a.spr" and copy it in weapons.zip. Then run PS and test. Mine looked like this:

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/banana59.png)(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/modeling_monkey.png)

Manny rejoices! Now he has his favourite fruit in-game! Surely eadible. This is the end of exporting conventions. You should now be able to fine tune your export results as needed.

End of Lesson 8: Exporting conventions
Title: Re: Simple Modeling School
Post by: Donari Tyndale on January 17, 2007, 04:12:32 pm
Great guide \\o//, but my banana doesn't move, no matter how I turn it. It stays static like that  >:(
(http://img50.imageshack.us/img50/8194/banra4.jpg) (http://imageshack.us)
Any suggestions what to do?
Title: Re: Simple Modeling School
Post by: Cherppow on January 17, 2007, 05:06:35 pm
Hi,

Hmm, it still follows the arm movement while you walk, right? Two possible things come into my mind:

- It seems that the "export library" command only takes into consideration the object factory data. Thus any rotation done outside editmode, will not be exported. Check that you've rotated not rotated the banana in object mode (see Transform Properties window). Also any rotation done in object mode can be cleared with alt+r. Then enter edit mode, rotate as you wish, exit edit mode and export.

- If the above doesn't help, check that there's no typos in the filenames, and that the updated file really overwrites the old shortsword01a.spr.

- If that doesn't help either you can paste your exported banana into http://rafb.net/paste/ (http://rafb.net/paste/) and I'll take a closer look at it. :)

Thanks for your interest,
 - Cherppow
Title: Re: Simple Modeling School
Post by: Donari Tyndale on January 18, 2007, 08:33:31 am
- It seems that the "export library" command only takes into consideration the object factory data. Thus any rotation done outside editmode, will not be exported. Check that you've rotated not rotated the banana in object mode (see Transform Properties window). Also any rotation done in object mode can be cleared with alt+r. Then enter edit mode, rotate as you wish, exit edit mode and export.
:D That's it! Thank you  \\o//
Title: Re: Simple Modeling School
Post by: Cherppow on January 25, 2007, 08:18:16 pm
Hi,

next parts. :)

Lesson 9: Into the intermediate

All right, You now have the knowledge to create basic PS models. However, the banana we created is about the simplest model there is, very small, static and unimportant object. There's a lot more that can be done. Your imagination is the only limit. The following are not lessons anymore, rather just tips, tricks and techniques that can be used to improve your models. There are many ways to do models, so these shouldn't be taken as the 'only right way'. Instead, you can try them out and use them if they feel useful for your style of modeling. Also feel welcome to propose a subject.

Lesson 9: Into the intermediate

****

Tip 1: Texture size

First step when creating a new texture is to choose a size. You can't make a good texture with bad size. In general it's better to create too large textures than too small, since large can be scaled down without much loss in detail. Here are some examples of different sized textures on 1 meter cube from 4m distance. See how the texture size affects the model:

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/resolutions_test.png)

At this distance, all top row textures are little bit too low on detail. Same goes for the 32x32. The 64x64 is already usable for generic objects, however, if the object is special, something that draws peoples' attention, I'd suggest using at least 128x128 texture. 256x256 and the larger ones don't show much difference here, but if we'd walk closer, the bigger textures would have the advantage. For a box like this I'd propably use 256x256.

The smaller textures are usable too. Mainly for smaller or less important objects, but also if UV-mapped efficiently. One way to get more out of small textures is by tiling the texture. This means simply that the UV map is actually bigger than the texture. The overflowing UV parts wrap to the opposite edge of the texture. Not all textures tile well, some may have sudden jumps in colour or lightness when wrapping from one edge to another. Those that do tile well, are called seamless. Here is the 16x16 texture tiled to resemble 48x48 texture:

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/texture_tiling.png)

Note how the tiled is much less pixelated than the original, although the cubes are similar otherwise. Also remember that you don't have to tile the texture in both directions, for example if you have a long staff model, you can tile it just vertically.

End of Tip 1: Texture size

*****

Tip 2: Texture drawing

Ok, let's have a closer look at drawing textures. I have made a simple sword (http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/simple_sword.blend) to act as a test object. It has 104 triangles.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/simple_sword01.png)

Manny goes "Boo, Cherp, you suck!". True, it isn't very impressive at it's current state. The sword is also uv-mapped; it uses 128x512 texture. Here's the layout:
(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/simple_sword02.png)

So with the above loaded onto the sword, looks like this:
(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/simple_sword03.png)

Next, I add the base textures as new layers. Just downloaded them from internet's many free texture sites. I've hidden the UV-layout for the pictures here, but I still have it as separate layer. Texture and mesh now look like this:

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/simple_sword05.png)(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/simple_sword04.png)

It's starting to look good, however, we can improve. In the next phase, I typically create a "grain merge" or "overlay" layer and paint static shadows. Here the UV layout comes to good use. I tend use large and smooth edged brush for this and pure black or white for colour.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/simple_sword07.png)(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/simple_sword06.png)

Finally, I make a new "normal" layer on the top, and hand draw some details. This is the most timetaking part, and requires imagination too. I enhance edges and fix earlier errors, but also add colour and extra details. Sometimes I go back to earlier layers to fix errors there, or to add more shadows and light.  Patience is the key here. Just relax, listen to funky music and think about that special person in your life, while drawing a bit. Fun stuff. For this I use very small and sharp brush.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/simple_sword09.png)(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/simple_sword08.png)

And that's about all there is to it. Or at least all I can teach you, I'm just a hobbyist. :)

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/minischool/simple_sword10.png)

End of Tip 2: Texture drawing
Title: Re: Simple Modeling School
Post by: Nikodemus on January 26, 2007, 11:35:26 am
too add a bit to the Cherppow's Lesson 9
To increase texture quality, near tiling, we can also play with the file size of the image. In extreme circumstances it is possible that 1024x1024 texture will have smaller filesize than 512x512 texture. In such an event, we increase the texture quality 4 times, keeping similiar filesize.
There are basically 3 factors we can play with to decrease the filesize.Number of colors - it depends of the format. For example .png: we can choose 16mln, 64k, 32k and 256 - 2 Generally, the less colors, the smaller file size. The above Cherppow's texture is 256 colors, because it wouldn't look really better if 16mln for example.
Format - it may happen that it may be worth to consider using a .jpeg, where we may not play with colors, but its compression, even if lossy, will make tiny difference in quality and so we gain smaller filesize.
The texture itself - generally, the less details, the smaller filesize. That's why when decreasing colors we choose "nearest color" over "error diffusion". Since it often happen that we don't use the whole texture surface for showing it on the model, Cherppow's texture should look like this in its last stage:
(http://crimsonorder.freepgs.com/things/tutcher-simple_sword09.png)

  • New texture filesize: 28152 B
  • Old texture filesize: 53072 B

The UV lines shouldn't be visible on the texture, but they are as indicator for you, where we should drawn the border of single color area. It shouldn't start along with the UV lines. When the texture start to blure, because of the angle how we look at the surface with texture, we start seeing what is behind the UV coords, because colors at different pixels are avaraged with this what is around. The more texture is blured because of the angle, the wider area from which the avarage color is obtained.
Title: Re: Simple Modeling School
Post by: ThomPhoenix on January 26, 2007, 11:47:40 am
As always, a great tutorial!/me loves it!
Title: Re: Simple Modeling School
Post by: Induane on February 22, 2007, 09:11:16 pm
It inspired me to make my first weapon ever!

(http://vaalnor.mine.nu/images/scythe.png)
Title: Re: Simple Modeling School
Post by: Nikodemus on March 03, 2007, 12:23:28 pm
You forgot to make a black robe with hood for the Ylian ;P

And you would have to atach the blade vertically if it is going to be considered a weapon ;P It's what peasands do when they are rebelling.
Title: Re: Simple Modeling School
Post by: mufler on April 05, 2007, 03:29:54 pm
OMG i love you! ;D

*edit*

if i modeled a wepon and stuff, will anybody els be able to see it? or just me?

[ Please avoid making one post right after the other in the same thread. Just "Modify" your first post to add more information. --Karyuu ]
Title: Re: Simple Modeling School
Post by: Karyuu on April 05, 2007, 03:34:36 pm
The modifications you do on your side of the client can only be seen by you, and those you give your modifications to. Client-based changes are not a server-wide event. Just imagine the problems that could arise if anyone could modify any item or texture they want and instantly have others see them (http://img247.imageshack.us/img247/8828/colonesseq6.gif)
Title: Re: Simple Modeling School
Post by: mufler on April 05, 2007, 04:47:12 pm
ah i see, no would be nasty:s
Title: Re: Simple Modeling School
Post by: Induane on April 09, 2007, 12:30:18 pm
/me imagines everyone running around with giant bananas!  OMG !! BANANAS!!
Title: Re: Simple Modeling School
Post by: Baldur on May 06, 2007, 09:27:28 am
My render seems to blacken when I photograph, could there be anything I've forgotten.
Title: Re: Simple Modeling School
Post by: bilbous on May 06, 2007, 01:42:04 pm
a light source?
Title: Re: Simple Modeling School
Post by: Feline Prince on May 06, 2007, 02:02:45 pm
Yes make sure the light source is on the same side of the object as the camera.
Title: Re: Simple Modeling School
Post by: Cherppow on May 07, 2007, 03:23:37 am
Hi,

Thanks for your interest and contributions.

To Baldur: There can be many reasons why renders turn out all black.

 - The most typical reason is, like bilbous and Feline Prince mentioned, that a lightsource is missing or placed in a bad location. The lamp can be inside the model, or too far to be effective, ect. It's hard to say without seeing your scene. One easy cure is to use the hemisphere type lamp, as it doesn't cast shadows it voids many of the possible problems. Lamp type can be changed in Shading panel - lamp buttons, while a lamp is selected.

 - Another quite usual mistake is to have camera pointing in wrong way. You can snap your viewport to camera with numpad0. Also in render window you can press a-key to view alpha channel. This will show the objects as white regardless of light, so you can see whether the objects are too dark or completely missing from the render area.

 - Finally check that your object is not black. Either apply image texture or set the material colour to something bright. :)

Ps. Note that depending on your system, complexity of the scene and render options, the render can take a while.

If these don't help, you can mail me the .blend and I'll check it out.
- Cherppow
Title: Re: Simple Modeling School
Post by: Mithodin on May 16, 2007, 04:12:20 am
Great work Cherppow! Really good tutorial indeed. But i have some questions:
1. On which versions of Blender and Blender2Crystal does your description base? I can't find some of the functions you use...
2. I made a little bottle with a cork, exported it to Blender2Crystal (couldn't find that genmesh stuff...). My world.zip folder contains one file "libary", one folder "factories" with two files "thingCylinder" and "thingSphere" in it and a folder "textures" with the textures i used. How can i let these replace the shortsword (or anything else)?
Title: Re: Simple Modeling School
Post by: Cherppow on May 16, 2007, 09:33:52 am
Greetings Mithodin,

1) The original tutorial was done for Blender 2.42a and Blender2Crystal version 0.6rc1. The newer versions are able to perform the same things, but the buttons may be labeled/located differently. This is the downside for working with developing software; documentation gets old pretty fast. Nowadays I'm using Blender 2.44 and Blender2Crystal 0.6.

2) Hmm, sounds about right. It would likely work in CS as is, but to make it work in PS, you need to:

a. join the two objects (likely the bottle and the cork) [CTRL+J] in object mode
b. join all the textures into one image and modify UV maps accordingly
c. change the object type to genmesh from the overlay GUI (see http://b2cs.delcorp.org/index.php/Overlay_Interface (http://b2cs.delcorp.org/index.php/Overlay_Interface))
d. re-export
e. extract all files (from all subdirs) of the new world.zip to a temporary directory
f. delete "library"-file
g. rename gen*-file to shortsword01a.spr
h. open the new shortsword01a.spr in a text editor
i. change meshfact name to "weapons#shortsword01a"
j. change plugin to "crystalspace.mesh.loader.factory.genmesh"
k. remove the line "<zuse/>" (optional)
l. change material to /planeshift/weapons/your_texture.png
m. save & exit the text editor
n. move shortsword01a.spr and your_texture.png to planeshift/art/things/weapons.zip
o. run PS normally and find yourself a shortsword

p. take screenshots and post them to PS forums \o/

Yes, I'd love one-click Blender->PS export too. :) I used to modify the export script to output more PS-suitable libraries, but it got too timetaking to maintain through version changes.

Thanks for your interest,
 - Cherppow
Title: Re: Simple Modeling School
Post by: LigH on May 16, 2007, 10:55:04 am
/me imagines everyone running around with giant bananas!  OMG !! BANANAS!!

 :lol: Seperot - your chance! Make lemons! :D
__

@ Cherppow:

Because it was mentioned recently in a "wanted contributions" thread: Could you explain how to save texture space by creating overlapping UV maps to reuse texture areas for several polygons with similar appearance?

For an example, I just imagine a shuffled Rubik's Cube... or whatever you may find more useful to learn from.
Title: Re: Simple Modeling School
Post by: Cherppow on May 16, 2007, 04:13:31 pm
Hi,

Ok, here goes. As simple as it gets. I'll use this stone block with characters so that faces are easier to identify.

(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/stone_cube_help01.png)
First make a cube and unwrap it. I made a couple of seams and used the standard unwrap function. It gives a basic UV map like in the image.


(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/stone_cube_help02.png)
We can just use this uv map and make a texture for it. As can be seen though, this type of map is quite ineffective. There's a lot of empty space in the texture, enough to fit in another similar cube and more. So let's work on it a bit.


(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/stone_cube_help03.png)
To make better use of texture space, we can scale up the UV map. I've scaled it so that one face fills the whole texture; all the space is now used. The image tiles to fill in the faces that go outside the image area. In our case all the cube's faces are square, so they align pretty nicely here. However, the old texture doesn't really fit with our model, so let's make a new one.


(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/stone_cube_help04.png)
This texture shows only one face, but that's all we need, as it tiles to all the faces. Also notice the increase in detail, as we can now use the whole image to draw one face. The drawback is that all the faces look the same. If the texture and model are well done, that usually doesn't matter.


(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/stone_cube_help05.png)
But what if the model is not a cube, and the UVs don't get aligned that nicely? Then we move them. Select a single UV face and use grab to move it around. One good way to do this is by turning "active face select" on, and disabling "Stick local UVs to Mesh Vertex". Both options found in the UV/Image editor header menus. You can then freely select any face and grab it around. I also had "draw shadow mesh" enabled.


(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/stone_cube_help06.png)
Just grab any faces you want, and move them to the place on the texture that you want. You can use either the model or the shadow image of the other faces as your guide. You can also rotate, mirror, scale, weld, ect. the UVs.


(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/stone_cube_help07.png)
In this case we wanted to overlap the faces, so I've simply moved them all, one by one, over each other. I also mirrored and rotated some, so that they'd look as similar as possible. This was actually wasted work, since Blender has "Reset" Unwrap option, which automatically unwraps each face to show the full texture, but at least we got some experience in moving the faces. Notice that it doesn't matter what size or form the faces are, you can move them just the same way. Moving multiple faces at once is no problem either, just select them all with shift, linked select or similar and grab 'em gone.


(http://users.tkk.fi/~vrantapu/PlaneShift/BlenderHelp/stone_cube_help08.png)
Here are the two cubes again, both with 128x128 texture. You can see which uses it's texture space more efficiently. And that's about all there is to it. :)

Greets,
 - Cherppow
Title: Re: Simple Modeling School
Post by: Shimala on July 19, 2007, 01:49:25 pm
These tutorials are great for beginners, i hate to say it but it didnt help me that much because, well i already know how to do it. But i would really like to donate a 3D mesh someday soon so thnx for the encouragement. Sadly i can not join the PS team since i am a lot younger than 21. Good Job  :thumbup:
Title: Re: Simple Modeling School
Post by: Karyuu on July 19, 2007, 02:47:32 pm
You need to be 18 to join the development team right now, not 21. The 21 age limit is for the GM team. Before donating any mesh to the game, contact me to see if your mesh is 1) going to fit within the game world, 2) going to be needed, and 3) fits all our 3D model requirements.
Title: Re: Simple Modeling School
Post by: Marawel on September 17, 2007, 06:05:27 pm
nicccce!
wanted to try this stuff for a while.. thanks for info!!

Me starts the work.
Title: Re: Simple Modeling School
Post by: Cherppow on September 28, 2007, 06:57:38 pm
Hi,

I've been thinking of creating a new tutorial part here, and was wondering if there is some specific area of 3d work you'd like to hear/learn about. :) I had few ideas already, but I'd love to hear your opinions too.

Thanks,
- Cherppow
Title: Re: Simple Modeling School
Post by: Rongar Elani on September 28, 2007, 09:21:39 pm
How about modeling a decent head? That's not too easy though. Or maybe doing some simple animations, with simple models and that way explaining how the Armatures work.
Title: Re: Simple Modeling School
Post by: Pizzasgood on October 21, 2007, 10:51:15 am
Yeah, it took me forever to figure out how to get rigging and animations working.  Setting up the armatures was easy enough, and animating them wasn't too hard.  But realizing I needed to add an armature modifier to the mesh, then set up vector groups named the same as the bones.... that took a while.

Where to go after would be nice too, like how (if) you can string together multiple animations.  Maybe an overview of the IPO view (I think that's what it's called, the one with the graphs of the animation).  Maybe some info about how to export an animation so that you can load it into a C++ program.  Those are all things on my to-learn list, next time I have enough free time to play with Blender again.
Title: Re: Simple Modeling School
Post by: piprees on May 21, 2008, 07:18:25 am
this guide is fantastic - any chance we can have it co-ordinated into a PDF file for people to download and print off - that way i can read it whilst i concentrate on the blender screen.

As a total newbie in model making its a swine to have to keep switching back forth between screens at every step.
Title: Re: Simple Modeling School
Post by: Morla Phlint on June 01, 2008, 08:19:48 am
Ok, here goes: Beginner Blender Tutorial ( Lesson 1 to 8 ) by Cherppow :).

http://rapidshare.com/files/119304309/Beginner-Blender-Tut-Cherppow.pdf.html

Thank you Cherppow!!!  \\o//
Title: Re: Simple Modeling School
Post by: Lolitra, Celorrim Purrty Twins on June 03, 2008, 11:25:28 am
um.. I tried to download this PDF, and the 'attached cat' thing just kept saying it was an error!!
Title: Re: Simple Modeling School
Post by: Morla Phlint on June 03, 2008, 12:59:02 pm
Sorry, the cats they use for verification can be tricky  :-\. Kittens are not always cute lol :P.

Anyway, uploaded it to another hosting site. Should work now  :).

http://www.mediafire.com/?ix6somyycue
Title: Re: Simple Modeling School
Post by: piprees on June 10, 2008, 08:14:21 am
Thankyou so much for the pdf - excellent work :)
Title: Re: Simple Modeling School
Post by: Morla Phlint on June 10, 2008, 10:11:23 am
You are welcome :).
Title: Simple Modeling School
Post by: amamips09 on December 13, 2009, 04:39:14 am
ok i know i need to enable the networking mod to use stuff like mail etc,

but if i reconfigure the network manually afterwords will my doings be undone once ebox has been restarted?

cheers