3
3
Import process
4
4
==============
5
5
6
- Importing assets in Godot 3.0+
7
- ------------------------------
6
+ Importing assets in Godot
7
+ -------------------------
8
8
9
- Previously, importing assets in Godot 2.x required manual maintenance
10
- of a separate directory with source assets. Without doing this, it was
11
- impossible to specify how to convert and change import flags for
12
- textures, audio files, scenes, etc.
13
-
14
- In Godot 3.0+, we use a more modern approach to importing: Simply drop
9
+ In Godot 3.0we use a more modern approach to importing: Simply drop
15
10
your assets (image files, scenes, audio files, fonts, etc) directly in the
16
- project folder (copy them manually with your OS file explorer ).
11
+ project folder (copy them manually with your operating system's file manager ).
17
12
Godot will automatically import these files internally
18
13
and keep the imported resources hidden in a ``res://.import `` folder.
19
14
20
- This means that when trying to access imported assets through code you
15
+ This means that when trying to access imported assets through code, you
21
16
need to use the :ref: `Resource Loader<class_ResourceLoader> ` as it will
22
17
automatically take into account where the internal files are saved. If you
23
- try and access an imported asset using the :ref: `FileAccess <class_FileAccess >` class
24
- it will work in the editor, but break in the exported project.
18
+ try and access an imported asset using the :ref: `FileAccess <class_FileAccess >` class,
19
+ it will work in the editor, but ** it will break in the exported project** .
25
20
26
21
However, the :ref: `Resource Loader<class_ResourceLoader> ` cannot access
27
- non imported files, only the :ref: `FileAccess <class_FileAccess >` class can.
22
+ non- imported files. Only the :ref: `FileAccess <class_FileAccess >` class can.
28
23
29
24
Changing import parameters
30
25
--------------------------
@@ -33,7 +28,7 @@ To change the import parameters of an asset in Godot (again, keep in mind
33
28
import parameters are only present in non-native Godot resource types)
34
29
select the relevant resource in the filesystem dock:
35
30
36
- .. image :: img/asset_workflow1.png
31
+ .. image :: img/import_process_example.webp
37
32
38
33
Then, after adjusting the parameters, press "Reimport". These parameters
39
34
will only be used for this asset and on future reimports.
@@ -42,6 +37,11 @@ Changing the import parameters of several assets at the same time is also
42
37
possible. Simply select all of them together in the resources dock and the
43
38
exposed parameters will apply to all of them when reimporting.
44
39
40
+ Default import parameters for
41
+ Custom fonts' properties are governed by their respective import options
42
+ instead. You can use the **Import Defaults ** section of the Project Settings
43
+ dialog to override default import options for custom fonts.
44
+
45
45
Reimporting multiple assets
46
46
---------------------------
47
47
@@ -66,48 +66,77 @@ automatic reimport of it, applying the preset configured for that specific
66
66
asset.
67
67
68
68
Files generated
69
- -----------------
69
+ ---------------
70
+
71
+ Importing will add an extra ``<asset>.import `` file next to the source file,
72
+ containing the import configuration.
70
73
71
- Importing will add an extra `` <asset>.import `` file, containing the import
72
- configuration. Make sure to commit these to your version control system!
74
+ ** Make sure to commit these files to your version control system **, as these
75
+ files contain important metadata.
73
76
74
- .. image :: img/asset_workflow4.png
77
+ ::
75
78
76
- Additionally, extra assets will be preset in the hidden ``res://.import `` folder:
79
+ $ ls
80
+ example.png
81
+ example.png.import
82
+ project.godot
77
83
78
- .. image :: img/asset_workflow5.png
84
+ Additionally, extra assets will be preset in the hidden
85
+ ``res://.godot/imported/ `` folder:
86
+
87
+ ::
88
+
89
+ $ ls .godot/imported
90
+ example.png-218a8f2b3041327d8a5756f3a245f83b.ctex
91
+ example.png-218a8f2b3041327d8a5756f3a245f83b.md5
79
92
80
93
If any of the files present in this folder is erased (or the whole folder), the
81
- asset or assets will be reimported automatically. As such, committing this folder
82
- to the version control system is optional. It can shorten
83
- reimporting time when checking out on another computer, but it takes considerably
84
- more space and transfer time. Pick your poison!
94
+ asset or assets will be reimported automatically. As such, committing the
95
+ ``.godot/ `` folder to the version control system is not recommended. While
96
+ committing this folder can shorten reimporting time when checking out on another
97
+ computer, it requires considerably more space and bandwidth.
98
+
99
+ The default version control metadata that can be generated on project creation
100
+ will automatically ignore the ``.godot/ `` folder.
85
101
86
102
Changing import resource type
87
103
-----------------------------
88
104
89
- Some source assets can be imported as different types of resources.
90
- For this, select the relevant type of resource desired and
91
- press "Reimport":
105
+ Some source assets can be imported as different types of resources. For this,
106
+ select the relevant type of resource desired then click **Reimport **:
92
107
93
- .. image :: img/asset_workflow2.png
108
+ .. image :: img/import_process_changing_import_type.webp
94
109
110
+ .. note ::
111
+
112
+ For technical reasons, the editor must be restarted after changing an import
113
+ type in the Import dock.
95
114
96
115
Changing default import parameters
97
- -----------------------------------
116
+ ----------------------------------
98
117
99
118
Different types of games might require different defaults.
100
119
Changing the defaults per project can be achieved by using the
101
- " Preset.." Menu. Besides some resource types offering presets,
120
+ ** Preset... ** Menu. Besides some resource types offering presets,
102
121
the default setting can be saved and cleared too:
103
122
104
- .. image :: img/asset_workflow3.png
123
+ .. image :: img/import_process_change_preset.webp
105
124
106
- Simplicity is key!
107
- ------------------
125
+ The default import parameters for a given resource type can be changed
126
+ project-wide using the **Import Defaults ** tab of the Project Settings dialog:
127
+
128
+ .. image :: img/import_process_import_defaults.webp
129
+
130
+ Further reading
131
+ ---------------
132
+
133
+ This workflow takes a little time to get used to, but it enforces a more correct
134
+ way to deal with resources.
108
135
109
- This workflow is aimed to be simple and take very little time to get used to. It also enforces a more
110
- correct way to deal with resources.
136
+ There are many types of assets available for import. Continue reading to
137
+ understand how to work with all of them:
111
138
112
- There are many types of assets available for import, so please continue reading to understand how to work
113
- with all of them!
139
+ - :ref: `doc_importing_images `
140
+ - :ref: `doc_importing_audio_samples `
141
+ - :ref: `doc_importing_3d_scenes `
142
+ - :ref: `doc_importing_translations `
0 commit comments