Browse Source

Added 3d model export docs

Björn Ritzl 5 years ago
parent
commit
a1105da37a

+ 4 - 0
docs/en/en.json

@@ -228,6 +228,10 @@
                         "path": "/manuals/importing-assets",
                         "name": "Importing and editing assets"
                     },
+                    {
+                        "path": "/manuals/importing-models",
+                        "name": "Importing and using 3D models"
+                    },
                     {
                         "path": "/manuals/adapting-graphics-to-screen-size",
                         "name": "Adapting to different screen sizes"

+ 2 - 10
docs/en/manuals/graphics.md

@@ -5,15 +5,7 @@ brief: This manual outlines Defold's support for graphical elements.
 
 # Graphics
 
-Defold is a full 3D engine, but it is designed and built with strong support for 2D games. The editor is currently best suited for making 2D games.
-
-## Importing Image Files
-
-Defold needs all assets that should be in your project hierarchy. Therefore you need to import all graphics asset files that you need for your graphics. To import an assets, simply drag the files from the file system on your computer and drop them in an appropriate place in the Defold editor _Project Explorer_.
-
-![Importing image files](images/graphics/import.png){srcset="images/graphics/[email protected] 2x"}
-
-Defold supports images in the PNG and JPEG image formats. For models, Defold uses the Collada DAE format.
+Defold is a full 3D engine, but it is designed and built with strong support for 2D games.
 
 ## Image resources
 
@@ -88,7 +80,7 @@ Models get its image data directly from an image file that is mapped onto the mo
 Learn more about models in the [Model manual](/manuals/model).
 
 Collada support
-: Defold's 3D support requires you to save or export model, skeleton and animation data in the _Collada_ format. This is a widely adopted format that most 3D modelling software supports. So you should be able to create assets in in _Maya_, _3D Max_, _Blender_, _Sketchup_ or any other popular software and then bring the results into Defold.
+: Defold's 3D support requires you to save or export model, skeleton and animation data in the _Collada_ format. This is a widely adopted format that most 3D modeling software supports. So you should be able to create assets in in _Maya_, _3D Max_, _Blender_, _Sketchup_ or any other popular software and then bring the results into Defold.
 
   Defold currently only supports baked animations. Animations need to have matrices for each animated bone each keyframe, and not position, rotation and scale as separate keys.
 

BIN
docs/en/manuals/images/model/blender_export.png


BIN
docs/en/manuals/images/model/blender_export_uv_layout.png


BIN
docs/en/manuals/images/model/blender_export_uv_layout_result.png


BIN
docs/en/manuals/images/model/blender_export_uv_layout_settings.png


BIN
docs/en/manuals/images/model/blender_join_meshes.png


BIN
docs/en/manuals/images/model/blender_remove_materials.png


BIN
docs/en/manuals/images/model/blender_select_all_vertices.png


BIN
docs/en/manuals/images/model/blender_unwrap_mesh.png


+ 22 - 4
docs/en/manuals/importing-assets.md

@@ -5,7 +5,22 @@ brief: This manual covers how to import and edit assets in Defold using external
 
 # Importing and editing assets
 
-A game project usually consists of a large number of external assets that are produced in various specialized programs for producing graphics, 3D models, sound files, animations and so forth. Defold is built for a workflow where you work in your external tools and then import the assets into Defold as they are finalized. When the assets are imported into Defold they can be used by the various component types to create flipbook animations, tilemaps, particle effects and many other things:
+A game project usually consists of a large number of external assets that are produced in various specialized programs for producing graphics, 3D models, sound files, animations and so forth. Defold is built for a workflow where you work in your external tools and then import the assets into Defold as they are finalized.
+
+
+## Importing Assets
+
+Defold needs all the assets used in your project to be located somewhere in the project hierarchy. You therefore need to import all assets before you can use them. To import assets, simply drag the files from the file system on your computer and drop them in an appropriate place in the Defold editor _Project Explorer_.
+
+![Importing files](images/graphics/import.png){srcset="images/graphics/[email protected] 2x"}
+
+:::sidenote
+Defold supports images in the PNG and JPEG image formats. Other image formats need to be converted before they can be used.
+:::
+
+## Using Assets
+
+When the assets are imported into Defold they can be used by the various component types to create flipbook animations, tilemaps, particle effects and many other things:
 
 * Images can be used to create texture [atlases](/manuals/atlas) and tile sources which in turn can be used by visual components such as [sprites](/manuals/sprite), [tilemaps](/manuals/tilemap) and [particle effects](/manuals/particlefx). Read more about this in the [Graphics manual](/manuals/graphics/#importing-image-files).
 * Sounds can be used by the [Sound component](/manuals/sound) to play sounds.
@@ -14,12 +29,15 @@ A game project usually consists of a large number of external assets that are pr
 * Collada models can be used by the [Model component](/manuals/model) to show 3D models with animations.
 
 
-## External editors and tools
+## Editing external Assets
 
 Defold does not provide editing tools for creating images, sound files, models or animations. Such assets need to be created outside of Defold in specialized tools and imported into Defold. Defold automatically detects changes to any asset in the project hierarchy and updates the editor view accordingly.
 
-There is currently no way to hook custom build steps into the in-editor builder, but we provide a stand-alone build pipeline (see [Bob the builder](/manuals/bob)) that can be incorporated in any pipeline.
 
-The editor saves all Defold assets in text based files that are merge friendly. They are also easy to create and modify with simple scripts. See [this forum thread](https://forum.defold.com/t/deftree-a-python-module-for-editing-defold-files/15210) for more information. Note though that we do not publish our file format details since they do change once in a while.
+## Editing Defold Assets
+
+The editor saves all Defold assets in text based files that are merge friendly. They are also easy to create and modify with simple scripts. See [this forum thread](https://forum.defold.com/t/deftree-a-python-module-for-editing-defold-files/15210) for more information. Note though that we do not publish our file format details since they do change once in a while. You can also use [Editor Scripts](/manuals/editor-scripts/) to hook into certain life-cycle events in the Editor to run scripts to generate or modify assets.
 
 Extra care should be taken when working with Defold asset files through a text editor or external tool. If you introduce errors those can prevent the file from opening in the Defold editor.
+
+Some external tools [such as Tiled](/assets/tiled/) can be used to generate Defold Assets automatically.

+ 72 - 0
docs/en/manuals/importing-models.md

@@ -0,0 +1,72 @@
+---
+title: Importing models
+brief: This manual covers how to import 3D models used by the model component.
+---
+
+# Importing 3D models
+
+Defold currently only support models in the Collada *.dae* format. You can use tools such as Maya and Blender to create and/or convert 3D models into Collada format. Blender is a powerful and popular 3D modeling, animation and rendering program. It runs on Windows, Mac OS X and Linux and is freely available for download at http://www.blender.org
+
+![Model in Blender](images/model/blender.png){srcset="images/model/[email protected] 2x"}
+
+## Exporting to Collada
+
+When you export a model to Collada format you get a file with the *.dae* file extension. This file contain all the vertices, edges and faces that make up the model, as well as _UV coordinates_ (what part of the texture image maps to a certain part of the mesh) if you have defined them, the bones in the skeleton and animation data.
+
+A detailed description on polygon meshes can be found on http://en.wikipedia.org/wiki/Polygon_mesh. UV coordinates and UV mapping is described at http://en.wikipedia.org/wiki/UV_mapping.
+
+When you export a model to Collada format you need to make sure that it fulfills the following requirements:
+
+* The model must consist of a single mesh
+* The model must use a single material
+
+
+### Joining multiple meshes into a single mesh
+
+You can use Blender to join multiple meshes. Select all of the meshes and press `CTRL` + `J` to join them.
+
+![Join meshes](images/model/blender_join_meshes.png)
+
+
+### Removing materials
+
+You can use Blender to remove extra materials from the model.
+
+![Remove materials](images/model/blender_remove_materials.png)
+
+
+### Exporting a texture
+
+If you do not already have a texture for your model you can use Blender to generate a texture. You should do this before you remove extra materials from the model. Start by selecting the mesh and all of its vertices:
+
+![Select all](images/model/blender_select_all_vertices.png)
+
+When all vertices are selected you unwrap the mesh to get the UV layout:
+
+![Unwrap mesh](images/model/blender_unwrap_mesh.png)
+
+You can then proceed to export the UV layout to an image that can be used as a texture:
+
+![Export UV layout](images/model/blender_export_uv_layout.png)
+
+![Export UV layout settings](images/model/blender_export_uv_layout_settings.png)
+
+![Export UV layout result](images/model/blender_export_uv_layout_result.png)
+
+
+### Exporting using Blender
+
+![Exporting using Blender](images/model/blender_export.png)
+
+
+
+## Importing to Defold
+
+To import the model, simply drag and drop the *.dae* file and the corresponding texture image into the *Project Explorer* somewhere.
+
+![Imported model assets](images/model/assets.png){srcset="images/model/[email protected] 2x"}
+
+
+## Using a model
+
+Once you have the model imported into Defold you can use it in a [Model component](/manuals/model).

+ 0 - 18
docs/en/manuals/model.md

@@ -7,24 +7,6 @@ brief: This manual describes how to bring 3D models, skeletons and animations in
 
 Defold is at its core a 3D engine. Even when you work with 2D material only all rendering is done in 3D, but orthographically projected onto the screen.  Defold allows you to utilize full 3D content by including 3D assets, or _Models_ into your collections. You can build games in strictly 3D with only 3D assets, or you can mix 3D and 2D content as you wish.
 
-## Creating a model
-
-Let's look at an example. We have created a simple model with an armature (skeleton) and a simple animation in _Blender_.
-
-Blender is a powerful and popular 3D modeling, animation and rendering program. It runs on Windows, Mac OS X and Linux and is freely available for download at http://www.blender.org
-
-Now we wish to bring this model to life in Defold.
-
-![Model in Blender](images/model/blender.png){srcset="images/model/[email protected] 2x"}
-
-When the model is done you select the Blender Collada exporter to produce a file with the *.dae* file extension. This exported mesh file contain all the vertices, edges and faces that make up the model, as well as _UV coordinates_ (what part of the texture image maps to a certain part of the mesh) if you have defined them, the bones in the skeleton and animation data.
-
-A detailed description on polygon meshes can be found on http://en.wikipedia.org/wiki/Polygon_mesh. UV coordinates and UV mapping is described at http://en.wikipedia.org/wiki/UV_mapping.
-
-Now, to import the model, simply drag and drop the *.dae* file and the corresponding texture image into the *Project Explorer* somewhere.
-
-![Imported model assets](images/model/assets.png){srcset="images/model/[email protected] 2x"}
-
 ## Creating a model component
 
 Model components are created just like any other game object component. You can do it two ways: