{LYN-2185} Helios - Added GraphObjectProxy::GetMethodList() function (#392)

* {LYN-2185} Helios - Added GraphObjectProxy::GetMethodList() function

* Updated the EditorPythonConsoleInterface to get Python type name info
* Added PythonBehaviorInfo to the GraphObjectProxy object to reflect abstract calls that can be invoked
* removed SCENE_DATA_API from Reflect() function

Jira: https://jira.agscollab.com/browse/LYN-2185
Tests: Added tests GraphObjectProxy_GetClassInfo_Loads & GraphObjectProxy_GetClassInfo_CorrectFormats to regress test

* fix compile error

* etchPythonTypeName() returns AZStd::string

* put None into a const char
This commit is contained in:
jackalbe
2021-05-04 12:55:47 -05:00
committed by GitHub
parent 790657f8c0
commit 8b1251c9f7
8 changed files with 226 additions and 9 deletions
@@ -161,7 +161,7 @@ namespace EditorPythonBindings
bufferArg = *name;
}
AZStd::string_view type = FetchPythonType(*behaviorMethod.GetArgument(argIndex));
AZStd::string type = FetchPythonTypeName(*behaviorMethod.GetArgument(argIndex));
if (!type.empty())
{
AzFramework::StringFunc::Append(bufferArg, ": ");
@@ -289,7 +289,7 @@ namespace EditorPythonBindings
bool isBroadcast = false;
if (sender.m_event)
{
AZStd::string_view addressType = FetchPythonType(behaviorEBus->m_idParam);
AZStd::string addressType = FetchPythonTypeName(behaviorEBus->m_idParam);
if (addressType.empty())
{
AzFramework::StringFunc::Append(buffer, "(busCallType: int, busEventName: str, address: Any, args: Tuple[Any])");
@@ -338,7 +338,7 @@ namespace EditorPythonBindings
}
const AZ::BehaviorParameter* resultParam = behaviorMethod->GetResult();
AZStd::string_view returnType = FetchPythonType(*resultParam);
AZStd::string returnType = FetchPythonTypeName(*resultParam);
AZStd::string returnTypeStr = AZStd::string::format(") -> " AZ_STRING_FORMAT" \n", AZ_STRING_ARG(returnType));
AzFramework::StringFunc::Append(inOutStrBuffer, returnTypeStr.c_str());
};
@@ -664,9 +664,9 @@ namespace EditorPythonBindings
return m_typeCache[typeId];
}
AZStd::string_view PythonLogSymbolsComponent::FetchPythonType(const AZ::BehaviorParameter& param)
AZStd::string PythonLogSymbolsComponent::FetchPythonTypeName(const AZ::BehaviorParameter& param)
{
AZStd::string_view pythonType = FetchPythonTypeAndTraits(param.m_typeId, param.m_traits);
AZStd::string pythonType = FetchPythonTypeAndTraits(param.m_typeId, param.m_traits);
if (pythonType.empty())
{
@@ -62,6 +62,7 @@ namespace EditorPythonBindings
void LogGlobalMethod(AZStd::string_view moduleName, AZStd::string_view methodName, AZ::BehaviorMethod* behaviorMethod) override;
void LogGlobalProperty(AZStd::string_view moduleName, AZStd::string_view propertyName, AZ::BehaviorProperty* behaviorProperty) override;
void Finalize() override;
AZStd::string FetchPythonTypeName(const AZ::BehaviorParameter& param) override;
////////////////////////////////////////////////////////////////////////
// EditorPythonConsoleInterface
@@ -71,7 +72,6 @@ namespace EditorPythonBindings
////////////////////////////////////////////////////////////////////////
// Python type deduction
AZStd::string_view FetchPythonTypeAndTraits(const AZ::TypeId& typeId, AZ::u32 traits);
AZStd::string_view FetchPythonType(const AZ::BehaviorParameter& param);
private:
using ModuleSet = AZStd::unordered_set<AZStd::string>;
@@ -41,9 +41,9 @@ namespace UnitTest
return FetchPythonTypeAndTraits(typeId, traits);
}
AZStd::string_view FetchPythonTypeWrapper(const AZ::BehaviorParameter& param)
AZStd::string FetchPythonTypeWrapper(const AZ::BehaviorParameter& param)
{
return FetchPythonType(param);
return FetchPythonTypeName(param);
}
};