After a several day battle, I finally have hard evidence that PostEditChangeChainProperty() isn’t working correctly. (Though the similar PostEditChangeProperty() does, PostEditChangeProperty() doesn’t work for structs.)
When a property is edited on a component in the editor, it appears that the component is copied to an identical component which has the same name, but suffixed with “_GEN_VARIABLE”. PostEditChangeProperty() will fire on both the actual component, as well as the _GEN_VARIABLE version. HOWEVER, PostEditChangeChainProperty() ONLY fires on the “_GEN_VARIABLE” version. The _GEN_VARIABLE data then appears to be used to update the Editor UI (so the properties will appear to change correctly), however, it does not actually propagate. If more direct methods are used to the actual data, it will reveal that it has not actually changed, resulting in a disagreement between what the editor is displaying and what’s really happened to the component’s data.
I’ve uploaded a zip of the relavent components and uasset [here][1]
You’ll need to get those components to compile and then import the UAsset.
I can provide a full uproject if need be, but arrangements would have to be made since even an almost empty project is a few hundred MB and this place only allows 5.2MB files.
Repro steps:
- Open the repro case above.
- Open the “BP_PostEditPropTest” Blueprint CDO in the content directory
- Open an output window so you can see log output
First, we’ll test the working PostEditChangeProperty to show the test case functions.
Select the “PostEditPropertyChange” component.
Confirm that “Event To Test” is set to “PostEditPropertyChange”, “Foo” is TRUE, and “Bar” is FALSE
Set “Foo” to FALSE.
Observe that “Bar” automatically becomes TRUE. (This is done in PostEditPropertyChange)
Check the log. Observe the following output:
LogTemp:Warning: BP_PostEditPropTest_C_0/PostEditPropertyChange: PostEditChangeProperty
LogTemp:Warning: BP_PostEditPropTest_C_0/PostEditPropertyChange: Property change: Foo
LogTemp:Warning: BP_PostEditPropTest_C_0/PostEditPropertyChange: Foo changed to 0. Bar set to 1.
LogTemp:Warning: NO_PARENT_ACTOR/PostEditPropertyChange_GEN_VARIABLE: PostEditChangeProperty
LogTemp:Warning: NO_PARENT_ACTOR/PostEditPropertyChange_GEN_VARIABLE: Property change: Foo
LogTemp:Warning: NO_PARENT_ACTOR/PostEditPropertyChange_GEN_VARIABLE: Foo changed to 0. Bar set to 1.
Note that there are TWO components firing events here. The “real” one, and the orphaned “GEN_VARIABLE” copy.
Select the “Property Outputter” component
Click the “Click Me To Log Values” bool
Check the log. Observe
LogTemp:Warning: BP_PostEditPropTest_C_0/PostEditPropertyChange: Actual values are currently Foo: 0 and Bar: 1.
This correctly reflects the change we made, as well as the change made by the PostEditPropertyChange.
Everything worked properly, yay!
Now we’ll try the same thing, except using the (broken) PostEditChangeChainProperty() version
Select the “PostEditPropertyChange” component again.
Set “Event To Test” to “PostEditChangeChainProperty”
Set “Foo” back to TRUE.
Observe that “Foo” changes to TRUE, and “Bar” automatically changes to “FALSE.” It looks like everything worked again, right? Well, here’s where things get weird.
Look at the log. It will :
LogTemp:Warning: BP_PostEditPropTest_C_0/PostEditPropertyChange: PostEditChangeProperty
LogTemp:Warning: NO_PARENT_ACTOR/PostEditPropertyChange_GEN_VARIABLE: PostEditChangeProperty
LogTemp:Warning: NO_PARENT_ACTOR/PostEditPropertyChange_GEN_VARIABLE: PostEditChangeChainProperty
LogTemp:Warning: NO_PARENT_ACTOR/PostEditPropertyChange_GEN_VARIABLE: Property change: Foo
LogTemp:Warning: NO_PARENT_ACTOR/PostEditPropertyChange_GEN_VARIABLE: Foo changed to 1. Bar set to 0.
LogTemp:Warning: BP_PostEditPropTest_C_0/PostEditPropertyChange: PostEditChangeProperty
LogTemp:Warning: NO_PARENT_ACTOR/PostEditPropertyChange_GEN_VARIABLE: PostEditChangeProperty
Note that this time, while the GEN_VARIABLE version toggled the value of Bar when Foo changed, the “real” version of the component DIDN’T. But yet, the editor is displaying values of Foo and Bar as if it HAD. We can verify this by accessing the values for Foo and Bar directly via code.
Select the “Property Outputter” component
Click the “Click Me To Log Values” bool
Check the log. Observe
LogTemp:Warning: BP_PostEditPropTest_C_0/PostEditPropertyChange: Actual values are currently Foo: 1 and Bar: 1.
So, while “Foo” changed correctly (it’s the one we set manually) Bar is still TRUE because the “real” version of the component never executed the PostEditChangeChainProperty event.
[1]: 121976-chainpropertybroken.zip (9.35 KB)