MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / LoadMesh

Method LoadMesh

Source/Engine/Content/Assets/SkinnedModel.cpp:447–475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

445#endif
446
447bool SkinnedModel::LoadMesh(MemoryReadStream& stream, byte meshVersion, MeshBase* mesh, MeshData* dataIfReadOnly)
448{
449 PROFILE_MEM(GraphicsMeshes);
450 if (ModelBase::LoadMesh(stream, meshVersion, mesh, dataIfReadOnly))
451 return true;
452 static_assert(MODEL_MESH_VERSION == 2, "Update code");
453 auto skinnedMesh = (SkinnedMesh*)mesh;
454
455 // Blend Shapes
456 uint16 blendShapesCount;
457 stream.Read(blendShapesCount);
458 if (dataIfReadOnly)
459 {
460 // Skip blend shapes
461 BlendShape tmp;
462 while (blendShapesCount-- != 0)
463 tmp.Load(stream, meshVersion);
464 return false;
465 }
466 if (blendShapesCount != skinnedMesh->BlendShapes.Count())
467 {
468 LOG(Warning, "Incorrect blend shapes amount: {} (expected: {})", blendShapesCount, skinnedMesh->BlendShapes.Count());
469 return true;
470 }
471 for (auto& blendShape : skinnedMesh->BlendShapes)
472 blendShape.Load(stream, meshVersion);
473
474 return false;
475}
476
477bool SkinnedModel::LoadHeader(ReadStream& stream, byte& headerVersion)
478{

Callers

nothing calls this directly

Calls 3

ReadMethod · 0.45
LoadMethod · 0.45
CountMethod · 0.45

Tested by

no test coverage detected