I have a delegate that I’m using to catch a material being edited in the editor:
DelegateHandles.Add(
FCoreUObjectDelegates::OnObjectPropertyChanged.AddRaw(
this,
&FMyPluginModule::OtherComponentPropertyChanged
)
);
This works, I can trap the event. This is what the event provides:
UObject *ObjectBeingModified,
FPropertyChangedEvent &PropertyChangedEvent
In this case ObjectBeingModified is a UObject whose name is "DEditorVectorParameterValuebut I can’t figure out from this which UMaterialInstance is being edited. Tracing up the Owner chain almost immediately gives me LevelEd, no useful objects along the way. Same deal for the UProperty in PropertyChangedEvent - there’s little info to go on in the data structure.
I can cast to UDEditorParameterValue and its sub-classes and I can get the UPackage that owns it using GetTypedOwner() but I can’t find anything else useful in the ownership chain. The name of the package is “/Engine/Transient”.
How do I get the material that owns a property that is changing?