diff --git a/Source/Engine/ContentImporters/ImportModel.cpp b/Source/Engine/ContentImporters/ImportModel.cpp index d2b4256b3..be71236ab 100644 --- a/Source/Engine/ContentImporters/ImportModel.cpp +++ b/Source/Engine/ContentImporters/ImportModel.cpp @@ -55,6 +55,27 @@ bool ImportModel::TryGetImportOptions(const StringView& path, Options& options) } } } + else + { + // Try model prefab + String pathPrefab = String(StringUtils::GetPathWithoutExtension(path)) + DEFAULT_PREFAB_EXTENSION_DOT; + if (FileSystem::FileExists(pathPrefab)) + { + auto prefab = Content::Load(pathPrefab); + if (prefab) + { + for (const auto& e : prefab->ObjectsDataCache) + { + auto importOptionsMember = e.Value->FindMember("ImportOptions"); + if (importOptionsMember != e.Value->MemberEnd() && importOptionsMember->value.IsObject()) + { + options.Deserialize(*(ISerializable::DeserializeStream*)&importOptionsMember->value, nullptr); + return true; + } + } + } + } + } return false; }