[LYN-3457] Removed the LensFlareEditor.

This commit is contained in:
Chris Galvan
2021-04-30 13:27:05 -05:00
parent 6f503b5225
commit 2a67584bc9
54 changed files with 3 additions and 9493 deletions
+1 -106
View File
@@ -29,18 +29,11 @@
#include "Include/IObjectManager.h"
#include "Objects/ObjectManager.h"
#include "ViewManager.h"
#include "LensFlareEditor/LensFlareManager.h"
#include "LensFlareEditor/LensFlareUtil.h"
#include "LensFlareEditor/LensFlareLibrary.h"
#include "AnimationContext.h"
#include "HitContext.h"
#include "Objects/SelectionGroup.h"
const char* CEntityObject::s_LensFlarePropertyName("flare_Flare");
const char* CEntityObject::s_LensFlareMaterialName("EngineAssets/Materials/lens_optics");
//////////////////////////////////////////////////////////////////////////
//! Undo Entity Link
class CUndoEntityLink
@@ -1985,14 +1978,7 @@ void CEntityObject::SetOpticsElement(IOpticsElementBase* pOptics)
return;
}
pLight->SetLensOpticsElement(pOptics);
if (GetEntityPropertyBool("bFlareEnable") && pOptics)
{
CBaseObject::SetMaterial(s_LensFlareMaterialName);
}
else
{
SetMaterial(NULL);
}
SetMaterial(NULL);
}
//////////////////////////////////////////////////////////////////////////
@@ -2005,7 +1991,6 @@ void CEntityObject::ApplyOptics(const QString& opticsFullName, IOpticsElementBas
{
pLight->SetLensOpticsElement(NULL);
}
SetFlareName("");
SetMaterial(NULL);
}
else
@@ -2024,9 +2009,7 @@ void CEntityObject::ApplyOptics(const QString& opticsFullName, IOpticsElementBas
}
return;
}
LensFlareUtil::CopyOptics(pOptics, pNewOptics);
}
SetFlareName(opticsFullName);
}
}
@@ -2040,19 +2023,8 @@ void CEntityObject::SetOpticsName(const QString& opticsFullName)
{
pLight->SetLensOpticsElement(NULL);
}
SetFlareName("");
SetMaterial(NULL);
}
else
{
if (GetOpticsElement())
{
if (gEnv->pOpticsManager->Rename(GetOpticsElement()->GetName(), opticsFullName.toUtf8().data()))
{
SetFlareName(opticsFullName);
}
}
}
}
//////////////////////////////////////////////////////////////////////////
@@ -2080,27 +2052,6 @@ CDLight* CEntityObject::GetLightProperty() const
return NULL;
}
//////////////////////////////////////////////////////////////////////////
bool CEntityObject::GetValidFlareName(QString& outFlareName) const
{
IVariable* pFlareVar(m_pProperties->FindVariable(s_LensFlarePropertyName));
if (!pFlareVar)
{
return false;
}
QString flareName;
pFlareVar->Get(flareName);
if (flareName.isEmpty() || flareName == "@root")
{
return false;
}
outFlareName = flareName;
return true;
}
//////////////////////////////////////////////////////////////////////////
void CEntityObject::PreInitLightProperty()
{
@@ -2108,42 +2059,6 @@ void CEntityObject::PreInitLightProperty()
{
return;
}
QString flareFullName;
if (GetValidFlareName(flareFullName))
{
bool bEnableOptics = GetEntityPropertyBool("bFlareEnable");
if (bEnableOptics)
{
CLensFlareManager* pLensManager = GetIEditor()->GetLensFlareManager();
CLensFlareLibrary* pLevelLib = (CLensFlareLibrary*)pLensManager->GetLevelLibrary();
IOpticsElementBasePtr pLevelOptics = pLevelLib->GetOpticsOfItem(flareFullName.toUtf8().data());
if (pLevelLib && pLevelOptics)
{
int nOpticsIndex(0);
IOpticsElementBasePtr pNewOptics = GetOpticsElement();
if (pNewOptics == NULL)
{
pNewOptics = gEnv->pOpticsManager->Create(eFT_Root);
}
if (gEnv->pOpticsManager->AddOptics(pNewOptics, flareFullName.toUtf8().data(), nOpticsIndex))
{
LensFlareUtil::CopyOptics(pLevelOptics, pNewOptics);
SetOpticsElement(pNewOptics);
}
else
{
CDLight* pLight = GetLightProperty();
if (pLight)
{
pLight->SetLensOpticsElement(NULL);
SetMaterial(NULL);
}
}
}
}
}
}
//////////////////////////////////////////////////////////////////////////
@@ -2153,26 +2068,6 @@ void CEntityObject::UpdateLightProperty()
{
return;
}
QString flareName;
if (GetValidFlareName(flareName))
{
IOpticsElementBasePtr pOptics = GetOpticsElement();
if (pOptics == NULL)
{
pOptics = gEnv->pOpticsManager->Create(eFT_Root);
}
bool bEnableOptics = GetEntityPropertyBool("bFlareEnable");
if (bEnableOptics && GetIEditor()->GetLensFlareManager()->LoadFlareItemByName(flareName, pOptics))
{
pOptics->SetName(flareName.toUtf8().data());
SetOpticsElement(pOptics);
}
else
{
SetOpticsElement(NULL);
}
}
}
//////////////////////////////////////////////////////////////////////////