Modifying FProperty flags per object instance?

I can get an FProperty from a class:

FProperty* TargetProperty = TargetWidget->GetClass()->FindPropertyByName(PropertyName);

But I want to modify property flags per object instance, not the CDO. Is this possible?

The main goal is to control what widget properties are editable on the editor window (conditionally per widget).

I am aware that UPROPERTY comes with specifiers for this and that UWidget has the “CanEditChange” method but I do not want to create new classes for all UWidgets just to add this support.

Is this direct access I require possible?

No this is not possible, because FProperties are not stored in object instances, they are stored in the UClass which is shared between all instances via ->GetClass().

The “CanEditChange” method sounds like a good approach to implement this without creating new classes. Maybe if you want to detail a bit more what the conditions look like, we could help with implementation.

I wrote automation systems which can completely take over property editing from anywhere.
Any user input on the editor panel gets overridden, so I’d like to be able to control externally if you can edit these properties or not when my systems take control. “CanEditChange” would still need an override per UWidget which is not desired.

Obj.cpp holds the CanEditChange method which only checks a provided FProperty’s flags instead of any data of its own.

I found some info about the editor panels, it might be possible to manage this process by customizing Slate a bit so I’m researching if that can be done without modifying the engine source:

Details Customization