When using the transform widget in the editor, the Property value of a PostEditChangeProperty() call will be NULL.
The transform widget that is being moved in this case is the widget attached to the Test1 property. When this widget is moved from within the viewport, the PropertyChangedEvent.Property is NULL. However, when the position of the widget is set within the details panel, the PropertyChangedEvent.Property value is valid. This is seen when simulating the project within the Editor viewport.
UPROPERTY(EditAnywhere, Category = Test, BlueprintReadWrite, meta = (MakeEditWidget = "")) FVector Test1; virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
void AMyActor::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) { if (PropertyChangedEvent.Property != NULL) { UE_LOG(LogTemp, Warning, TEXT("Its a me! Mario!")); } else { UE_LOG(LogTemp, Warning, TEXT("King of Second Bananas - Luigi")); } Super::PostEditChangeProperty(PropertyChangedEvent); }
Result:
The "else" portion of the above code will be printed to the Output Log while moving the widget. Clicking the yellow arrow next to Test1 in the detail panel to reset the widget position will trigger correctly and print the "if" portion.
Head over to the existing Questions & Answers thread and let us know what's up.
0 |
Component | UE - Gameplay |
---|---|
Affects Versions | 4.7.3, 4.8 |
Target Fix | 4.12 |
Fix Commit | 2853930 |
---|---|
Main Commit | 2855709 |
Created | Mar 17, 2015 |
---|---|
Resolved | Mar 24, 2016 |
Updated | Apr 27, 2018 |