[LYN-3078] Removed legacy CMaterial and all related/unused classes.

This commit is contained in:
Chris Galvan
2021-05-03 16:42:11 -05:00
parent 71c5df040f
commit 8b0b3f4d02
116 changed files with 9 additions and 15510 deletions
@@ -46,9 +46,7 @@
#include <LmbrCentral/Rendering/MaterialOwnerBus.h>
#include <IDisplayViewport.h>
#include <Material/MaterialManager.h>
#include <MathConversion.h>
#include <Objects/StatObjValidator.h>
#include <TrackView/TrackViewAnimNode.h>
#include <ViewManager.h>
#include <Viewport.h>
@@ -1096,56 +1094,3 @@ void CComponentEntityObject::DrawAccent(DisplayContext& dc)
dc.DrawWireBox(box.min, box.max);
}
}
void CComponentEntityObject::SetMaterial(CMaterial* material)
{
AZ::Entity* entity = nullptr;
EBUS_EVENT_RESULT(entity, AZ::ComponentApplicationBus, FindEntity, m_entityId);
if (entity)
{
if (material)
{
EBUS_EVENT_ID(m_entityId, LmbrCentral::MaterialOwnerRequestBus, SetMaterial, material->GetMatInfo());
}
else
{
EBUS_EVENT_ID(m_entityId, LmbrCentral::MaterialOwnerRequestBus, SetMaterial, nullptr);
}
}
ValidateMeshStatObject();
}
CMaterial* CComponentEntityObject::GetMaterial() const
{
_smart_ptr<IMaterial> material = nullptr;
EBUS_EVENT_ID_RESULT(material, m_entityId, LmbrCentral::MaterialOwnerRequestBus, GetMaterial);
return GetIEditor()->GetMaterialManager()->FromIMaterial(material);
}
CMaterial* CComponentEntityObject::GetRenderMaterial() const
{
AZ::Entity* entity = nullptr;
EBUS_EVENT_RESULT(entity, AZ::ComponentApplicationBus, FindEntity, m_entityId);
if (entity)
{
_smart_ptr<IMaterial> material = nullptr;
EBUS_EVENT_ID_RESULT(material, m_entityId, LmbrCentral::MaterialOwnerRequestBus, GetMaterial);
if (material)
{
return GetIEditor()->GetMaterialManager()->LoadMaterial(material->GetName(), false);
}
}
return nullptr;
}
void CComponentEntityObject::ValidateMeshStatObject()
{
IStatObj* statObj = GetIStatObj();
CMaterial* editorMaterial = GetMaterial();
CStatObjValidator statValidator;
statValidator.Validate(statObj, editorMaterial);
}