Add support for importing skeleton-only as Skinned Model (eg. from animation file to have skeleton for retargeting)

This commit is contained in:
Wojtek Figat
2023-05-04 15:43:44 +02:00
parent c91bc0d8c6
commit 71a5d56105
7 changed files with 94 additions and 43 deletions

View File

@@ -766,21 +766,11 @@ bool ModelData::Pack2SkinnedModelHeader(WriteStream* stream) const
return true;
}
const int32 lodCount = GetLODsCount();
if (lodCount == 0 || lodCount > MODEL_MAX_LODS)
if (lodCount > MODEL_MAX_LODS)
{
Log::ArgumentOutOfRangeException();
return true;
}
if (Materials.IsEmpty())
{
Log::ArgumentOutOfRangeException(TEXT("MaterialSlots"), TEXT("Material slots collection cannot be empty."));
return true;
}
if (!HasSkeleton())
{
Log::InvalidOperationException(TEXT("Missing skeleton."));
return true;
}
// Version
stream->WriteByte(1);