Skip to content

Commit

Permalink
Merge pull request #49524 from Calinou/document-editor-import-options
Browse files Browse the repository at this point in the history
Document editor import options in the class reference
  • Loading branch information
YuriSizov committed Jul 12, 2023
2 parents 4e66c4c + 8352122 commit f25233c
Show file tree
Hide file tree
Showing 25 changed files with 465 additions and 25 deletions.
20 changes: 11 additions & 9 deletions core/io/resource_importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,15 @@ Ref<ResourceImporter> ResourceFormatImporter::get_importer_by_name(const String
return Ref<ResourceImporter>();
}

void ResourceFormatImporter::add_importer(const Ref<ResourceImporter> &p_importer, bool p_first_priority) {
ERR_FAIL_COND(p_importer.is_null());
if (p_first_priority) {
importers.insert(0, p_importer);
} else {
importers.push_back(p_importer);
}
}

void ResourceFormatImporter::get_importers_for_extension(const String &p_extension, List<Ref<ResourceImporter>> *r_importers) {
for (int i = 0; i < importers.size(); i++) {
List<String> local_exts;
Expand Down Expand Up @@ -472,20 +481,13 @@ ResourceFormatImporter::ResourceFormatImporter() {
singleton = this;
}

//////////////

void ResourceImporter::_bind_methods() {
BIND_ENUM_CONSTANT(IMPORT_ORDER_DEFAULT);
BIND_ENUM_CONSTANT(IMPORT_ORDER_SCENE);
}

void ResourceFormatImporter::add_importer(const Ref<ResourceImporter> &p_importer, bool p_first_priority) {
ERR_FAIL_COND(p_importer.is_null());
if (p_first_priority) {
importers.insert(0, p_importer);
} else {
importers.push_back(p_importer);
}
}

/////

Error ResourceFormatImporterSaver::set_uid(const String &p_path, ResourceUID::ID p_uid) {
Expand Down
15 changes: 15 additions & 0 deletions doc/classes/ResourceImporterBMFont.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ResourceImporterBMFont" inherits="ResourceImporter" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<members>
<member name="compress" type="bool" setter="" getter="" default="true">
</member>
<member name="fallbacks" type="Array" setter="" getter="" default="[]">
</member>
</members>
</class>
15 changes: 15 additions & 0 deletions doc/classes/ResourceImporterBitMap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ResourceImporterBitMap" inherits="ResourceImporter" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<members>
<member name="create_from" type="int" setter="" getter="" default="0">
</member>
<member name="threshold" type="float" setter="" getter="" default="0.5">
</member>
</members>
</class>
15 changes: 15 additions & 0 deletions doc/classes/ResourceImporterCSVTranslation.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ResourceImporterCSVTranslation" inherits="ResourceImporter" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<members>
<member name="compress" type="bool" setter="" getter="" default="true">
</member>
<member name="delimiter" type="int" setter="" getter="" default="0">
</member>
</members>
</class>
43 changes: 43 additions & 0 deletions doc/classes/ResourceImporterDynamicFont.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ResourceImporterDynamicFont" inherits="ResourceImporter" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<members>
<member name="allow_system_fallback" type="bool" setter="" getter="" default="true">
</member>
<member name="antialiasing" type="int" setter="" getter="" default="1">
</member>
<member name="compress" type="bool" setter="" getter="" default="true">
</member>
<member name="fallbacks" type="Array" setter="" getter="" default="[]">
</member>
<member name="force_autohinter" type="bool" setter="" getter="" default="false">
</member>
<member name="generate_mipmaps" type="bool" setter="" getter="" default="false">
</member>
<member name="hinting" type="int" setter="" getter="" default="1">
</member>
<member name="language_support" type="Dictionary" setter="" getter="" default="{}">
</member>
<member name="msdf_pixel_range" type="int" setter="" getter="" default="8">
</member>
<member name="msdf_size" type="int" setter="" getter="" default="48">
</member>
<member name="multichannel_signed_distance_field" type="bool" setter="" getter="" default="false">
</member>
<member name="opentype_features" type="Dictionary" setter="" getter="" default="{}">
</member>
<member name="oversampling" type="float" setter="" getter="" default="0.0">
</member>
<member name="preload" type="Array" setter="" getter="" default="[]">
</member>
<member name="script_support" type="Dictionary" setter="" getter="" default="{}">
</member>
<member name="subpixel_positioning" type="int" setter="" getter="" default="1">
</member>
</members>
</class>
9 changes: 9 additions & 0 deletions doc/classes/ResourceImporterImage.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ResourceImporterImage" inherits="ResourceImporter" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
</class>
25 changes: 25 additions & 0 deletions doc/classes/ResourceImporterImageFont.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ResourceImporterImageFont" inherits="ResourceImporter" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<members>
<member name="character_margin" type="Rect2i" setter="" getter="" default="Rect2i(0, 0, 0, 0)">
</member>
<member name="character_ranges" type="PackedStringArray" setter="" getter="" default="PackedStringArray()">
</member>
<member name="columns" type="int" setter="" getter="" default="1">
</member>
<member name="compress" type="bool" setter="" getter="" default="true">
</member>
<member name="fallbacks" type="Array" setter="" getter="" default="[]">
</member>
<member name="image_margin" type="Rect2i" setter="" getter="" default="Rect2i(0, 0, 0, 0)">
</member>
<member name="rows" type="int" setter="" getter="" default="1">
</member>
</members>
</class>
27 changes: 27 additions & 0 deletions doc/classes/ResourceImporterLayeredTexture.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ResourceImporterLayeredTexture" inherits="ResourceImporter" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<members>
<member name="compress/channel_pack" type="int" setter="" getter="" default="0">
</member>
<member name="compress/hdr_compression" type="int" setter="" getter="" default="1">
</member>
<member name="compress/high_quality" type="bool" setter="" getter="" default="false">
</member>
<member name="compress/lossy_quality" type="float" setter="" getter="" default="0.7">
</member>
<member name="compress/mode" type="int" setter="" getter="" default="1">
</member>
<member name="mipmaps/generate" type="bool" setter="" getter="" default="true">
</member>
<member name="mipmaps/limit" type="int" setter="" getter="" default="-1">
</member>
<member name="slices/arrangement" type="int" setter="" getter="" default="1">
</member>
</members>
</class>
19 changes: 19 additions & 0 deletions doc/classes/ResourceImporterOBJ.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ResourceImporterOBJ" inherits="ResourceImporter" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<members>
<member name="generate_tangents" type="bool" setter="" getter="" default="true">
</member>
<member name="offset_mesh" type="Vector3" setter="" getter="" default="Vector3(0, 0, 0)">
</member>
<member name="optimize_mesh" type="bool" setter="" getter="" default="true">
</member>
<member name="scale_mesh" type="Vector3" setter="" getter="" default="Vector3(1, 1, 1)">
</member>
</members>
</class>
43 changes: 43 additions & 0 deletions doc/classes/ResourceImporterScene.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ResourceImporterScene" inherits="ResourceImporter" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<members>
<member name="_subresources" type="Dictionary" setter="" getter="" default="{}">
</member>
<member name="animation/fps" type="float" setter="" getter="" default="30">
</member>
<member name="animation/import" type="bool" setter="" getter="" default="true">
</member>
<member name="animation/remove_immutable_tracks" type="bool" setter="" getter="" default="true">
</member>
<member name="animation/trimming" type="bool" setter="" getter="" default="false">
</member>
<member name="import_script/path" type="String" setter="" getter="" default="&quot;&quot;">
</member>
<member name="meshes/create_shadow_meshes" type="bool" setter="" getter="" default="true">
</member>
<member name="meshes/ensure_tangents" type="bool" setter="" getter="" default="true">
</member>
<member name="meshes/generate_lods" type="bool" setter="" getter="" default="true">
</member>
<member name="meshes/light_baking" type="int" setter="" getter="" default="1">
</member>
<member name="meshes/lightmap_texel_size" type="float" setter="" getter="" default="0.2">
</member>
<member name="nodes/apply_root_scale" type="bool" setter="" getter="" default="true">
</member>
<member name="nodes/root_name" type="String" setter="" getter="" default="&quot;Scene Root&quot;">
</member>
<member name="nodes/root_scale" type="float" setter="" getter="" default="1.0">
</member>
<member name="nodes/root_type" type="String" setter="" getter="" default="&quot;Node3D&quot;">
</member>
<member name="skins/use_named_skins" type="bool" setter="" getter="" default="true">
</member>
</members>
</class>
9 changes: 9 additions & 0 deletions doc/classes/ResourceImporterShaderFile.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ResourceImporterShaderFile" inherits="ResourceImporter" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
</class>
51 changes: 51 additions & 0 deletions doc/classes/ResourceImporterTexture.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ResourceImporterTexture" inherits="ResourceImporter" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<members>
<member name="compress/channel_pack" type="int" setter="" getter="" default="0">
</member>
<member name="compress/hdr_compression" type="int" setter="" getter="" default="1">
</member>
<member name="compress/high_quality" type="bool" setter="" getter="" default="false">
</member>
<member name="compress/lossy_quality" type="float" setter="" getter="" default="0.7">
</member>
<member name="compress/mode" type="int" setter="" getter="" default="0">
</member>
<member name="compress/normal_map" type="int" setter="" getter="" default="0">
</member>
<member name="detect_3d/compress_to" type="int" setter="" getter="" default="1">
</member>
<member name="editor/convert_colors_with_editor_theme" type="bool" setter="" getter="" default="false">
</member>
<member name="editor/scale_with_editor_scale" type="bool" setter="" getter="" default="false">
</member>
<member name="mipmaps/generate" type="bool" setter="" getter="" default="false">
</member>
<member name="mipmaps/limit" type="int" setter="" getter="" default="-1">
</member>
<member name="process/fix_alpha_border" type="bool" setter="" getter="" default="true">
</member>
<member name="process/hdr_as_srgb" type="bool" setter="" getter="" default="false">
</member>
<member name="process/hdr_clamp_exposure" type="bool" setter="" getter="" default="false">
</member>
<member name="process/normal_map_invert_y" type="bool" setter="" getter="" default="false">
</member>
<member name="process/premult_alpha" type="bool" setter="" getter="" default="false">
</member>
<member name="process/size_limit" type="int" setter="" getter="" default="0">
</member>
<member name="roughness/mode" type="int" setter="" getter="" default="0">
</member>
<member name="roughness/src_normal" type="String" setter="" getter="" default="&quot;&quot;">
</member>
<member name="svg/scale" type="float" setter="" getter="" default="1.0">
</member>
</members>
</class>
19 changes: 19 additions & 0 deletions doc/classes/ResourceImporterTextureAtlas.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ResourceImporterTextureAtlas" inherits="ResourceImporter" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<members>
<member name="atlas_file" type="String" setter="" getter="" default="&quot;&quot;">
</member>
<member name="crop_to_region" type="bool" setter="" getter="" default="false">
</member>
<member name="import_mode" type="int" setter="" getter="" default="0">
</member>
<member name="trim_alpha_border_from_region" type="bool" setter="" getter="" default="true">
</member>
</members>
</class>
31 changes: 31 additions & 0 deletions doc/classes/ResourceImporterWAV.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ResourceImporterWAV" inherits="ResourceImporter" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<members>
<member name="compress/mode" type="int" setter="" getter="" default="0">
</member>
<member name="edit/loop_begin" type="int" setter="" getter="" default="0">
</member>
<member name="edit/loop_end" type="int" setter="" getter="" default="-1">
</member>
<member name="edit/loop_mode" type="int" setter="" getter="" default="0">
</member>
<member name="edit/normalize" type="bool" setter="" getter="" default="false">
</member>
<member name="edit/trim" type="bool" setter="" getter="" default="false">
</member>
<member name="force/8_bit" type="bool" setter="" getter="" default="false">
</member>
<member name="force/max_rate" type="bool" setter="" getter="" default="false">
</member>
<member name="force/max_rate_hz" type="float" setter="" getter="" default="44100">
</member>
<member name="force/mono" type="bool" setter="" getter="" default="false">
</member>
</members>
</class>
Loading

0 comments on commit f25233c

Please sign in to comment.