Integrating latest from github/staging
Integrating up through commit 5e1bdae
This commit is contained in:
@@ -1,45 +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.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <AzQtComponents/Components/Widgets/Slider.h>
|
||||
#include <Viewport/InputController/MaterialEditorViewportInputController.h>
|
||||
#include <Source/Window/ToolBar/FovSliderWidget.h>
|
||||
|
||||
AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
AZ_POP_DISABLE_WARNING
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
FovSliderWidget::FovSliderWidget(QWidget* parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
QHBoxLayout* layout = new QHBoxLayout();
|
||||
m_label = new QLabel("Field of View");
|
||||
layout->addWidget(m_label);
|
||||
AzQtComponents::SliderInt* slider = new AzQtComponents::SliderInt(Qt::Orientation::Horizontal);
|
||||
slider->setRange(60, 120);
|
||||
connect(slider, &AzQtComponents::SliderInt::valueChanged, this, &FovSliderWidget::SliderValueChanged);
|
||||
slider->setValue(90);
|
||||
layout->addWidget(slider);
|
||||
setLayout(layout);
|
||||
}
|
||||
|
||||
void FovSliderWidget::SliderValueChanged(int value) const
|
||||
{
|
||||
m_label->setText(QString("Field of View (%1)").arg(value));
|
||||
MaterialEditorViewportInputControllerRequestBus::Broadcast(
|
||||
&MaterialEditorViewportInputControllerRequestBus::Handler::SetFieldOfView,
|
||||
aznumeric_cast<float>(value));
|
||||
}
|
||||
} // namespace MaterialEditor
|
||||
@@ -1,39 +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.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/PlatformDef.h>
|
||||
|
||||
AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT
|
||||
#include <QLabel>
|
||||
#include <QWidget>
|
||||
AZ_POP_DISABLE_WARNING
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
//! Widget for adjusting Field of View in viewport
|
||||
class FovSliderWidget
|
||||
: public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
FovSliderWidget(QWidget* parent = 0);
|
||||
~FovSliderWidget() = default;
|
||||
|
||||
private:
|
||||
QLabel* m_label;
|
||||
|
||||
private Q_SLOTS:
|
||||
void SliderValueChanged(int value) const;
|
||||
};
|
||||
} // namespace MaterialEditor
|
||||
+9
-10
@@ -13,12 +13,15 @@
|
||||
#include <Source/Window/ToolBar/MaterialEditorToolBar.h>
|
||||
#include <Source/Window/ToolBar/ModelPresetComboBox.h>
|
||||
#include <Source/Window/ToolBar/LightingPresetComboBox.h>
|
||||
#include <Source/Window/ToolBar/FovSliderWidget.h>
|
||||
#include <Atom/Document/MaterialEditorSettingsBus.h>
|
||||
#include <Atom/Viewport/MaterialViewportRequestBus.h>
|
||||
|
||||
#include <AzCore/std/containers/vector.h>
|
||||
#include <Atom/Viewport/MaterialViewportNotificationBus.h>
|
||||
|
||||
AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT
|
||||
#include <AzQtComponents/Components/Widgets/ToolBar.h>
|
||||
#include <QIcon>
|
||||
#include <QMenu>
|
||||
#include <QToolButton>
|
||||
#include <QAction>
|
||||
@@ -36,7 +39,7 @@ namespace MaterialEditor
|
||||
toggleGrid->setCheckable(true);
|
||||
connect(toggleGrid, &QAction::triggered, [this, toggleGrid]() {
|
||||
MaterialViewportRequestBus::Broadcast(&MaterialViewportRequestBus::Events::SetGridEnabled, toggleGrid->isChecked());
|
||||
});
|
||||
});
|
||||
bool enableGrid = false;
|
||||
MaterialViewportRequestBus::BroadcastResult(enableGrid, &MaterialViewportRequestBus::Events::GetGridEnabled);
|
||||
toggleGrid->setChecked(enableGrid);
|
||||
@@ -46,7 +49,7 @@ namespace MaterialEditor
|
||||
toggleShadowCatcher->setCheckable(true);
|
||||
connect(toggleShadowCatcher, &QAction::triggered, [this, toggleShadowCatcher]() {
|
||||
MaterialViewportRequestBus::Broadcast(&MaterialViewportRequestBus::Events::SetShadowCatcherEnabled, toggleShadowCatcher->isChecked());
|
||||
});
|
||||
});
|
||||
bool enableShadowCatcher = false;
|
||||
MaterialViewportRequestBus::BroadcastResult(enableShadowCatcher, &MaterialViewportRequestBus::Events::GetShadowCatcherEnabled);
|
||||
toggleShadowCatcher->setChecked(enableShadowCatcher);
|
||||
@@ -57,13 +60,13 @@ namespace MaterialEditor
|
||||
QMenu* toneMappingMenu = new QMenu(toneMappingButton);
|
||||
toneMappingMenu->addAction("None", [this]() {
|
||||
MaterialEditorSettingsRequestBus::Broadcast(&MaterialEditorSettingsRequests::SetStringProperty, "toneMapping", "None");
|
||||
});
|
||||
});
|
||||
toneMappingMenu->addAction("Gamma2.2", [this]() {
|
||||
MaterialEditorSettingsRequestBus::Broadcast(&MaterialEditorSettingsRequests::SetStringProperty, "toneMapping", "Gamma2.2");
|
||||
});
|
||||
});
|
||||
toneMappingMenu->addAction("ACES", [this]() {
|
||||
MaterialEditorSettingsRequestBus::Broadcast(&MaterialEditorSettingsRequests::SetStringProperty, "toneMapping", "ACES");
|
||||
});
|
||||
});
|
||||
toneMappingButton->setMenu(toneMappingMenu);
|
||||
toneMappingButton->setText("Tone Mapping");
|
||||
toneMappingButton->setIcon(QIcon(":/Icons/toneMapping.svg"));
|
||||
@@ -82,10 +85,6 @@ namespace MaterialEditor
|
||||
auto lightingPresetComboBox = new LightingPresetComboBox(this);
|
||||
lightingPresetComboBox->setSizeAdjustPolicy(QComboBox::SizeAdjustPolicy::AdjustToContents);
|
||||
addWidget(lightingPresetComboBox);
|
||||
|
||||
FovSliderWidget* fovSlider = new FovSliderWidget(this);
|
||||
fovSlider->setFixedWidth(250);
|
||||
addWidget(fovSlider);
|
||||
}
|
||||
} // namespace MaterialEditor
|
||||
|
||||
|
||||
Reference in New Issue
Block a user