Merge branch 'development' into issues/3202
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
@@ -90,6 +90,7 @@ AzAssetBrowserWindow::AzAssetBrowserWindow(QWidget* parent)
|
||||
|
||||
m_tableModel->setFilterRole(Qt::DisplayRole);
|
||||
m_tableModel->setSourceModel(m_filterModel.data());
|
||||
m_tableModel->setDynamicSortFilter(true);
|
||||
m_ui->m_assetBrowserTableViewWidget->setModel(m_tableModel.data());
|
||||
|
||||
connect(
|
||||
|
||||
@@ -174,6 +174,8 @@ ly_add_target(
|
||||
Legacy::EditorLib
|
||||
ProjectManager
|
||||
)
|
||||
|
||||
ly_set_gem_variant_to_load(TARGETS Editor VARIANTS Tools)
|
||||
set_property(SOURCE
|
||||
CryEdit.cpp
|
||||
APPEND PROPERTY
|
||||
|
||||
@@ -573,6 +573,10 @@ static CVarBlock* VarBlockFromConsoleVars()
|
||||
IVariable* pVariable = nullptr;
|
||||
for (int i = 0; i < cmdCount; i++)
|
||||
{
|
||||
if (!cmds[i].data())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
ICVar* pCVar = console->GetCVar(cmds[i].data());
|
||||
if (!pCVar)
|
||||
{
|
||||
|
||||
+17
-2
@@ -551,7 +551,9 @@ public:
|
||||
{ "NSDocumentRevisionsDebugMode", nsDocumentRevisionsDebugMode},
|
||||
{ "skipWelcomeScreenDialog", m_bSkipWelcomeScreenDialog},
|
||||
{ "autotest_mode", m_bAutotestMode},
|
||||
{ "regdumpall", dummy }
|
||||
{ "regdumpall", dummy },
|
||||
{ "attach-debugger", dummy }, // Attaches a debugger for the current application
|
||||
{ "wait-for-debugger", dummy }, // Waits until a debugger is attached to the current application
|
||||
};
|
||||
|
||||
QString dummyString;
|
||||
@@ -2290,7 +2292,7 @@ int CCryEditApp::IdleProcessing(bool bBackgroundUpdate)
|
||||
int res = 0;
|
||||
if (bIsAppWindow || m_bForceProcessIdle || m_bKeepEditorActive
|
||||
// Automated tests must always keep the editor active, or they can get stuck
|
||||
|| m_bAutotestMode)
|
||||
|| m_bAutotestMode || m_bRunPythonTestScript)
|
||||
{
|
||||
res = 1;
|
||||
bActive = true;
|
||||
@@ -4011,6 +4013,19 @@ extern "C" int AZ_DLL_EXPORT CryEditMain(int argc, char* argv[])
|
||||
{
|
||||
CryAllocatorsRAII cryAllocatorsRAII;
|
||||
|
||||
// Debugging utilities
|
||||
for (int i = 1; i < argc; ++i)
|
||||
{
|
||||
if (azstricmp(argv[i], "--attach-debugger") == 0)
|
||||
{
|
||||
AZ::Debug::Trace::AttachDebugger();
|
||||
}
|
||||
else if (azstricmp(argv[i], "--wait-for-debugger") == 0)
|
||||
{
|
||||
AZ::Debug::Trace::WaitForDebugger();
|
||||
}
|
||||
}
|
||||
|
||||
// ensure the EditorEventsBus context gets created inside EditorLib
|
||||
[[maybe_unused]] const auto& editorEventsContext = AzToolsFramework::EditorEvents::Bus::GetOrCreateContext();
|
||||
|
||||
|
||||
@@ -401,6 +401,16 @@ inline namespace Commands
|
||||
{
|
||||
return static_cast<int>(GetIEditor()->GetEditorConfigPlatform());
|
||||
}
|
||||
|
||||
bool PyAttachDebugger()
|
||||
{
|
||||
return AZ::Debug::Trace::AttachDebugger();
|
||||
}
|
||||
|
||||
bool PyWaitForDebugger(float timeoutSeconds = -1.f)
|
||||
{
|
||||
return AZ::Debug::Trace::WaitForDebugger(timeoutSeconds);
|
||||
}
|
||||
}
|
||||
|
||||
namespace AzToolsFramework
|
||||
@@ -448,6 +458,9 @@ namespace AzToolsFramework
|
||||
addLegacyGeneral(behaviorContext->Method("start_process_detached", PyStartProcessDetached, nullptr, "Launches a detached process with an optional space separated list of arguments."));
|
||||
addLegacyGeneral(behaviorContext->Method("launch_lua_editor", PyLaunchLUAEditor, nullptr, "Launches the Lua editor, may receive a list of space separate file paths, or an empty string to only open the editor."));
|
||||
|
||||
addLegacyGeneral(behaviorContext->Method("attach_debugger", PyAttachDebugger, nullptr, "Prompts for attaching the debugger"));
|
||||
addLegacyGeneral(behaviorContext->Method("wait_for_debugger", PyWaitForDebugger, behaviorContext->MakeDefaultValues(-1.f), "Pauses this thread execution until the debugger has been attached"));
|
||||
|
||||
// this will put these methods into the 'azlmbr.legacy.checkout_dialog' module
|
||||
auto addCheckoutDialog = [](AZ::BehaviorContext::GlobalMethodBuilder methodBuilder)
|
||||
{
|
||||
|
||||
@@ -47,7 +47,6 @@ struct ToolTip
|
||||
class CEditorPanelUtils_Impl
|
||||
: public IEditorPanelUtils
|
||||
{
|
||||
#pragma region Drag & Drop
|
||||
public:
|
||||
void SetViewportDragOperation(void(* dropCallback)(CViewport* viewport, int dragPointX, int dragPointY, void* custom), void* custom) override
|
||||
{
|
||||
@@ -56,8 +55,7 @@ public:
|
||||
GetIEditor()->GetViewManager()->GetView(i)->SetGlobalDropCallback(dropCallback, custom);
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma region Preview Window
|
||||
|
||||
public:
|
||||
|
||||
int PreviewWindow_GetDisplaySettingsDebugFlags(CDisplaySettings* settings) override
|
||||
@@ -72,8 +70,6 @@ public:
|
||||
settings->SetDebugFlags(flags);
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
#pragma region Shortcuts
|
||||
protected:
|
||||
QVector<HotKey> hotkeys;
|
||||
bool m_hotkeysAreEnabled;
|
||||
@@ -408,8 +404,6 @@ public:
|
||||
return m_hotkeysAreEnabled;
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
#pragma region ToolTip
|
||||
protected:
|
||||
QMap<QString, ToolTip> m_tooltips;
|
||||
|
||||
@@ -539,7 +533,6 @@ public:
|
||||
}
|
||||
return GetToolTip(path).disabledContent;
|
||||
}
|
||||
#pragma endregion ToolTip
|
||||
};
|
||||
|
||||
IEditorPanelUtils* CreateEditorPanelUtils()
|
||||
|
||||
@@ -84,12 +84,6 @@ AZ_POP_DISABLE_WARNING
|
||||
#include "IEditorPanelUtils.h"
|
||||
#include "EditorPanelUtils.h"
|
||||
|
||||
|
||||
// even in Release mode, the editor will return its heap, because there's no Profile build configuration for the editor
|
||||
#ifdef _RELEASE
|
||||
#undef _RELEASE
|
||||
#endif
|
||||
|
||||
#include "Core/QtEditorApplication.h" // for Editor::EditorQtApplication
|
||||
|
||||
static CCryEditDoc * theDocument;
|
||||
@@ -104,8 +98,6 @@ static CCryEditDoc * theDocument;
|
||||
#define VERIFY(EXPRESSION) { auto e = EXPRESSION; assert(e); }
|
||||
#endif
|
||||
|
||||
#undef GetCommandLine
|
||||
|
||||
const char* CEditorImpl::m_crashLogFileName = "SessionStatus/editor_statuses.json";
|
||||
|
||||
CEditorImpl::CEditorImpl()
|
||||
|
||||
@@ -76,6 +76,7 @@
|
||||
</qresource>
|
||||
<qresource prefix="/Application">
|
||||
<file>res/o3de_editor.ico</file>
|
||||
<file alias="o3de_application_reverse.svg">res/o3de_application_reverse.svg</file>
|
||||
</qresource>
|
||||
<qresource prefix="/Icons">
|
||||
<file alias="Eye.svg">res/Eye.svg</file>
|
||||
@@ -152,6 +153,7 @@
|
||||
<file alias="error_report_error.svg">res/error_report_error.svg</file>
|
||||
<file alias="error_report_warning.svg">res/error_report_warning.svg</file>
|
||||
<file alias="error_report_comment.svg">res/error_report_comment.svg</file>
|
||||
<file alias="error_report_helper.svg">res/error_report_helper.svg</file>
|
||||
<file>particles_tree_00.png</file>
|
||||
<file>particles_tree_01.png</file>
|
||||
<file>particles_tree_02.png</file>
|
||||
|
||||
@@ -66,7 +66,7 @@ int main(int argc, char* argv[])
|
||||
processLaunchInfo.m_environmentVariables = &envVars;
|
||||
processLaunchInfo.m_showWindow = true;
|
||||
|
||||
AZStd::unique_ptr<AzFramework::ProcessWatcher> processWatcher(AzFramework::ProcessWatcher::LaunchProcess(processLaunchInfo, AzFramework::ProcessCommunicationType::COMMUNICATOR_TYPE_NONE));
|
||||
AzFramework::ProcessLauncher::LaunchUnwatchedProcess(processLaunchInfo);
|
||||
|
||||
application.Destroy();
|
||||
|
||||
|
||||
@@ -48,7 +48,6 @@ OutlinerCheckBox
|
||||
spacing: 0px;
|
||||
padding: 0px;
|
||||
line-height: 0px;
|
||||
font-size: 0px;
|
||||
margin: 0px;
|
||||
background-color: none;
|
||||
max-height: 20px;
|
||||
@@ -66,7 +65,6 @@ OutlinerCheckBox::indicator
|
||||
spacing: 0px;
|
||||
padding: 0px;
|
||||
line-height: 0px;
|
||||
font-size: 0px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include "CryEdit.h"
|
||||
#include "MainWindow.h"
|
||||
|
||||
#pragma comment(lib, "Gdi32.lib")
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Global Instance of Editor settings.
|
||||
|
||||
@@ -2505,7 +2505,6 @@ OutlinerCheckBox
|
||||
spacing: 0px;
|
||||
padding: 0px;
|
||||
line-height: 0px;
|
||||
font-size: 0px;
|
||||
margin: 2px 2px 0 2px;
|
||||
background-color: none;
|
||||
max-height: 20px;
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="21px" height="21px" viewBox="0 0 21 21" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Icons / Notification / Helpers</title>
|
||||
<g id="primary-use-cases" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Screen-1-Copy-61" transform="translate(-620.000000, -295.000000)">
|
||||
<g id="Modals-/-Scrollable-Modal" transform="translate(594.114148, 244.000000)">
|
||||
<g id="Group" transform="translate(24.000000, 49.500000)">
|
||||
<rect id="Icon-Background" x="0" y="0" width="24" height="24"></rect>
|
||||
<path d="M12,2 C17.5228475,2 22,6.4771525 22,12 C22,17.5228475 17.5228475,22 12,22 C6.4771525,22 2,17.5228475 2,12 C2,6.4771525 6.4771525,2 12,2 Z M12.4748737,17 L10.4748737,17 L10.4748737,20 L12.4748737,20 L12.4748737,17 Z M8.47487373,5 L5.5,8.06066017 L6.91421356,9.47487373 L9.324,7 L14.9,7 L16,7.888 L16,11.306 L15.501,12 L10.4748737,12 L10.4748737,15 L12.4748737,15 L12.474,14 L16.4748737,14 L17.998,12 L18,12 L18,7 L15.4748737,5 L8.47487373,5 Z" id="Combined-Shape" fill="#FFFFFF"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24px" height="21px" viewBox="0 0 24 21" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>o3de icon</title>
|
||||
<g id="o3de-icon" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Mono-Reversed" transform="translate(0.000000, 0.000000)" fill="#000000" fill-rule="nonzero">
|
||||
<path d="M21.1541405,17.6979529 C19.3400003,19.4999226 16.9380429,20.4923077 14.3913014,20.4923077 L14.390648,20.4923077 L14.3450938,20.4923077 C11.7797759,20.4803636 9.3640962,19.4651168 7.54323489,17.6334736 C5.11112576,15.1866169 4.27677437,11.7429896 5.03495316,8.61000159 L8.51135509,8.61000159 C8.23037526,9.33504454 8.08409772,10.1140225 8.08885851,10.9163286 C8.09866013,12.5958715 8.76171652,14.1683842 9.95574077,15.3439429 C11.1512586,16.5210879 12.7239055,17.1693342 14.3843003,17.1693342 L14.4020365,17.1692408 C16.0735398,17.163922 17.6458133,16.505038 18.8316229,15.3138961 C20.0308746,14.109317 20.6859031,12.5198213 20.6761947,10.8382256 C20.6663931,9.15513684 19.9919482,7.57151988 18.7770139,6.37907152 C17.5971786,5.2210557 16.046842,4.58577998 14.4049303,4.58577998 C14.3803796,4.58577998 14.3559222,4.5859666 14.3311848,4.58624655 C13.4169268,4.59604442 12.5319804,4.80254636 11.7229265,5.18298395 L11.7229265,1.63624556 C12.5795883,1.3889658 13.4737762,1.25879399 14.3867273,1.25879399 L14.4338684,1.25879399 C17.005814,1.27120464 19.4248544,2.29568939 21.2452489,4.14366241 C23.038479,5.96410807 24.0166808,8.37475921 23.9997847,10.9315387 C23.9828886,13.4891581 22.9722947,15.8920641 21.1541405,17.6979529 L21.1541405,17.6979529 Z M1.11066379,1.9110527 L3.02244681,1.9110527 L3.02244681,0 L1.11066379,0 L1.11066379,1.9110527 Z M0,7.6534488 L2.99948301,7.6534488 L2.99948301,4.65511162 L0,4.65511162 L0,7.6534488 Z M4.90426487,6.43272657 L9.52867009,6.43272657 L9.52867009,1.8100879 L4.90426487,1.8100879 L4.90426487,6.43272657 Z" id="Fill-2"></path>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.0 KiB |
@@ -25,6 +25,7 @@
|
||||
#include <AzCore/std/containers/unordered_set.h>
|
||||
#include <AzCore/Module/Environment.h>
|
||||
#include <AzCore/Console/IConsole.h>
|
||||
#include <AzCore/std/chrono/chrono.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
@@ -33,6 +34,7 @@ namespace AZ
|
||||
namespace Platform
|
||||
{
|
||||
#if defined(AZ_ENABLE_DEBUG_TOOLS)
|
||||
bool AttachDebugger();
|
||||
bool IsDebuggerPresent();
|
||||
void HandleExceptions(bool isEnabled);
|
||||
void DebugBreak();
|
||||
@@ -141,6 +143,42 @@ namespace AZ
|
||||
#endif
|
||||
}
|
||||
|
||||
bool
|
||||
Trace::AttachDebugger()
|
||||
{
|
||||
#if defined(AZ_ENABLE_DEBUG_TOOLS)
|
||||
return Platform::AttachDebugger();
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool
|
||||
Trace::WaitForDebugger(float timeoutSeconds/*=-1.f*/)
|
||||
{
|
||||
#if defined(AZ_ENABLE_DEBUG_TOOLS)
|
||||
using AZStd::chrono::system_clock;
|
||||
using AZStd::chrono::time_point;
|
||||
using AZStd::chrono::milliseconds;
|
||||
|
||||
milliseconds timeoutMs = milliseconds(aznumeric_cast<long long>(timeoutSeconds * 1000));
|
||||
system_clock clock;
|
||||
time_point start = clock.now();
|
||||
auto hasTimedOut = [&clock, start, timeoutMs]()
|
||||
{
|
||||
return timeoutMs.count() >= 0 && (clock.now() - start) >= timeoutMs;
|
||||
};
|
||||
|
||||
while (!AZ::Debug::Trace::IsDebuggerPresent() && !hasTimedOut())
|
||||
{
|
||||
AZStd::this_thread::sleep_for(milliseconds(1));
|
||||
}
|
||||
return AZ::Debug::Trace::IsDebuggerPresent();
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
//=========================================================================
|
||||
// HandleExceptions
|
||||
// [8/3/2009]
|
||||
|
||||
@@ -49,6 +49,8 @@ namespace AZ
|
||||
*/
|
||||
static const char* GetDefaultSystemWindow();
|
||||
static bool IsDebuggerPresent();
|
||||
static bool AttachDebugger();
|
||||
static bool WaitForDebugger(float timeoutSeconds = -1.f);
|
||||
|
||||
/// True or false if we want to handle system exceptions.
|
||||
static void HandleExceptions(bool isEnabled);
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <AzCore/std/containers/array.h>
|
||||
#include <AzCore/std/string/wildcard.h>
|
||||
#include <AzCore/Casting/numeric_cast.h>
|
||||
#include <AzCore/AzCore_Traits_Platform.h>
|
||||
|
||||
// extern instantiations of Path templates to prevent implicit instantiations
|
||||
namespace AZ::IO
|
||||
@@ -92,11 +93,23 @@ namespace AZ::IO::Internal
|
||||
constexpr auto ConsumeRootName(InputIt entryBeginIter, InputIt entryEndIter, const char preferredSeparator)
|
||||
-> AZStd::enable_if_t<AZStd::Internal::is_forward_iterator_v<InputIt>, InputIt>
|
||||
{
|
||||
if (preferredSeparator == '/')
|
||||
if (preferredSeparator == PosixPathSeparator)
|
||||
{
|
||||
// If the preferred separator is forward slash the parser is in posix path
|
||||
// parsing mode, which doesn't have a root name
|
||||
// parsing mode, which doesn't have a root name,
|
||||
// unless we're on a posix platform that uses a custom path root separator
|
||||
#if defined(AZ_TRAIT_CUSTOM_PATH_ROOT_SEPARATOR)
|
||||
const AZStd::string_view path{ entryBeginIter, entryEndIter };
|
||||
const auto positionOfPathSeparator = path.find(AZ_TRAIT_CUSTOM_PATH_ROOT_SEPARATOR);
|
||||
if (positionOfPathSeparator == AZStd::string_view::npos)
|
||||
{
|
||||
return entryBeginIter;
|
||||
}
|
||||
const AZStd::string_view rootName{ path.substr(0, positionOfPathSeparator + 1) };
|
||||
return AZStd::next(entryBeginIter, rootName.size());
|
||||
#else
|
||||
return entryBeginIter;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -185,13 +198,18 @@ namespace AZ::IO::Internal
|
||||
template <typename InputIt, typename EndIt, typename = AZStd::enable_if_t<AZStd::Internal::is_input_iterator_v<InputIt>>>
|
||||
static constexpr bool IsAbsolute(InputIt first, EndIt last, const char preferredSeparator)
|
||||
{
|
||||
size_t pathSize = AZStd::distance(first, last);
|
||||
|
||||
// If the preferred separator is a forward slash
|
||||
// than an absolute path is simply one that starts with a forward slash
|
||||
if (preferredSeparator == '/')
|
||||
// than an absolute path is simply one that starts with a forward slash,
|
||||
// unless we're on a posix platform that uses a custom path root separator
|
||||
if (preferredSeparator == PosixPathSeparator)
|
||||
{
|
||||
#if defined(AZ_TRAIT_CUSTOM_PATH_ROOT_SEPARATOR)
|
||||
const AZStd::string_view path{ first, last };
|
||||
return path.find(AZ_TRAIT_CUSTOM_PATH_ROOT_SEPARATOR) != AZStd::string_view::npos;
|
||||
#else
|
||||
const size_t pathSize = AZStd::distance(first, last);
|
||||
return pathSize > 0 && IsSeparator(*first);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -199,6 +217,7 @@ namespace AZ::IO::Internal
|
||||
{
|
||||
// If a windows path ends starts with C:foo it is a root relative path
|
||||
// A path is absolute root absolute on windows if it starts with <drive_letter><colon><path_separator>
|
||||
const size_t pathSize = AZStd::distance(first, last);
|
||||
return pathSize > 2 && Internal::IsSeparator(*AZStd::next(first, 2));
|
||||
}
|
||||
|
||||
|
||||
@@ -550,7 +550,7 @@ namespace AZ::SettingsRegistryMergeUtils
|
||||
}
|
||||
registry.Set(FilePathKey_ProjectUserPath, projectUserPath.Native());
|
||||
|
||||
// Set the user directory with the provided path or using project/user as default
|
||||
// Set the log directory with the provided path or using project/user/log as default
|
||||
auto projectLogPathKey = FixedValueString::format("%s/project_log_path", BootstrapSettingsRootKey);
|
||||
AZ::IO::FixedMaxPath projectLogPath;
|
||||
if (!registry.Get(projectLogPath.Native(), projectLogPathKey))
|
||||
@@ -640,7 +640,7 @@ namespace AZ::SettingsRegistryMergeUtils
|
||||
}
|
||||
|
||||
#if !AZ_TRAIT_OS_IS_HOST_OS_PLATFORM
|
||||
// Setup the cache and user paths when to platform specific locations when running on non-host platforms
|
||||
// Setup the cache, user, and log paths to platform specific locations when running on non-host platforms
|
||||
path = engineRoot;
|
||||
if (AZStd::optional<AZ::IO::FixedMaxPathString> nonHostCacheRoot = Utils::GetDefaultAppRootPath();
|
||||
nonHostCacheRoot)
|
||||
@@ -656,13 +656,16 @@ namespace AZ::SettingsRegistryMergeUtils
|
||||
if (AZStd::optional<AZ::IO::FixedMaxPathString> devWriteStorage = Utils::GetDevWriteStoragePath();
|
||||
devWriteStorage)
|
||||
{
|
||||
registry.Set(FilePathKey_DevWriteStorage, *devWriteStorage);
|
||||
registry.Set(FilePathKey_ProjectUserPath, *devWriteStorage);
|
||||
const AZ::IO::FixedMaxPath devWriteStoragePath(*devWriteStorage);
|
||||
registry.Set(FilePathKey_DevWriteStorage, devWriteStoragePath.LexicallyNormal().Native());
|
||||
registry.Set(FilePathKey_ProjectUserPath, (devWriteStoragePath / "user").LexicallyNormal().Native());
|
||||
registry.Set(FilePathKey_ProjectLogPath, (devWriteStoragePath / "user/log").LexicallyNormal().Native());
|
||||
}
|
||||
else
|
||||
{
|
||||
registry.Set(FilePathKey_DevWriteStorage, path.LexicallyNormal().Native());
|
||||
registry.Set(FilePathKey_ProjectUserPath, (path / "user").LexicallyNormal().Native());
|
||||
registry.Set(FilePathKey_ProjectLogPath, (path / "user/log").LexicallyNormal().Native());
|
||||
}
|
||||
#endif // AZ_TRAIT_OS_IS_HOST_OS_PLATFORM
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <AzCore/std/typetraits/is_member_pointer.h>
|
||||
#include <AzCore/std/typetraits/is_const.h>
|
||||
#include <AzCore/std/typetraits/remove_cvref.h>
|
||||
#include <AzCore/std/typetraits/is_volatile.h>
|
||||
#include <AzCore/std/createdestroy.h>
|
||||
|
||||
#define AZSTD_FUNCTION_TARGET_FIX(x)
|
||||
@@ -591,8 +592,8 @@ namespace AZStd
|
||||
|
||||
Internal::function_util::function_buffer type_result;
|
||||
type_result.type.type = aztypeid(Functor);
|
||||
type_result.type.const_qualified = is_const<Functor>::value;
|
||||
type_result.type.volatile_qualified = is_volatile<Functor>::value;
|
||||
type_result.type.const_qualified = AZStd::is_const<Functor>::value;
|
||||
type_result.type.volatile_qualified = AZStd::is_volatile<Functor>::value;
|
||||
vtable->manager(functor, type_result, Internal::function_util::check_functor_type_tag);
|
||||
return static_cast<Functor*>(type_result.obj_ptr);
|
||||
}
|
||||
@@ -608,7 +609,7 @@ namespace AZStd
|
||||
Internal::function_util::function_buffer type_result;
|
||||
type_result.type.type = aztypeid(Functor);
|
||||
type_result.type.const_qualified = true;
|
||||
type_result.type.volatile_qualified = is_volatile<Functor>::value;
|
||||
type_result.type.volatile_qualified = AZStd::is_volatile<Functor>::value;
|
||||
vtable->manager(functor, type_result, Internal::function_util::check_functor_type_tag);
|
||||
// GCC 2.95.3 gets the CV qualifiers wrong here, so we
|
||||
// can't do the static_cast that we should do.
|
||||
|
||||
@@ -359,7 +359,7 @@ namespace AZStd
|
||||
{
|
||||
functor.obj_ref.obj_ptr = (void*)&f.get();
|
||||
functor.obj_ref.is_const_qualified = is_const<FunctionObj>::value;
|
||||
functor.obj_ref.is_volatile_qualified = is_volatile<FunctionObj>::value;
|
||||
functor.obj_ref.is_volatile_qualified = AZStd::is_volatile<FunctionObj>::value;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -70,11 +70,11 @@ namespace AZStd
|
||||
bool try_acquire_until(const chrono::time_point<Clock, Duration>& abs_time)
|
||||
{
|
||||
auto timeNow = chrono::system_clock::now();
|
||||
if (timeNow >= absTime)
|
||||
if (timeNow >= abs_time)
|
||||
{
|
||||
return false; // we timed out already!
|
||||
}
|
||||
auto deltaTime = absTime - timeNow;
|
||||
auto deltaTime = abs_time - timeNow;
|
||||
auto timeToTry = chrono::duration_cast<chrono::milliseconds>(deltaTime);
|
||||
return (WaitForSingleObject(m_event, aznumeric_cast<DWORD>(timeToTry.count())) == AZ_WAIT_OBJECT_0);
|
||||
}
|
||||
|
||||
@@ -56,6 +56,13 @@ namespace AZ
|
||||
return ((info.kp_proc.p_flag & P_TRACED) != 0);
|
||||
}
|
||||
|
||||
bool AttachDebugger()
|
||||
{
|
||||
// Not supported yet
|
||||
AZ_Assert(false, "AttachDebugger() is not supported for Mac platform yet");
|
||||
return false;
|
||||
}
|
||||
|
||||
void HandleExceptions(bool)
|
||||
{}
|
||||
|
||||
|
||||
@@ -60,6 +60,13 @@ namespace AZ
|
||||
return s_debuggerDetected;
|
||||
}
|
||||
|
||||
bool AttachDebugger()
|
||||
{
|
||||
// Not supported yet
|
||||
AZ_Assert(false, "AttachDebugger() is not supported for Unix platform yet");
|
||||
return false;
|
||||
}
|
||||
|
||||
void HandleExceptions(bool)
|
||||
{}
|
||||
|
||||
|
||||
@@ -49,6 +49,45 @@ namespace AZ
|
||||
}
|
||||
}
|
||||
|
||||
bool AttachDebugger()
|
||||
{
|
||||
if (IsDebuggerPresent())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// Launch vsjitdebugger.exe, this app is always present in System32 folder
|
||||
// with an installation of any version of visual studio.
|
||||
// It will open a debugging dialog asking the user what debugger to use
|
||||
|
||||
STARTUPINFOW startupInfo = {0};
|
||||
startupInfo.cb = sizeof(startupInfo);
|
||||
PROCESS_INFORMATION processInfo = {0};
|
||||
|
||||
wchar_t cmdline[MAX_PATH];
|
||||
swprintf_s(cmdline, L"vsjitdebugger.exe -p %li", ::GetCurrentProcessId());
|
||||
bool success = ::CreateProcessW(
|
||||
NULL, // No module name (use command line)
|
||||
cmdline, // Command line
|
||||
NULL, // Process handle not inheritable
|
||||
NULL, // Thread handle not inheritable
|
||||
FALSE, // No handle inheritance
|
||||
0, // No creation flags
|
||||
NULL, // Use parent's environment block
|
||||
NULL, // Use parent's starting directory
|
||||
&startupInfo, // Pointer to STARTUPINFO structure
|
||||
&processInfo); // Pointer to PROCESS_INFORMATION structure
|
||||
|
||||
if (success)
|
||||
{
|
||||
::WaitForSingleObject(processInfo.hProcess, INFINITE);
|
||||
::CloseHandle(processInfo.hProcess);
|
||||
::CloseHandle(processInfo.hThread);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void DebugBreak()
|
||||
{
|
||||
__debugbreak();
|
||||
|
||||
+2
-2
@@ -198,7 +198,7 @@ namespace AZStd
|
||||
AZ_FORCE_INLINE cv_status condition_variable_any::wait_for(Lock& lock, const chrono::duration<Rep, Period>& rel_time)
|
||||
{
|
||||
chrono::milliseconds toWait = rel_time;
|
||||
EnterCriticalSection(&m_mutex);
|
||||
EnterCriticalSection(AZ_STD_MUTEX_CAST(m_mutex));
|
||||
lock.unlock();
|
||||
|
||||
// We need to make sure we use CriticalSection based mutex.
|
||||
@@ -217,7 +217,7 @@ namespace AZStd
|
||||
returnCode = cv_status::timeout;
|
||||
}
|
||||
}
|
||||
LeaveCriticalSection(&m_mutex);
|
||||
LeaveCriticalSection(AZ_STD_MUTEX_CAST(m_mutex));
|
||||
lock.lock();
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
@@ -480,7 +480,9 @@ namespace UnitTest
|
||||
TEST_F(AnyTest, Any_CopyAssignSelfEmpty_IsEmpty)
|
||||
{
|
||||
any a;
|
||||
AZ_PUSH_DISABLE_WARNING(, "-Wself-assign-overloaded")
|
||||
a = a;
|
||||
AZ_POP_DISABLE_WARNING
|
||||
EXPECT_TRUE(a.empty());
|
||||
}
|
||||
|
||||
@@ -491,7 +493,9 @@ namespace UnitTest
|
||||
any a((TypeParam(1)));
|
||||
EXPECT_EQ(TypeParam::s_count, 1);
|
||||
|
||||
AZ_PUSH_DISABLE_WARNING(, "-Wself-assign-overloaded")
|
||||
a = a;
|
||||
AZ_POP_DISABLE_WARNING
|
||||
|
||||
EXPECT_EQ(TypeParam::s_count, 1);
|
||||
EXPECT_EQ(any_cast<const TypeParam&>(a).val(), 1);
|
||||
|
||||
@@ -285,7 +285,9 @@ namespace UnitTest
|
||||
|
||||
// Invocation and self-assignment
|
||||
global_int = 0;
|
||||
AZ_PUSH_DISABLE_WARNING(, "-Wself-assign-overloaded")
|
||||
v1 = v1;
|
||||
AZ_POP_DISABLE_WARNING
|
||||
v1();
|
||||
AZ_TEST_ASSERT(global_int == 3);
|
||||
|
||||
@@ -294,7 +296,9 @@ namespace UnitTest
|
||||
|
||||
// Invocation and self-assignment
|
||||
global_int = 0;
|
||||
AZ_PUSH_DISABLE_WARNING(, "-Wself-assign-overloaded")
|
||||
v1 = (v1);
|
||||
AZ_POP_DISABLE_WARNING
|
||||
v1();
|
||||
AZ_TEST_ASSERT(global_int == 5);
|
||||
|
||||
|
||||
@@ -2100,8 +2100,8 @@ namespace UnitTest
|
||||
typename TypeParam::ContainerType container;
|
||||
container.emplace(-2352);
|
||||
container.emplace(3534);
|
||||
container.emplace(1535408957);
|
||||
container.emplace(3310556522);
|
||||
container.emplace(535408957);
|
||||
container.emplace(1310556522);
|
||||
container.emplace(55546193);
|
||||
container.emplace(1582);
|
||||
|
||||
|
||||
@@ -1805,8 +1805,8 @@ namespace UnitTest
|
||||
typename TypeParam::ContainerType container;
|
||||
container.emplace(-2352);
|
||||
container.emplace(3534);
|
||||
container.emplace(1535408957);
|
||||
container.emplace(3310556522);
|
||||
container.emplace(535408957);
|
||||
container.emplace(1310556522);
|
||||
container.emplace(55546193);
|
||||
container.emplace(1582);
|
||||
|
||||
|
||||
@@ -920,7 +920,9 @@ namespace UnitTest
|
||||
|
||||
AZStd::shared_ptr<incomplete> p1;
|
||||
|
||||
AZ_PUSH_DISABLE_WARNING(, "-Wself-assign-overloaded")
|
||||
p1 = p1;
|
||||
AZ_POP_DISABLE_WARNING
|
||||
|
||||
EXPECT_EQ(p1, p1);
|
||||
EXPECT_FALSE(p1);
|
||||
@@ -950,7 +952,9 @@ namespace UnitTest
|
||||
{
|
||||
AZStd::shared_ptr<void> p1;
|
||||
|
||||
AZ_PUSH_DISABLE_WARNING(, "-Wself-assign-overloaded")
|
||||
p1 = p1;
|
||||
AZ_POP_DISABLE_WARNING
|
||||
|
||||
EXPECT_EQ(p1, p1);
|
||||
EXPECT_FALSE(p1);
|
||||
@@ -996,7 +1000,9 @@ namespace UnitTest
|
||||
using X = SharedPtr::test::X;
|
||||
AZStd::shared_ptr<X> p1;
|
||||
|
||||
AZ_PUSH_DISABLE_WARNING(, "-Wself-assign-overloaded")
|
||||
p1 = p1;
|
||||
AZ_POP_DISABLE_WARNING
|
||||
|
||||
EXPECT_EQ(p1, p1);
|
||||
EXPECT_FALSE(p1);
|
||||
|
||||
@@ -72,11 +72,8 @@ namespace AzFramework
|
||||
/// Retrieves the app root path for the application.
|
||||
virtual const char* GetAppRoot() const { return nullptr; }
|
||||
|
||||
#pragma push_macro("GetCommandLine")
|
||||
#undef GetCommandLine
|
||||
/// Get the Command Line arguments passed in.
|
||||
virtual const CommandLine* GetCommandLine() { return nullptr; }
|
||||
#pragma pop_macro("GetCommandLine")
|
||||
|
||||
/// Get the Command Line arguments passed in. (Avoids collisions with platform specific macros.)
|
||||
virtual const CommandLine* GetApplicationCommandLine() { return nullptr; }
|
||||
|
||||
@@ -707,6 +707,7 @@ namespace AZ
|
||||
resolvedPathLen += postAliasView.size();
|
||||
// Null-Terminated the resolved path
|
||||
resolvedPath[resolvedPathLen] = '\0';
|
||||
|
||||
// If the path started with one of the "asset cache" path aliases, lowercase the path
|
||||
const char* assetAliasPath = GetAlias("@assets@");
|
||||
const char* rootAliasPath = GetAlias("@root@");
|
||||
@@ -714,10 +715,13 @@ namespace AZ
|
||||
const bool lowercasePath = (assetAliasPath != nullptr && AZ::StringFunc::StartsWith(resolvedPath, assetAliasPath)) ||
|
||||
(rootAliasPath != nullptr && AZ::StringFunc::StartsWith(resolvedPath, rootAliasPath)) ||
|
||||
(projectPlatformCacheAliasPath != nullptr && AZ::StringFunc::StartsWith(resolvedPath, projectPlatformCacheAliasPath));
|
||||
|
||||
if (lowercasePath)
|
||||
{
|
||||
AZStd::to_lower(resolvedPath, resolvedPath + resolvedPathLen);
|
||||
// Lowercase only the relative part after the replaced alias.
|
||||
AZStd::to_lower(resolvedPath + aliasValue.size(), resolvedPath + resolvedPathLen);
|
||||
}
|
||||
|
||||
// Replace any backslashes with posix slashes
|
||||
AZStd::replace(resolvedPath, resolvedPath + resolvedPathLen, AZ::IO::WindowsPathSeparator, AZ::IO::PosixPathSeparator);
|
||||
return true;
|
||||
|
||||
+3
-3
@@ -31,10 +31,10 @@ namespace AzToolsFramework
|
||||
AssetBrowserFilterModel::AssetBrowserFilterModel(QObject* parent)
|
||||
: QSortFilterProxyModel(parent)
|
||||
{
|
||||
m_showColumn.insert(aznumeric_cast<int>(AssetBrowserEntry::Column::DisplayName));
|
||||
m_shownColumns.insert(aznumeric_cast<int>(AssetBrowserEntry::Column::DisplayName));
|
||||
if (ed_useNewAssetBrowserTableView)
|
||||
{
|
||||
m_showColumn.insert(aznumeric_cast<int>(AssetBrowserEntry::Column::Path));
|
||||
m_shownColumns.insert(aznumeric_cast<int>(AssetBrowserEntry::Column::Path));
|
||||
}
|
||||
m_collator.setNumericMode(true);
|
||||
AssetBrowserComponentNotificationBus::Handler::BusConnect();
|
||||
@@ -96,7 +96,7 @@ namespace AzToolsFramework
|
||||
bool AssetBrowserFilterModel::filterAcceptsColumn(int source_column, const QModelIndex&) const
|
||||
{
|
||||
//if the column is in the set we want to show it
|
||||
return m_showColumn.find(source_column) != m_showColumn.end();
|
||||
return m_shownColumns.find(source_column) != m_shownColumns.end();
|
||||
}
|
||||
|
||||
bool AssetBrowserFilterModel::lessThan(const QModelIndex& source_left, const QModelIndex& source_right) const
|
||||
|
||||
+6
-4
@@ -27,6 +27,8 @@ namespace AzToolsFramework
|
||||
{
|
||||
namespace AssetBrowser
|
||||
{
|
||||
using ShownColumnsSet = AZStd::fixed_unordered_set<int, 3, aznumeric_cast<int>(AssetBrowserEntry::Column::Count)>;
|
||||
|
||||
class AssetBrowserFilterModel
|
||||
: public QSortFilterProxyModel
|
||||
, public AssetBrowserComponentNotificationBus::Handler
|
||||
@@ -61,11 +63,11 @@ namespace AzToolsFramework
|
||||
void filterUpdatedSlot();
|
||||
|
||||
protected:
|
||||
//set for filtering columns
|
||||
//if the column is in the set the column is not filtered and is shown
|
||||
AZStd::fixed_unordered_set<int, 3, aznumeric_cast<int>(AssetBrowserEntry::Column::Count)> m_showColumn;
|
||||
// Set for filtering columns
|
||||
// If the column is in the set the column is not filtered and is shown
|
||||
ShownColumnsSet m_shownColumns;
|
||||
bool m_alreadyRecomputingFilters = false;
|
||||
//asset source name match filter
|
||||
//Asset source name match filter
|
||||
FilterConstType m_filter;
|
||||
AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // 4251: class '...' needs to have dll-interface to be used by clients of class '...'
|
||||
QWeakPointer<const StringFilter> m_stringFilter;
|
||||
|
||||
+53
-30
@@ -16,7 +16,6 @@ namespace AzToolsFramework
|
||||
AssetBrowserTableModel::AssetBrowserTableModel(QObject* parent /* = nullptr */)
|
||||
: QSortFilterProxyModel(parent)
|
||||
{
|
||||
setDynamicSortFilter(false);
|
||||
}
|
||||
|
||||
void AssetBrowserTableModel::setSourceModel(QAbstractItemModel* sourceModel)
|
||||
@@ -25,19 +24,47 @@ namespace AzToolsFramework
|
||||
AZ_Assert(
|
||||
m_filterModel,
|
||||
"Error in AssetBrowserTableModel initialization, class expects source model to be an AssetBrowserFilterModel.");
|
||||
connect(sourceModel, &QAbstractItemModel::rowsInserted, this, &AssetBrowserTableModel::UpdateTableModelMaps);
|
||||
connect(sourceModel, &QAbstractItemModel::rowsRemoved, this, &AssetBrowserTableModel::UpdateTableModelMaps);
|
||||
connect(sourceModel, &QAbstractItemModel::modelAboutToBeReset, this, &AssetBrowserTableModel::beginResetModel);
|
||||
connect(
|
||||
sourceModel, &QAbstractItemModel::modelReset, this,
|
||||
[this]()
|
||||
{
|
||||
{
|
||||
QSignalBlocker sb(this);
|
||||
UpdateTableModelMaps();
|
||||
}
|
||||
endResetModel();
|
||||
});
|
||||
connect(sourceModel, &QAbstractItemModel::layoutChanged, this, &AssetBrowserTableModel::UpdateTableModelMaps);
|
||||
connect(sourceModel, &QAbstractItemModel::dataChanged, this, &AssetBrowserTableModel::SourceDataChanged);
|
||||
|
||||
|
||||
QSortFilterProxyModel::setSourceModel(sourceModel);
|
||||
}
|
||||
|
||||
QModelIndex AssetBrowserTableModel::mapToSource(const QModelIndex& proxyIndex) const
|
||||
{
|
||||
Q_ASSERT(!proxyIndex.isValid() || proxyIndex.model() == this);
|
||||
if (!proxyIndex.isValid())
|
||||
Q_ASSERT(!proxyIndex.isValid() || proxyIndex.model() != this);
|
||||
if (!proxyIndex.isValid() || !m_indexMap.contains(proxyIndex.row()))
|
||||
{
|
||||
return QModelIndex();
|
||||
}
|
||||
return m_indexMap[proxyIndex.row()];
|
||||
}
|
||||
|
||||
QModelIndex AssetBrowserTableModel::mapFromSource(const QModelIndex& sourceIndex) const
|
||||
{
|
||||
Q_ASSERT(!sourceIndex.isValid() || sourceIndex.model() == sourceModel());
|
||||
if (!sourceIndex.isValid() || !m_rowMap.contains(sourceIndex))
|
||||
{
|
||||
return QModelIndex();
|
||||
}
|
||||
|
||||
return createIndex(m_rowMap[sourceIndex], sourceIndex.column());
|
||||
}
|
||||
|
||||
QVariant AssetBrowserTableModel::headerData(int section, Qt::Orientation orientation, int role) const
|
||||
{
|
||||
if (role == Qt::DisplayRole && orientation == Qt::Horizontal)
|
||||
@@ -49,20 +76,8 @@ namespace AzToolsFramework
|
||||
|
||||
QVariant AssetBrowserTableModel::data(const QModelIndex& index, int role) const
|
||||
{
|
||||
auto sourceIndex = mapToSource(index);
|
||||
if (!sourceIndex.isValid())
|
||||
{
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
AssetBrowserEntry* entry = GetAssetEntry(sourceIndex);
|
||||
if (entry == nullptr)
|
||||
{
|
||||
AZ_Assert(false, "AssetBrowserTableModel - QModelIndex does not reference an AssetEntry. Source model is not valid.");
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
return sourceIndex.data(role);
|
||||
Q_ASSERT(index.isValid() && index.model() == this);
|
||||
return sourceModel()->data(mapToSource(index), role);
|
||||
}
|
||||
|
||||
QModelIndex AssetBrowserTableModel::parent([[maybe_unused]] const QModelIndex& child) const
|
||||
@@ -76,14 +91,28 @@ namespace AzToolsFramework
|
||||
return QModelIndex();
|
||||
}
|
||||
|
||||
void AssetBrowserTableModel::SourceDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight)
|
||||
{
|
||||
for (int row = topLeft.row(); row <= bottomRight.row(); ++row)
|
||||
{
|
||||
if (!m_indexMap.contains(row))
|
||||
{
|
||||
UpdateTableModelMaps();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QModelIndex AssetBrowserTableModel::index(int row, int column, const QModelIndex& parent) const
|
||||
{
|
||||
Q_ASSERT(!parent.isValid());
|
||||
|
||||
return parent.isValid() ? QModelIndex() : createIndex(row, column, m_indexMap[row].internalPointer());
|
||||
}
|
||||
|
||||
int AssetBrowserTableModel::rowCount(const QModelIndex& parent) const
|
||||
{
|
||||
return !parent.isValid() ? m_indexMap.size() : 0;
|
||||
return !parent.isValid() ? m_indexMap.size() : sourceModel()->rowCount(parent);
|
||||
}
|
||||
|
||||
int AssetBrowserTableModel::BuildTableModelMap(
|
||||
@@ -102,14 +131,12 @@ namespace AzToolsFramework
|
||||
{
|
||||
QModelIndex index = model->index(currentRow, 0, parent);
|
||||
AssetBrowserEntry* entry = GetAssetEntry(m_filterModel->mapToSource(index));
|
||||
// We only want to see the source assets.
|
||||
if (entry->GetEntryType() == AssetBrowserEntry::AssetEntryType::Source)
|
||||
// We only want to see source and product assets.
|
||||
if (entry->GetEntryType() == AssetBrowserEntry::AssetEntryType::Source ||
|
||||
entry->GetEntryType() == AssetBrowserEntry::AssetEntryType::Product)
|
||||
{
|
||||
beginInsertRows(parent, row, row);
|
||||
m_indexMap[row] = index;
|
||||
endInsertRows();
|
||||
|
||||
Q_EMIT dataChanged(index, index);
|
||||
m_rowMap[index] = row;
|
||||
++row;
|
||||
++m_displayedItemsCounter;
|
||||
}
|
||||
@@ -143,12 +170,8 @@ namespace AzToolsFramework
|
||||
void AssetBrowserTableModel::UpdateTableModelMaps()
|
||||
{
|
||||
emit layoutAboutToBeChanged();
|
||||
if (!m_indexMap.isEmpty())
|
||||
{
|
||||
beginRemoveRows(m_indexMap.first(), m_indexMap.first().row(), m_indexMap.last().row());
|
||||
m_indexMap.clear();
|
||||
endRemoveRows();
|
||||
}
|
||||
m_indexMap.clear();
|
||||
m_rowMap.clear();
|
||||
|
||||
AzToolsFramework::EditorSettingsAPIBus::BroadcastResult(
|
||||
m_numberOfItemsDisplayed, &AzToolsFramework::EditorSettingsAPIBus::Handler::GetMaxNumberOfItemsShownInSearchView);
|
||||
|
||||
+8
-5
@@ -21,8 +21,7 @@ namespace AzToolsFramework
|
||||
class AssetBrowserFilterModel;
|
||||
class AssetBrowserEntry;
|
||||
|
||||
class AssetBrowserTableModel
|
||||
: public QSortFilterProxyModel
|
||||
class AssetBrowserTableModel : public QSortFilterProxyModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -30,12 +29,11 @@ namespace AzToolsFramework
|
||||
AZ_CLASS_ALLOCATOR(AssetBrowserTableModel, AZ::SystemAllocator, 0);
|
||||
explicit AssetBrowserTableModel(QObject* parent = nullptr);
|
||||
|
||||
void UpdateTableModelMaps();
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// QSortFilterProxyModel
|
||||
void setSourceModel(QAbstractItemModel* sourceModel) override;
|
||||
QModelIndex mapToSource(const QModelIndex& proxyIndex) const override;
|
||||
QModelIndex mapFromSource(const QModelIndex &sourceIndex) const override;
|
||||
QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override;
|
||||
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
|
||||
QModelIndex parent(const QModelIndex& child) const override;
|
||||
@@ -45,16 +43,21 @@ namespace AzToolsFramework
|
||||
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role /* = Qt::DisplayRole */) const override;
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
private:
|
||||
AssetBrowserEntry* GetAssetEntry(QModelIndex index) const;
|
||||
int BuildTableModelMap(const QAbstractItemModel* model, const QModelIndex& parent = QModelIndex(), int row = 0);
|
||||
|
||||
public slots:
|
||||
void UpdateTableModelMaps();
|
||||
|
||||
private slots:
|
||||
void SourceDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight);
|
||||
private:
|
||||
int m_numberOfItemsDisplayed = 50;
|
||||
int m_displayedItemsCounter = 0;
|
||||
QPointer<AssetBrowserFilterModel> m_filterModel;
|
||||
QMap<int, QModelIndex> m_indexMap;
|
||||
QMap<QModelIndex, int> m_rowMap;
|
||||
};
|
||||
} // namespace AssetBrowser
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
+65
-2
@@ -9,9 +9,11 @@
|
||||
#include <AzCore/UserSettings/UserSettings.h>
|
||||
|
||||
#include <AzQtComponents/Components/DockBar.h>
|
||||
#include <AzCore/Console/IConsole.h>
|
||||
|
||||
#include <AzToolsFramework/AssetBrowser/Views/AssetBrowserTreeView.h>
|
||||
#include <AzToolsFramework/AssetBrowser/AssetBrowserFilterModel.h>
|
||||
#include <AzToolsFramework/AssetBrowser/AssetBrowserTableModel.h>
|
||||
#include <AzToolsFramework/AssetBrowser/AssetBrowserModel.h>
|
||||
#include <AzToolsFramework/AssetBrowser/AssetBrowserBus.h>
|
||||
#include <AzToolsFramework/AssetBrowser/AssetSelectionModel.h>
|
||||
@@ -26,6 +28,11 @@ AZ_PUSH_DISABLE_WARNING(4251 4244, "-Wunknown-warning-option") // disable warnin
|
||||
#include <QTimer>
|
||||
AZ_POP_DISABLE_WARNING
|
||||
|
||||
AZ_CVAR(
|
||||
bool, ed_hideAssetPickerPathColumn, false, nullptr, AZ::ConsoleFunctorFlags::Null,
|
||||
"Hide AssetPicker path column for a clearer view.");
|
||||
AZ_CVAR_EXTERNED(bool, ed_useNewAssetBrowserTableView);
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
namespace AssetBrowser
|
||||
@@ -34,6 +41,7 @@ namespace AzToolsFramework
|
||||
: QDialog(parent)
|
||||
, m_ui(new Ui::AssetPickerDialogClass())
|
||||
, m_filterModel(new AssetBrowserFilterModel(parent))
|
||||
, m_tableModel(new AssetBrowserTableModel(parent))
|
||||
, m_selection(selection)
|
||||
, m_hasFilter(false)
|
||||
{
|
||||
@@ -97,6 +105,56 @@ namespace AzToolsFramework
|
||||
|
||||
m_persistentState = AZ::UserSettings::CreateFind<AzToolsFramework::QWidgetSavedState>(AZ::Crc32(("AssetBrowserTreeView_Dialog_" + name).toUtf8().data()), AZ::UserSettings::CT_GLOBAL);
|
||||
|
||||
m_ui->m_assetBrowserTableViewWidget->setVisible(false);
|
||||
if (ed_useNewAssetBrowserTableView)
|
||||
{
|
||||
m_ui->m_assetBrowserTreeViewWidget->setVisible(false);
|
||||
m_ui->m_assetBrowserTableViewWidget->setVisible(true);
|
||||
m_tableModel->setSourceModel(m_filterModel.get());
|
||||
m_ui->m_assetBrowserTableViewWidget->setModel(m_tableModel.get());
|
||||
|
||||
m_ui->m_assetBrowserTableViewWidget->SetName("AssetBrowserTableView_" + name);
|
||||
m_ui->m_assetBrowserTableViewWidget->setDragEnabled(false);
|
||||
m_ui->m_assetBrowserTableViewWidget->setSelectionMode(
|
||||
selection.GetMultiselect() ? QAbstractItemView::SelectionMode::ExtendedSelection
|
||||
: QAbstractItemView::SelectionMode::SingleSelection);
|
||||
|
||||
if (ed_hideAssetPickerPathColumn)
|
||||
{
|
||||
m_ui->m_assetBrowserTableViewWidget->hideColumn(1);
|
||||
}
|
||||
|
||||
// if the current selection is invalid, disable the Ok button
|
||||
m_ui->m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(EvaluateSelection());
|
||||
|
||||
connect(
|
||||
m_filterModel.data(), &AssetBrowserFilterModel::filterChanged, this,
|
||||
[this]()
|
||||
{
|
||||
m_tableModel->UpdateTableModelMaps();
|
||||
});
|
||||
|
||||
connect(
|
||||
m_ui->m_assetBrowserTableViewWidget, &AssetBrowserTableView::selectionChangedSignal, this,
|
||||
[this](const QItemSelection&, const QItemSelection&)
|
||||
{
|
||||
AssetPickerDialog::SelectionChangedSlot();
|
||||
});
|
||||
|
||||
connect(m_ui->m_assetBrowserTableViewWidget, &QAbstractItemView::doubleClicked, this, &AssetPickerDialog::DoubleClickedSlot);
|
||||
|
||||
connect(
|
||||
m_ui->m_assetBrowserTableViewWidget, &AssetBrowserTableView::ClearStringFilter, m_ui->m_searchWidget,
|
||||
&SearchWidget::ClearStringFilter);
|
||||
|
||||
connect(
|
||||
m_ui->m_assetBrowserTableViewWidget, &AssetBrowserTableView::ClearTypeFilter, m_ui->m_searchWidget,
|
||||
&SearchWidget::ClearTypeFilter);
|
||||
|
||||
m_ui->m_assetBrowserTableViewWidget->SetName("AssetBrowserTableView_main");
|
||||
m_tableModel->UpdateTableModelMaps();
|
||||
}
|
||||
|
||||
QTimer::singleShot(0, this, &AssetPickerDialog::RestoreState);
|
||||
SelectionChangedSlot();
|
||||
}
|
||||
@@ -134,6 +192,7 @@ namespace AzToolsFramework
|
||||
{
|
||||
m_ui->m_assetBrowserTreeViewWidget->expandAll();
|
||||
});
|
||||
m_tableModel->UpdateTableModelMaps();
|
||||
}
|
||||
|
||||
if (m_hasFilter && !hasFilter)
|
||||
@@ -166,7 +225,8 @@ namespace AzToolsFramework
|
||||
|
||||
bool AssetPickerDialog::EvaluateSelection() const
|
||||
{
|
||||
auto selectedAssets = m_ui->m_assetBrowserTreeViewWidget->GetSelectedAssets();
|
||||
auto selectedAssets = m_ui->m_assetBrowserTreeViewWidget->isVisible() ? m_ui->m_assetBrowserTreeViewWidget->GetSelectedAssets()
|
||||
: m_ui->m_assetBrowserTableViewWidget->GetSelectedAssets();
|
||||
// exactly one item must be selected, even if multi-select option is disabled, still good practice to check
|
||||
if (selectedAssets.empty())
|
||||
{
|
||||
@@ -197,7 +257,10 @@ namespace AzToolsFramework
|
||||
|
||||
void AssetPickerDialog::UpdatePreview() const
|
||||
{
|
||||
auto selectedAssets = m_ui->m_assetBrowserTreeViewWidget->GetSelectedAssets();
|
||||
auto selectedAssets = m_ui->m_assetBrowserTreeViewWidget->isVisible()
|
||||
? m_ui->m_assetBrowserTreeViewWidget->GetSelectedAssets()
|
||||
: m_ui->m_assetBrowserTableViewWidget->GetSelectedAssets();
|
||||
;
|
||||
if (selectedAssets.size() != 1)
|
||||
{
|
||||
m_ui->m_previewerFrame->Clear();
|
||||
|
||||
+2
@@ -33,6 +33,7 @@ namespace AzToolsFramework
|
||||
{
|
||||
class ProductAssetBrowserEntry;
|
||||
class AssetBrowserFilterModel;
|
||||
class AssetBrowserTableModel;
|
||||
class AssetBrowserModel;
|
||||
class AssetSelectionModel;
|
||||
|
||||
@@ -69,6 +70,7 @@ namespace AzToolsFramework
|
||||
QScopedPointer<Ui::AssetPickerDialogClass> m_ui;
|
||||
AssetBrowserModel* m_assetBrowserModel = nullptr;
|
||||
QScopedPointer<AssetBrowserFilterModel> m_filterModel;
|
||||
QScopedPointer<AssetBrowserTableModel> m_tableModel;
|
||||
AssetSelectionModel& m_selection;
|
||||
bool m_hasFilter;
|
||||
AZStd::unique_ptr<TreeViewState> m_filterStateSaver;
|
||||
|
||||
+8
@@ -142,6 +142,9 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="AzToolsFramework::AssetBrowser::AssetBrowserTableView" name="m_assetBrowserTableViewWidget"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="verticalLayoutWidget">
|
||||
@@ -197,6 +200,11 @@
|
||||
<header>AzToolsFramework/AssetBrowser/Previewer/PreviewerFrame.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>AzToolsFramework::AssetBrowser::AssetBrowserTableView</class>
|
||||
<extends>QTableView</extends>
|
||||
<header>AzToolsFramework/AssetBrowser/Views/AssetBrowserTableView.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
||||
-1
@@ -53,7 +53,6 @@ namespace AzToolsFramework
|
||||
// AssetBrowserComponentNotificationBus
|
||||
void OnAssetBrowserComponentReady() override;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Q_SIGNALS:
|
||||
void selectionChangedSignal(const QItemSelection& selected, const QItemSelection& deselected);
|
||||
void ClearStringFilter();
|
||||
|
||||
+1
@@ -65,6 +65,7 @@ namespace AzToolsFramework
|
||||
AddedScanTimeSecondsSinceEpochField = 29,
|
||||
ChangedSortFunctionFromQSortToStdStableSort = 30,
|
||||
RemoveOutputPrefixFromScanFolders,
|
||||
AddedSourceIndexForSourceDependencyTable,
|
||||
//Add all new versions before this
|
||||
DatabaseVersionCount,
|
||||
LatestVersion = DatabaseVersionCount - 1
|
||||
|
||||
@@ -43,7 +43,6 @@ AzToolsFramework--EntityOutlinerCheckBox
|
||||
padding: 0;
|
||||
padding-right: 2px;
|
||||
line-height: 0px;
|
||||
font-size: 0px;
|
||||
margin: 0px;
|
||||
max-height: 20px;
|
||||
max-width: 18px;
|
||||
@@ -59,7 +58,6 @@ AzToolsFramework--EntityOutlinerCheckBox::indicator
|
||||
spacing: 0px;
|
||||
padding: 0px;
|
||||
line-height: 0px;
|
||||
font-size: 0px;
|
||||
margin: 3px 0 0 0;
|
||||
max-width: 18px;
|
||||
width: 18px;
|
||||
|
||||
@@ -99,5 +99,6 @@ namespace AzToolsFramework
|
||||
|
||||
// Draw border at the bottom
|
||||
painter->drawLine(rect.bottomLeft(), rect.bottomRight());
|
||||
painter->restore();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
set_property(GLOBAL PROPERTY LAUNCHER_UNIFIED_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
# Launcher targets for a project need to be generated when configuring a project.
|
||||
# When building the engine source, this file will be included by LauncherUnified's CMakeLists.txt
|
||||
# When using an installed engine, this file will be included by the FindLauncherGenerator.cmake script
|
||||
@@ -121,6 +121,7 @@ foreach(project_name project_path IN ZIP_LISTS LY_PROJECTS_TARGET_NAME LY_PROJEC
|
||||
set_target_properties(${project_name}.GameLauncher
|
||||
PROPERTIES
|
||||
FOLDER ${project_name}
|
||||
LY_PROJECT_NAME ${project_name}
|
||||
)
|
||||
|
||||
# After ensuring that we correctly support DPI scaling, this should be switched to "PerMonitor"
|
||||
@@ -129,6 +130,9 @@ foreach(project_name project_path IN ZIP_LISTS LY_PROJECTS_TARGET_NAME LY_PROJEC
|
||||
set_property(TARGET ${project_name}.GameLauncher APPEND PROPERTY VS_DEBUGGER_COMMAND_ARGUMENTS "--project-path=\"${LY_DEFAULT_PROJECT_PATH}\"")
|
||||
endif()
|
||||
|
||||
# Associate the Clients Gem Variant with each projects GameLauncher
|
||||
ly_set_gem_variant_to_load(TARGETS ${project_name}.GameLauncher VARIANTS Clients)
|
||||
|
||||
################################################################################
|
||||
# Server
|
||||
################################################################################
|
||||
@@ -168,11 +172,15 @@ foreach(project_name project_path IN ZIP_LISTS LY_PROJECTS_TARGET_NAME LY_PROJEC
|
||||
set_target_properties(${project_name}.ServerLauncher
|
||||
PROPERTIES
|
||||
FOLDER ${project_name}
|
||||
LY_PROJECT_NAME ${project_name}
|
||||
)
|
||||
|
||||
if(LY_DEFAULT_PROJECT_PATH)
|
||||
set_property(TARGET ${project_name}.ServerLauncher APPEND PROPERTY VS_DEBUGGER_COMMAND_ARGUMENTS "--project-path=\"${LY_DEFAULT_PROJECT_PATH}\"")
|
||||
endif()
|
||||
|
||||
# Associate the Servers Gem Variant with each projects ServerLauncher
|
||||
ly_set_gem_variant_to_load(TARGETS ${project_name}.ServerLauncher VARIANTS Servers)
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
@@ -9,4 +9,5 @@
|
||||
set(FILES
|
||||
LauncherProject.cpp
|
||||
StaticModules.in
|
||||
launcher_generator.cmake
|
||||
)
|
||||
|
||||
@@ -13,10 +13,6 @@
|
||||
#define CRYINCLUDE_CRYCOMMON_APPLESPECIFIC_H
|
||||
#pragma once
|
||||
|
||||
#if defined(__clang__)
|
||||
#pragma diagnostic ignore "-W#pragma-messages"
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Standard includes.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -118,10 +118,6 @@ struct IConsoleVarSink
|
||||
// </interfuscator:shuffle>
|
||||
};
|
||||
|
||||
#if defined(GetCommandLine)
|
||||
#undef GetCommandLine
|
||||
#endif
|
||||
|
||||
// Interface to the arguments of the console command.
|
||||
struct IConsoleCmdArgs
|
||||
{
|
||||
|
||||
@@ -39,6 +39,7 @@ ly_add_source_properties(
|
||||
)
|
||||
|
||||
if(TARGET AssetBuilder)
|
||||
ly_set_gem_variant_to_load(TARGETS AssetBuilder VARIANTS Builders)
|
||||
# Adds the AssetBuilder target as a C preprocessor define so that it can be used as a Settings Registry
|
||||
# specialization in order to look up the generated .setreg which contains the dependencies
|
||||
# specified for the AssetBuilder in the <Project>/Gem/Code/CMakeLists via ly_add_project_dependencies
|
||||
|
||||
@@ -81,6 +81,7 @@ ly_add_target(
|
||||
# specialization in order to look up the generated .setreg which contains the dependencies
|
||||
# specified for the target.
|
||||
if(TARGET AssetProcessor)
|
||||
ly_set_gem_variant_to_load(TARGETS AssetProcessor VARIANTS Builders)
|
||||
set_source_files_properties(
|
||||
native/AssetProcessorBuildTarget.cpp
|
||||
PROPERTIES
|
||||
@@ -130,6 +131,7 @@ endif()
|
||||
# specialization in order to look up the generated .setreg which contains the dependencies
|
||||
# specified for the target.
|
||||
if(TARGET AssetProcessorBatch)
|
||||
ly_set_gem_variant_to_load(TARGETS AssetProcessorBatch VARIANTS Builders)
|
||||
set_source_files_properties(
|
||||
native/AssetProcessorBatchBuildTarget.cpp
|
||||
PROPERTIES
|
||||
|
||||
@@ -66,7 +66,7 @@ int main(int argc, char* argv[])
|
||||
processLaunchInfo.m_environmentVariables = &envVars;
|
||||
processLaunchInfo.m_showWindow = true;
|
||||
|
||||
AZStd::unique_ptr<AzFramework::ProcessWatcher> processWatcher(AzFramework::ProcessWatcher::LaunchProcess(processLaunchInfo, AzFramework::ProcessCommunicationType::COMMUNICATOR_TYPE_NONE));
|
||||
AzFramework::ProcessLauncher::LaunchUnwatchedProcess(processLaunchInfo);
|
||||
|
||||
application.Destroy();
|
||||
|
||||
|
||||
@@ -758,6 +758,14 @@ namespace AssetProcessor
|
||||
"FileID = :fileid;";
|
||||
static const auto s_DeleteFileQuery = MakeSqlQuery(DELETE_FILE, DELETE_FILE_STATEMENT, LOG_NAME,
|
||||
SqlParam<AZ::s64>(":fileid"));
|
||||
|
||||
static const char* CREATEINDEX_SOURCEDEPENDENCY_SOURCE = "AssetProcesser::CreateIndexSourceSourceDependency";
|
||||
static const char* CREATEINDEX_SOURCEDEPENDENCY_SOURCE_STATEMENT =
|
||||
"CREATE INDEX IF NOT EXISTS Source_SourceDependency ON SourceDependency (Source);";
|
||||
|
||||
static const char* DROPINDEX_BUILDERGUID_SOURCE_SOURCEDEPENDENCY = "AssetProcesser::DropIndexBuilderGuid_Source_SourceDependency";
|
||||
static const char* DROPINDEX_BUILDERGUID_SOURCE_SOURCEDEPENDENCY_STATEMENT =
|
||||
"DROP INDEX IF EXISTS BuilderGuid_Source_SourceDependency;";
|
||||
}
|
||||
|
||||
AssetDatabaseConnection::AssetDatabaseConnection()
|
||||
@@ -1033,6 +1041,15 @@ namespace AssetProcessor
|
||||
// sqlite doesn't not support altering a table to remove a column
|
||||
// This is fine as the extra OutputPrefix column will not be queried
|
||||
|
||||
if (foundVersion == AssetDatabase::DatabaseVersion::RemoveOutputPrefixFromScanFolders)
|
||||
{
|
||||
if (m_databaseConnection->ExecuteOneOffStatement(DROPINDEX_BUILDERGUID_SOURCE_SOURCEDEPENDENCY) && m_databaseConnection->ExecuteOneOffStatement(CREATEINDEX_SOURCEDEPENDENCY_SOURCE))
|
||||
{
|
||||
foundVersion = AssetDatabase::DatabaseVersion::AddedSourceIndexForSourceDependencyTable;
|
||||
AZ_TracePrintf(AssetProcessor::ConsoleChannel, "Upgraded Asset Database to version %i (AddedSourceIndexForSourceDependencyTable)\n", foundVersion)
|
||||
}
|
||||
}
|
||||
|
||||
if (foundVersion == CurrentDatabaseVersion())
|
||||
{
|
||||
dropAllTables = false;
|
||||
@@ -1306,6 +1323,12 @@ namespace AssetProcessor
|
||||
m_databaseConnection->AddStatement(CREATEINDEX_SCANFOLDERS_FILES, CREATEINDEX_SCANFOLDERS_FILES_STATEMENT);
|
||||
m_createStatements.push_back(CREATEINDEX_SCANFOLDERS_FILES);
|
||||
|
||||
m_databaseConnection->AddStatement(CREATEINDEX_SOURCEDEPENDENCY_SOURCE, CREATEINDEX_SOURCEDEPENDENCY_SOURCE_STATEMENT);
|
||||
m_createStatements.push_back(CREATEINDEX_SOURCEDEPENDENCY_SOURCE);
|
||||
|
||||
m_databaseConnection->AddStatement(DROPINDEX_BUILDERGUID_SOURCE_SOURCEDEPENDENCY, DROPINDEX_BUILDERGUID_SOURCE_SOURCEDEPENDENCY_STATEMENT);
|
||||
m_createStatements.push_back(DROPINDEX_BUILDERGUID_SOURCE_SOURCEDEPENDENCY);
|
||||
|
||||
m_databaseConnection->AddStatement(DELETE_AUTO_SUCCEED_JOBS, DELETE_AUTO_SUCCEED_JOBS_STATEMENT);
|
||||
}
|
||||
|
||||
|
||||
@@ -715,12 +715,7 @@ void AssetProcessingStateDataUnitTest::DataTest(AssetProcessor::AssetDatabaseCon
|
||||
|
||||
//try retrieving this source by id
|
||||
UNIT_TEST_EXPECT_TRUE(stateData->GetJobByJobID(job.m_jobID, job));
|
||||
if (job.m_jobID == AzToolsFramework::AssetDatabase::InvalidEntryId ||
|
||||
job.m_jobID != job.m_jobID ||
|
||||
job.m_sourcePK != job.m_sourcePK ||
|
||||
job.m_jobKey != job.m_jobKey ||
|
||||
job.m_fingerprint != job.m_fingerprint ||
|
||||
job.m_platform != job.m_platform)
|
||||
if (job.m_jobID == AzToolsFramework::AssetDatabase::InvalidEntryId)
|
||||
{
|
||||
Q_EMIT UnitTestFailed("AssetProcessingStateDataTest Failed - GetJobByJobID failed");
|
||||
return;
|
||||
|
||||
@@ -57,9 +57,6 @@
|
||||
|
||||
#include <sstream>
|
||||
|
||||
// windows headers bring in a macro which conflicts GetCommandLine
|
||||
#undef GetCommandLine
|
||||
|
||||
namespace AssetUtilsInternal
|
||||
{
|
||||
static const unsigned int g_RetryWaitInterval = 250; // The amount of time that we are waiting for retry.
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace AzTestRunner
|
||||
{
|
||||
static char cwd_buffer[AZ_MAX_PATH_LEN] = { '\0' };
|
||||
|
||||
AZ::Utils::ExecutablePathResult result = AZ::Utils::GetExecutableDirectory(cwd_buffer, AZ_ARRAY_SIZE(cwd_buffer));
|
||||
[[maybe_unused]] AZ::Utils::ExecutablePathResult result = AZ::Utils::GetExecutableDirectory(cwd_buffer, AZ_ARRAY_SIZE(cwd_buffer));
|
||||
AZ_Assert(result == AZ::Utils::ExecutablePathResult::Success, "Error retrieving executable path");
|
||||
|
||||
return static_cast<const char*>(cwd_buffer);
|
||||
|
||||
@@ -157,15 +157,16 @@ QTabBar::tab:focus {
|
||||
font-size:14px;
|
||||
text-align:left;
|
||||
margin:0;
|
||||
padding-top:10px;
|
||||
padding-bottom:-5px;
|
||||
min-height:15px;
|
||||
max-height:15px;
|
||||
padding-top:0px;
|
||||
padding-bottom:0px;
|
||||
min-height:20px;
|
||||
max-height:20px;
|
||||
}
|
||||
#headerSubTitle {
|
||||
font-size:24px;
|
||||
text-align:left;
|
||||
margin:0;
|
||||
padding-top:-5px;
|
||||
min-height:42px;
|
||||
max-height:42px;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,18 @@
|
||||
#include <SceneAPI/SceneCore/Containers/Views/PairIterator.h>
|
||||
#include <SceneAPI/SceneCore/Tests/Containers/Views/IteratorTestsBase.h>
|
||||
|
||||
// This test gives trouble with /permissive-, the following instantiation workarounds the missing resolution
|
||||
namespace std
|
||||
{
|
||||
template<>
|
||||
void iter_swap(
|
||||
AZ::SceneAPI::Containers::Views::PairIterator<int*, int*, std::random_access_iterator_tag> lhs,
|
||||
AZ::SceneAPI::Containers::Views::PairIterator<int*, int*, std::random_access_iterator_tag> rhs)
|
||||
{
|
||||
AZStd::iter_swap(lhs, rhs);
|
||||
}
|
||||
}
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
namespace SceneAPI
|
||||
|
||||
@@ -230,6 +230,19 @@ namespace AZ
|
||||
return m_uniqueId;
|
||||
}
|
||||
|
||||
namespace Helper
|
||||
{
|
||||
template <typename T>
|
||||
T ReturnOptionalValue(AZStd::optional<T> value)
|
||||
{
|
||||
if (!value)
|
||||
{
|
||||
return {};
|
||||
}
|
||||
return value.value();
|
||||
}
|
||||
}
|
||||
|
||||
void MaterialData::Reflect(ReflectContext* context)
|
||||
{
|
||||
SerializeContext* serializeContext = azrtti_cast<SerializeContext*>(context);
|
||||
@@ -285,6 +298,76 @@ namespace AZ
|
||||
->DataElement(AZ::Edit::UIHandlers::Default, &MaterialData::m_useAOMap, "Use Ambient Occlusion Map", "True to use an ambient occlusion map, false to ignore it.");
|
||||
}
|
||||
}
|
||||
|
||||
BehaviorContext* behaviorContext = azrtti_cast<BehaviorContext*>(context);
|
||||
if (behaviorContext)
|
||||
{
|
||||
behaviorContext->Class<SceneAPI::DataTypes::IMaterialData>()
|
||||
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
|
||||
->Attribute(AZ::Script::Attributes::Module, "scene");
|
||||
|
||||
using namespace Helper;
|
||||
using DataTypes::IMaterialData;
|
||||
|
||||
behaviorContext->Class<MaterialData>()
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
|
||||
->Attribute(AZ::Script::Attributes::Module, "scene")
|
||||
->Constant("AmbientOcclusion", BehaviorConstant(TextureMapType::AmbientOcclusion))
|
||||
->Constant("BaseColor", BehaviorConstant(TextureMapType::BaseColor))
|
||||
->Constant("Bump", BehaviorConstant(TextureMapType::Bump))
|
||||
->Constant("Diffuse", BehaviorConstant(TextureMapType::Diffuse))
|
||||
->Constant("Emissive", BehaviorConstant(TextureMapType::Emissive))
|
||||
->Constant("Metallic", BehaviorConstant(TextureMapType::Metallic))
|
||||
->Constant("Normal", BehaviorConstant(TextureMapType::Normal))
|
||||
->Constant("Roughness", BehaviorConstant(TextureMapType::Roughness))
|
||||
->Constant("Specular", BehaviorConstant(TextureMapType::Specular))
|
||||
->Method("GetTexture", &MaterialData::GetTexture)
|
||||
->Method("GetMaterialName", &MaterialData::GetMaterialName)
|
||||
->Method("IsNoDraw", &MaterialData::IsNoDraw)
|
||||
->Method("GetDiffuseColor", &MaterialData::GetDiffuseColor)
|
||||
->Method("GetSpecularColor", &MaterialData::GetSpecularColor)
|
||||
->Method("GetEmissiveColor", &MaterialData::GetEmissiveColor)
|
||||
->Method("GetOpacity", &MaterialData::GetOpacity)
|
||||
->Method("GetUniqueId", &MaterialData::GetUniqueId)
|
||||
->Method("GetShininess", &MaterialData::GetShininess)
|
||||
->Method("GetUseColorMap", [](const MaterialData& self)
|
||||
{
|
||||
return ReturnOptionalValue(self.GetUseColorMap());
|
||||
})
|
||||
->Method("GetBaseColor", [](const MaterialData& self)
|
||||
{
|
||||
return ReturnOptionalValue(self.GetBaseColor());
|
||||
})
|
||||
->Method("GetUseMetallicMap", [](const MaterialData& self)
|
||||
{
|
||||
return ReturnOptionalValue(self.GetUseMetallicMap());
|
||||
})
|
||||
->Method("GetMetallicFactor", [](const MaterialData& self)
|
||||
{
|
||||
return ReturnOptionalValue(self.GetMetallicFactor());
|
||||
})
|
||||
->Method("GetUseRoughnessMap", [](const MaterialData& self)
|
||||
{
|
||||
return ReturnOptionalValue(self.GetUseRoughnessMap());
|
||||
})
|
||||
->Method("GetRoughnessFactor", [](const MaterialData& self)
|
||||
{
|
||||
return ReturnOptionalValue(self.GetRoughnessFactor());
|
||||
})
|
||||
->Method("GetUseEmissiveMap", [](const MaterialData& self)
|
||||
{
|
||||
return ReturnOptionalValue(self.GetUseEmissiveMap());
|
||||
})
|
||||
->Method("GetEmissiveIntensity", [](const MaterialData& self)
|
||||
{
|
||||
return ReturnOptionalValue(self.GetEmissiveIntensity());
|
||||
})
|
||||
->Method("GetUseAOMap", [](const MaterialData& self)
|
||||
{
|
||||
return ReturnOptionalValue(self.GetUseAOMap());
|
||||
});
|
||||
}
|
||||
}
|
||||
} // namespace GraphData
|
||||
} // namespace SceneData
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <AzCore/Serialization/Json/RegistrationContext.h>
|
||||
#include <AzCore/std/smart_ptr/make_shared.h>
|
||||
#include <AzCore/std/smart_ptr/shared_ptr.h>
|
||||
#include <AzCore/std/optional.h>
|
||||
#include <AzCore/UnitTest/TestTypes.h>
|
||||
#include <AzTest/AzTest.h>
|
||||
|
||||
@@ -27,6 +28,7 @@
|
||||
#include <SceneAPI/SceneData/GraphData/MeshVertexUVData.h>
|
||||
#include <SceneAPI/SceneData/GraphData/AnimationData.h>
|
||||
#include <SceneAPI/SceneData/GraphData/BlendShapeData.h>
|
||||
#include <SceneAPI/SceneData/GraphData/MaterialData.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
@@ -145,6 +147,38 @@ namespace AZ
|
||||
blendShapeData->SetVertexIndexToControlPointIndexMap(2, 0);
|
||||
return true;
|
||||
}
|
||||
else if (data.get_type_info().m_id == azrtti_typeid<AZ::SceneData::GraphData::MaterialData>())
|
||||
{
|
||||
auto* materialDataData = AZStd::any_cast<AZ::SceneData::GraphData::MaterialData>(&data);
|
||||
materialDataData->SetBaseColor(AZStd::make_optional(AZ::Vector3(0.1, 0.2, 0.3)));
|
||||
materialDataData->SetDiffuseColor({ 0.3, 0.4, 0.5 });
|
||||
materialDataData->SetEmissiveColor({ 0.4, 0.5, 0.6 });
|
||||
materialDataData->SetEmissiveIntensity(AZStd::make_optional(0.789f));
|
||||
materialDataData->SetMaterialName("TestMaterialName");
|
||||
materialDataData->SetMetallicFactor(AZStd::make_optional(0.123f));
|
||||
materialDataData->SetNoDraw(true);
|
||||
materialDataData->SetOpacity(0.7);
|
||||
materialDataData->SetRoughnessFactor(AZStd::make_optional(0.456f));
|
||||
materialDataData->SetShininess(1.23);
|
||||
materialDataData->SetSpecularColor({ 0.8, 0.9, 1.0 });
|
||||
materialDataData->SetUseAOMap(AZStd::make_optional(true));
|
||||
materialDataData->SetUseColorMap(AZStd::make_optional(true));
|
||||
materialDataData->SetUseMetallicMap(AZStd::make_optional(true));
|
||||
materialDataData->SetUseRoughnessMap(AZStd::make_optional(true));
|
||||
materialDataData->SetUseEmissiveMap(AZStd::make_optional(true));
|
||||
materialDataData->SetUniqueId(102938);
|
||||
materialDataData->SetTexture(AZ::SceneAPI::DataTypes::IMaterialData::TextureMapType::AmbientOcclusion, "ambientocclusion");
|
||||
materialDataData->SetTexture(AZ::SceneAPI::DataTypes::IMaterialData::TextureMapType::BaseColor, "basecolor");
|
||||
materialDataData->SetTexture(AZ::SceneAPI::DataTypes::IMaterialData::TextureMapType::Bump, "bump");
|
||||
materialDataData->SetTexture(AZ::SceneAPI::DataTypes::IMaterialData::TextureMapType::Diffuse, "diffuse");
|
||||
materialDataData->SetTexture(AZ::SceneAPI::DataTypes::IMaterialData::TextureMapType::Emissive, "emissive");
|
||||
materialDataData->SetTexture(AZ::SceneAPI::DataTypes::IMaterialData::TextureMapType::Metallic, "metallic");
|
||||
materialDataData->SetTexture(AZ::SceneAPI::DataTypes::IMaterialData::TextureMapType::Normal, "normal");
|
||||
materialDataData->SetTexture(AZ::SceneAPI::DataTypes::IMaterialData::TextureMapType::Roughness, "roughness");
|
||||
materialDataData->SetTexture(AZ::SceneAPI::DataTypes::IMaterialData::TextureMapType::Specular, "specular");
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -337,7 +371,7 @@ namespace AZ
|
||||
ExpectExecute("TestExpectFloatEquals(tangentData.z, 0.19)");
|
||||
ExpectExecute("TestExpectFloatEquals(tangentData.w, 0.29)");
|
||||
ExpectExecute("TestExpectIntegerEquals(meshVertexTangentData:GetTangentSetIndex(), 2)");
|
||||
ExpectExecute("TestExpectTrue(meshVertexTangentData:GetGenerationMethod(), MeshVertexTangentData.EMotionFX)");
|
||||
ExpectExecute("TestExpectTrue(meshVertexTangentData:GetGenerationMethod(), MeshVertexTangentData.MikkT)");
|
||||
}
|
||||
|
||||
TEST_F(GrapDatahBehaviorScriptTest, SceneGraph_AnimationData_AccessWorks)
|
||||
@@ -449,6 +483,49 @@ namespace AZ
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetBitangent(2).y, 0.3)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetBitangent(2).z, 0.4)");
|
||||
}
|
||||
|
||||
TEST_F(GrapDatahBehaviorScriptTest, SceneGraph_MaterialData_AccessWorks)
|
||||
{
|
||||
ExpectExecute("materialData = MaterialData()");
|
||||
ExpectExecute("TestExpectTrue(materialData ~= nil)");
|
||||
ExpectExecute("TestExpectTrue(materialData:IsNoDraw() == false)");
|
||||
ExpectExecute("TestExpectTrue(materialData:GetUseColorMap() == false)");
|
||||
ExpectExecute("TestExpectTrue(materialData:GetUseMetallicMap() == false)");
|
||||
ExpectExecute("TestExpectTrue(materialData:GetUseRoughnessMap() == false)");
|
||||
ExpectExecute("TestExpectTrue(materialData:GetUseEmissiveMap() == false)");
|
||||
ExpectExecute("TestExpectTrue(materialData:GetUseAOMap() == false)");
|
||||
ExpectExecute("MockGraphData.FillData(materialData)");
|
||||
ExpectExecute("TestExpectTrue(materialData:IsNoDraw())");
|
||||
ExpectExecute("TestExpectTrue(materialData:GetUseColorMap())");
|
||||
ExpectExecute("TestExpectTrue(materialData:GetUseMetallicMap())");
|
||||
ExpectExecute("TestExpectTrue(materialData:GetUseRoughnessMap())");
|
||||
ExpectExecute("TestExpectTrue(materialData:GetUseEmissiveMap())");
|
||||
ExpectExecute("TestExpectTrue(materialData:GetUseAOMap())");
|
||||
ExpectExecute("TestExpectFloatEquals(materialData:GetMetallicFactor(), 0.123)");
|
||||
ExpectExecute("TestExpectFloatEquals(materialData:GetRoughnessFactor(), 0.456)");
|
||||
ExpectExecute("TestExpectFloatEquals(materialData:GetEmissiveIntensity(), 0.789)");
|
||||
ExpectExecute("TestExpectFloatEquals(materialData:GetOpacity(), 0.7)");
|
||||
ExpectExecute("TestExpectFloatEquals(materialData:GetShininess(), 1.23)");
|
||||
ExpectExecute("TestExpectTrue(materialData:GetMaterialName() == 'TestMaterialName')");
|
||||
ExpectExecute("TestExpectFloatEquals(materialData:GetBaseColor().x, 0.1)");
|
||||
ExpectExecute("TestExpectFloatEquals(materialData:GetBaseColor().y, 0.2)");
|
||||
ExpectExecute("TestExpectFloatEquals(materialData:GetBaseColor().z, 0.3)");
|
||||
ExpectExecute("TestExpectFloatEquals(materialData:GetDiffuseColor().x, 0.3)");
|
||||
ExpectExecute("TestExpectFloatEquals(materialData:GetDiffuseColor().y, 0.4)");
|
||||
ExpectExecute("TestExpectFloatEquals(materialData:GetDiffuseColor().z, 0.5)");
|
||||
ExpectExecute("TestExpectFloatEquals(materialData:GetEmissiveColor().x, 0.4)");
|
||||
ExpectExecute("TestExpectFloatEquals(materialData:GetEmissiveColor().y, 0.5)");
|
||||
ExpectExecute("TestExpectFloatEquals(materialData:GetEmissiveColor().z, 0.6)");
|
||||
ExpectExecute("TestExpectIntegerEquals(materialData:GetUniqueId(), 102938)");
|
||||
ExpectExecute("TestExpectTrue(materialData:GetTexture(MaterialData.AmbientOcclusion) == 'ambientocclusion')");
|
||||
ExpectExecute("TestExpectTrue(materialData:GetTexture(MaterialData.Bump) == 'bump')");
|
||||
ExpectExecute("TestExpectTrue(materialData:GetTexture(MaterialData.Diffuse) == 'diffuse')");
|
||||
ExpectExecute("TestExpectTrue(materialData:GetTexture(MaterialData.Emissive) == 'emissive')");
|
||||
ExpectExecute("TestExpectTrue(materialData:GetTexture(MaterialData.Metallic) == 'metallic')");
|
||||
ExpectExecute("TestExpectTrue(materialData:GetTexture(MaterialData.Normal) == 'normal')");
|
||||
ExpectExecute("TestExpectTrue(materialData:GetTexture(MaterialData.Roughness) == 'roughness')");
|
||||
ExpectExecute("TestExpectTrue(materialData:GetTexture(MaterialData.Specular) == 'specular')");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+12
-12
@@ -368,7 +368,7 @@ namespace TestImpact
|
||||
const AZStd::vector<AZStd::string>& draftedTestRuns,
|
||||
TestRunReport&& selectedTestRunReport,
|
||||
TestRunReport&& draftedTestRunReport)
|
||||
: SequenceReportBase(
|
||||
: SequenceReportBase<PolicyStateType> (
|
||||
type,
|
||||
maxConcurrency,
|
||||
testTargetTimeout,
|
||||
@@ -397,57 +397,57 @@ namespace TestImpact
|
||||
// SequenceReport overrides ...
|
||||
AZStd::chrono::milliseconds GetDuration() const override
|
||||
{
|
||||
return SequenceReportBase::GetDuration() + m_draftedTestRunReport.GetDuration();
|
||||
return GetDuration() + m_draftedTestRunReport.GetDuration();
|
||||
}
|
||||
|
||||
TestSequenceResult GetResult() const override
|
||||
{
|
||||
return CalculateMultiTestSequenceResult({ SequenceReportBase::GetResult(), m_draftedTestRunReport.GetResult() });
|
||||
return CalculateMultiTestSequenceResult({ GetResult(), m_draftedTestRunReport.GetResult() });
|
||||
}
|
||||
|
||||
size_t GetTotalNumTestRuns() const override
|
||||
{
|
||||
return SequenceReportBase::GetTotalNumTestRuns() + m_draftedTestRunReport.GetTotalNumTestRuns();
|
||||
return GetTotalNumTestRuns() + m_draftedTestRunReport.GetTotalNumTestRuns();
|
||||
}
|
||||
|
||||
size_t GetTotalNumPassingTests() const override
|
||||
{
|
||||
return SequenceReportBase::GetTotalNumPassingTests() + m_draftedTestRunReport.GetTotalNumPassingTests();
|
||||
return GetTotalNumPassingTests() + m_draftedTestRunReport.GetTotalNumPassingTests();
|
||||
}
|
||||
|
||||
size_t GetTotalNumFailingTests() const override
|
||||
{
|
||||
return SequenceReportBase::GetTotalNumFailingTests() + m_draftedTestRunReport.GetTotalNumFailingTests();
|
||||
return GetTotalNumFailingTests() + m_draftedTestRunReport.GetTotalNumFailingTests();
|
||||
}
|
||||
|
||||
size_t GetTotalNumDisabledTests() const override
|
||||
{
|
||||
return SequenceReportBase::GetTotalNumDisabledTests() + m_draftedTestRunReport.GetTotalNumDisabledTests();
|
||||
return GetTotalNumDisabledTests() + m_draftedTestRunReport.GetTotalNumDisabledTests();
|
||||
}
|
||||
|
||||
size_t GetTotalNumPassingTestRuns() const override
|
||||
{
|
||||
return SequenceReportBase::GetTotalNumPassingTestRuns() + m_draftedTestRunReport.GetNumPassingTestRuns();
|
||||
return GetTotalNumPassingTestRuns() + m_draftedTestRunReport.GetNumPassingTestRuns();
|
||||
}
|
||||
|
||||
size_t GetTotalNumFailingTestRuns() const override
|
||||
{
|
||||
return SequenceReportBase::GetTotalNumFailingTestRuns() + m_draftedTestRunReport.GetNumFailingTestRuns();
|
||||
return GetTotalNumFailingTestRuns() + m_draftedTestRunReport.GetNumFailingTestRuns();
|
||||
}
|
||||
|
||||
size_t GetTotalNumExecutionFailureTestRuns() const override
|
||||
{
|
||||
return SequenceReportBase::GetTotalNumExecutionFailureTestRuns() + m_draftedTestRunReport.GetNumExecutionFailureTestRuns();
|
||||
return GetTotalNumExecutionFailureTestRuns() + m_draftedTestRunReport.GetNumExecutionFailureTestRuns();
|
||||
}
|
||||
|
||||
size_t GetTotalNumTimedOutTestRuns() const override
|
||||
{
|
||||
return SequenceReportBase::GetTotalNumTimedOutTestRuns() + m_draftedTestRunReport.GetNumTimedOutTestRuns();
|
||||
return GetTotalNumTimedOutTestRuns() + m_draftedTestRunReport.GetNumTimedOutTestRuns();
|
||||
}
|
||||
|
||||
size_t GetTotalNumUnexecutedTestRuns() const override
|
||||
{
|
||||
return SequenceReportBase::GetTotalNumUnexecutedTestRuns() + m_draftedTestRunReport.GetNumUnexecutedTestRuns();
|
||||
return GetTotalNumUnexecutedTestRuns() + m_draftedTestRunReport.GetNumUnexecutedTestRuns();
|
||||
}
|
||||
private:
|
||||
AZStd::vector<AZStd::string> m_draftedTestRuns;
|
||||
|
||||
+5
-5
@@ -26,11 +26,11 @@ namespace TestImpact
|
||||
constexpr RepoPath() = default;
|
||||
constexpr RepoPath(const RepoPath&) = default;
|
||||
constexpr RepoPath(RepoPath&&) noexcept = default;
|
||||
constexpr RepoPath::RepoPath(const string_type& path) noexcept;
|
||||
constexpr RepoPath::RepoPath(const string_view_type& path) noexcept;
|
||||
constexpr RepoPath::RepoPath(const value_type* path) noexcept;
|
||||
constexpr RepoPath::RepoPath(const AZ::IO::PathView& path);
|
||||
constexpr RepoPath::RepoPath(const AZ::IO::Path& path);
|
||||
constexpr RepoPath(const string_type& path) noexcept;
|
||||
constexpr RepoPath(const string_view_type& path) noexcept;
|
||||
constexpr RepoPath(const value_type* path) noexcept;
|
||||
constexpr RepoPath(const AZ::IO::PathView& path);
|
||||
constexpr RepoPath(const AZ::IO::Path& path);
|
||||
|
||||
RepoPath& operator=(const RepoPath&) noexcept = default;
|
||||
RepoPath& operator=(const string_type&) noexcept;
|
||||
|
||||
+2
-2
@@ -14,8 +14,8 @@ namespace TestImpact
|
||||
{
|
||||
AZStd::string GetTestTargetExtension(const TestTarget* testTarget)
|
||||
{
|
||||
static constexpr char* const standAloneExtension = ".exe";
|
||||
static constexpr char* const testRunnerExtension = ".dll";
|
||||
static constexpr const char* const standAloneExtension = ".exe";
|
||||
static constexpr const char* const testRunnerExtension = ".dll";
|
||||
|
||||
switch (const auto launchMethod = testTarget->GetLaunchMethod(); launchMethod)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user