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

Method SetupMaterialSlots

Source/Engine/Content/Assets/Model.cpp:429–444  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

427#endif
428
429void Model::SetupMaterialSlots(int32 slotsCount)
430{
431 PROFILE_MEM(GraphicsMeshes);
432 ModelBase::SetupMaterialSlots(slotsCount);
433
434 // Adjust meshes indices for slots
435 for (int32 lodIndex = 0; lodIndex < LODs.Count(); lodIndex++)
436 {
437 for (int32 meshIndex = 0; meshIndex < LODs[lodIndex].Meshes.Count(); meshIndex++)
438 {
439 auto& mesh = LODs[lodIndex].Meshes[meshIndex];
440 if (mesh.GetMaterialSlotIndex() >= slotsCount)
441 mesh.SetMaterialSlotIndex(slotsCount - 1);
442 }
443 }
444}
445
446int32 Model::GetLODsCount() const
447{

Callers 1

Calls 3

SetupMaterialSlotsFunction · 0.85
SetMaterialSlotIndexMethod · 0.80
CountMethod · 0.45

Tested by

no test coverage detected