Fix deploying fbx files in cooked build from ModelPrefab

This commit is contained in:
Wojtek Figat
2024-08-17 16:48:42 +02:00
parent 650a2921a3
commit ce1a1d6031

View File

@@ -110,13 +110,13 @@ uint64 JsonAssetBase::GetMemoryUsage() const
#if USE_EDITOR #if USE_EDITOR
void FindIds(ISerializable::DeserializeStream& node, Array<Guid>& output, Array<String>& files) void FindIds(ISerializable::DeserializeStream& node, Array<Guid>& output, Array<String>& files, rapidjson_flax::Value* nodeName = nullptr)
{ {
if (node.IsObject()) if (node.IsObject())
{ {
for (auto i = node.MemberBegin(); i != node.MemberEnd(); ++i) for (auto i = node.MemberBegin(); i != node.MemberEnd(); ++i)
{ {
FindIds(i->value, output, files); FindIds(i->value, output, files, &i->name);
} }
} }
else if (node.IsArray()) else if (node.IsArray())
@@ -138,7 +138,8 @@ void FindIds(ISerializable::DeserializeStream& node, Array<Guid>& output, Array<
return; return;
} }
} }
if (node.GetStringLength() < 512) if (node.GetStringLength() < 512 &&
(!nodeName || nodeName->GetStringAnsiView() != "ImportPath")) // Ignore path in ImportPath from ModelPrefab (TODO: resave prefabs/scenes before cooking to get rid of editor-only data)
{ {
// Try to detect file paths // Try to detect file paths
String path = node.GetText(); String path = node.GetText();