You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using tagged release for commit 56a6f30 built from source, UE 4.18, and Python 3.4 on Windows 10. I have a USTRUCT which is a member of a UCLASS defined like so:
USTRUCT(BlueprintType)
struct FCartPoint
{
GENERATED_STRUCT_BODY()
UPROPERTY(BlueprintReadonly)
int x;
UPROPERTY(BlueprintReadonly)
int y;
// + some constructors/accessors etc.
}
UCLASS()
class PROJECT_API APointHolder : public AActor
{
GENERATED_BODY()
protected:
FCartPoint MyPoint;
public:UFUNCTION(BlueprintCallable)
FCartPoint GetPoint() const {
UE_LOG(LogTemp, Log, TEXT("Point: (%d, %d)"), MyPoint.x, MyPoint.y)
return MyPoint;
}
}
In Python doing this:
p=actor.GetPoint()
ue.log("p by members: (%d, %d) -- p by get_field: (%d, %d)"% (p.x, p.y, p.get_field('x'), p.get_field('y')))
When ran, the log output from GetPoint prints the values I've assigned, but all the values printed from python appear to just be random blocks of memory typecast to int, and p.x != p.get_field('x') - they appear to be pointing at different locations as the values it spits out are unrelated.
The text was updated successfully, but these errors were encountered:
FWIW, this problem also causes UE4 to crash if the struct contains properties that are in turn pointers to other things (e.g. if you have a struct with an FString property).
I fixed it locally by changing UEPyModule.cpp's ue_py_convert_property function to call py_ue_new_owned_uscriptstruct instead of py_ue_new_uscriptstruct. Not sure if that's the correct fix or not, but so far it seems to be working in every case that was previously failing.
Using tagged release for commit 56a6f30 built from source, UE 4.18, and Python 3.4 on Windows 10. I have a USTRUCT which is a member of a UCLASS defined like so:
In Python doing this:
When ran, the log output from GetPoint prints the values I've assigned, but all the values printed from python appear to just be random blocks of memory typecast to int, and p.x != p.get_field('x') - they appear to be pointing at different locations as the values it spits out are unrelated.
The text was updated successfully, but these errors were encountered: