Skip to content

Commit c80bb1b

Browse files
committed
Merge pull request #104025 from huwpascoe/named_placeholder
Add named placeholder to blender import options
2 parents 033e55f + f180e8a commit c80bb1b

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
@@ -168,10 +168,17 @@ Node *EditorSceneFormatImporterBlend::import_scene(const String &p_path, uint32_
168168
}
169169
if (p_options.has(SNAME("blender/materials/export_materials"))) {
170170
int32_t exports = p_options["blender/materials/export_materials"];
171-
if (exports == BLEND_MATERIAL_EXPORT_PLACEHOLDER) {
172-
parameters_map["export_materials"] = "PLACEHOLDER";
173-
} else if (exports == BLEND_MATERIAL_EXPORT_EXPORT) {
174-
parameters_map["export_materials"] = "EXPORT";
171+
switch (exports) {
172+
case BLEND_MATERIAL_EXPORT_PLACEHOLDER: {
173+
parameters_map["export_materials"] = "PLACEHOLDER";
174+
} break;
175+
case BLEND_MATERIAL_EXPORT_EXPORT: {
176+
parameters_map["export_materials"] = "EXPORT";
177+
} break;
178+
case BLEND_MATERIAL_EXPORT_NAMED_PLACEHOLDER: {
179+
parameters_map["export_materials"] = "EXPORT";
180+
parameters_map["export_image_format"] = "NONE";
181+
} break;
175182
}
176183
} else {
177184
parameters_map["export_materials"] = "PLACEHOLDER";
@@ -360,7 +367,7 @@ void EditorSceneFormatImporterBlend::get_import_options(const String &p_path, Li
360367
ADD_OPTION_ENUM("blender/meshes/skins", "None,4 Influences (Compatible),All Influences", BLEND_BONE_INFLUENCES_ALL);
361368
ADD_OPTION_BOOL("blender/meshes/export_bones_deforming_mesh_only", false);
362369
ADD_OPTION_BOOL("blender/materials/unpack_enabled", true);
363-
ADD_OPTION_ENUM("blender/materials/export_materials", "Placeholder,Export", BLEND_MATERIAL_EXPORT_EXPORT);
370+
ADD_OPTION_ENUM("blender/materials/export_materials", "Placeholder,Export,Named Placeholder", BLEND_MATERIAL_EXPORT_EXPORT);
364371
ADD_OPTION_BOOL("blender/animation/limit_playback", true);
365372
ADD_OPTION_BOOL("blender/animation/always_sample", true);
366373
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
@@ -57,7 +57,8 @@ class EditorSceneFormatImporterBlend : public EditorSceneFormatImporter {
5757
};
5858
enum {
5959
BLEND_MATERIAL_EXPORT_PLACEHOLDER,
60-
BLEND_MATERIAL_EXPORT_EXPORT
60+
BLEND_MATERIAL_EXPORT_EXPORT,
61+
BLEND_MATERIAL_EXPORT_NAMED_PLACEHOLDER,
6162
};
6263
enum {
6364
BLEND_MODIFIERS_NONE,

0 commit comments

Comments
 (0)