Merge branch 'development' of https://github.com/o3de/o3de into carlitosan/development
This commit is contained in:
@@ -13,3 +13,27 @@ set_target_properties(Editor PROPERTIES
|
||||
RESOURCE ${CMAKE_CURRENT_LIST_DIR}/Images.xcassets
|
||||
XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME EditorAppIcon
|
||||
)
|
||||
|
||||
# We cannot use ly_add_target here because we're already including this file from inside ly_add_target
|
||||
# So we need to setup target, dependencies and install logic manually.
|
||||
add_executable(EditorDummy Platform/Mac/main_dummy.cpp)
|
||||
add_executable(AZ::EditorDummy ALIAS EditorDummy)
|
||||
|
||||
ly_target_link_libraries(EditorDummy
|
||||
PRIVATE
|
||||
AZ::AzCore
|
||||
AZ::AzFramework)
|
||||
|
||||
ly_add_dependencies(Editor EditorDummy)
|
||||
|
||||
# Store the aliased target into a DIRECTORY property
|
||||
set_property(DIRECTORY APPEND PROPERTY LY_DIRECTORY_TARGETS AZ::EditorDummy)
|
||||
|
||||
# Store the directory path in a GLOBAL property so that it can be accessed
|
||||
# in the layout install logic. Skip if the directory has already been added
|
||||
get_property(ly_all_target_directories GLOBAL PROPERTY LY_ALL_TARGET_DIRECTORIES)
|
||||
if(NOT CMAKE_CURRENT_SOURCE_DIR IN_LIST ly_all_target_directories)
|
||||
set_property(GLOBAL APPEND PROPERTY LY_ALL_TARGET_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
endif()
|
||||
|
||||
ly_install_add_install_path_setreg(Editor)
|
||||
@@ -3,7 +3,7 @@
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>Editor</string>
|
||||
<string>EditorDummy</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.O3DE.Editor</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include <AzCore/Component/ComponentApplication.h>
|
||||
#include <AzCore/Memory/SystemAllocator.h>
|
||||
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
|
||||
#include <AzCore/Utils/Utils.h>
|
||||
#include <AzFramework/Process/ProcessWatcher.h>
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
// Create a ComponentApplication to initialize the AZ::SystemAllocator and initialize the SettingsRegistry
|
||||
AZ::ComponentApplication::Descriptor desc;
|
||||
AZ::ComponentApplication application;
|
||||
application.Create(desc);
|
||||
|
||||
AZStd::vector<AZStd::string> envVars;
|
||||
|
||||
const char* homePath = std::getenv("HOME");
|
||||
envVars.push_back(AZStd::string::format("HOME=%s", homePath));
|
||||
|
||||
if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr)
|
||||
{
|
||||
const char* dyldLibPathOrig = std::getenv("DYLD_LIBRARY_PATH");
|
||||
AZStd::string dyldSearchPath = AZStd::string::format("DYLD_LIBRARY_PATH=%s", dyldLibPathOrig);
|
||||
if (AZ::IO::FixedMaxPath projectModulePath;
|
||||
settingsRegistry->Get(projectModulePath.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_ProjectConfigurationBinPath))
|
||||
{
|
||||
dyldSearchPath.append(":");
|
||||
dyldSearchPath.append(projectModulePath.c_str());
|
||||
}
|
||||
|
||||
if (AZ::IO::FixedMaxPath installedBinariesFolder;
|
||||
settingsRegistry->Get(installedBinariesFolder.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_InstalledBinaryFolder))
|
||||
{
|
||||
if (AZ::IO::FixedMaxPath engineRootFolder;
|
||||
settingsRegistry->Get(engineRootFolder.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_EngineRootFolder))
|
||||
{
|
||||
installedBinariesFolder = engineRootFolder / installedBinariesFolder;
|
||||
dyldSearchPath.append(":");
|
||||
dyldSearchPath.append(installedBinariesFolder.c_str());
|
||||
}
|
||||
}
|
||||
envVars.push_back(dyldSearchPath);
|
||||
}
|
||||
|
||||
AZStd::string commandArgs;
|
||||
for (int i = 1; i < argc; i++)
|
||||
{
|
||||
commandArgs.append(argv[i]);
|
||||
commandArgs.append(" ");
|
||||
}
|
||||
|
||||
AzFramework::ProcessLauncher::ProcessLaunchInfo processLaunchInfo;
|
||||
AZ::IO::Path processPath{ AZ::IO::PathView(AZ::Utils::GetExecutableDirectory()) };
|
||||
processPath /= "Editor";
|
||||
processLaunchInfo.m_processExecutableString = AZStd::move(processPath.Native());
|
||||
processLaunchInfo.m_commandlineParameters = commandArgs;
|
||||
processLaunchInfo.m_environmentVariables = &envVars;
|
||||
processLaunchInfo.m_showWindow = true;
|
||||
|
||||
AzFramework::ProcessWatcher* processWatcher = AzFramework::ProcessWatcher::LaunchProcess(processLaunchInfo, AzFramework::ProcessCommunicationType::COMMUNICATOR_TYPE_NONE);
|
||||
|
||||
application.Destroy();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace AZ::SettingsRegistryMergeUtils
|
||||
inline static constexpr char FilePathsRootKey[] = "/Amazon/AzCore/Runtime/FilePaths";
|
||||
inline static constexpr char FilePathKey_BinaryFolder[] = "/Amazon/AzCore/Runtime/FilePaths/BinaryFolder";
|
||||
inline static constexpr char FilePathKey_EngineRootFolder[] = "/Amazon/AzCore/Runtime/FilePaths/EngineRootFolder";
|
||||
inline static constexpr char FilePathKey_InstalledBinaryFolder[] = "/Amazon/AzCore/Runtime/FilePaths/InstalledBinariesFolder";
|
||||
|
||||
//! Stores the absolute path to root of a project's cache. No asset platform in this path, this is where the asset database file lives.
|
||||
//! i.e. <ProjectPath>/Cache
|
||||
|
||||
@@ -21,7 +21,18 @@ namespace AZStd
|
||||
{
|
||||
// alias std::pointer_traits into the AZStd::namespace
|
||||
using std::pointer_traits;
|
||||
|
||||
//! Bring the names of uninitialized_default_construct and
|
||||
//! uninitialized_default_construct_n into the AZStd namespace
|
||||
using std::uninitialized_default_construct;
|
||||
using std::uninitialized_default_construct_n;
|
||||
|
||||
//! uninitialized_value_construct and uninitialized_value_construct_n
|
||||
//! are now brought into scope of the AZStd namespace
|
||||
using std::uninitialized_value_construct;
|
||||
using std::uninitialized_value_construct_n;
|
||||
}
|
||||
|
||||
namespace AZStd::Internal
|
||||
{
|
||||
template <typename T, typename = void>
|
||||
@@ -223,107 +234,6 @@ namespace AZStd
|
||||
}
|
||||
}
|
||||
|
||||
namespace AZStd
|
||||
{
|
||||
//! C++20 implementation of uninitialized_default_construct
|
||||
//! Initializes objects by default-initialization via placement new
|
||||
//! Ex. `new(declval<void*>()) T` - Notice no parenthesis after T
|
||||
//! This performs default initialization instead of value initialization
|
||||
//! Default initialization performs the following actions
|
||||
//! # If T is a class type it considers constructors which can be invoked
|
||||
//! with an empty argument list. The selected constructor is invoked
|
||||
//! to provide the initial value of the object
|
||||
//! # If T is an array type, then default initialization is performed
|
||||
//! on each array element
|
||||
//! # Otherwise nothing is done and objects with automatic storage duration(i.e scope)
|
||||
//! are initialized with indeterminate values
|
||||
//! For example given the following struct
|
||||
//! struct Foo
|
||||
//! {
|
||||
//! int mint;
|
||||
//! double bubble;
|
||||
//! };
|
||||
//! Invoking uninitialized_default_construct(FooPtr, FooPtr + 1)
|
||||
//! Will default initialize the FooPtr object (Foo has an implicitly-defined default constructor)
|
||||
//! The values of mint and bubble are indeterminate
|
||||
template <typename ForwardIt>
|
||||
constexpr auto uninitialized_default_construct(ForwardIt first, ForwardIt last)
|
||||
-> enable_if_t<Internal::is_forward_iterator_v<ForwardIt>, void>
|
||||
{
|
||||
for (; first != last; ++first)
|
||||
{
|
||||
return ::new (AZStd::addressof(*first)) typename AZStd::iterator_traits<ForwardIt>::value_type;
|
||||
}
|
||||
}
|
||||
// C++20 implementation of uninitialized_default_construct_n
|
||||
// Constructs "n" objects starting at first via default-initialization
|
||||
template <typename ForwardIt, typename Size>
|
||||
constexpr auto uninitialized_default_construct_n(ForwardIt first, Size numElements)
|
||||
-> enable_if_t<Internal::is_forward_iterator_v<ForwardIt>, ForwardIt>
|
||||
{
|
||||
for (; numElements > 0; ++first, --numElements)
|
||||
{
|
||||
return ::new (AZStd::addressof(*first)) typename AZStd::iterator_traits<ForwardIt>::value_type;
|
||||
}
|
||||
|
||||
return first;
|
||||
}
|
||||
}
|
||||
|
||||
namespace AZStd
|
||||
{
|
||||
//! C++20 implementation of uninitialized_value_construct
|
||||
//! Initializes objects by value-initialization via placement new
|
||||
//! Ex. `new(declval<void*>()) T()` - Notice parenthesis are here after T
|
||||
//! value-initialization of an object performs different rules depending
|
||||
//! on the type of T
|
||||
//! Value initialization performs the following actions
|
||||
//! # If T is a class type with no default constructor or with a user-provided
|
||||
//! constructor or a deleted default constructor, then default-initialization
|
||||
//! is performed
|
||||
//! # If T is a class type with a default constructor that is neither
|
||||
//! user-provided nor deleted(i.e a class with an implicitly-defined or defaulted
|
||||
//! default constructor), then the object is zero-initialized and then it is
|
||||
//! default-initialized if it has a non-trivial default constructor
|
||||
//! # If T is an array type, then value initialization is performed
|
||||
//! on each array element
|
||||
//! # Otherwise the object is zero-initialized
|
||||
//! (i.e sets arithmetic and enum objects to 0, bool objects to false, pointers to nullptr)
|
||||
//! For example given the following struct
|
||||
//! struct Foo
|
||||
//! {
|
||||
//! int mint;
|
||||
//! double bubble;
|
||||
//! };
|
||||
//! Invoking uninitialized_default_construct(FooPtr, FooPtr + 1)
|
||||
//! Will value-initialize the FooPtr object.
|
||||
//! The Foo has an implicitly-defined default constructor.
|
||||
//! For aggregates such as int and double this will perform zero-initialization
|
||||
//! which will set their values to 0
|
||||
//! Therefore The values of mint will be 0 and and bubble 0.0
|
||||
template <typename ForwardIt>
|
||||
constexpr auto uninitialized_value_construct(ForwardIt first, ForwardIt last)
|
||||
-> enable_if_t<Internal::is_forward_iterator_v<ForwardIt>, void>
|
||||
{
|
||||
for (; first != last; ++first)
|
||||
{
|
||||
return ::new (AZStd::addressof(*first)) typename AZStd::iterator_traits<ForwardIt>::value_type();
|
||||
}
|
||||
}
|
||||
// C++20 implementation of uninitialized_default_construct_n
|
||||
// Constructs "n" objects starting at the first via by value-initialization
|
||||
template <typename ForwardIt, typename Size>
|
||||
constexpr auto uninitialized_value_construct_n(ForwardIt first, Size numElements)
|
||||
-> enable_if_t<Internal::is_forward_iterator_v<ForwardIt>, ForwardIt>
|
||||
{
|
||||
for (; numElements > 0; ++first, --numElements)
|
||||
{
|
||||
return ::new (AZStd::addressof(*first)) typename AZStd::iterator_traits<ForwardIt>::value_type();
|
||||
}
|
||||
|
||||
return first;
|
||||
}
|
||||
}
|
||||
|
||||
namespace AZStd::Internal
|
||||
{
|
||||
|
||||
@@ -25,29 +25,7 @@ namespace AZStd
|
||||
AZStd::sys_time_t GetTimeNowTicks()
|
||||
{
|
||||
AZStd::sys_time_t timeNow;
|
||||
struct timespec ts;
|
||||
clock_serv_t cclock;
|
||||
mach_timespec_t mts;
|
||||
kern_return_t ret = host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
|
||||
if (ret == KERN_SUCCESS)
|
||||
{
|
||||
ret = clock_get_time(cclock, &mts);
|
||||
if (ret == KERN_SUCCESS)
|
||||
{
|
||||
ts.tv_sec = mts.tv_sec;
|
||||
ts.tv_nsec = mts.tv_nsec;
|
||||
}
|
||||
else
|
||||
{
|
||||
AZ_Assert(false, "clock_get_time error: %d\n", ret);
|
||||
}
|
||||
mach_port_deallocate(mach_task_self(), cclock);
|
||||
}
|
||||
else
|
||||
{
|
||||
AZ_Assert(false, "clock_get_time error: %d\n", ret);
|
||||
}
|
||||
timeNow = ts.tv_sec * GetTimeTicksPerSecond() + ts.tv_nsec;
|
||||
timeNow = clock_gettime_nsec_np(CLOCK_UPTIME_RAW);
|
||||
return timeNow;
|
||||
}
|
||||
|
||||
@@ -62,29 +40,7 @@ namespace AZStd
|
||||
AZStd::sys_time_t GetTimeNowSecond()
|
||||
{
|
||||
AZStd::sys_time_t timeNowSecond;
|
||||
struct timespec ts;
|
||||
clock_serv_t cclock;
|
||||
mach_timespec_t mts;
|
||||
kern_return_t ret = host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
|
||||
if (ret == KERN_SUCCESS)
|
||||
{
|
||||
ret = clock_get_time(cclock, &mts);
|
||||
if (ret == KERN_SUCCESS)
|
||||
{
|
||||
ts.tv_sec = mts.tv_sec;
|
||||
ts.tv_nsec = mts.tv_nsec;
|
||||
}
|
||||
else
|
||||
{
|
||||
AZ_Assert(false, "clock_get_time error: %d\n", ret);
|
||||
}
|
||||
mach_port_deallocate(mach_task_self(), cclock);
|
||||
}
|
||||
else
|
||||
{
|
||||
AZ_Assert(false, "clock_get_time error: %d\n", ret);
|
||||
}
|
||||
timeNowSecond = ts.tv_sec;
|
||||
timeNowSecond = GetTimeNowTicks()/GetTimeTicksPerSecond();
|
||||
return timeNowSecond;
|
||||
}
|
||||
|
||||
|
||||
@@ -134,4 +134,48 @@ namespace UnitTest
|
||||
EXPECT_FLOAT_EQ(4.0f, resultAddress->m_floatValue);
|
||||
AZStd::destroy_at(resultAddress);
|
||||
}
|
||||
|
||||
TEST(CreateDestroy, UninitializedDefaultConstruct_IsAbleToConstructMultipleElements_Succeeds)
|
||||
{
|
||||
struct RefWrapper
|
||||
{
|
||||
RefWrapper()
|
||||
{}
|
||||
int m_intValue{ 2 };
|
||||
};
|
||||
constexpr size_t ArraySize = 2;
|
||||
AZStd::aligned_storage_for_t<RefWrapper> testArray[ArraySize];
|
||||
RefWrapper(&uninitializedAddress)[2] = reinterpret_cast<RefWrapper(&)[2]>(testArray);
|
||||
AZStd::uninitialized_default_construct(AZStd::begin(uninitializedAddress), AZStd::end(uninitializedAddress));
|
||||
|
||||
|
||||
EXPECT_EQ(2, uninitializedAddress[0].m_intValue);
|
||||
EXPECT_EQ(2, uninitializedAddress[1].m_intValue);
|
||||
// Reset uninitializedAddress to Debug pattern
|
||||
memset(uninitializedAddress, 0xCD, ArraySize * sizeof(RefWrapper));
|
||||
AZStd::uninitialized_default_construct_n(AZStd::data(uninitializedAddress), AZStd::size(uninitializedAddress));
|
||||
EXPECT_EQ(2, uninitializedAddress[0].m_intValue);
|
||||
EXPECT_EQ(2, uninitializedAddress[1].m_intValue);
|
||||
}
|
||||
|
||||
TEST(CreateDestroy, UninitializedValueConstruct_IsAbleToConstructMultipleElements_Succeeds)
|
||||
{
|
||||
struct RefWrapper
|
||||
{
|
||||
int m_intValue;
|
||||
};
|
||||
constexpr size_t ArraySize = 2;
|
||||
AZStd::aligned_storage_for_t<RefWrapper> testArray[ArraySize];
|
||||
RefWrapper(&uninitializedAddress)[2] = reinterpret_cast<RefWrapper(&)[2]>(testArray);
|
||||
AZStd::uninitialized_value_construct(AZStd::begin(uninitializedAddress), AZStd::end(uninitializedAddress));
|
||||
|
||||
|
||||
EXPECT_EQ(0, uninitializedAddress[0].m_intValue);
|
||||
EXPECT_EQ(0, uninitializedAddress[1].m_intValue);
|
||||
// Reset uninitializedAddress to Debug pattern
|
||||
memset(uninitializedAddress, 0xCD, ArraySize * sizeof(RefWrapper));
|
||||
AZStd::uninitialized_value_construct_n(AZStd::data(uninitializedAddress), AZStd::size(uninitializedAddress));
|
||||
EXPECT_EQ(0, uninitializedAddress[0].m_intValue);
|
||||
EXPECT_EQ(0, uninitializedAddress[1].m_intValue);
|
||||
}
|
||||
}
|
||||
|
||||
+15
-23
@@ -24,7 +24,9 @@
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/resource.h> // for iopolicy
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
extern char **environ;
|
||||
|
||||
namespace AzFramework
|
||||
{
|
||||
@@ -45,7 +47,7 @@ namespace AzFramework
|
||||
// result == 0 means child PID is still running, nothing to check
|
||||
if (result == -1)
|
||||
{
|
||||
AZ_TracePrintf("ProcessWatcher", "IsChildProcessDone could not determine child process status (waitpid errno %d). assuming process either failed to launch or terminated unexpectedly\n", errno);
|
||||
AZ_TracePrintf("ProcessWatcher", "IsChildProcessDone could not determine child process status (waitpid errno %d(%s)). assuming process either failed to launch or terminated unexpectedly\n", errno, strerror(errno));
|
||||
exitCode = 0;
|
||||
}
|
||||
else if (result == childProcessId)
|
||||
@@ -274,28 +276,27 @@ namespace AzFramework
|
||||
azstrcat(commandAndArgs[i], token.size(), token.c_str());
|
||||
}
|
||||
commandAndArgs[commandTokens.size()] = nullptr;
|
||||
|
||||
char** environmentVariables = nullptr;
|
||||
int numEnvironmentVars = 0;
|
||||
|
||||
constexpr int MaxEnvVariables = 128;
|
||||
using EnvironmentVariableContainer = AZStd::fixed_vector<char*, MaxEnvVariables>;
|
||||
EnvironmentVariableContainer environmentVariables;
|
||||
for (char **env = ::environ; *env; env++)
|
||||
{
|
||||
environmentVariables.push_back(*env);
|
||||
}
|
||||
if (processLaunchInfo.m_environmentVariables)
|
||||
{
|
||||
const int numEnvironmentVars = processLaunchInfo.m_environmentVariables->size();
|
||||
// Adding one more as exec expects the array to have a nullptr as the last element
|
||||
environmentVariables = new char*[numEnvironmentVars + 1];
|
||||
for (int i = 0; i < numEnvironmentVars; i++)
|
||||
for (AZStd::string& processLaunchEnv : *processLaunchInfo.m_environmentVariables)
|
||||
{
|
||||
const AZStd::string& envVarString = processLaunchInfo.m_environmentVariables->at(i);
|
||||
environmentVariables[i] = new char[envVarString.size() + 1];
|
||||
environmentVariables[i][0] = '\0';
|
||||
azstrcat(environmentVariables[i], envVarString.size(), envVarString.c_str());
|
||||
environmentVariables.push_back(processLaunchEnv.data());
|
||||
}
|
||||
environmentVariables[numEnvironmentVars] = NULL;
|
||||
}
|
||||
environmentVariables.push_back(nullptr);
|
||||
|
||||
pid_t child_pid = fork();
|
||||
if (IsIdChildProcess(child_pid))
|
||||
{
|
||||
ExecuteCommandAsChild(commandAndArgs, environmentVariables, processLaunchInfo, processData.m_startupInfo);
|
||||
ExecuteCommandAsChild(commandAndArgs, environmentVariables.data(), processLaunchInfo, processData.m_startupInfo);
|
||||
}
|
||||
|
||||
processData.m_childProcessId = child_pid;
|
||||
@@ -303,15 +304,6 @@ namespace AzFramework
|
||||
// Close these handles as they are only to be used by the child process
|
||||
processData.m_startupInfo.CloseAllHandles();
|
||||
|
||||
if (processLaunchInfo.m_environmentVariables)
|
||||
{
|
||||
for (int i = 0; i < numEnvironmentVars; i++)
|
||||
{
|
||||
delete [] environmentVariables[i];
|
||||
}
|
||||
delete [] environmentVariables;
|
||||
}
|
||||
|
||||
for (int i = 0; i < commandTokens.size(); i++)
|
||||
{
|
||||
delete [] commandAndArgs[i];
|
||||
|
||||
@@ -13,3 +13,27 @@ set_target_properties(AssetProcessor PROPERTIES
|
||||
RESOURCE ${CMAKE_CURRENT_SOURCE_DIR}/Platform/Mac/Images.xcassets
|
||||
XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME AssetProcessorAppIcon
|
||||
)
|
||||
|
||||
# We cannot use ly_add_target here because we're already including this file from inside ly_add_target
|
||||
# So we need to setup target, dependencies and install logic manually.
|
||||
add_executable(AssetProcessorDummy Platform/Mac/main_dummy.cpp)
|
||||
add_executable(AZ::AssetProcessorDummy ALIAS AssetProcessorDummy)
|
||||
|
||||
ly_target_link_libraries(AssetProcessorDummy
|
||||
PRIVATE
|
||||
AZ::AzCore
|
||||
AZ::AzFramework)
|
||||
|
||||
ly_add_dependencies(AssetProcessor AssetProcessorDummy)
|
||||
|
||||
# Store the aliased target into a DIRECTORY property
|
||||
set_property(DIRECTORY APPEND PROPERTY LY_DIRECTORY_TARGETS AZ::AssetProcessorDummy)
|
||||
|
||||
# Store the directory path in a GLOBAL property so that it can be accessed
|
||||
# in the layout install logic. Skip if the directory has already been added
|
||||
get_property(ly_all_target_directories GLOBAL PROPERTY LY_ALL_TARGET_DIRECTORIES)
|
||||
if(NOT CMAKE_CURRENT_SOURCE_DIR IN_LIST ly_all_target_directories)
|
||||
set_property(GLOBAL APPEND PROPERTY LY_ALL_TARGET_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
endif()
|
||||
|
||||
ly_install_add_install_path_setreg(AssetProcessor)
|
||||
@@ -11,7 +11,7 @@
|
||||
<key>CFBundleSignature</key>
|
||||
<string>ASPR</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>AssetProcessor</string>
|
||||
<string>AssetProcessorDummy</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.Amazon.AssetProcessor</string>
|
||||
</dict>
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include <AzCore/Component/ComponentApplication.h>
|
||||
#include <AzCore/Memory/SystemAllocator.h>
|
||||
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
|
||||
#include <AzCore/Utils/Utils.h>
|
||||
#include <AzFramework/Process/ProcessWatcher.h>
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
// Create a ComponentApplication to initialize the AZ::SystemAllocator and initialize the SettingsRegistry
|
||||
AZ::ComponentApplication::Descriptor desc;
|
||||
AZ::ComponentApplication application;
|
||||
application.Create(desc);
|
||||
|
||||
AZStd::vector<AZStd::string> envVars;
|
||||
|
||||
const char* homePath = std::getenv("HOME");
|
||||
envVars.push_back(AZStd::string::format("HOME=%s", homePath));
|
||||
|
||||
if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr)
|
||||
{
|
||||
const char* dyldLibPathOrig = std::getenv("DYLD_LIBRARY_PATH");
|
||||
AZStd::string dyldSearchPath = AZStd::string::format("DYLD_LIBRARY_PATH=%s", dyldLibPathOrig);
|
||||
if (AZ::IO::FixedMaxPath projectModulePath;
|
||||
settingsRegistry->Get(projectModulePath.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_ProjectConfigurationBinPath))
|
||||
{
|
||||
dyldSearchPath.append(":");
|
||||
dyldSearchPath.append(projectModulePath.c_str());
|
||||
}
|
||||
|
||||
if (AZ::IO::FixedMaxPath installedBinariesFolder;
|
||||
settingsRegistry->Get(installedBinariesFolder.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_InstalledBinaryFolder))
|
||||
{
|
||||
if (AZ::IO::FixedMaxPath engineRootFolder;
|
||||
settingsRegistry->Get(engineRootFolder.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_EngineRootFolder))
|
||||
{
|
||||
installedBinariesFolder = engineRootFolder / installedBinariesFolder;
|
||||
dyldSearchPath.append(":");
|
||||
dyldSearchPath.append(installedBinariesFolder.c_str());
|
||||
}
|
||||
}
|
||||
envVars.push_back(dyldSearchPath);
|
||||
}
|
||||
|
||||
AZStd::string commandArgs;
|
||||
for (int i = 1; i < argc; i++)
|
||||
{
|
||||
commandArgs.append(argv[i]);
|
||||
commandArgs.append(" ");
|
||||
}
|
||||
|
||||
AzFramework::ProcessLauncher::ProcessLaunchInfo processLaunchInfo;
|
||||
AZ::IO::Path processPath{ AZ::IO::PathView(AZ::Utils::GetExecutableDirectory()) };
|
||||
processPath /= "AssetProcessor";
|
||||
processLaunchInfo.m_processExecutableString = AZStd::move(processPath.Native());
|
||||
processLaunchInfo.m_commandlineParameters = commandArgs;
|
||||
processLaunchInfo.m_environmentVariables = &envVars;
|
||||
processLaunchInfo.m_showWindow = true;
|
||||
|
||||
AzFramework::ProcessWatcher* processWatcher = AzFramework::ProcessWatcher::LaunchProcess(processLaunchInfo, AzFramework::ProcessCommunicationType::COMMUNICATOR_TYPE_NONE);
|
||||
|
||||
application.Destroy();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace AssetProcessor
|
||||
//! Amount of time in seconds to wait for a builder to start up and connect
|
||||
// sometimes, builders take a long time to start because of things like virus scanners scanning each
|
||||
// builder DLL, so we give them a large margin.
|
||||
static const int s_StartupConnectionWaitTimeS = 120;
|
||||
static const int s_StartupConnectionWaitTimeS = 300;
|
||||
|
||||
static const int s_MillisecondsInASecond = 1000;
|
||||
|
||||
|
||||
@@ -103,10 +103,6 @@ namespace AZ
|
||||
}
|
||||
}
|
||||
|
||||
if(!isBone)
|
||||
{
|
||||
return Events::ProcessingResult::Ignored;
|
||||
}
|
||||
|
||||
// If the current scene node (our eventual parent) contains bone data, we are not a root bone
|
||||
AZStd::shared_ptr<SceneData::GraphData::BoneData> createdBoneData;
|
||||
|
||||
@@ -135,18 +135,13 @@ namespace AZ
|
||||
const aiBone* bone = FindFirstBoneByNodeName(node, boneByNameMap);
|
||||
if (bone)
|
||||
{
|
||||
const DataTypes::MatrixType inverseOffsetMatrix = AssImpSDKWrapper::AssImpTypeConverter::ToTransform(bone->mOffsetMatrix).GetInverseFull();
|
||||
|
||||
const aiBone* parentBone = FindFirstBoneByNodeName(node->mParent, boneByNameMap);
|
||||
if (parentBone)
|
||||
{
|
||||
DataTypes::MatrixType inverseOffsetMatrix = AssImpSDKWrapper::AssImpTypeConverter::ToTransform(bone->mOffsetMatrix).GetInverseFull();
|
||||
const DataTypes::MatrixType parentBoneOffsetMatrix = AssImpSDKWrapper::AssImpTypeConverter::ToTransform(parentBone->mOffsetMatrix);
|
||||
return parentBoneOffsetMatrix * inverseOffsetMatrix;
|
||||
}
|
||||
else
|
||||
{
|
||||
return inverseOffsetMatrix;
|
||||
}
|
||||
}
|
||||
|
||||
return AssImpSDKWrapper::AssImpTypeConverter::ToTransform(GetConcatenatedLocalTransform(node));
|
||||
|
||||
Reference in New Issue
Block a user