Merge branch 'development' of https://github.com/o3de/o3de into carlitosan/development

This commit is contained in:
chcurran
2021-09-02 18:14:39 -07:00
334 changed files with 3022 additions and 2797 deletions
+1 -2
View File
@@ -47,8 +47,7 @@ ly_add_target(
)
# the script canvas debugger is an optional gem module
# To Enable it: ly_enable_gems( ... TARGETS xxxyyzzz GEMS ScriptCanvasDebugger ...)
# in any particular target.
# To Enable it, associate it with a project
ly_create_alias(NAME ScriptCanvasDebugger.Builders NAMESPACE Gem TARGETS Gem::ScriptCanvasDebugger)
ly_create_alias(NAME ScriptCanvasDebugger.Tools NAMESPACE Gem TARGETS Gem::ScriptCanvasDebugger)
ly_create_alias(NAME ScriptCanvasDebugger.Clients NAMESPACE Gem TARGETS Gem::ScriptCanvasDebugger)
@@ -28,7 +28,7 @@ namespace ScriptCanvasEditor
{
setDynamicSortFilter(true);
m_showColumn.insert(aznumeric_cast<int>(AssetBrowserEntry::Column::DisplayName));
m_shownColumns.insert(aznumeric_cast<int>(AssetBrowserEntry::Column::DisplayName));
UnitTestWidgetNotificationBus::Handler::BusConnect();
@@ -408,7 +408,7 @@ namespace ScriptCanvasEditor::Nodes
AZ::BehaviorAzEventDescription behaviorAzEventDesc;
AZ::AttributeReader azEventDescAttributeReader(nullptr, azEventDescAttribute);
azEventDescAttributeReader.Read<decltype(behaviorAzEventDesc)>(behaviorAzEventDesc);
if(behaviorAzEventDesc.m_eventName.empty())
if (behaviorAzEventDesc.m_eventName.empty())
{
AZ_Error("NodeUtils", false, "Cannot create an AzEvent node with empty event name")
return {};
@@ -140,21 +140,10 @@ namespace
// If the reflected method returns an AZ::Event, reflect it to the SerializeContext
if (AZ::MethodReturnsAzEventByReferenceOrPointer(method))
{
AZ::SerializeContext* serializeContext{};
AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationRequests::GetSerializeContext);
const AZ::BehaviorParameter* resultParameter = method.GetResult();
AZ::SerializeContext::ClassData classData;
classData.m_name = resultParameter->m_name;
classData.m_typeId = resultParameter->m_typeId;
classData.m_azRtti = resultParameter->m_azRtti;
auto EventPlaceholderAnyCreator = [](AZ::SerializeContext*) -> AZStd::any
{
return AZStd::make_any<AZStd::monostate>();
};
serializeContext->RegisterType(resultParameter->m_typeId, AZStd::move(classData), EventPlaceholderAnyCreator);
ScriptCanvas::ReflectEventTypeOnDemand(resultParameter->m_typeId, resultParameter->m_name, resultParameter->m_azRtti);
}
nodePaletteModel.RegisterClassNode(categoryPath, behaviorClass ? behaviorClass->m_name : "", name, &method, &behaviorContext, propertyStatus, isOverloaded);
}
@@ -177,19 +166,8 @@ namespace
// If the reflected method returns an AZ::Event, reflect it to the SerializeContext
if (AZ::MethodReturnsAzEventByReferenceOrPointer(behaviorMethod))
{
AZ::SerializeContext* serializeContext{};
AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationRequests::GetSerializeContext);
const AZ::BehaviorParameter* resultParameter = behaviorMethod.GetResult();
AZ::SerializeContext::ClassData classData;
classData.m_name = resultParameter->m_name;
classData.m_typeId = resultParameter->m_typeId;
classData.m_azRtti = resultParameter->m_azRtti;
auto EventPlaceholderAnyCreator = [](AZ::SerializeContext*) -> AZStd::any
{
return AZStd::make_any<AZStd::monostate>();
};
serializeContext->RegisterType(resultParameter->m_typeId, AZStd::move(classData), EventPlaceholderAnyCreator);
ScriptCanvas::ReflectEventTypeOnDemand(resultParameter->m_typeId, resultParameter->m_name, resultParameter->m_azRtti);
}
nodePaletteModel.RegisterMethodNode(behaviorContext, behaviorMethod);
@@ -165,4 +165,22 @@ namespace ScriptCanvas
runtimeVersion = RuntimeVersion::Current;
fileVersion = FileVersion::Current;
}
void ReflectEventTypeOnDemand(const AZ::TypeId& typeId, AZStd::string_view name, AZ::IRttiHelper* rttiHelper)
{
AZ::SerializeContext* serializeContext{};
AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationRequests::GetSerializeContext);
AZ::SerializeContext::ClassData classData;
classData.m_name = name.data();
classData.m_typeId = typeId;
classData.m_azRtti = rttiHelper;
auto EventPlaceholderAnyCreator = [](AZ::SerializeContext*) -> AZStd::any
{
return AZStd::make_any<AZStd::monostate>();
};
serializeContext->RegisterType(typeId, AZStd::move(classData), EventPlaceholderAnyCreator);
}
}
@@ -293,6 +293,8 @@ namespace ScriptCanvas
bool m_wasAdded = false;
AZ::Entity* m_buildEntity = nullptr;
};
void ReflectEventTypeOnDemand(const AZ::TypeId& typeId, AZStd::string_view name, AZ::IRttiHelper* rttiHelper = nullptr);
}
namespace AZStd