How do I access FPluginDescriptor from within the plugin?

Is there a clean way to access my plugin’s metadata (version, description, support URL, etc.) from within the plugin itself?

I can probably use FPluginDescriptor::Load() and give it the uplugin file, but that feels hacky.

Can I get an IPlugin somehow and use IPlugin::GetDescriptor()?

From IPluginManager

In such of cases look for module main class, it usually got some entry functions and has singleton (Get() static function) which you cna access from anywhere

Remember to ■■■ “Projects” to decencies

Thank you! That pointed me in the right direction.

If anyone needs to do this, I did something like this:

FString  pluginVersion()
{
   auto  &manager = IPluginManager::Get();
   auto  plugin = manager.FindPlugin( "<plugin name>" );

   if ( !plugin.IsValid() )
   {
	  // log error
	  return {};
   }

   return plugin->GetDescriptor().VersionName;
}

Works great.

1 Like