Difference between revisions of "Using Blender"
m |
|||
Line 1: | Line 1: | ||
− | This is a basic crib sheet for creating a mob in Blender. It could be used to create any other mod relatively easily. | + | '''This is a basic crib sheet for creating a mob in Blender.''' It could be used to create any other mod relatively easily. |
+ | <!--This was made using Blender 2.70, but instructions should also work for Blender 2.5 or 2.6 as menu structure is pretty similar (but possibly not 2.4 or prior).--> | ||
− | + | === On file formats === | |
− | + | Minetest uses the 3D rendering library provided by [http://irrlicht.sourceforge.net/ '''Irrlicht'''].<ref>As stated on the [http://dev.minetest.net/Terminology Terminology page] of the developer Minetest Wiki</ref> Irrlicht can import the following mesh-formats<ref>Irrlicht Features - [http://irrlicht.sourceforge.net/features/#supportedformats Supported Formats]</ref>: | |
− | Minetest uses the 3D rendering library provided by [http://irrlicht.sourceforge.net/ '''Irrlicht'''].<ref>As stated on the [http://dev.minetest.net/Terminology Terminology page] of Minetest | ||
Animated objects: | Animated objects: | ||
Line 30: | Line 30: | ||
* PLY 3D files (.ply, r/w) | * PLY 3D files (.ply, r/w) | ||
− | Notes: Different 3D formats may perform differently in other setups, | + | '''Notes:''' Different 3D formats may perform differently in other setups, DirectX and B3D allow animation (but this crib sheet doesn't cover that) |
− | |||
− | |||
If you want to be able to export in B3D (Blitz 3D) format (with 2.70) | If you want to be able to export in B3D (Blitz 3D) format (with 2.70) | ||
− | # Download the Blender export script B3DExport.py<br /> | + | |
+ | # Download the Blender export script B3DExport.py<br />On GNU/Linux: copy to ~/.config/blender/2.71/scripts/addons<br />On Windows: copy to | ||
# Open Blender | # Open Blender | ||
# In Blender open the menu File/User Preferences/Addons/Import Export/B3D (Blitz 3D) Model Exporter | # In Blender open the menu File/User Preferences/Addons/Import Export/B3D (Blitz 3D) Model Exporter | ||
Line 43: | Line 42: | ||
# Close Preferences Window | # Close Preferences Window | ||
− | If you want to import, install version 2.49, save as a | + | If you want to import, install version 2.49, save as a Blender file, then open with 2.70 to edit. |
+ | |||
+ | == Begin with a basic mob == | ||
− | |||
To create a basic mob, copy an animal from animals_modpack-2.3.6. | To create a basic mob, copy an animal from animals_modpack-2.3.6. | ||
Then in the init.lua you only have to do a search and replace of the name of the animal, and delete any irrelevant code. | Then in the init.lua you only have to do a search and replace of the name of the animal, and delete any irrelevant code. | ||
You can edit speed, acceleration, etc as you wish. | You can edit speed, acceleration, etc as you wish. | ||
− | === Create a 3D | + | === Create a 3D model === |
+ | |||
+ | Don't bother with materials – Minetest doesn't handle them – you need a texture to define any colours. | ||
+ | If you want your model to walk forwards, you must create it with “forward” pointing in the +ve x direction (i.e. right when you select view point '''KP 7''', or facing in the direction of the red “x” arrow when an object is selected). | ||
− | + | ==== Create object ==== | |
− | |||
− | + | # In 3D View | |
− | # In 3D | ||
# If not already active switch to object mode (dropdown in 3D viewport) | # If not already active switch to object mode (dropdown in 3D viewport) | ||
− | # Add objects (eg 3D Menu | + | # Add objects (eg 3D Menu → Add → Mesh → Cube) |
− | # Move around by right-clicking to select and dragging arrows.<br /> ' | + | # Move around by right-clicking to select and dragging arrows.<br /> '''B''' box/border select. '''G''' grab to move.<br /> Resize or rotate using the properties viewport (has a row of camera, cube, spanner, etc at top) |
# Select the cube | # Select the cube | ||
− | # Use rotation and scale to transform objects<br /> [See the hundreds of | + | # Use rotation and scale to transform objects<br /> [See the hundreds of Blender tutorials for more advanced editing techniques.] |
+ | |||
+ | ==== Save primary Blender model ==== | ||
− | + | # Save as a Blender file (Ctrl-S or File → Save) | |
− | # Save as a | ||
# Save with the name: yourname.blend (or similar) | # Save with the name: yourname.blend (or similar) | ||
− | # You might also want to save a separate | + | # You might also want to save a separate “unjoined” copy before the following join operation, as you won't be able to access the base components afterward |
=== Texturing === | === Texturing === | ||
− | When the basic model is completed you'll need to create a texture. | + | |
+ | When the basic model is completed, you'll need to create a texture. | ||
# Switch to Object mode | # Switch to Object mode | ||
− | ## | + | ## Press '''A''' (perhaps twice) to select all objects |
− | ## Ctrl | + | ## '''Ctrl + J''' to join all objects in a model together |
− | #Switch to Edit Mode | + | # Switch to Edit Mode |
## Mesh/UV Unwrap/Smart UV Project [see one of the many UV Mapping tutorials if you want seams to match, etc]<br />[optional] Set island margin to 0.004 (this leaves a gap between faces, so there will be less risk of bleeding of colour across sharp edges. 0.002 is approx 1 pixel for a 512 pixel image) | ## Mesh/UV Unwrap/Smart UV Project [see one of the many UV Mapping tutorials if you want seams to match, etc]<br />[optional] Set island margin to 0.004 (this leaves a gap between faces, so there will be less risk of bleeding of colour across sharp edges. 0.002 is approx 1 pixel for a 512 pixel image) | ||
# Move mouse to the top of the 3D window to get and up/down arrow. Right click/split window and size to 50:50. | # Move mouse to the top of the 3D window to get and up/down arrow. Right click/split window and size to 50:50. | ||
## On the R hand new window select the litle cube (3D viewport) icon and switch to UV Map viewport | ## On the R hand new window select the litle cube (3D viewport) icon and switch to UV Map viewport | ||
## LowMenubar:New | ## LowMenubar:New | ||
− | ### Set | + | ### Set name - eg 'yourname UV Map' |
### Click UV Test Grid (optional) | ### Click UV Test Grid (optional) | ||
### OK (=Save)<br />[if you want to resize the image use a power of 2 (512/1024/etc) for x and y dimensions as it significantly speeds processing] | ### OK (=Save)<br />[if you want to resize the image use a power of 2 (512/1024/etc) for x and y dimensions as it significantly speeds processing] | ||
− | ## LowMenubar:Image | + | ## LowMenubar:Image → Pack as PNG → Accept warning (this ensures you will save a copy of the image within the .blend file (I think in 2.4 this may have to be updated manually, but the tickbox in 2.7 implies is should be saved with the rest of the file) |
− | ## Check UV map fits on image - adjust with: | + | ## Check UV map fits on image - adjust with: '''G''' - move, '''R''' - rotate, '''S''' - scale (menu:UV → Transform)<br />The UV vertices won't always align to pixel boundaries, which means if you don't use 'island margin' above, then painting on one face may also unavoidable paint onto another face. There is reference in the manual to a UV snap-to-pixel option (to align UV vertices to pixel edges) but I haven't figured how to access it yet (and it would only perfectly stop bleed for horizontal or vertically aligned vertices). |
− | # In 3D View | + | # In 3D View window |
## Switch to Texture Paint (from Edit Mode) | ## Switch to Texture Paint (from Edit Mode) | ||
## in the Toolbar set:- | ## in the Toolbar set:- | ||
### Brush<br />Select white (should be selected by default)<br />Strength 1.0 (ie 100% replacement of the underlying colour)<br />Radi 500 (or whatever brush radius you want) | ### Brush<br />Select white (should be selected by default)<br />Strength 1.0 (ie 100% replacement of the underlying colour)<br />Radi 500 (or whatever brush radius you want) | ||
###Curve<br />select the square profile if you want a solid colour brush<br />select the 'normal distribution curve' if you want a fading brush<br />(or any other profile you like) | ###Curve<br />select the square profile if you want a solid colour brush<br />select the 'normal distribution curve' if you want a fading brush<br />(or any other profile you like) | ||
− | # UV Map | + | # UV Map window |
## Switch to Paint (from View) | ## Switch to Paint (from View) | ||
− | ## Paint entire object white (or some other basecoat). This is easiest to do in UV Map window | + | ## Paint the entire object white (or some other basecoat). This is easiest to do in UV Map window |
− | # In 3D View | + | # In 3D View window |
## To paint only particular faces, click the face Menu/faceselect (the cube with grid pattern on the face), you will then be able to select an entire face/s with R click (or shift R-click for multiple faces). | ## To paint only particular faces, click the face Menu/faceselect (the cube with grid pattern on the face), you will then be able to select an entire face/s with R click (or shift R-click for multiple faces). | ||
− | ## Change colour,strength,radius, | + | ## Change colour, strength, radius, curve… and paint the different parts as you wish – painting in either 3D or UV Mesh windows.<br />NB the colour picker has an eyedropper to copy the colour from within the 3D or UV Map windows – just click on the currently displayed colour (under the colour wheel) to bring it up. |
+ | |||
+ | == Save your work and export the files == | ||
− | |||
# Save the mesh | # Save the mesh | ||
## Export as a .b3d file (File/Export/B3D) | ## Export as a .b3d file (File/Export/B3D) | ||
Line 102: | Line 106: | ||
## Don't forget to look for and OK the overwrite message if needed or it will disappear and you won't have saved your file. | ## Don't forget to look for and OK the overwrite message if needed or it will disappear and you won't have saved your file. | ||
# Save the texture | # Save the texture | ||
− | ## UV Window | + | ## UV Window → Image → Save As Image |
## Save with the name: textures/animal_yourname_yourname_mesh.png | ## Save with the name: textures/animal_yourname_yourname_mesh.png | ||
− | == Create or copy the | + | == Create or copy the inventory texture == |
− | Find | + | Find or create a nice graphic to be the image in the inventory.<br /> |
A flat texture can be created with a 6 sided cube model (eg animal_yourname_yourname.png)<br /> | A flat texture can be created with a 6 sided cube model (eg animal_yourname_yourname.png)<br /> | ||
The inventory image is animal_yourname_yourname_item.png<br /> | The inventory image is animal_yourname_yourname_item.png<br /> | ||
− | (Remember to respect copyright | + | (Remember to respect copyright – use screenshots of your model, perhaps with the help of a “green screen” for transparency, if you want a simple free graphic. To turn off the 3D viewport grid floor open the propertles menu (+ at top R of window), and untick display/grid floor). |
− | == Rendering the | + | == Rendering the model == |
− | If you want to be able to render the model (F12 | + | |
− | # In 3D edit view. Add | + | If you want to be able to render the model ('''F12''''), you'll first need to do the following steps to enable the texture: |
+ | |||
+ | # In 3D edit view. Add → Lamp → Hemi. You might need to move this around to adjust lighting direction, but probably not. | ||
# In properties viewpane:- | # In properties viewpane:- | ||
# Select checkered box tab, | # Select checkered box tab, | ||
− | ## | + | ## Change texture type to Image → Movie, |
− | ## | + | ## Click on image dropdown below this and select your UV texture image, |
− | ## | + | ## Under mapping dropdown change coord to UV. |
− | Now | + | |
+ | Now, rendering should work… | ||
== Animation == | == Animation == | ||
Line 130: | Line 137: | ||
# Don't forget to export animation when exporting to .x file. | # Don't forget to export animation when exporting to .x file. | ||
− | == Notes and | + | == Notes and references == |
+ | |||
<references /> | <references /> | ||
+ | |||
[[Category:Tutorials]] | [[Category:Tutorials]] | ||
[[Category:Related software]] | [[Category:Related software]] |
Revision as of 20:30, 28 September 2014
This is a basic crib sheet for creating a mob in Blender. It could be used to create any other mod relatively easily.
On file formats
Minetest uses the 3D rendering library provided by Irrlicht.[1] Irrlicht can import the following mesh-formats[2]:
Animated objects:
- B3D files (.b3d, r, skeleton)
- Microsoft DirectX (.x, r) (binary & text, skeleton)
- Milkshape (.ms3d, r, skeleton)
- Quake 3 models (.md3, r, morph)
- Quake 2 models (.md2, r, morph)
Static objects:
- Irrlicht scenes (.irr, r/w)
- Irrlicht static meshes (.irrmesh, r/w)
- 3D Studio meshes (.3ds, r)
- Alias Wavefront Maya (.obj, r/w)
- Lightwave Objects (.lwo, r)
- COLLADA 1.4 (.xml, .dae, r/w)
- OGRE meshes (.mesh, r)
- My3DTools 3 (.my3D, r)
- Pulsar LMTools (.lmts, r)
- Quake 3 levels (.bsp, r)
- DeleD (.dmf, r)
- FSRad oct (.oct, r)
- Cartography shop 4 (.csm, r)
- STL 3D files (.stl, r/w)
- PLY 3D files (.ply, r/w)
Notes: Different 3D formats may perform differently in other setups, DirectX and B3D allow animation (but this crib sheet doesn't cover that)
If you want to be able to export in B3D (Blitz 3D) format (with 2.70)
- Download the Blender export script B3DExport.py
On GNU/Linux: copy to ~/.config/blender/2.71/scripts/addons
On Windows: copy to - Open Blender
- In Blender open the menu File/User Preferences/Addons/Import Export/B3D (Blitz 3D) Model Exporter
- Select box on R
(If you want .x (directX) then find this and enable it too.) - While you're in preferences on the file tab you may want to enable Save&Load/Compress File (for much smaller saved files), and Autosave/Keep Session (to save on exit)
- Save User Settings
- Close Preferences Window
If you want to import, install version 2.49, save as a Blender file, then open with 2.70 to edit.
Begin with a basic mob
To create a basic mob, copy an animal from animals_modpack-2.3.6. Then in the init.lua you only have to do a search and replace of the name of the animal, and delete any irrelevant code. You can edit speed, acceleration, etc as you wish.
Create a 3D model
Don't bother with materials – Minetest doesn't handle them – you need a texture to define any colours. If you want your model to walk forwards, you must create it with “forward” pointing in the +ve x direction (i.e. right when you select view point KP 7, or facing in the direction of the red “x” arrow when an object is selected).
Create object
- In 3D View
- If not already active switch to object mode (dropdown in 3D viewport)
- Add objects (eg 3D Menu → Add → Mesh → Cube)
- Move around by right-clicking to select and dragging arrows.
B box/border select. G grab to move.
Resize or rotate using the properties viewport (has a row of camera, cube, spanner, etc at top) - Select the cube
- Use rotation and scale to transform objects
[See the hundreds of Blender tutorials for more advanced editing techniques.]
Save primary Blender model
- Save as a Blender file (Ctrl-S or File → Save)
- Save with the name: yourname.blend (or similar)
- You might also want to save a separate “unjoined” copy before the following join operation, as you won't be able to access the base components afterward
Texturing
When the basic model is completed, you'll need to create a texture.
- Switch to Object mode
- Press A (perhaps twice) to select all objects
- Ctrl + J to join all objects in a model together
- Switch to Edit Mode
- Mesh/UV Unwrap/Smart UV Project [see one of the many UV Mapping tutorials if you want seams to match, etc]
[optional] Set island margin to 0.004 (this leaves a gap between faces, so there will be less risk of bleeding of colour across sharp edges. 0.002 is approx 1 pixel for a 512 pixel image)
- Mesh/UV Unwrap/Smart UV Project [see one of the many UV Mapping tutorials if you want seams to match, etc]
- Move mouse to the top of the 3D window to get and up/down arrow. Right click/split window and size to 50:50.
- On the R hand new window select the litle cube (3D viewport) icon and switch to UV Map viewport
- LowMenubar:New
- Set name - eg 'yourname UV Map'
- Click UV Test Grid (optional)
- OK (=Save)
[if you want to resize the image use a power of 2 (512/1024/etc) for x and y dimensions as it significantly speeds processing]
- LowMenubar:Image → Pack as PNG → Accept warning (this ensures you will save a copy of the image within the .blend file (I think in 2.4 this may have to be updated manually, but the tickbox in 2.7 implies is should be saved with the rest of the file)
- Check UV map fits on image - adjust with: G - move, R - rotate, S - scale (menu:UV → Transform)
The UV vertices won't always align to pixel boundaries, which means if you don't use 'island margin' above, then painting on one face may also unavoidable paint onto another face. There is reference in the manual to a UV snap-to-pixel option (to align UV vertices to pixel edges) but I haven't figured how to access it yet (and it would only perfectly stop bleed for horizontal or vertically aligned vertices).
- In 3D View window
- Switch to Texture Paint (from Edit Mode)
- in the Toolbar set:-
- Brush
Select white (should be selected by default)
Strength 1.0 (ie 100% replacement of the underlying colour)
Radi 500 (or whatever brush radius you want) - Curve
select the square profile if you want a solid colour brush
select the 'normal distribution curve' if you want a fading brush
(or any other profile you like)
- Brush
- UV Map window
- Switch to Paint (from View)
- Paint the entire object white (or some other basecoat). This is easiest to do in UV Map window
- In 3D View window
- To paint only particular faces, click the face Menu/faceselect (the cube with grid pattern on the face), you will then be able to select an entire face/s with R click (or shift R-click for multiple faces).
- Change colour, strength, radius, curve… and paint the different parts as you wish – painting in either 3D or UV Mesh windows.
NB the colour picker has an eyedropper to copy the colour from within the 3D or UV Map windows – just click on the currently displayed colour (under the colour wheel) to bring it up.
Save your work and export the files
- Save the mesh
- Export as a .b3d file (File/Export/B3D)
- Save with the name: models/animal_yourname.b3d
- Don't forget to look for and OK the overwrite message if needed or it will disappear and you won't have saved your file.
- Save the texture
- UV Window → Image → Save As Image
- Save with the name: textures/animal_yourname_yourname_mesh.png
Create or copy the inventory texture
Find or create a nice graphic to be the image in the inventory.
A flat texture can be created with a 6 sided cube model (eg animal_yourname_yourname.png)
The inventory image is animal_yourname_yourname_item.png
(Remember to respect copyright – use screenshots of your model, perhaps with the help of a “green screen” for transparency, if you want a simple free graphic. To turn off the 3D viewport grid floor open the propertles menu (+ at top R of window), and untick display/grid floor).
Rendering the model
If you want to be able to render the model (F12'), you'll first need to do the following steps to enable the texture:
- In 3D edit view. Add → Lamp → Hemi. You might need to move this around to adjust lighting direction, but probably not.
- In properties viewpane:-
- Select checkered box tab,
- Change texture type to Image → Movie,
- Click on image dropdown below this and select your UV texture image,
- Under mapping dropdown change coord to UV.
Now, rendering should work…
Animation
- Make sure your mesh is child of Armature.
- Make sure there's only one bone parenting all others (having a child bone being parent of another one is no problem).
- All faces need to be members of a vertex group.
- Make sure all of your vertex groups have same name as at least one bone.
- Don't forget to export animation when exporting to .x file.
Notes and references
- ↑ As stated on the Terminology page of the developer Minetest Wiki
- ↑ Irrlicht Features - Supported Formats