Merge pull request #140 from aws-lumberyard-dev/Editor/RemoveLegacyMaterialEditor

[LYN-3070] Removed legacy Material Editor.
main
cgalvan 5 years ago committed by GitHub
commit 22cfe18601
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -126,7 +126,6 @@ AZ_POP_DISABLE_WARNING
#include "EditorPreferencesDialog.h"
#include "GraphicsSettingsDialog.h"
#include "FeedbackDialog/FeedbackDialog.h"
#include "MatEditMainDlg.h"
#include "AnimationContext.h"
#include "GotoPositionDlg.h"
@ -1898,14 +1897,6 @@ BOOL CCryEditApp::InitInstance()
CWipFeatureManager::Init();
#endif
if (GetIEditor()->IsInMatEditMode())
{
m_pMatEditDlg = new CMatEditMainDlg(QStringLiteral("Material Editor"));
m_pEditor->InitFinished();
m_pMatEditDlg->show();
return true;
}
if (!m_bConsoleMode && !m_bPreviewMode)
{
GetIEditor()->UpdateViews();

@ -28,7 +28,6 @@
class CCryDocManager;
class CQuickAccessBar;
class CMatEditMainDlg;
class CCryEditDoc;
class CEditCommandLineInfo;
class CMainFrame;
@ -367,7 +366,6 @@ private:
//! Autotest mode: Special mode meant for automated testing, things like blocking dialogs or error report windows won't appear
bool m_bAutotestMode = false;
CMatEditMainDlg* m_pMatEditDlg = nullptr;
CConsoleDialog* m_pConsoleDialog = nullptr;
AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING

@ -92,7 +92,6 @@ AZ_POP_DISABLE_WARNING
#include "TrackView/TrackViewDialog.h"
#include "ErrorReportDialog.h"
#include "Material/MaterialDialog.h"
#include "LensFlareEditor/LensFlareEditor.h"
#include "TimeOfDayDialog.h"
@ -1974,7 +1973,6 @@ void MainWindow::RegisterStdViewClasses()
if (!AZ::Interface<AzFramework::AtomActiveInterface>::Get())
{
CMaterialDialog::RegisterViewClass();
CLensFlareEditor::RegisterViewClass();
CTimeOfDayDialog::RegisterViewClass();
}

@ -1,110 +0,0 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
// Original file Copyright Crytek GMBH or its affiliates, used under license.
// Description : implementation file
#include "EditorDefs.h"
#include "MatEditMainDlg.h"
// Qt
#include <QVBoxLayout>
#include <QAbstractEventDispatcher>
// Editor
#include "Material/MaterialDialog.h"
#include "Material/MaterialManager.h"
#include "MaterialSender.h"
CMatEditMainDlg::CMatEditMainDlg(const QString& title, QWidget* pParent /*=NULL*/)
: QWidget(pParent)
{
resize(1000, 600);
setWindowTitle(title);
QTimer* t = new QTimer(this);
connect(t, &QTimer::timeout, this, &CMatEditMainDlg::OnKickIdle);
t->start(250);
m_materialDialog = new CMaterialDialog(); // must be created after the timer
auto layout = new QVBoxLayout(this);
layout->addWidget(m_materialDialog);
#ifdef Q_OS_WIN
if (auto aed = QAbstractEventDispatcher::instance())
{
aed->installNativeEventFilter(this);
}
#endif
}
CMatEditMainDlg::~CMatEditMainDlg()
{
#ifdef Q_OS_WIN
if (auto aed = QAbstractEventDispatcher::instance())
{
aed->removeNativeEventFilter(this);
}
#endif
}
/////////////////////////////////////////////////////////////////////////////
// CMatEditMainDlg message handlers
void CMatEditMainDlg::showEvent(QShowEvent*)
{
if (QWindow *win = window()->windowHandle())
{
// Make sure our top-level window decorator wrapper set this exact title
// 3ds Max Exporter will use ::FindWindow with this name
win->setTitle("Material Editor");
}
}
bool CMatEditMainDlg::nativeEventFilter(const QByteArray&, void* message, long*)
{
#ifdef Q_OS_WIN
// WM_MATEDITSEND is Windows only. Used by 3ds Max exporter.
MSG* msg = static_cast<MSG*>(message);
if (msg->message == WM_MATEDITSEND)
{
OnMatEditSend(msg->wParam);
return true;
}
#endif
return false;
}
void CMatEditMainDlg::closeEvent(QCloseEvent* event)
{
QWidget::closeEvent(event);
qApp->quit();
}
void CMatEditMainDlg::OnKickIdle()
{
GetIEditor()->Notify(eNotify_OnIdleUpdate);
}
void CMatEditMainDlg::OnMatEditSend(int param)
{
if (param != eMSM_Init)
{
GetIEditor()->GetMaterialManager()->SyncMaterialEditor();
}
}
#include <moc_MatEditMainDlg.cpp>

@ -1,48 +0,0 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
// Original file Copyright Crytek GMBH or its affiliates, used under license.
#ifndef CRYINCLUDE_EDITOR_MATEDITMAINDLG_H
#define CRYINCLUDE_EDITOR_MATEDITMAINDLG_H
#pragma once
#if !defined(Q_MOC_RUN)
#include <QWidget>
#include <QString>
#include <QAbstractNativeEventFilter>
#endif
class CMaterialDialog;
class CMatEditMainDlg
: public QWidget
, public QAbstractNativeEventFilter
{
Q_OBJECT
public:
explicit CMatEditMainDlg(const QString& title = QString(), QWidget* parent = nullptr);
~CMatEditMainDlg();
bool nativeEventFilter(const QByteArray& eventType, void* message, long* result) override;
protected:
void closeEvent(QCloseEvent* event) override;
void showEvent(QShowEvent* event) override;
private:
void OnKickIdle();
void OnMatEditSend(int param);
CMaterialDialog* m_materialDialog = nullptr;
};
#endif // CRYINCLUDE_EDITOR_MATEDITMAINDLG_H

File diff suppressed because it is too large Load Diff

@ -1,176 +0,0 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
// Original file Copyright Crytek GMBH or its affiliates, used under license.
#pragma once
#if !defined(Q_MOC_RUN)
#include "MaterialBrowser.h"
#include <QMainWindow>
#include <QPointer>
#include <QScopedPointer>
#endif
static const char* MATERIAL_EDITOR_NAME = "Material Editor";
static const char* MATERIAL_EDITOR_VER = "1.00";
class QComboBox;
class QLabel;
class CMaterial;
class CMaterialManager;
class CMatEditPreviewDlg;
class CMaterialSender;
class CMaterialImageListCtrl;
class QMaterialImageListModel;
class TwoColumnPropertyControl;
/** Dialog which hosts entity prototype library.
*/
struct SMaterialExcludedVars
{
CMaterial* pMaterial;
CVarBlock vars;
SMaterialExcludedVars()
: pMaterial(nullptr)
{
}
};
class CMaterialDialog
: public QMainWindow
, public IMaterialBrowserListener
, public IDataBaseManagerListener
, public IEditorNotifyListener
{
Q_OBJECT
public:
CMaterialDialog(QWidget* parent = 0);
~CMaterialDialog();
static void RegisterViewClass();
static const GUID& GetClassID();
public slots:
void OnAssignMaterialToSelection();
void OnResetMaterialOnSelection();
void OnGetMaterialFromSelection();
protected:
BOOL OnInitDialog();
void closeEvent(QCloseEvent *ev) override;
protected slots:
void OnAddItem();
void OnDeleteItem();
void OnSaveItem();
void OnPickMtl();
void OnCopy();
void OnPaste();
void OnMaterialPreview();
void OnSelectAssignedObjects();
void OnChangedBrowserListType(int);
void OnResetMaterialViewport();
void UpdateActions();
protected:
//////////////////////////////////////////////////////////////////////////
// Some functions can be overriden to modify standart functionality.
//////////////////////////////////////////////////////////////////////////
virtual void InitToolbar(UINT nToolbarResID);
virtual void SelectItem(CBaseLibraryItem* item, bool bForceReload = false);
virtual void DeleteItem(CBaseLibraryItem* pItem);
virtual bool SetItemName(CBaseLibraryItem* item, const QString& groupName, const QString& itemName);
virtual void ReloadItems();
//////////////////////////////////////////////////////////////////////////
// IMaterialBrowserListener implementation.
//////////////////////////////////////////////////////////////////////////
virtual void OnBrowserSelectItem(IDataBaseItem* pItem, bool bForce);
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
// IDataBaseManagerListener implementation.
//////////////////////////////////////////////////////////////////////////
virtual void OnDataBaseItemEvent(IDataBaseItem* pItem, EDataBaseItemEvent event);
//////////////////////////////////////////////////////////////////////////
// IEditorNotifyListener implementation.
virtual void OnEditorNotifyEvent(EEditorNotifyEvent event);
//////////////////////////////////////////////////////////////////////////
CMaterial* GetSelectedMaterial();
void OnUpdateProperties(IVariable* var);
void OnUndo(IVariable* pVar);
void UpdateShaderParamsUI(CMaterial* pMtl);
void UpdatePreview();
//void SetTextureVars( CVariableArray *texVar,CMaterial *mtl,int id,const CString &name );
void SetMaterialVars(CMaterial* mtl);
MaterialBrowserWidget* m_wndMtlBrowser;
QStatusBar* m_statusBar;
//CXTCaption m_wndCaption;
TwoColumnPropertyControl* m_propsCtrl;
bool m_bForceReloadPropsCtrl;
QLabel* m_placeHolderLabel;
CBaseLibraryItem* m_pPrevSelectedItem;
// Material manager.
CMaterialManager* m_pMatManager;
CVarBlockPtr m_vars;
CVarBlockPtr m_publicVars;
// collection of excluded vars from m_publicVars for remembering values
// when updating shader params
SMaterialExcludedVars m_excludedPublicVars;
CVarBlockPtr m_shaderGenParamsVars;
CVarBlockPtr m_textureSlots;
class CMaterialUI* m_pMaterialUI;
QPointer<CMatEditPreviewDlg> m_pPreviewDlg;
QScopedPointer<CMaterialImageListCtrl> m_pMaterialImageListCtrl;
QScopedPointer<QMaterialImageListModel> m_pMaterialImageListModel;
QToolBar* m_toolbar;
QComboBox* m_filterTypeSelection;
QAction* m_addAction;
QAction* m_assignToSelectionAction;
QAction* m_copyAction;
QAction* m_getFromSelectionAction;
QAction* m_pasteAction;
QAction* m_pickAction;
QAction* m_previewAction;
QAction* m_removeAction;
QAction* m_resetAction;
QAction* m_saveAction;
QAction* m_resetViewporAction;
};

@ -1,39 +1,4 @@
<RCC>
<qresource prefix="/MaterialDialog/ToolBar">
<file>images/materialdialog_add_disabled.png</file>
<file>images/materialdialog_copy_disabled.png</file>
<file>images/materialdialog_paste_disabled.png</file>
<file>images/materialdialog_preview_disabled.png</file>
<file>images/materialdialog_remove_disabled.png</file>
<file>images/materialdialog_save_disabled.png</file>
<file>images/materialdialog_assignselection_disabled.png</file>
<file>images/materialdialog_getfromselection_disabled.png</file>
<file>images/materialdialog_pick_disabled.png</file>
<file>images/materialdialog_reset_disabled.png</file>
<file>images/materialdialog_assignselection_active.png</file>
<file>images/materialdialog_assignselection_normal.png</file>
<file>images/materialdialog_add_active.png</file>
<file>images/materialdialog_add_normal.png</file>
<file>images/materialdialog_copy_active.png</file>
<file>images/materialdialog_copy_normal.png</file>
<file>images/materialdialog_getfromselection_active.png</file>
<file>images/materialdialog_getfromselection_normal.png</file>
<file>images/materialdialog_paste_active.png</file>
<file>images/materialdialog_paste_normal.png</file>
<file>images/materialdialog_pick_active.png</file>
<file>images/materialdialog_pick_normal.png</file>
<file>images/materialdialog_preview_active.png</file>
<file>images/materialdialog_preview_normal.png</file>
<file>images/materialdialog_remove_active.png</file>
<file>images/materialdialog_remove_normal.png</file>
<file>images/materialdialog_reset_active.png</file>
<file>images/materialdialog_reset_normal.png</file>
<file>images/materialdialog_save_active.png</file>
<file>images/materialdialog_save_normal.png</file>
<file>images/materialdialog_reset_viewport_active.png</file>
<file>images/materialdialog_reset_viewport_disabled.png</file>
<file>images/materialdialog_reset_viewport_normal.png</file>
</qresource>
<qresource prefix="/MaterialBrowser">
<file>images/material_browser_00.png</file>
<file>images/material_browser_01.png</file>

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:703f6875258486629bc1db68ce80fe1653f0d2876cd1252d03f72f6eae04dd84
size 392

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3f3c05f8425956e9c1e380fde9a65df8f0d341868900a3589d9f629f34a0ddf6
size 251

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:25554e93a4f0d9b904a2a3628c315ee55c0ad8831bb5891a9d7e27e5cb9a5416
size 261

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b2ee886c6e487a6490361609fdd44c64438e40c7e5a4c40fda866ec399ec4727
size 256

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:943ff19774cbe8d47c1e8001a48e6d137fdac2c0af63c9092911c37be0d6d6a8
size 471

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:400d669d7a658968549f6ee776ee415b871b207c444d8797a404b76d536131b1
size 325

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:02bdc8aad92bb75b118c4a703a3e5b1369376620b3836a125faedc7f6b42b49b
size 330

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:38097d3041defeec0179390a73bb463e54e7f4c1f0b1a20e77ab3f69ea9cf13c
size 332

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e1d9fe8e97655bf776b20e242d66900980721ba2f3ee93c02cd4062a8b872eed
size 433

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:468b68c44d8ef183b292c1bc6ca4dc583357f693db9ea2cd198fb2af22537be1
size 249

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b27a1346f2edebe34ee06d7892a467bfc67952d0f8e4458e09a74a6dbf62fe98
size 336

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c3f40524a96689b8c8549bc662415df654494baeeda6eed47e66b455ac902eeb
size 254

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cebe97de0d879d239fcd61595fd28b73760aa6452dcf4dabc54bfe034e2e33c1
size 476

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:699ee40aeedfc50b7766e94ef66e645762eb183ddd6ce134b4bdab01c3957ab9
size 327

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5f1fd8a7cecb22901c6d73f2e6129f3bada0f94cf73d9a8fd2676a972faa5719
size 348

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d432de9e921d23fbbf3c1b805f644b9554aa206011a87c063d167c30c7c4579e
size 335

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c006e70efd8bdb1dd5aac867db9d97de587e8d518ba0693d19c319e34a74c7d0
size 501

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:00c291361664d357502f5267fccd0a6fff0c3f2e906c0402d57ad9fa5ca7f023
size 255

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d68fc8604a23eb3bcc0cac9bb6e83dd4dc4cdab70b0bdaec3c456559727c6b5b
size 354

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4055c7f029d7711e5c32f3f74901bf1dcc1540fd2c0f3f30dc74743d7f2cc042
size 355

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:99e2c0378137bef94eb6f281e0168852540bf1ca823b9bcd4365ef2849db9956
size 420

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:34075016c93f1914fe4d12ead7c5ee322a18466f08a476eff7c127e4e1429224
size 290

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:dc289621f8a9d3e714cd985651d7d6f20495fb7be46e1f60c283d8920c730d0b
size 307

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7e9d5c878acf9fee4252cb854f192690d3f50d46dc4e5f5b1b5812b79fc2cdf7
size 296

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e2e912c40f07ca3d2a9b2aa1c5caf3acc181436b6a1b560fc021450701331b4c
size 403

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:00663e473803ba6c2798c494676b0a65fd62d7484f6d7b51d9fc8955ad586477
size 273

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:34b7d5520cfc8f00ff580558db4f0ec4297458d310321471204daa8678db5fc1
size 298

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7bca1a8811739949aa2e87486f8697dfae5bc5238894dd1b95ae80aa6f80d517
size 279

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:db86d857b651a2fec80418f8b251447bb3fcf4c0cf64bdee12c3b656adbde29a
size 422

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fef72444f077879d5c0186c9583f67aa45aafc23214d9e7de90a7c595609270f
size 258

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d2117fda3ed6a28032ae8f03ed7f9a7a0960f4691e49903c63b2150027dfe1ea
size 302

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:06b384ecc11ed2547a9bf466f585889d647c29a4883840070e444a382e80c41c
size 266

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4b9ee01e7fe2f19b0e736efe09c2b81d3243e369375b4f26346e6abd499e54a6
size 476

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:935a041332be1fe11ed01c09a3cd367fb9ede7e7eb04909614943f80e741d35f
size 334

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2b343233ab25a73fcdb4fff5509011497814fc4cb591065bdb3043a0f1092577
size 342

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1cc0183d7f57f15c4efeffb32795921f2f4e9c7965955fd0a392f826d5f6b6c8
size 337

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9a8467c1dcc343f637e0f7f5071a20b8881a43d567fb32fd96f5383f7b69bbb6
size 430

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0fd5ec79fc2c679f99ac5eb63d725f2cc815b09286bd0f3b5d2921eeb2e1e8cc
size 406

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3e19713b6586581d2336e833d8ecbd78b4b8f15b1c49a29d80acbf05e8aae3df
size 418

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4de0f4a102e5c4990d5d23e22b5cdd16532192f3a125758b608cd8c731278898
size 355

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d0b6f7c69112d124eac1123ffa840268c16148fef9ded3a67f84d3ad8d73eb96
size 212

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0b795fb88a6f301d7ecc9ce75141bdcf9e6dca25043730661aa4d1f09b055d6f
size 222

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:88fbce753cdd9381a814e3b2ec5d16df7cc26f2a37ad30b7010be71ae9183510
size 214

@ -316,8 +316,6 @@ set(FILES
Material/MaterialHelpers.cpp
Material/MaterialHelpers.h
Material/MaterialDialog.qrc
Material/MaterialDialog.cpp
Material/MaterialDialog.h
Material/MaterialPreviewModelView.cpp
Material/MaterialPreviewModelView.h
Material/PreviewModelView.cpp
@ -632,8 +630,6 @@ set(FILES
LensFlareEditor/LensFlareView.h
LogFileImpl.cpp
LogFileImpl.h
MatEditMainDlg.cpp
MatEditMainDlg.h
MatEditPreviewDlg.cpp
MatEditPreviewDlg.h
Material/MaterialBrowser.cpp

Loading…
Cancel
Save