Merge branch 'main' into cgalvan/EntityHelperRefactor

This commit is contained in:
Chris Galvan
2021-04-19 13:18:27 -05:00
1385 changed files with 16306 additions and 25761 deletions
@@ -578,16 +578,6 @@ namespace AzToolsFramework
*/
virtual bool IsEditorInIsolationMode() = 0;
/*!
* Get the engine root path that the current tool is running under.
*/
virtual const char* GetEngineRootPath() const = 0;
/**
* Get the version of the engine the current tools application is running under
*/
virtual const char* GetEngineVersion() const = 0;
/**
* Creates and adds a new entity to the tools application from components which match at least one of the requiredTags
* The tag matching occurs on AZ::Edit::SystemComponentTags attribute from the reflected class data in the serialization context
@@ -601,7 +591,7 @@ namespace AzToolsFramework
virtual ResolveToolPathOutcome ResolveConfigToolsPath(const char* toolApplicationName) const = 0;
/**
* LUMBERYARD INTERNAL USE ONLY.
* Open 3D Engine Internal use only.
*
* Run a specific redo command separate from the undo/redo system.
* In many cases before a modifcation on an entity takes place, it is first packaged into
@@ -92,7 +92,7 @@ namespace AzToolsFramework
namespace Internal
{
static const char* s_engineConfigFileName = "engine.json";
static const char* s_engineConfigEngineVersionKey = "LumberyardVersion";
static const char* s_engineConfigEngineVersionKey = "O3DEVersion";
static const char* s_startupLogWindow = "Startup";
@@ -224,112 +224,6 @@ namespace AzToolsFramework
} // Internal
#define AZ_MAX_ENGINE_VERSION_LEN 64
// Private Implementation class to manage the engine root and version
// Note: We are not using any AzCore classes because the ToolsApplication
// initialization happens early on, before the Allocators get instantiated,
// so we are using Qt privately instead
class ToolsApplication::EngineConfigImpl
{
private:
friend class ToolsApplication;
typedef QMap<QString, QString> EngineJsonMap;
EngineConfigImpl(const char* logWindow, const char* fileName)
: m_logWindow(logWindow)
, m_fileName(fileName)
{
m_engineRoot[0] = '\0';
m_engineVersion[0] = '\0';
}
char m_engineRoot[AZ_MAX_PATH_LEN];
char m_engineVersion[AZ_MAX_ENGINE_VERSION_LEN];
EngineJsonMap m_engineConfigMap;
const char* m_logWindow;
const char* m_fileName;
// Read an engine configuration into a map of key/value pairs
bool ReadEngineConfigIntoMap(QString engineJsonPath, EngineJsonMap& engineJsonMap)
{
QFile engineJsonFile(engineJsonPath);
if (!engineJsonFile.open(QIODevice::ReadOnly | QIODevice::Text))
{
AZ_Warning(m_logWindow, false, "Unable to open file '%s' in the current root directory", engineJsonPath.toUtf8().data());
return false;
}
QByteArray engineJsonData = engineJsonFile.readAll();
engineJsonFile.close();
QJsonDocument engineJsonDoc(QJsonDocument::fromJson(engineJsonData));
if (engineJsonDoc.isNull())
{
AZ_Warning(m_logWindow, false, "Unable to read file '%s' in the current root directory", engineJsonPath.toUtf8().data());
return false;
}
QJsonObject engineJsonRoot = engineJsonDoc.object();
for (const QString& configKey : engineJsonRoot.keys())
{
QJsonValue configValue = engineJsonRoot[configKey];
if (configValue.isString() || configValue.isDouble())
{
// Only map strings and numbers, ignore every other type
engineJsonMap[configKey] = configValue.toString();
}
else
{
AZ_Warning(m_logWindow, false, "Ignoring key '%s' from '%s', unsupported type.", configKey.toUtf8().data(), engineJsonPath.toUtf8().data());
}
}
return true;
}
// Initialize the engine config object based on the current
bool Initialize(const char* currentEngineRoot)
{
// Start with the app root as the engine root (legacy), but check to see if the engine root
// is external to the app root
azstrncpy(m_engineRoot, AZ_ARRAY_SIZE(m_engineRoot), currentEngineRoot, strlen(currentEngineRoot) + 1);
// From the appRoot, check and see if we can read any external engine reference in engine.json
QString engineJsonFileName = QString(m_fileName);
QString engineJsonFilePath = QDir(currentEngineRoot).absoluteFilePath(engineJsonFileName);
// From the appRoot, check and see if we can read any external engine reference in engine.json
if (!QFile::exists(engineJsonFilePath))
{
AZ_Warning(m_logWindow, false, "Unable to find '%s' in the current app root directory.", m_fileName);
return false;
}
if (!ReadEngineConfigIntoMap(engineJsonFilePath, m_engineConfigMap))
{
AZ_Warning(m_logWindow, false, "Defaulting root engine path to '%s'", currentEngineRoot);
return false;
}
// Read in the local engine version value
auto localEngineVersionValue = m_engineConfigMap.find(QString(AzToolsFramework::Internal::s_engineConfigEngineVersionKey));
QString localEngineVersion(localEngineVersionValue.value());
azstrncpy(m_engineVersion, AZ_ARRAY_SIZE(m_engineVersion), localEngineVersion.toUtf8().data(), localEngineVersion.length() + 1);
return true;
}
const char* GetEngineRoot() const
{
return m_engineRoot;
}
const char* GetEngineVersion() const
{
return m_engineVersion;
}
};
ToolsApplication::ToolsApplication(int* argc, char*** argv)
: AzFramework::Application(argc, argv)
, m_selectionBounds(AZ::Aabb())
@@ -339,7 +233,6 @@ namespace AzToolsFramework
, m_isInIsolationMode(false)
{
ToolsApplicationRequests::Bus::Handler::BusConnect();
m_engineConfigImpl.reset(new ToolsApplication::EngineConfigImpl(AzToolsFramework::Internal::s_startupLogWindow, AzToolsFramework::Internal::s_engineConfigFileName));
m_undoCache.RegisterToUndoCacheInterface();
}
@@ -391,7 +284,6 @@ namespace AzToolsFramework
void ToolsApplication::Start(const Descriptor& descriptor, const StartupParameters& startupParameters/* = StartupParameters()*/)
{
Application::Start(descriptor, startupParameters);
InitializeEngineConfig();
m_editorEntityManager.Start();
@@ -399,14 +291,6 @@ namespace AzToolsFramework
AZ_Assert(m_editorEntityAPI, "ToolsApplication - Could not retrieve instance of EditorEntityAPI");
}
void ToolsApplication::InitializeEngineConfig()
{
if (!m_engineConfigImpl->Initialize(GetEngineRoot()))
{
AZ_Warning(AzToolsFramework::Internal::s_startupLogWindow, false, "Defaulting engine root path to '%s'", GetEngineRoot());
}
}
void ToolsApplication::StartCommon(AZ::Entity* systemEntity)
{
Application::StartCommon(systemEntity);
@@ -1832,16 +1716,6 @@ namespace AzToolsFramework
return m_isInIsolationMode;
}
const char* ToolsApplication::GetEngineRootPath() const
{
return m_engineConfigImpl->GetEngineRoot();
}
const char* ToolsApplication::GetEngineVersion() const
{
return m_engineConfigImpl->GetEngineVersion();
}
void ToolsApplication::CreateAndAddEntityFromComponentTags(const AZStd::vector<AZ::Crc32>& requiredTags, const char* entityName)
{
if (!entityName || !entityName[0])
@@ -150,12 +150,10 @@ namespace AzToolsFramework
void EnterEditorIsolationMode() override;
void ExitEditorIsolationMode() override;
bool IsEditorInIsolationMode() override;
const char* GetEngineRootPath() const override;
const char* GetEngineVersion() const override;
void CreateAndAddEntityFromComponentTags(const AZStd::vector<AZ::Crc32>& requiredTags, const char* entityName) override;
/* LUMBERYARD INTERNAL USE ONLY. */
/* Open 3D Engine INTERNAL USE ONLY. */
void RunRedoSeparately(UndoSystem::URSequencePoint* redoCommand) override;
//////////////////////////////////////////////////////////////////////////
@@ -174,7 +172,6 @@ namespace AzToolsFramework
void CreateUndosForDirtyEntities();
void ConsistencyCheckUndoCache();
void InitializeEngineConfig();
AZ::Aabb m_selectionBounds;
EntityIdList m_selectedEntities;
EntityIdList m_highlightedEntities;
@@ -186,9 +183,6 @@ namespace AzToolsFramework
bool m_isInIsolationMode;
EntityIdSet m_isolatedEntityIdSet;
class EngineConfigImpl;
AZStd::unique_ptr<EngineConfigImpl> m_engineConfigImpl;
EditorEntityAPI* m_editorEntityAPI = nullptr;
EditorEntityManager m_editorEntityManager;
@@ -23,7 +23,7 @@
#include <AzToolsFramework/AssetBrowser/AssetPicker/AssetPickerDialog.h>
AZ_PUSH_DISABLE_WARNING(4251 4244, "-Wunknown-warning-option") // disable warnings spawned by QT
#include "AssetBrowser/AssetPicker/ui_AssetPickerDialog.h"
#include <AzToolsFramework/AssetBrowser/AssetPicker/ui_AssetPickerDialog.h>
#include <QPushButton>
#include <QDialogButtonBox>
#include <QKeyEvent>
@@ -17,7 +17,7 @@
// 4251: class needs to have dll-interface to be used by clients of class
// 4800: forcing value to bool 'true' or 'false' (performance warning)
AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option")
#include "AssetBrowser/Previewer/ui_EmptyPreviewer.h"
#include <AzToolsFramework/AssetBrowser/Previewer/ui_EmptyPreviewer.h>
AZ_POP_DISABLE_WARNING
namespace AzToolsFramework
@@ -45,4 +45,4 @@ namespace AzToolsFramework
}
}
#include <AssetBrowser/Previewer/moc_EmptyPreviewer.cpp>
#include <AssetBrowser/Previewer/moc_EmptyPreviewer.cpp>
@@ -11,7 +11,7 @@
*/
#include <AzQtComponents/Components/ExtendedLabel.h>
AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // 4251: class 'QFlags<Qt::AlignmentFlag>' needs to have dll-interface to be used by clients of class 'QLayoutItem'
#include <AssetBrowser/Search/ui_FilterByWidget.h>
#include <AzToolsFramework/AssetBrowser/Search/ui_FilterByWidget.h>
AZ_POP_DISABLE_WARNING
#include <AzToolsFramework/AssetBrowser/Search/FilterByWidget.h>
@@ -39,4 +39,4 @@ namespace AzToolsFramework
} // namespace AssetBrowser
} // namespace AzToolsFramework
#include "AssetBrowser/Search/moc_FilterByWidget.cpp"
#include "AssetBrowser/Search/moc_FilterByWidget.cpp"
@@ -18,7 +18,7 @@
#include <AzToolsFramework/AssetBrowser/Search/FilterByWidget.h>
AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // 4251: 'QLayoutItem::align': class 'QFlags<Qt::AlignmentFlag>' needs to have dll-interface to be used by clients of class 'QLayoutItem'
#include <AssetBrowser/Search/ui_SearchAssetTypeSelectorWidget.h>
#include <AzToolsFramework/AssetBrowser/Search/ui_SearchAssetTypeSelectorWidget.h>
AZ_POP_DISABLE_WARNING
#include <QPushButton>
@@ -154,4 +154,4 @@ namespace AzToolsFramework
} // namespace AssetBrowser
} // namespace AzToolsFramework
#include "AssetBrowser/Search/moc_SearchAssetTypeSelectorWidget.cpp"
#include "AssetBrowser/Search/moc_SearchAssetTypeSelectorWidget.cpp"
@@ -12,7 +12,7 @@
#include "SearchParametersWidget.h"
AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // 4251: 'QLayoutItem::align': class 'QFlags<Qt::AlignmentFlag>' needs to have dll-interface to be used by clients of class 'QLayoutItem'
#include "AssetBrowser/Search/ui_SearchParametersWidget.h"
#include <AzToolsFramework/AssetBrowser/Search/ui_SearchParametersWidget.h>
AZ_POP_DISABLE_WARNING
#include <AzQtComponents/Components/ExtendedLabel.h>
@@ -68,4 +68,4 @@ namespace AzToolsFramework
} // namespace AssetBrowser
} // namespace AzToolsFramework
#include "AssetBrowser/Search/moc_SearchParametersWidget.cpp"
#include "AssetBrowser/Search/moc_SearchParametersWidget.cpp"
@@ -54,7 +54,7 @@ namespace AzToolsFramework
//! Set unique asset browser name, used to persist tree expansion states
void SetName(const QString& name);
// LUMBERYARD_DEPRECATED
// O3DE_DEPRECATED
void LoadState(const QString& name);
void SaveState() const;
@@ -19,9 +19,9 @@
#include <AssetEditor/AssetEditorBus.h>
#include <AssetEditor/AssetEditorHeader.h>
AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // 'QLayoutItem::align': class 'QFlags<Qt::AlignmentFlag>' needs to have dll-interface to be used by clients of class 'QLayoutItem'
#include <AssetEditor/ui_AssetEditorToolbar.h>
#include <AzToolsFramework/AssetEditor/ui_AssetEditorToolbar.h>
AZ_POP_DISABLE_WARNING
#include <AssetEditor/ui_AssetEditorStatusBar.h>
#include <AzToolsFramework/AssetEditor/ui_AssetEditorStatusBar.h>
#include <AssetBrowser/AssetSelectionModel.h>
@@ -256,6 +256,8 @@ namespace AzToolsFramework
m_userSettings = AZ::UserSettings::CreateFind<AssetEditorWidgetUserSettings>(k_assetEditorWidgetSettings, AZ::UserSettings::CT_LOCAL);
UpdateRecentFileListState();
QObject::connect(m_recentFileMenu, &QMenu::aboutToShow, this, &AssetEditorWidget::PopulateRecentMenu);
}
@@ -952,7 +954,8 @@ namespace AzToolsFramework
void AssetEditorWidget::AddRecentPath(const AZStd::string& recentPath)
{
m_userSettings->AddRecentPath(recentPath);
m_userSettings->AddRecentPath(recentPath);
UpdateRecentFileListState();
}
void AssetEditorWidget::PopulateRecentMenu()
@@ -989,6 +992,21 @@ namespace AzToolsFramework
m_saveAsAssetAction->setEnabled(true);
}
void AssetEditorWidget::UpdateRecentFileListState()
{
if (m_recentFileMenu)
{
if (!m_userSettings || m_userSettings->m_recentPaths.empty())
{
m_recentFileMenu->setEnabled(false);
}
else
{
m_recentFileMenu->setEnabled(true);
}
}
}
} // namespace AssetEditor
} // namespace AzToolsFramework
@@ -122,6 +122,8 @@ namespace AzToolsFramework
void OnCatalogAssetAdded(const AZ::Data::AssetId& assetId) override;
void OnCatalogAssetRemoved(const AZ::Data::AssetId& assetId, const AZ::Data::AssetInfo& assetInfo) override;
void UpdateRecentFileListState();
private:
void DirtyAsset();
@@ -707,7 +707,7 @@ namespace AzToolsFramework
{
QMessageBox::warning(AzToolsFramework::GetActiveWindow(),
QStringLiteral("Can't instantiate the selected slice"),
QString("The slice may contain UI elements that can't be instantiated in the main Lumberyard editor. "
QString("The slice may contain UI elements that can't be instantiated in the main Open 3D Engine editor. "
"Use the UI Editor to instantiate this slice or select another one."),
QMessageBox::Ok);
}
@@ -89,7 +89,7 @@ namespace AzToolsFramework
const AzFramework::CameraState& cameraState,
const ViewportInteraction::MouseInteraction& mouseInteraction);
// LUMBERYARD_DEPRECATED(LY-117150)
// O3DE_DEPRECATED(LY-117150)
/// Check if the modifier key state has changed - if so we may need to refresh
/// certain manipulator bounds.
AZ_DEPRECATED(
@@ -31,7 +31,7 @@ namespace AzToolsFramework
class InstanceEntityScrubber
{
public:
AZ_RTTI(InstanceEntityScrubber, "{0BC12562-C240-48AD-89C6-EDF572C9B485}");
AZ_TYPE_INFO(InstanceEntityScrubber, "{0BC12562-C240-48AD-89C6-EDF572C9B485}");
explicit InstanceEntityScrubber(Instance::EntityList& entities);
@@ -219,11 +219,10 @@ namespace AzToolsFramework
entitiesInInstance.emplace_back(entity.get());
}
InstanceEntityScrubber** instanceEntityScrubber = jsonDeserializerContext.GetMetadata().Find<InstanceEntityScrubber*>();
if (instanceEntityScrubber && (*instanceEntityScrubber))
InstanceEntityScrubber* instanceEntityScrubber = jsonDeserializerContext.GetMetadata().Find<InstanceEntityScrubber>();
if (instanceEntityScrubber)
{
(*instanceEntityScrubber)->AddEntitiesToScrub(entitiesInInstance);
instanceEntityScrubber->AddEntitiesToScrub(entitiesInInstance);
}
}
@@ -10,6 +10,7 @@
*
*/
#include <AzCore/Asset/AssetManager.h>
#include <AzCore/JSON/prettywriter.h>
#include <AzCore/Serialization/Json/JsonSerialization.h>
#include <AzToolsFramework/Entity/EditorEntityContextBus.h>
@@ -78,6 +79,11 @@ namespace AzToolsFramework
bool LoadInstanceFromPrefabDom(Instance& instance, const PrefabDom& prefabDom, LoadInstanceFlags flags)
{
// When entities are rebuilt they are first destroyed. As a result any assets they were exclusively holding on to will
// be released and reloaded once the entities are built up again. By suspending asset release temporarily the asset reload
// is avoided.
AZ::Data::AssetManager::Instance().SuspendAssetRelease();
InstanceEntityIdMapper entityIdMapper;
entityIdMapper.SetLoadingInstance(instance);
if ((flags & LoadInstanceFlags::AssignRandomEntityId) == LoadInstanceFlags::AssignRandomEntityId)
@@ -91,10 +97,12 @@ namespace AzToolsFramework
// data has strict typing and doesn't look for inheritance both have to be explicitly added so they're found both locations.
settings.m_metadata.Add(static_cast<AZ::JsonEntityIdSerializer::JsonEntityIdMapper*>(&entityIdMapper));
settings.m_metadata.Add(&entityIdMapper);
AZ::JsonSerializationResult::ResultCode result =
AZ::JsonSerialization::Load(instance, prefabDom, settings);
AZ::Data::AssetManager::Instance().ResumeAssetRelease();
if (result.GetProcessing() == AZ::JsonSerializationResult::Processing::Halted)
{
AZ_Error("Prefab", false,
@@ -110,6 +118,11 @@ namespace AzToolsFramework
bool LoadInstanceFromPrefabDom(
Instance& instance, Instance::EntityList& newlyAddedEntities, const PrefabDom& prefabDom, LoadInstanceFlags flags)
{
// When entities are rebuilt they are first destroyed. As a result any assets they were exclusively holding on to will
// be released and reloaded once the entities are built up again. By suspending asset release temporarily the asset reload
// is avoided.
AZ::Data::AssetManager::Instance().SuspendAssetRelease();
InstanceEntityIdMapper entityIdMapper;
entityIdMapper.SetLoadingInstance(instance);
if ((flags & LoadInstanceFlags::AssignRandomEntityId) == LoadInstanceFlags::AssignRandomEntityId)
@@ -123,12 +136,12 @@ namespace AzToolsFramework
// data has strict typing and doesn't look for inheritance both have to be explicitly added so they're found both locations.
settings.m_metadata.Add(static_cast<AZ::JsonEntityIdSerializer::JsonEntityIdMapper*>(&entityIdMapper));
settings.m_metadata.Add(&entityIdMapper);
InstanceEntityScrubber instanceEntityScrubber(newlyAddedEntities);
settings.m_metadata.Add(&instanceEntityScrubber);
settings.m_metadata.Create<InstanceEntityScrubber>(newlyAddedEntities);
AZ::JsonSerializationResult::ResultCode result = AZ::JsonSerialization::Load(instance, prefabDom, settings);
AZ::Data::AssetManager::Instance().ResumeAssetRelease();
if (result.GetProcessing() == AZ::JsonSerializationResult::Processing::Halted)
{
AZ_Error(
@@ -58,7 +58,7 @@ namespace AzToolsFramework
m_prefabUndoCache.Destroy();
}
PrefabOperationResult PrefabPublicHandler::CreatePrefab(const AZStd::vector<AZ::EntityId>& entityIds, AZStd::string_view filePath)
PrefabOperationResult PrefabPublicHandler::CreatePrefab(const AZStd::vector<AZ::EntityId>& entityIds, AZ::IO::PathView filePath)
{
// Retrieve entityList from entityIds
EntityList inputEntityList = EntityIdListToEntityList(entityIds);
@@ -42,7 +42,7 @@ namespace AzToolsFramework
void UnregisterPrefabPublicHandlerInterface();
// PrefabPublicInterface...
PrefabOperationResult CreatePrefab(const AZStd::vector<AZ::EntityId>& entityIds, AZStd::string_view filePath) override;
PrefabOperationResult CreatePrefab(const AZStd::vector<AZ::EntityId>& entityIds, AZ::IO::PathView filePath) override;
PrefabOperationResult InstantiatePrefab(AZStd::string_view filePath, AZ::EntityId parent, AZ::Vector3 position) override;
PrefabOperationResult SavePrefab(AZ::IO::Path filePath) override;
PrefabEntityResult CreateEntity(AZ::EntityId parentId, const AZ::Vector3& position) override;
@@ -49,7 +49,7 @@ namespace AzToolsFramework
* @param filePath The path for the new prefab file.
* @return An outcome object; on failure, it comes with an error message detailing the cause of the error.
*/
virtual PrefabOperationResult CreatePrefab(const AZStd::vector<AZ::EntityId>& entityIds, AZStd::string_view filePath) = 0;
virtual PrefabOperationResult CreatePrefab(const AZStd::vector<AZ::EntityId>& entityIds, AZ::IO::PathView filePath) = 0;
/**
* Instantiate a prefab from a prefab file.
@@ -2662,7 +2662,7 @@ namespace AzToolsFramework
QString cleanAssetSafeFolder(QDir::cleanPath(assetSafeFolder.c_str()));
// Compare using clean paths so slash direction does not matter.
// Note that this comparison is case sensitive because some file systems
// Lumberyard supports are case sensitive.
// Open 3D Engine supports are case sensitive.
if (cleanSaveAs.startsWith(cleanAssetSafeFolder))
{
isPathSafeForAssets = true;
@@ -4017,8 +4017,8 @@ namespace AzToolsFramework
// Detach entities action currently acts on entities and all descendants, so include those as part of the selection
AzToolsFramework::EntityIdList selectedDetachEntities(selectedTransformHierarchyEntities.begin(), selectedTransformHierarchyEntities.end());
// A selection in Lumberyard is usually singular, but a selection can have more than one entity.
// No Lumberyard systems support multiple selections, or multiple different groups of selected entities.
// A selection in Open 3D Engine is usually singular, but a selection can have more than one entity.
// No Open 3D Engine systems support multiple selections, or multiple different groups of selected entities.
QString detachEntitiesActionText(QObject::tr("Selection"));
QString detachEntitiesTooltipText;
if (selectedDetachEntities.size() == 1)
@@ -71,7 +71,7 @@ namespace AzToolsFramework
AZ_Assert(!s_perforceConn, "You may only have one Perforce component.\n");
m_shutdownThreadSignal = false;
m_waitingOnTrust = false;
m_autoChangelistDescription = "*Lumberyard Auto";
m_autoChangelistDescription = "*Open 3D Engine Auto";
m_connectionState = SourceControlState::Disabled;
m_validConnection = false;
m_testConnection = false;
@@ -24,7 +24,7 @@ namespace AzToolsFramework
{
QString ComponentTypeMimeData::GetMimeType()
{
return "application/x-amazon-lumberyard-editorcomponenttypes";
return "application/x-amazon-o3de-editorcomponenttypes";
}
AZStd::unique_ptr<QMimeData> ComponentTypeMimeData::Create(const ClassDataContainer& container)
@@ -99,7 +99,7 @@ namespace AzToolsFramework
QString ComponentMimeData::GetMimeType()
{
return "application/x-amazon-lumberyard-editorcomponentdata";
return "application/x-amazon-o3de-editorcomponentdata";
}
AZStd::unique_ptr<QMimeData> ComponentMimeData::Create(const ComponentDataContainer& components)
@@ -15,7 +15,7 @@
* Header file for the editor component base class.
* Derive from this class to create a version of a component to use in the
* editor, as opposed to the version of the component that is used during run time.
* To learn more about editor components, see the [Lumberyard Developer Guide]
* To learn more about editor components, see the [Open 3D Engine Developer Guide]
* (http://docs.aws.amazon.com/lumberyard/latest/developerguide/component-entity-system-pg-editor-components.html).
*/
@@ -52,7 +52,7 @@ namespace AzToolsFramework
* To create one or more game components to represent your editor component
* in runtime, use BuildGameEntity().
*
* To learn more about editor components, see the [Lumberyard Developer Guide]
* To learn more about editor components, see the [Open 3D Engine Developer Guide]
* (http://docs.aws.amazon.com/lumberyard/latest/developerguide/component-entity-system-pg-editor-components.html).
*/
class EditorComponentBase
@@ -408,7 +408,7 @@ namespace AzToolsFramework
QString fullLayerPath(layerFolder.filePath(myLayerFileName));
// Lumberyard will read in the layer in whatever format it's in, so there's no need to check what the save format is set to.
// Open 3D Engine will read in the layer in whatever format it's in, so there's no need to check what the save format is set to.
// The save format is also set in this object that is being loaded, so it wouldn't even be available.
m_loadedLayer = AZ::Utils::LoadObjectFromFile<EditorLayer>(fullLayerPath.toUtf8().data());
@@ -1051,7 +1051,6 @@ namespace AzToolsFramework
currentFailure));
// FileIO doesn't support removing directory, so use Qt.
// QDir::IsEmpty isn't available until a newer version fo Qt than Lumberyard is using.
if (layerTempFolder.entryInfoList(
QDir::NoDotAndDotDot | QDir::AllEntries | QDir::System | QDir::Hidden).count() == 0)
{
@@ -1485,7 +1484,7 @@ namespace AzToolsFramework
if (!newLayerEntityId.IsValid())
{
return LayerResult(LayerResultStatus::Error, "Lumberyard was unable to create a layer entity.");
return LayerResult(LayerResultStatus::Error, "Open 3D Engine was unable to create a layer entity.");
}
// If this new layer has a parent, then set its parent.
@@ -58,7 +58,7 @@ namespace AzToolsFramework
AZ::Color m_color = AZ::Color::CreateOne();
// Default to text files, so the save history is easier to understand in source control.
// This attribute only effects writing layers, and is safe to store here instead of on the component.
// When reading files off disk, Lumberyard figures out the correct format automatically.
// When reading files off disk, Open 3D Engine figures out the correct format automatically.
bool m_saveAsBinary = false;
// The layer entity needs to be invisible to all other systems, so they don't show up in the viewport.
@@ -338,7 +338,7 @@ namespace AzToolsFramework
EditorLayer* m_loadedLayer = nullptr;
AZStd::string m_layerFileName;
// Lumberyard's serialization system requires everything in the editor to have a serialized to disk counterpart.
// Open 3D Engine's serialization system requires everything in the editor to have a serialized to disk counterpart.
// Layers have their data split into two categories: Stuff that should save to the layer file, and stuff that should
// save to the layer component in the level. To allow the layer component to edit the data that goes in the layer file,
// a placeholder value is serialized. This is only used at edit time, and is copied and cleared during serialization.
@@ -13,6 +13,7 @@
#include <AzToolsFramework/ToolsComponents/EditorNonUniformScaleComponent.h>
#include <AzCore/Serialization/EditContext.h>
#include <AzFramework/Components/NonUniformScaleComponent.h>
#include <AzCore/Math/Transform.h>
#include <AzCore/Math/ToString.h>
namespace AzToolsFramework
@@ -44,7 +45,9 @@ namespace AzToolsFramework
->DataElement(
AZ::Edit::UIHandlers::Default, &EditorNonUniformScaleComponent::m_scale, "Non-uniform Scale",
"Non-uniform scale for this entity only (does not propagate through hierarchy)")
->Attribute(AZ::Edit::Attributes::Min, AZ::MinNonUniformScale)
->Attribute(AZ::Edit::Attributes::Min, AZ::MinTransformScale)
->Attribute(AZ::Edit::Attributes::Max, AZ::MaxTransformScale)
->Attribute(AZ::Edit::Attributes::Step, 0.1f)
->Attribute(AZ::Edit::Attributes::ChangeNotify, &EditorNonUniformScaleComponent::OnScaleChanged)
;
}
@@ -106,13 +109,13 @@ namespace AzToolsFramework
void EditorNonUniformScaleComponent::SetScale(const AZ::Vector3& scale)
{
if (scale.GetMinElement() >= AZ::MinNonUniformScale)
if (scale.GetMinElement() >= AZ::MinTransformScale && scale.GetMaxElement() <= AZ::MaxTransformScale)
{
m_scale = scale;
}
else
{
AZ::Vector3 clampedScale = scale.GetMax(AZ::Vector3(AZ::MinNonUniformScale));
AZ::Vector3 clampedScale = scale.GetClamp(AZ::Vector3(AZ::MinTransformScale), AZ::Vector3(AZ::MaxTransformScale));
AZ_Warning("Editor Non-uniform Scale Component", false, "SetScale value was clamped from %s to %s for entity %s",
AZ::ToString(scale).c_str(), AZ::ToString(clampedScale).c_str(), GetEntity()->GetName().c_str());
m_scale = clampedScale;
@@ -1276,7 +1276,6 @@ namespace AzToolsFramework
Attribute(AZ::Edit::Attributes::SliceFlags, AZ::Edit::SliceFlags::NotPushableOnSliceRoot)->
DataElement(TransformScaleHandler, &EditorTransform::m_scale, "Scale", "Local Scale")->
Attribute(AZ::Edit::Attributes::Step, 0.1f)->
Attribute(AZ::Edit::Attributes::Min, 0.01f)->
Attribute(AZ::Edit::Attributes::ReadOnly, &EditorTransform::m_locked)
;
}
@@ -12,6 +12,7 @@
#include "AzToolsFramework_precompiled.h"
#include <ToolsComponents/TransformScalePropertyHandler.h>
#include <AzCore/Math/Transform.h>
#include <AzCore/Math/Vector3.h>
namespace AzToolsFramework
@@ -36,8 +37,8 @@ namespace AzToolsFramework
AzToolsFramework::PropertyEditorGUIMessages::Bus::Broadcast(&AzToolsFramework::PropertyEditorGUIMessages::RequestWrite, newCtrl);
});
newCtrl->setMinimum(0.01f);
newCtrl->setMaximum(std::numeric_limits<float>::max());
newCtrl->setMinimum(AZ::MinTransformScale);
newCtrl->setMaximum(AZ::MaxTransformScale);
return newCtrl;
}
@@ -112,7 +112,6 @@ namespace LegacyFramework
m_applicationEntity = NULL;
m_ptrSystemEntity = NULL;
m_applicationModule[0] = 0;
m_appRoot[0] = 0;
}
HMODULE Application::GetMainModule()
@@ -16,7 +16,7 @@
#include "NewLogTabDialog.h"
AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // 4251: 'QLayoutItem::align': class 'QFlags<Qt::AlignmentFlag>' needs to have dll-interface to be used by clients of class 'QLayoutItem'
#include <UI/Logging/ui_NewLogTabDialog.h>
#include <AzToolsFramework/UI/Logging/ui_NewLogTabDialog.h>
AZ_POP_DISABLE_WARNING
#include <QPushButton>
#include <QLineEdit>
@@ -97,4 +97,4 @@ namespace AzToolsFramework
} // namespace LogPanel
} // namespace AzToolsFramework
#include "UI/Logging/moc_NewLogTabDialog.cpp"
#include "UI/Logging/moc_NewLogTabDialog.cpp"
@@ -49,7 +49,7 @@
#include <QTimer>
#include <QToolButton>
#include <UI/Outliner/ui_EntityOutlinerWidget.h>
#include <AzToolsFramework/UI/Outliner/ui_EntityOutlinerWidget.h>
namespace
{
@@ -24,6 +24,7 @@
#include <AzToolsFramework/AssetBrowser/AssetBrowserBus.h>
#include <AzToolsFramework/AssetBrowser/AssetSelectionModel.h>
#include <AzToolsFramework/AssetBrowser/Entries/SourceAssetBrowserEntry.h>
#include <AzToolsFramework/Prefab/PrefabLoaderInterface.h>
#include <AzToolsFramework/ToolsComponents/EditorLayerComponentBus.h>
#include <AzToolsFramework/UI/EditorEntityUi/EditorEntityUiInterface.h>
#include <AzToolsFramework/UI/Prefab/PrefabIntegrationInterface.h>
@@ -39,9 +40,12 @@ namespace AzToolsFramework
{
namespace Prefab
{
EditorEntityUiInterface* PrefabIntegrationManager::s_editorEntityUiInterface = nullptr;
PrefabPublicInterface* PrefabIntegrationManager::s_prefabPublicInterface = nullptr;
PrefabEditInterface* PrefabIntegrationManager::s_prefabEditInterface = nullptr;
PrefabLoaderInterface* PrefabIntegrationManager::s_prefabLoaderInterface = nullptr;
const AZStd::string PrefabIntegrationManager::s_prefabFileExtension = ".prefab";
void PrefabUserSettings::Reflect(AZ::ReflectContext* context)
@@ -79,6 +83,13 @@ namespace AzToolsFramework
return;
}
s_prefabLoaderInterface = AZ::Interface<PrefabLoaderInterface>::Get();
if (s_prefabLoaderInterface == nullptr)
{
AZ_Assert(false, "Prefab - could not get PrefabLoaderInterface on PrefabIntegrationManager construction.");
return;
}
EditorContextMenuBus::Handler::BusConnect();
PrefabInstanceContainerNotificationBus::Handler::BusConnect();
AZ::Interface<PrefabIntegrationInterface>::Register(this);
@@ -320,14 +331,15 @@ namespace AzToolsFramework
GenerateSuggestedFilenameFromEntities(prefabRootEntities, suggestedName);
if (!QueryUserForPrefabSaveLocation(suggestedName, targetDirectory, AZ_CRC("PrefabUserSettings"), activeWindow, prefabName, prefabFilePath))
if (!QueryUserForPrefabSaveLocation(
suggestedName, targetDirectory, AZ_CRC("PrefabUserSettings"), activeWindow, prefabName, prefabFilePath))
{
// User canceled prefab creation, or error prevented continuation.
return;
}
}
auto createPrefabOutcome = s_prefabPublicInterface->CreatePrefab(selectedEntities, prefabFilePath);
auto createPrefabOutcome = s_prefabPublicInterface->CreatePrefab(selectedEntities, s_prefabLoaderInterface->GetRelativePathToProject(prefabFilePath.data()));
if (!createPrefabOutcome.IsSuccess())
{
@@ -644,7 +656,7 @@ namespace AzToolsFramework
QString cleanAssetSafeFolder(QDir::cleanPath(assetSafeFolder.c_str()));
// Compare using clean paths so slash direction does not matter.
// Note that this comparison is case sensitive because some file systems
// Lumberyard supports are case sensitive.
// Open 3D Engine supports are case sensitive.
if (cleanSaveAs.startsWith(cleanAssetSafeFolder))
{
isPathSafeForAssets = true;
@@ -29,6 +29,9 @@ namespace AzToolsFramework
{
namespace Prefab
{
class PrefabLoaderInterface;
//! Structure for saving/retrieving user settings related to prefab workflows.
class PrefabUserSettings
: public AZ::UserSettings
@@ -129,6 +132,7 @@ namespace AzToolsFramework
static EditorEntityUiInterface* s_editorEntityUiInterface;
static PrefabPublicInterface* s_prefabPublicInterface;
static PrefabEditInterface* s_prefabEditInterface;
static PrefabLoaderInterface* s_prefabLoaderInterface;
};
}
}
@@ -100,7 +100,7 @@ AZ_PUSH_DISABLE_WARNING(4244 4251 4800, "-Wunknown-warning-option") // 4244: con
#include <QTimer>
AZ_POP_DISABLE_WARNING
#include <UI/PropertyEditor/ui_EntityPropertyEditor.h>
#include <AzToolsFramework/UI/PropertyEditor/ui_EntityPropertyEditor.h>
// This has to live outside of any namespaces due to issues on Linux with calls to Q_INIT_RESOURCE if they are inside a namespace
void initEntityPropertyEditorResources()
@@ -32,7 +32,7 @@
#include <AzToolsFramework/Entity/EditorEntityContextBus.h>
#include <AzToolsFramework/ToolsComponents/ComponentMimeData.h>
#include <AzToolsFramework/ToolsComponents/EditorInspectorComponentBus.h>
#include <AzQtComponents/Components/LumberyardStylesheet.h>
#include <AzQtComponents/Components/O3DEStylesheet.h>
#include <QtWidgets/QWidget>
#include <QtGui/QIcon>
@@ -38,6 +38,7 @@ AZ_POP_DISABLE_WARNING
#include <AzCore/Asset/AssetManager.h>
#include <AzCore/Component/ComponentApplicationBus.h>
#include <AzCore/Asset/AssetTypeInfoBus.h>
#include <AzCore/Utils/Utils.h>
#include <AzFramework/StringFunc/StringFunc.h>
#include <AzFramework/Asset/SimpleAsset.h>
#include <AzFramework/Asset/AssetCatalogBus.h>
@@ -1212,9 +1213,8 @@ namespace AzToolsFramework
if (!QFile::exists(path))
{
const char* engineRoot = nullptr;
AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(engineRoot, &AzToolsFramework::ToolsApplicationRequests::GetEngineRootPath);
QDir engineDir = engineRoot ? QDir(engineRoot) : QDir::current();
AZ::IO::FixedMaxPathString engineRoot = AZ::Utils::GetEnginePath();
QDir engineDir = !engineRoot.empty() ? QDir(QString(engineRoot.c_str())) : QDir::current();
path = engineDir.absoluteFilePath(iconPath.c_str());
}
@@ -89,7 +89,7 @@ namespace AzToolsFramework
//! When set, disables data access for this property editor.
//! This prevents any value refreshes from the inspected values from occurring as well as disabling user input.
void PreventDataAccess(bool shouldPrevent);
// LUMBERYARD_DEPRECATED(LY-120821)
// O3DE_DEPRECATED(LY-120821)
void PreventRefresh(bool shouldPrevent){PreventDataAccess(shouldPrevent);}
void SetAutoResizeLabels(bool autoResizeLabels);
@@ -11,7 +11,7 @@
*/
#include "AzToolsFramework_precompiled.h"
AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // 4251: 'QLayoutItem::align': class 'QFlags<Qt::AlignmentFlag>' needs to have dll-interface to be used by clients of class 'QLayoutItem'
#include "UI/Slice/ui_NotificationWindow.h"
#include <AzToolsFramework/UI/Slice/ui_NotificationWindow.h>
AZ_POP_DISABLE_WARNING
#include "UI/Slice/Constants.h"
@@ -14,7 +14,7 @@
#include "OverwritePromptDialog.hxx"
AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // 'QLayoutItem::align': class 'QFlags<Qt::AlignmentFlag>' needs to have dll-interface to be used by clients of class 'QLayoutItem'
#include <UI/UICore/ui_OverwritePromptDialog.h>
#include <AzToolsFramework/UI/UICore/ui_OverwritePromptDialog.h>
AZ_POP_DISABLE_WARNING
namespace AzToolsFramework
@@ -54,4 +54,4 @@ namespace AzToolsFramework
}
#include "UI/UICore/moc_OverwritePromptDialog.cpp"
#include "UI/UICore/moc_OverwritePromptDialog.cpp"
@@ -18,7 +18,7 @@
#include <AzToolsFramework/UI/UICore/ProgressShield.hxx>
AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // 4251: 'QLayoutItem::align': class 'QFlags<Qt::AlignmentFlag>' needs to have dll-interface to be used by clients of class 'QLayoutItem'
#include <UI/UICore/ui_ProgressShield.h>
#include <AzToolsFramework/UI/UICore/ui_ProgressShield.h>
AZ_POP_DISABLE_WARNING
namespace AzToolsFramework
@@ -118,4 +118,4 @@ namespace AzToolsFramework
} // namespace AzToolsFramework
#include "UI/UICore/moc_ProgressShield.cpp"
#include "UI/UICore/moc_ProgressShield.cpp"
@@ -14,7 +14,7 @@
#include "SaveChangesDialog.hxx"
AZ_PUSH_DISABLE_WARNING(4244 4251, "-Wunknown-warning-option")
#include <UI/UICore/ui_SaveChangesDialog.h>
#include <AzToolsFramework/UI/UICore/ui_SaveChangesDialog.h>
AZ_POP_DISABLE_WARNING
namespace AzToolsFramework
@@ -52,4 +52,4 @@ namespace AzToolsFramework
}
}
#include "UI/UICore/moc_SaveChangesDialog.cpp"
#include "UI/UICore/moc_SaveChangesDialog.cpp"
@@ -246,7 +246,7 @@ namespace UnitTest
R"(... client unittest_workspace)" "\r\n"
R"(... status pending)" "\r\n"
R"(... changeType public)" "\r\n"
R"(... desc *Lumberyard Auto)" "\r\n"
R"(... desc *Open 3D Engine Auto)" "\r\n"
"\r\n";
}
else if (m_commandArgs.starts_with("fstat"))
@@ -65,7 +65,7 @@ namespace AzToolsFramework
if (!contextMenu.m_menu->isEmpty())
{
contextMenu.m_menu->popup(QCursor::pos());
contextMenu.m_menu->exec(QCursor::pos());
}
}
}
@@ -214,7 +214,7 @@ namespace AzToolsFramework
return AzFramework::ScreenPoint{qpoint.x(), qpoint.y()};
}
/// Map from Qt -> Lumberyard buttons.
/// Map from Qt -> Open 3D Engine buttons.>>>>>>> main
inline AZ::u32 TranslateMouseButtons(const Qt::MouseButtons buttons)
{
AZ::u32 result = 0;
@@ -224,7 +224,7 @@ namespace AzToolsFramework
return result;
}
/// Map from Qt -> Lumberyard modifiers.
/// Map from Qt -> Open 3D Engine modifiers.
inline AZ::u32 TranslateKeyboardModifiers(const Qt::KeyboardModifiers modifiers)
{
AZ::u32 result = 0;
@@ -234,13 +234,13 @@ namespace AzToolsFramework
return result;
}
/// Interface to translate Qt modifiers to Lumberyard modifiers.
/// Interface to translate Qt modifiers to Open 3D Engine modifiers.
inline KeyboardModifiers BuildKeyboardModifiers(const Qt::KeyboardModifiers modifiers)
{
return KeyboardModifiers(TranslateKeyboardModifiers(modifiers));
}
/// Interface to translate Qt buttons to Lumberyard buttons.
/// Interface to translate Qt buttons to Open 3D Engine buttons.
inline MouseButtons BuildMouseButtons(const Qt::MouseButtons buttons)
{
return MouseButtons(TranslateMouseButtons(buttons));
@@ -53,7 +53,7 @@ namespace AzToolsFramework
float, cl_viewportGizmoAxisLabelOffset, 1.15f, nullptr, AZ::ConsoleFunctorFlags::Null,
"The offset of the label for the viewport axis gizmo");
AZ_CVAR(
float, cl_viewportGizmoAxisLabelSize, 2.0f, nullptr, AZ::ConsoleFunctorFlags::Null,
float, cl_viewportGizmoAxisLabelSize, 1.0f, nullptr, AZ::ConsoleFunctorFlags::Null,
"The size of each label for the viewport axis gizmo");
AZ_CVAR(
AZ::Vector2, cl_viewportGizmoAxisScreenPosition, AZ::Vector2(0.045f, 0.9f), nullptr,
@@ -1603,7 +1603,7 @@ namespace AzToolsFramework
const AZ::Vector3 uniformScale = AZ::Vector3(action.m_start.m_sign * sumVectorElements(action.LocalScaleOffset()));
const AZ::Vector3 scale = (AZ::Vector3::CreateOne() +
(uniformScale / initialScale)).GetMax(AZ::Vector3(0.01f));
(uniformScale / initialScale)).GetClamp(AZ::Vector3(AZ::MinTransformScale), AZ::Vector3(AZ::MaxTransformScale));
const AZ::Transform scaleTransform = AZ::Transform::CreateScale(scale);
if (action.m_modifiers.Alt())
@@ -3434,19 +3434,22 @@ namespace AzToolsFramework
const auto cameraProjection = AzFramework::CameraProjection(gizmoCameraState);
// screen space offset to move the 2d gizmo around
const AZ::Vector3 screenPosition =
(AZ::Vector2ToVector3(cl_viewportGizmoAxisScreenPosition) - AZ::Vector3(0.5f, 0.5f, 0.0f)) *
AZ::Vector2ToVector3(gizmoCameraState.m_viewportSize);
const AZ::Vector2 screenOffset = AZ::Vector2(cl_viewportGizmoAxisScreenPosition) - AZ::Vector2(0.5f, 0.5f);
// map from a position in world space (relative to the the gizmo camera near the origin) to a position in
// screen space
const auto calculateGizmoAxis =
[&cameraView, &cameraProjection, &gizmoCameraState, &screenPosition]
(const AZ::Vector3& position)
[&cameraView, &cameraProjection, &screenOffset]
(const AZ::Vector3& axis)
{
return AZ::Vector2ToVector3(AzFramework::Vector2FromScreenPoint(
AzFramework::WorldToScreen(
position, cameraView, cameraProjection, gizmoCameraState.m_viewportSize))) + screenPosition;
auto result = AZ::Vector2(
AzFramework::WorldToScreenNDC(
axis,
cameraView,
cameraProjection)
);
result.SetY(1.0f - result.GetY());
return result + screenOffset;
};
// get all important axis positions in screen space
@@ -3456,31 +3459,31 @@ namespace AzToolsFramework
const auto gizmoEndAxisY = calculateGizmoAxis(-AZ::Vector3::CreateAxisY() * lineLength);
const auto gizmoEndAxisZ = calculateGizmoAxis(-AZ::Vector3::CreateAxisZ() * lineLength);
const AZ::Vector3 gizmoAxisX = gizmoEndAxisX - gizmoStart;
const AZ::Vector3 gizmoAxisY = gizmoEndAxisY - gizmoStart;
const AZ::Vector3 gizmoAxisZ = gizmoEndAxisZ - gizmoStart;
const AZ::Vector2 gizmoAxisX = gizmoEndAxisX - gizmoStart;
const AZ::Vector2 gizmoAxisY = gizmoEndAxisY - gizmoStart;
const AZ::Vector2 gizmoAxisZ = gizmoEndAxisZ - gizmoStart;
// draw the axes of the gizmo
debugDisplay.SetLineWidth(cl_viewportGizmoAxisLineWidth);
debugDisplay.SetColor(AZ::Colors::Red);
debugDisplay.DrawLine(gizmoStart, gizmoEndAxisX);
debugDisplay.DrawLine2d(gizmoStart, gizmoEndAxisX, 1.0f);
debugDisplay.SetColor(AZ::Colors::Lime);
debugDisplay.DrawLine(gizmoStart, gizmoEndAxisY);
debugDisplay.DrawLine2d(gizmoStart, gizmoEndAxisY, 1.0f);
debugDisplay.SetColor(AZ::Colors::Blue);
debugDisplay.DrawLine(gizmoStart, gizmoEndAxisZ);
debugDisplay.DrawLine2d(gizmoStart, gizmoEndAxisZ, 1.0f);
debugDisplay.SetLineWidth(1.0f);
const float labelOffset = cl_viewportGizmoAxisLabelOffset;
const auto labelOffsetX = gizmoStart + gizmoAxisX * labelOffset;
const auto labelOffsetY = gizmoStart + gizmoAxisY * labelOffset;
const auto labelOffsetZ = gizmoStart + gizmoAxisZ * labelOffset;
const auto labelXScreenPosition = (gizmoStart + (gizmoAxisX * labelOffset)) * editorCameraState.m_viewportSize;
const auto labelYScreenPosition = (gizmoStart + (gizmoAxisY * labelOffset)) * editorCameraState.m_viewportSize;
const auto labelZScreenPosition = (gizmoStart + (gizmoAxisZ * labelOffset)) * editorCameraState.m_viewportSize;
// draw the label of of each axis for the gizmo
const float labelSize = cl_viewportGizmoAxisLabelSize;
debugDisplay.SetColor(AZ::Colors::White);
debugDisplay.Draw2dTextLabel(labelOffsetX.GetX(), labelOffsetX.GetY(), labelSize, "X", true);
debugDisplay.Draw2dTextLabel(labelOffsetY.GetX(), labelOffsetY.GetY(), labelSize, "Y", true);
debugDisplay.Draw2dTextLabel(labelOffsetZ.GetX(), labelOffsetZ.GetY(), labelSize, "Z", true);
debugDisplay.Draw2dTextLabel(labelXScreenPosition.GetX(), labelXScreenPosition.GetY(), labelSize, "X", true);
debugDisplay.Draw2dTextLabel(labelYScreenPosition.GetX(), labelYScreenPosition.GetY(), labelSize, "Y", true);
debugDisplay.Draw2dTextLabel(labelZScreenPosition.GetX(), labelZScreenPosition.GetY(), labelSize, "Z", true);
}
void EditorTransformComponentSelection::DisplayViewportSelection2d(
@@ -68,7 +68,7 @@ namespace UnitTest
{
assets[idx] = AssetId(AZ::Uuid::CreateRandom(), 0);
AZ::Data::AssetInfo info;
info.m_relativePath = AZStd::string::format("Asset%d.txt", idx);
info.m_relativePath = AZStd::string::format("asset%d.txt", idx);
m_assetsPath[idx] = info.m_relativePath;
info.m_assetId = assets[idx];
m_assetRegistry->RegisterAsset(assets[idx], info);
@@ -623,7 +623,7 @@ namespace UnitTest
EXPECT_TRUE(Search(assetList1, assets[fileIndex]));
if (m_fileStreams[0][fileIndex].Open(m_assetsPathFull[0][fileIndex].c_str(), AZ::IO::OpenMode::ModeWrite | AZ::IO::OpenMode::ModeBinary | AZ::IO::OpenMode::ModeCreatePath))
{
AZStd::string fileContent = AZStd::string::format("Asset%d.txt", fileIndex);
AZStd::string fileContent = AZStd::string::format("asset%d.txt", fileIndex);
m_fileStreams[0][fileIndex].Write(fileContent.size(), fileContent.c_str());
m_fileStreams[0][fileIndex].Close();
}
@@ -654,7 +654,7 @@ namespace UnitTest
EXPECT_TRUE(Search(assetList1, assets[fileIndex]));
if (m_fileStreams[0][fileIndex].Open(m_assetsPathFull[0][fileIndex].c_str(), AZ::IO::OpenMode::ModeWrite | AZ::IO::OpenMode::ModeBinary | AZ::IO::OpenMode::ModeCreatePath))
{
AZStd::string fileContent = AZStd::string::format("Asset%d.txt", fileIndex + 1);// changing file content
AZStd::string fileContent = AZStd::string::format("asset%d.txt", fileIndex + 1);// changing file content
m_fileStreams[0][fileIndex].Write(fileContent.size(), fileContent.c_str());
m_fileStreams[0][fileIndex].Close();
}
@@ -987,7 +987,7 @@ namespace UnitTest
m_assetSeedManager->AddSeedAsset(assets[0], AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_OSX);
m_assetSeedManager->RemoveSeedAsset("Asset0.txt", AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_OSX);
m_assetSeedManager->RemoveSeedAsset("asset0.txt", AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_OSX);
const AzFramework::AssetSeedList& secondSeedList = m_assetSeedManager->GetAssetSeedList();
EXPECT_EQ(secondSeedList.size(), 0);
}
@@ -1003,7 +1003,7 @@ namespace UnitTest
m_assetSeedManager->AddSeedAsset(assets[0], AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_OSX);
m_assetSeedManager->RemoveSeedAsset("Asset0.txt", AzFramework::PlatformFlags::Platform_PC);
m_assetSeedManager->RemoveSeedAsset("asset0.txt", AzFramework::PlatformFlags::Platform_PC);
const AzFramework::AssetSeedList& secondSeedList = m_assetSeedManager->GetAssetSeedList();
EXPECT_EQ(secondSeedList.size(), 1);
}
@@ -1017,7 +1017,7 @@ namespace UnitTest
EXPECT_EQ(seedList.size(), 1);
m_assetSeedManager->RemoveSeedAsset("Asset1.txt", AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_OSX);
m_assetSeedManager->RemoveSeedAsset("asset1.txt", AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_OSX);
const AzFramework::AssetSeedList& secondSeedList = m_assetSeedManager->GetAssetSeedList();
EXPECT_EQ(secondSeedList.size(), 1);
}