object=UEditorUtilityLibrary::GetSelectedAssets()[0];
UBlueprint *blueprint=Cast(object);
UClass wang=UBlueprintEditorLibrary::GeneratedClass(blueprint);
if (wang)
{
for (TFieldIterator proint(wang); proint; ++proint)
{
FProperty property=*proint;
if (property->GetName()=="QW")
{
FString wangq= FString(L"1");
**property->SetMetaData("Tooltip", TEXT("is a tool"));**
blueprint->MarkPackageDirty();
I created an editor script that allows me to modify the tooltip of the variables in the blueprint. However, when I run it, I can display the corrected tooltip in the default values of the blueprint class by hovering over the variables. But when I compile or run the game, the tooltip returns to its previous state and cannot be persisted.
This is very strange, I used UClass::FindPropertyByName and Set/GetMetaData and I don’t see any changes in the blueprint at all.
Although if display the log before and after - the tooltip (description) is displayed correctly.
How great that Widget Reflector exists!
I found a function that is called when you change the description in the Details tab. You need to use FBlueprintEditorUtils::SetBlueprintVariableMetaData