better comment for animated prefab and remove unused code in remap blendshapes
This commit is contained in:
@@ -608,8 +608,8 @@ CreateAssetResult ImportModel::Create(CreateAssetContext& context)
|
||||
CreateAssetResult ImportModel::CreateModel(CreateAssetContext& context, const ModelData& modelData, const Options* options)
|
||||
{
|
||||
PROFILE_CPU();
|
||||
IMPORT_SETUP(Model, Model::SerializedVersion);
|
||||
static_assert(Model::SerializedVersion == 30, "Update code.");
|
||||
IMPORT_SETUP(Model, Model::SerializedVersion);
|
||||
static_assert(Model::SerializedVersion == 30, "Update code.");
|
||||
|
||||
// Save model header
|
||||
MemoryWriteStream stream(4096);
|
||||
@@ -738,7 +738,7 @@ CreateAssetResult ImportModel::CreatePrefab(CreateAssetContext& context, const M
|
||||
{
|
||||
if(e.IsSkinned)
|
||||
{
|
||||
LOG(Info,"Model {0} is Animated", e.Name);
|
||||
LOG(Info,"Creating animated model prefab {0}.", e.Name);
|
||||
auto* actor = New<AnimatedModel>();
|
||||
actor->SetName(e.Name);
|
||||
if (auto* skinnedModel = Content::LoadAsync<SkinnedModel>(e.AssetPath))
|
||||
|
||||
@@ -2114,12 +2114,10 @@ bool ModelTool::ImportModel(const String& path, ModelData& data, Options& option
|
||||
#undef REMAP_VERTEX_BUFFER
|
||||
|
||||
// Remap blend shapes
|
||||
dstMesh->BlendShapes.Clear();
|
||||
dstMesh->BlendShapes.EnsureCapacity(srcMesh->BlendShapes.Count(), false);
|
||||
for (int32 blendShapeIndex = 0; blendShapeIndex < srcMesh->BlendShapes.Count(); blendShapeIndex++)
|
||||
{
|
||||
const auto& srcBlendShape = srcMesh->BlendShapes[blendShapeIndex];
|
||||
//auto& dstBlendShape = dstMesh->BlendShapes[blendShapeIndex];
|
||||
BlendShape dstBlendShape;
|
||||
dstBlendShape.Name = srcBlendShape.Name;
|
||||
dstBlendShape.Weight = srcBlendShape.Weight;
|
||||
@@ -2132,18 +2130,11 @@ bool ModelTool::ImportModel(const String& path, ModelData& data, Options& option
|
||||
dstBlendShape.Vertices.Add(v);
|
||||
}
|
||||
|
||||
// Add only valid blend shapes
|
||||
if (dstBlendShape.Vertices.HasItems())
|
||||
dstMesh->BlendShapes.Add(dstBlendShape);
|
||||
}
|
||||
|
||||
/*
|
||||
// Remove empty blend shapes
|
||||
for (int32 blendShapeIndex = dstMesh->BlendShapes.Count() - 1; blendShapeIndex >= 0; blendShapeIndex--)
|
||||
{
|
||||
if (dstMesh->BlendShapes[blendShapeIndex].Vertices.IsEmpty())
|
||||
dstMesh->BlendShapes.RemoveAt(blendShapeIndex);
|
||||
}
|
||||
*/
|
||||
// Optimize generated LOD
|
||||
meshopt_optimizeVertexCache(dstMesh->Indices.Get(), dstMesh->Indices.Get(), dstMeshIndexCount, dstMeshVertexCount);
|
||||
meshopt_optimizeOverdraw(dstMesh->Indices.Get(), dstMesh->Indices.Get(), dstMeshIndexCount, (const float*)dstMesh->Positions.Get(), dstMeshVertexCount, sizeof(Float3), 1.05f);
|
||||
|
||||
Reference in New Issue
Block a user