You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Added support for native FProperty setters and getters.
Setters and getters are native functions called by FProperties when setting property values with *_InContainer functions. Setters and getter function names can be manually specified with Setter = Func and Getter = Func keywords inside of UPROEPRTY macro but they will also be automatically parsed if the name is not explicitly specified if the setter or getter function name matches SetPropertyName and GetPropertyName pattern. The latter behavior can be disabled in UHT's DefaultEngine.ini by setting AutomaticSettersAndGetters=False. ImportText and ExportTextItem functions have been deprecated and should be replaced with *_InContainer or *_Direct variants. #rb Steve.Robb #preflight 6210a377a83e0bcefd03d9e1 #ROBOMERGE-OWNER: marc.audy #ROBOMERGE-AUTHOR: robert.manuszewski #ROBOMERGE-SOURCE: CL 19070318 via CL 19098059 via CL 19104650 via CL 19104661 via CL 19110012 #ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845) [CL 19147839 by marc audy in ue5-main branch]
This commit is contained in:
@@ -1163,6 +1163,7 @@ bool InvokePythonCallableFromUnrealFunctionThunk(FPyObjectPtr InSelf, PyObject*
|
||||
|
||||
// Step the property data to populate the local value
|
||||
Stack.MostRecentPropertyAddress = nullptr;
|
||||
Stack.MostRecentPropertyContainer = nullptr;
|
||||
void* LocalValue = Param->ContainerPtrToValuePtr<void>(LocalStruct);
|
||||
Stack.StepCompiledIn(LocalValue, Param->GetClass());
|
||||
|
||||
|
||||
@@ -520,7 +520,7 @@ void ImportDefaultValue(const FProperty* InProp, void* InPropValue, const FStrin
|
||||
}
|
||||
}
|
||||
|
||||
InProp->ImportText(*InDefaultValue, InPropValue, PPF_None, nullptr);
|
||||
InProp->ImportText_Direct(*InDefaultValue, InPropValue, nullptr, PPF_None);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1184,7 +1184,7 @@ FString GetFriendlyPropertyValue(const FProperty* InProp, const void* InPropValu
|
||||
}
|
||||
|
||||
FString FriendlyPropertyValue;
|
||||
InProp->ExportTextItem(FriendlyPropertyValue, InPropValue, InPropValue, nullptr, InPortFlags, nullptr);
|
||||
InProp->ExportTextItem_Direct(FriendlyPropertyValue, InPropValue, InPropValue, nullptr, InPortFlags, nullptr);
|
||||
return FriendlyPropertyValue;
|
||||
}
|
||||
|
||||
|
||||
@@ -342,7 +342,7 @@ FPyWrapperArray* FPyWrapperArray::CastPyObject(PyObject* InPyObject, PyTypeObjec
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!NewArray->ArrayProp->Inner->ImportText(*ExportedEntry, NewScriptArrayHelper.GetRawPtr(ElementIndex), PPF_None, nullptr))
|
||||
if (!NewArray->ArrayProp->Inner->ImportText_Direct(*ExportedEntry, NewScriptArrayHelper.GetRawPtr(ElementIndex), nullptr, PPF_None))
|
||||
{
|
||||
PyUtil::SetPythonError(PyExc_Exception, Self, *FString::Printf(TEXT("Failed to import text '%s' element for property '%s' (%s) at index %d"), *ExportedEntry, *NewArray->ArrayProp->Inner->GetName(), *NewArray->ArrayProp->Inner->GetClass()->GetName(), ElementIndex));
|
||||
return nullptr;
|
||||
|
||||
@@ -310,7 +310,7 @@ FPyWrapperFixedArray* FPyWrapperFixedArray::CastPyObject(PyObject* InPyObject, P
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!NewArray->ArrayProp->ImportText(*ExportedEntry, GetItemPtr(NewArray, ArrIndex), PPF_None, nullptr))
|
||||
if (!NewArray->ArrayProp->ImportText_Direct(*ExportedEntry, GetItemPtr(NewArray, ArrIndex), nullptr, PPF_None))
|
||||
{
|
||||
PyUtil::SetPythonError(PyExc_Exception, Self, *FString::Printf(TEXT("Failed to import text '%s' for property '%s' (%s) at index %d"), *ExportedEntry, *NewArray->ArrayProp->GetName(), *NewArray->ArrayProp->GetClass()->GetName(), ArrIndex));
|
||||
return nullptr;
|
||||
|
||||
@@ -690,12 +690,12 @@ FPyWrapperMap* FPyWrapperMap::CastPyObject(PyObject* InPyObject, PyTypeObject* I
|
||||
}
|
||||
|
||||
const int32 NewElementIndex = NewScriptMapHelper.AddDefaultValue_Invalid_NeedsRehash();
|
||||
if (!NewScriptMapHelper.GetKeyProperty()->ImportText(*ExportedKey, NewScriptMapHelper.GetKeyPtr(NewElementIndex), PPF_None, nullptr))
|
||||
if (!NewScriptMapHelper.GetKeyProperty()->ImportText_Direct(*ExportedKey, NewScriptMapHelper.GetKeyPtr(NewElementIndex), nullptr, PPF_None))
|
||||
{
|
||||
PyUtil::SetPythonError(PyExc_Exception, Self, *FString::Printf(TEXT("Failed to import text '%s' key for property '%s' (%s) at index %d"), *ExportedKey, *NewScriptMapHelper.GetKeyProperty()->GetName(), *NewScriptMapHelper.GetKeyProperty()->GetClass()->GetName(), ElementIndex));
|
||||
return nullptr;
|
||||
}
|
||||
if (!NewScriptMapHelper.GetValueProperty()->ImportText(*ExportedValue, NewScriptMapHelper.GetValuePtr(NewElementIndex), PPF_None, nullptr))
|
||||
if (!NewScriptMapHelper.GetValueProperty()->ImportText_Direct(*ExportedValue, NewScriptMapHelper.GetValuePtr(NewElementIndex), nullptr, PPF_None))
|
||||
{
|
||||
PyUtil::SetPythonError(PyExc_Exception, Self, *FString::Printf(TEXT("Failed to import text '%s' value for property '%s' (%s) at index %d"), *ExportedValue, *NewScriptMapHelper.GetValueProperty()->GetName(), *NewScriptMapHelper.GetValueProperty()->GetClass()->GetName(), ElementIndex));
|
||||
return nullptr;
|
||||
|
||||
@@ -399,7 +399,7 @@ FPyWrapperSet* FPyWrapperSet::CastPyObject(PyObject* InPyObject, PyTypeObject* I
|
||||
}
|
||||
|
||||
const int32 NewElementIndex = NewScriptSetHelper.AddDefaultValue_Invalid_NeedsRehash();
|
||||
if (!NewScriptSetHelper.GetElementProperty()->ImportText(*ExportedEntry, NewScriptSetHelper.GetElementPtr(NewElementIndex), PPF_None, nullptr))
|
||||
if (!NewScriptSetHelper.GetElementProperty()->ImportText_Direct(*ExportedEntry, NewScriptSetHelper.GetElementPtr(NewElementIndex), nullptr, PPF_None))
|
||||
{
|
||||
PyUtil::SetPythonError(PyExc_Exception, Self, *FString::Printf(TEXT("Failed to import text '%s' element for property '%s' (%s) at index %d"), *ExportedEntry, *NewScriptSetHelper.GetElementProperty()->GetName(), *NewScriptSetHelper.GetElementProperty()->GetClass()->GetName(), ElementIndex));
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user