Both sides previous revision Previous revision Next revision | Previous revision | ||
hpl3:3rdparty:blender [2012/12/11 10:37] jens |
hpl3:3rdparty:blender [2012/12/14 08:40] (current) jens |
||
---|---|---|---|
Line 14: | Line 14: | ||
Go back to the 3D view by pressing SHIFT-F5. Make sure you are in Edit Mode (TAB toggles between Object and Edit) and with the cube selected, press CTRL-T to triangulate it. | Go back to the 3D view by pressing SHIFT-F5. Make sure you are in Edit Mode (TAB toggles between Object and Edit) and with the cube selected, press CTRL-T to triangulate it. | ||
- | Extra info: See [[:#work-aroundtriangulate_export|Work-around: Triangulate export]] for a method where you only temporary triangulate objects on export, which is what you want when doing proper modelling later. | + | Extra info: See [[:hpl3/3rdparty/blender#triangulate_only_on_export|Triangulate only on export]] for a method where you only temporary triangulate objects on export, which is what you want when doing proper modelling later. |
To see if the cube has the texture properly applied, at the bottom of the 3D view next to the large Edit Mode button, press the button with a circle and switch the viewport shading to "Texture". You should now see the texture on the cube. | To see if the cube has the texture properly applied, at the bottom of the 3D view next to the large Edit Mode button, press the button with a circle and switch the viewport shading to "Texture". You should now see the texture on the cube. | ||
Line 24: | Line 24: | ||
Open the HPL3 ModelViewer.exe and click the Load Model button, then navigate to where you exported the Collada file and open it. You should now see a magnificent textured cube. | Open the HPL3 ModelViewer.exe and click the Load Model button, then navigate to where you exported the Collada file and open it. You should now see a magnificent textured cube. | ||
+ | ===== Blender - Making your own model ===== | ||
+ | Making your own model does not require much else beyond the above introduction. There is however one small but important detail to get right, so let us try this again. | ||
- | ===== Blender wish-list ===== | + | Open a new project in Blender. Select the cube and press X, confirm that you want to delete it. |
- | * Option to triangulate in the COLLADA export menu (see solutions for work-around). | + | |
- | * Up axis settings for COLLADA, or preferably dealing with it automatically on import/export (currently importing object with Y up flips it 90 degrees). | + | |
- | * Units settings for COLLADA. | + | |
- | * Relative paths for COLLADA. | + | |
+ | In the Add menu, select Mesh -> Cube. You should now have a new identical cube in the 3D view. | ||
- | ===== Work-around: Triangulate export ===== | + | If you follow the above guide from here and try to export, the modelviewer will fail to show the object (most likely crash). This is because the exported Collada file does not contain any information on what image is used for the material. To fix this you will need to do the following: |
+ | |||
+ | In the properties panel (largest panel on the far right side of the screen) go to Materials (the red/pink circle icon, should be icon number 8 from the left). Click the large New button. This creates a material and automatically assigns it to the cube. If you have done all the steps correctly in the first guide, this should be all you have to do. If you export the cube again, the Collada file should now contain information on what image is to be used for the material. | ||
+ | |||
+ | Extra info: If you use two different materials for two different cubes in the same export, then you have to make sure that you create two different materials. The assigned material for a cube will automatically get the corresponding image you have added to the cube in the UV/Image editor. A tip is to use the Outline to get the best overview of what materials are assigned to what mesh. | ||
+ | |||
+ | Extra info 2: To get even better overview and clarity of how things are related, you can add a texture to your material. This is not actually used in the export or by the game, but will let you see in Blender what material has what texture and what mesh it is assigned to. | ||
+ | |||
+ | To do this go to Textures (icon 9 in the properties panel), click New and change Type from Clouds to "Image or Movie". | ||
+ | |||
+ | In the Image section, click Open and select a .dds image. You can see the image in the Preview as well as listed as a Texture. | ||
+ | |||
+ | You will now be able to easily see what image it is that you assign to a mesh. Important! You still have to UV map and use the UV/Image editor to assign the image to the mesh properly. If you do not it will not work when you export. | ||
+ | |||
+ | |||
+ | ===== Blender - How to model ===== | ||
+ | For this you have to read (or watch) regular Blender tutorials. | ||
+ | |||
+ | |||
+ | ===== Triangulate only on export ===== | ||
- Go to modifiers (the wrench icon) in the properties panel. | - Go to modifiers (the wrench icon) in the properties panel. | ||
- | - Add a Decimate modifier (listed in Generate category), no need to change settings or to apply it. | + | - Add the Triangulate (pre 2.65 Blender, use Decimate) modifier listed in Generate category, no need to change settings or to apply it. |
- When you export, check the "Apply Modifiers" option. This will triangulate the mesh for the COLLADA file export, but not the mesh in your blender project. | - When you export, check the "Apply Modifiers" option. This will triangulate the mesh for the COLLADA file export, but not the mesh in your blender project. | ||
+ | |||
+ | |||
+ | ===== Blender wish-list ===== | ||
+ | * Up axis settings for COLLADA, or preferably dealing with it automatically on import/export (currently importing object with Y up flips it 90 degrees). | ||
+ | * Units settings for COLLADA. | ||
+ | * Relative paths for COLLADA. |