Skip to content

Commit e2b9894

Browse files
committed
Added note about model bones
And cleaned up notes about collada. Fixes #576
1 parent d91daa0 commit e2b9894

File tree

7 files changed

+30
-32
lines changed

7 files changed

+30
-32
lines changed

docs/en/manuals/glossary.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ Here, `"#weapon"` is the address of the current object's sprite component. `"dis
125125

126126
## Model
127127

128-
![Model](images/icons/model.png){.left} The 3D model component can import glTF and Collada mesh, skeleton and animation assets into your game. See the [Model manual](/manuals/model/) for more information.
128+
![Model](images/icons/model.png){.left} The 3D model component can import glTF mesh, skeleton and animation assets into your game. See the [Model manual](/manuals/model/) for more information.
129129

130130
## ParticleFX
131131

docs/en/manuals/importing-assets.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ When the assets are imported into Defold they can be used by the various compone
2626
* Images can be used to create many kinds of visual components frequently used in 2D games. Read more about [how to import and use 2D graphics here](/manuals/importing-graphics).
2727
* Sounds can be used by the [Sound component](/manuals/sound) to play sounds.
2828
* Fonts are used by the [Label component](/manuals/label) and by [text nodes](/manuals/gui-text) in a GUI.
29-
* glTF and Collada models can be used by the [Model component](/manuals/model) to show 3D models with animations. Read more about [how to import and use 3D models here](/manuals/importing-models).
29+
* glTF models can be used by the [Model component](/manuals/model) to show 3D models with animations. Read more about [how to import and use 3D models here](/manuals/importing-models).
3030

3131

3232
## Editing external assets

docs/en/manuals/importing-models.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ brief: This manual covers how to import 3D models used by the model component.
44
---
55

66
# Importing 3D models
7-
Defold currently support models, skeletons and animations in GL Transmission Format *.glTF* and Collada *.dae* format. You can use tools such as Maya, 3D Max, Sketchup and Blender to create and/or convert 3D models into glTF and Collada format. Blender is a powerful and popular 3D modeling, animation and rendering program. It runs on Windows, macOS and Linux and is freely available for download at http://www.blender.org
7+
Defold currently support models, skeletons and animations in GL Transmission Format *.glTF* format. You can use tools such as Maya, 3D Max, Sketchup and Blender to create and/or convert 3D models into glTF format. Blender is a powerful and popular 3D modeling, animation and rendering program. It runs on Windows, macOS and Linux and is freely available for download at http://www.blender.org
88

99
![Model in Blender](images/model/blender.png)
1010

@@ -17,8 +17,8 @@ To import the model, simply drag and drop the *.gltf* file or *.dae* file and th
1717
Once you have the model imported into Defold you can use it in a [Model component](/manuals/model).
1818

1919

20-
## Exporting to glTF and Collada
21-
The exported *.gltf* or *.dae* 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.
20+
## Exporting to glTF
21+
The exported *.gltf* 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.
2222

2323
* A detailed description on polygon meshes can be found on http://en.wikipedia.org/wiki/Polygon_mesh.
2424

@@ -30,8 +30,6 @@ Defold imposes some limitations on exported animation data:
3030

3131
* Animations are also linearly interpolated. If you do more advanced curve interpolation the animations needs to be prebaked from the exporter.
3232

33-
* Animation clips in Collada are not supported. To use multiple animations per model, export them into separate *.dae* files and gather the files into an *.animationset* file in Defold.
34-
3533
### Requirements
3634
When you export a model it's good to know that we don't yet support all features.
3735
Currently known issues/not supported features from the glTF format:

docs/en/manuals/model-animation.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ end
2828
Defold currently supports only baked animations. Animations need to have matrices for each animated bone each keyframe, and not position, rotation and scale as separate keys.
2929

3030
Animations are also linearly interpolated. If you do more advanced curve interpolation the animations needs to be prebaked from the exporter.
31-
32-
Animation clips in Collada are not supported. To use multiple animations per model, export them into separate *.dae* files and gather the files into an *.animationset* file in Defold.
3331
:::
3432

3533
### The bone hierarchy

docs/en/manuals/model.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,21 @@ With the model created you need to specify a number of properties:
2323
Apart from the properties *Id*, *Position* and *Rotation* the following component specific properties exist:
2424

2525
*Mesh*
26-
: This property should refer to the glTF *.gltf* or Collada *.dae* file that contains the mesh to use. If the file contains multiple meshes, only the first one is read.
26+
: This property should refer to the glTF *.gltf* file that contains the mesh to use. If the file contains multiple meshes, only the first one is read.
27+
28+
*Create GO Bones*
29+
: Check this to create a game object for every bone of the model. You can use the game objects to attach other game objects such as weapons to hand bones and so on.
30+
31+
*Skeleton*
32+
: This property should refer to the glTF *.gltf* file that contains the skeleton to use for animation. Note that Defold requires a single root bone in your hierarchy.
33+
34+
*Animations*
35+
: Set this to the *Animation Set File* that contains the animations you want to use on the model.
36+
37+
*Default Animation*
38+
: This is the animation (from the animation set) that will be automatically played on the model.
39+
40+
In addition to the properties above there will also be a field to assign a material for every mesh of the model:
2741

2842
*Material*
2943
: Set this property to a material you have created that is suitable for a textured 3D object. There are a number of built-in materials that you can use as a starting point:
@@ -33,17 +47,11 @@ Apart from the properties *Id*, *Position* and *Rotation* the following componen
3347
* Use *model_skinned.material* for skinned (animated) non-instanced models
3448
* Use *model_skinned_instances.material* for skinned (animated) instanced models
3549

50+
Depending on the material there will be one or more texture properties:
51+
3652
*Texture*
3753
: This property should point to the texture image file that you want applied to the object.
3854

39-
*Skeleton*
40-
: This property should refer to the glTF *.gltf* or Collada *.dae* file that contains the skeleton to use for animation. Note that Defold requires a single root bone in your hierarchy.
41-
42-
*Animations*
43-
: Set this to the *Animation Set File* that contains the animations you want to use on the model.
44-
45-
*Default Animation*
46-
: This is the animation (from the animation set) that will be automatically played on the model.
4755

4856
## Editor manipulation
4957

@@ -95,7 +103,7 @@ A model also has a number of different properties that can be manipulated using
95103

96104
## Material
97105

98-
3D software commonly allows you to set properties on your object vertices, like coloring and texturing. This information goes into the glTF *.gltf* or Collada *.dae* file that you export from your 3D software. Depending on the requirements of your game you will have to select and/or create appropriate and _performant_ materials for your objects. A material combines _shader programs_ with a set of parameters for rendering of the object.
106+
3D software commonly allows you to set properties on your object vertices, like coloring and texturing. This information goes into the glTF *.gltf* file that you export from your 3D software. Depending on the requirements of your game you will have to select and/or create appropriate and _performant_ materials for your objects. A material combines _shader programs_ with a set of parameters for rendering of the object.
99107

100108
There are a number of built-in materials that you can use as a starting point:
101109

docs/en/tutorials/grading.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,9 @@ That's all we need to do. If you run the game now it will draw everything to the
114114

115115
To draw the pixels in the render target's color buffer onto the screen, we need to set something up that we can texture with the pixel data. For that purpose we are going to use a flat, quadratic 3D model.
116116

117-
Create a quadratic plane mesh in Blender (or any other 3D modelling program). Set the vertex coordinates to -1 and 1 on the X-axis and -1 and 1 on the Y axis. Blender has the Z-axis up by default so you need to rotate the mesh 90° around the X-axis. You should also make sure that you generate correct UV-coordinates for the mesh. In Blender, enter Edit Mode with the mesh selected, then select <kbd>Mesh ▸ UV unwrap... ▸ Unwrap</kbd>.
118-
119-
![game.project](images/grading/quad_blender.png)
120-
121-
1. Export the model as a Collada file called *`quad.dae`* and drag it into your Defold project.
122-
2. Open *`main.collection`* and create a new game object called "`grade`".
123-
3. Add a Model component to the "`grade`" game object.
124-
3. Set the *Mesh* property of the model component to the *`quad.dae`* file.
117+
1. Open *`main.collection`* and create a new game object called "`grade`".
118+
2. Add a Model component to the "`grade`" game object.
119+
3. Set the *Mesh* property of the model component to the *`quad.gltf`* file found in `builtins/assets/meshes`.
125120

126121
Leave the game object unscaled at origin. Later, when we render the quad we will project it so it fills the whole screen. But first we need a material and shader programs for the quad:
127122

docs/en/tutorials/shadertoy.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,10 @@ Blender is a free, open-source 3D software which can be downloaded from [blender
2929

3030
![quad in Blender](images/shadertoy/quad_blender.png)
3131

32-
1. Export the model as a *Collada* file called *`quad.dae`* and drag it into a new Defold project.
33-
2. Open your "main.collection" file in Defold and create a new game object "star-nest".
34-
3. Add a *Model* component to "star-nest".
35-
4. Set the *Mesh* property to the *`quad.dae`* file.
36-
5. The model is small (2⨉2 units) so we need to scale the "star-nest" game object to a reasonable size. 600⨉600 is a nice large size so set the X and Y scale to 300.
32+
1. Open your "main.collection" file in Defold and create a new game object "star-nest".
33+
2. Add a *Model* component to "star-nest".
34+
3. Set the *Mesh* property to the *`quad.gltf`* file found in `builtins/assets/meshes`.
35+
4. The model is small (2⨉2 units) so we need to scale the "star-nest" game object to a reasonable size. 600⨉600 is a nice large size so set the X and Y scale to 300.
3736

3837
The model should appear in the scene editor, but it is rendered all black. That is because it has no material set yet:
3938

0 commit comments

Comments
 (0)