Skip to content

Commit f180e8a

Browse files
committed
Add named placeholder to blender import options
1 parent 0a30831 commit f180e8a

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

modules/gltf/editor/editor_scene_importer_blend.cpp

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,17 @@ Node *EditorSceneFormatImporterBlend::import_scene(const String &p_path, uint32_
175175
}
176176
if (p_options.has(SNAME("blender/materials/export_materials"))) {
177177
int32_t exports = p_options["blender/materials/export_materials"];
178-
if (exports == BLEND_MATERIAL_EXPORT_PLACEHOLDER) {
179-
parameters_map["export_materials"] = "PLACEHOLDER";
180-
} else if (exports == BLEND_MATERIAL_EXPORT_EXPORT) {
181-
parameters_map["export_materials"] = "EXPORT";
178+
switch (exports) {
179+
case BLEND_MATERIAL_EXPORT_PLACEHOLDER: {
180+
parameters_map["export_materials"] = "PLACEHOLDER";
181+
} break;
182+
case BLEND_MATERIAL_EXPORT_EXPORT: {
183+
parameters_map["export_materials"] = "EXPORT";
184+
} break;
185+
case BLEND_MATERIAL_EXPORT_NAMED_PLACEHOLDER: {
186+
parameters_map["export_materials"] = "EXPORT";
187+
parameters_map["export_image_format"] = "NONE";
188+
} break;
182189
}
183190
} else {
184191
parameters_map["export_materials"] = "PLACEHOLDER";
@@ -367,7 +374,7 @@ void EditorSceneFormatImporterBlend::get_import_options(const String &p_path, Li
367374
ADD_OPTION_ENUM("blender/meshes/skins", "None,4 Influences (Compatible),All Influences", BLEND_BONE_INFLUENCES_ALL);
368375
ADD_OPTION_BOOL("blender/meshes/export_bones_deforming_mesh_only", false);
369376
ADD_OPTION_BOOL("blender/materials/unpack_enabled", true);
370-
ADD_OPTION_ENUM("blender/materials/export_materials", "Placeholder,Export", BLEND_MATERIAL_EXPORT_EXPORT);
377+
ADD_OPTION_ENUM("blender/materials/export_materials", "Placeholder,Export,Named Placeholder", BLEND_MATERIAL_EXPORT_EXPORT);
371378
ADD_OPTION_BOOL("blender/animation/limit_playback", true);
372379
ADD_OPTION_BOOL("blender/animation/always_sample", true);
373380
ADD_OPTION_BOOL("blender/animation/group_tracks", true);

modules/gltf/editor/editor_scene_importer_blend.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ class EditorSceneFormatImporterBlend : public EditorSceneFormatImporter {
5959
};
6060
enum {
6161
BLEND_MATERIAL_EXPORT_PLACEHOLDER,
62-
BLEND_MATERIAL_EXPORT_EXPORT
62+
BLEND_MATERIAL_EXPORT_EXPORT,
63+
BLEND_MATERIAL_EXPORT_NAMED_PLACEHOLDER,
6364
};
6465
enum {
6566
BLEND_MODIFIERS_NONE,

0 commit comments

Comments
 (0)