Commit Graph

432 Commits

Author SHA1 Message Date
nick verigakis
d2ed7b31a3 New batch APIs to optimize UEFN project close times by deferring and batching:
- Calls to OnPluginUnload (one GC call for all plugins)
- Calls to FCollectionManager::HandleObjectDeleted (one UpdateCaches call at the end)

#rb Dave.Belanger, Francis.Hurteau
[FYI] Rex.Hill
#rnx

[CL 36757086 by nick verigakis in 5.5 branch]
2024-10-01 19:26:41 -04:00
evgenii babinets
3ce5552d59 Removing IniCacheSet usage in plugin manager; the set doesn't actually get propagated in the ParallelFor below where it is currently used, and would require some thread-local globals or parameters to propagate it down safely to where it's needed. After testing whether that would be helpful, there are still some DirectoryExists calls later that would not be feasible to cache, so this just reverts it to the previous state where it wasn't being used at all.
#rb Josh.Adams

[CL 36029532 by evgenii babinets in ue5-main branch]
2024-09-04 21:48:10 -04:00
zach brockway
1e7eb6e4d1 Plugin Manager: Prioritize editor target receipts whose Launch executable matches the currently running executable.
Previously, the first (arbitrary) editor target receipt with a matching configuration was chosen.

This is necessary to disambiguate a second receipt for an editor target in the engine binaries directory, and matches existing logic used to determine the correct receipt in FEngineLoop::AppInit.

#jira UE-196216
#rb jeremie.roy, will.brown

[CL 36017174 by zach brockway in ue5-main branch]
2024-09-04 13:55:33 -04:00
zach brockway
ed347ff4ed Plugin Browser + Plugin Manager: Add UI for configuring additional/external plugin directories.
Adds a "Plugin Directories" button to the Plugin Browser, which spawns a nomad tab containing a struct details view that lists configured directories, and optionally (config-driven) allows them to be modified and handles updates to the relevant managers.

Also includes some smaller supporting changes to make the Plugin Browser usable in LiveLink Hub.

Related changes to plugin manager:
- Adds an EPluginExternalSource enum, and extends IPluginManager's "external path" representation from FString to a tagged struct indicating the source of each path.
- Adds `void IPluginManager::GetExternalPluginSources(TSet<FExternalPluginPath>& OutPluginSources)` as an alternative/successor to `const TSet<FString>& GetAdditionalPluginSearchPaths()`.
- Adds `IPluginManager::RemovePluginSearchPath()` counterpart to existing `AddPluginSearchPath()`.

Other changes:
- Adds `[EditorSettings] bCanModifyProjectPluginDirectoriesFromBrowser` config bool. If not explicitly set, effectively defaults to the value of `bCanModifyPluginsFromBrowser`.
- Adds `[EditorSettings] bCanModifyUserPluginDirectoriesFromBrowser` config bool. Disabled and hidden by default, 'User' plugin directories are intended as an application-specific mechanism to expose `IPluginManager::AddPluginSearchPath` without requiring a writable uproject descriptor.
- Adds `[EditorSettings] HidePluginCategoriesFromBrowser` config string list to exclude named categories from SPluginCategoryTree (unused by default, will be used for LiveLink Hub).
- Adds `[EditorSettings] bCanCreatePluginsFromBrowser` config bool to disable the plugin creator / "Add Plugin" button.

#jira UE-216220
#rb jason.walter, will.brown

[CL 35747847 by zach brockway in ue5-main branch]
2024-08-22 13:47:11 -04:00
evgenii babinets
3d3c2d7f70 Adding CVar to control whether to IniCacheSet when loading plugins, since this shows an improvement on some platforms.
#rb josh.adams

[CL 35279573 by evgenii babinets in ue5-main branch]
2024-08-02 13:09:21 -04:00
jamie dale
e2ac45336d Remove restriction that the package localization cache can only be updated on the game thread
This restriction was added before the asset registry itself was made thread-safe, and is no longer needed

This allows us to remove all the places that were pessimistically calling ConditionalUpdateCache from the GT to avoid warnings from the ALT, as the ALT can now update the cache itself as needed. This avoids the per-plugin/GFP hit when calling ConditionalUpdateCache after mounting/loading the asset registry state, and in the editor means that nothing ever needs to call ConditionalUpdateCache (as the editor doesn't partake in localized asset loading).

#rb Justin.Marcus, Rex.Hill

[CL 35252667 by jamie dale in ue5-main branch]
2024-08-01 14:42:06 -04:00
jamie dale
6e9d3680c9 Centralized the logic for forcing game localization data to load in an editor
This is now controlled by FTextLocalizationManager::ShouldForceLoadGameLocalization, which will return true in the following cases:
  * A cooked editor.
  * An uncooked editor with the game localization preview enabled, or with the CVar Localization.ForceLoadGameLocalizationInEditor set to true.

This is queried to add the ELocalizationLoadFlags::ForceLocalizedGame flag when loading localization data, and also by FLocalizationTargetDescriptor::ShouldLoadLocalizationTarget when deciding whether to load a game localization target for a plugin (which also allows plugins to work with the game localization preview).

#rb eric.boucher

[CL 34460891 by jamie dale in ue5-main branch]
2024-06-18 10:51:09 -04:00
dave belanger
d86e214cf0 IPlugin::Get/SetVerseVersion
#rb Rex.Hill

[CL 34458414 by dave belanger in ue5-main branch]
2024-06-18 09:58:40 -04:00
eric boucher
5fe1716cf3 Load game localization data in cooked editors
#rb Jamie.Dale
#rnx

[CL 34357337 by eric boucher in ue5-main branch]
2024-06-13 18:23:49 -04:00
eric knapik
31b5565620 Fix issue where GFS plugins or dependencies of root plugins might become unmounted and not enabled. This would prevent them from being mounted again by requiring that the plugins be enabled when tied to a root.
Add way to know the current enabled plugins for the target. This allows the application to only load the modules and plugins.

[REVIEW] [at]Will.Brown [at]Lewis.Farrell [at]Aidan.McDu
#rb aidan.mcdu, will.brown

[CL 34212830 by eric knapik in ue5-main branch]
2024-06-07 15:59:14 -04:00
zach brockway
f74f50ff06 UnrealBuildTool: Introduce TargetRules.bAllowEnginePluginsEnabledByDefault, analogous to (the inverse of) "DisableEnginePluginsByDefault" in the project descriptor.
This is passed through to the target receipt, and respected in FPluginManager.

#jira UE-214749
#rb Joe.Kirchoff

[CL 33811096 by zach brockway in ue5-main branch]
2024-05-21 17:30:36 -04:00
will brown
101934fc5e Adding an optional sort delegate to allow custom sorting of the updated json array before it's set. The default behavor adds new elements to the end of the json array which may not match the source input array. Removing the clearing of "Plugins" so that existing data is preserved again.
#jira UE-214985
#rb Dave.Belanger, robert.millar

[CL 33687013 by will brown in ue5-main branch]
2024-05-16 10:23:59 -04:00
josh adams
908083ad22 FConfigBranch Phase 2:
- Making use of unload configs in PluginManager, GameFeaturePlugins, and HotFixes
- To help with memory increase from the branch memory for unloadable configs, I added FConfigCacheIni::SafeUnload(BranchName), which can unload the memory usage by a branch, but then will on-demand reload the hierarchy if accessed
- Used SafeUnload to GGameplayTagsIni because that is read once and cached
- Various other minor optimizations, like not creating hundreds of empty configs in GConfig,
- Added "config memusage" (similar to configmem as it turns out)
- Removed some old deprecated code
- Added ability for editor to remember and write out comments in .ini files
- Changed commandline ini overrides to a dynamic layer (this is a work in progress - old method is still in there - it's tied to the ini.UseNewDynamicLayers cvar - old GFP code used the old way, etc, which i still support)
- Experimental support for runtime config change tracking, so saving out .ini files will have more context about how the user changed a config section (mostly important for arrays). This is not fully functional yet [WILL PROBABLY REMOVE]
- Experimental new config layer expansion system that uses FPaths::ConvertPath to find Restricted/Platform locations, instead of hardcoding
#rb David.Harvey

[CL 33489816 by josh adams in ue5-main branch]
2024-05-07 14:20:06 -04:00
jamie dale
5e7a6465f7 Avoid localization data failing to load for loaded/active GFPs if GameFeaturePlugin.DeferLocalizationDataLoad is hotfixed to false after the GFPs have already mounted
Since the mount/unmount localization calls are now ref-counted, we can just always call them during GFP loading/unloading as they'll be a no-op if the localization data was already loaded by mounting (or anything else).

Also improved the logging when the localization data skips being loaded/unloaded due to an existing reference, so that we can see the ref-count in the log.

[FYI] Kelby.Gamble
#rnx

[CL 33204941 by jamie dale in ue5-main branch]
2024-04-24 13:28:35 -04:00
zousar shaker
95ce2445c4 Adding internal API to allow monolithic programs to optionally accept a uproject as a first argument and use that as its project directory even if it is an engine executable.
#rb paul.chipchase

[CL 33084091 by zousar shaker in ue5-main branch]
2024-04-18 16:23:21 -04:00
jamie dale
2f91dbac02 Ref-count the mounting of localization data for explicitly mounted plugins
This allows different systems that need plugin localization to call MountExplicitlyLoadedPluginLocalizationData and UnmountExplicitlyLoadedPluginLocalizationData (in pairs), without needing to understand any other system that may have mounted localization for that plugin, and avoids the unmount calls from different systems fighting with each other.

#rb simon.orr

[CL 32929429 by jamie dale in ue5-main branch]
2024-04-12 10:36:02 -04:00
will brown
685fe96237 Enabling the runtime root plugin optional references code so that not enabled plugins are ignored with snapshot use. Non shipping builds only. This is required as the staging step which performs the stripping is not executed in this workflow
#rb Eric.Knapik, robert.millar

[CL 32913468 by will brown in ue5-main branch]
2024-04-11 18:58:09 -04:00
george rolfe
e05aebc20a Adding GameTarget Allow/Deny Lists to UBT
#rnx
#rb Joe.Kirchoff

[CL 32721753 by george rolfe in ue5-main branch]
2024-04-04 04:41:05 -04:00
will brown
dfc6665b28 Displaying the SunsetFortReleaseVersion in the plugin editor through the FortGameFeaturePluginMetadataCustomization
#rb robert.millar

[CL 32705650 by will brown in ue5-main branch]
2024-04-03 14:36:35 -04:00
daniel lamb
be0ce0757f Added plugin param for generating iads
[CL 32431824 by daniel lamb in ue5-main branch]
2024-03-22 09:34:47 -04:00
will brown
741bee3268 Removing the field "Plugins" on update to force the array to be rebuilt in the same order as the plugins array rather than new items being appended to the end
#rb robert.millar

[CL 32390197 by will brown in ue5-main branch]
2024-03-20 21:11:28 -04:00
jamie dale
d463d5199b Implemented localization resource unloading for plugins
This leverages 4-bytes of padding in FDisplayStringEntry to store an ID (an int32 index generated via FTextLocalizationManager::GetLocalizationTargetPathId) that is used to tag each display string with the localization target that it belongs to, without increasing the size of DisplayStringLookupTable.

There is an additional LUT mapping each localization target ID to its text IDs to act as an accelerator for HandleLocalizationTargetsUnmounted, however this LUT only tracks text IDs associated with localization data loaded via HandleLocalizationTargetsMounted to minimize the memory impact of this additional tracking. Without this LUT HandleLocalizationTargetsUnmounted would need to spin the entire live table each time, which is not acceptable from a performance standpoint.

Now that HandleLocalizationTargetsUnmounted is implemented it's also been hooked into GFP deactivation, to mirror how HandleLocalizationTargetsMounted was hooked into GFP activation.

#rb anton.dunchev

[CL 32312744 by jamie dale in ue5-main branch]
2024-03-18 17:21:49 -04:00
jamie dale
87c34119f4 Don't mount localization data for explicitly loaded plugins by default
This allows them to separate their mounting and content loading into two phases, such as allowing a GFP to mount the plugin when "registered" and defer mounting the localization data until "activating".

Note: Anything that was calling one of the MountExplicitlyLoadedPlugin functions to load a plugin, will now need to also call MountExplicitlyLoadedPluginLocalizationData if it wants to also mount the localization data.

#rb anton.dunchev, Leon.Huang

[CL 32029617 by jamie dale in ue5-main branch]
2024-03-05 14:18:02 -05:00
jamie dale
edef03928d Don't load localization data for unmounted explicitly loaded plugins
[FYI] Leon.Huang
#rnx

[CL 31978251 by jamie dale in ue5-main branch]
2024-03-02 17:41:16 -05:00
matt breindel
3c6cf59c14 Infrastructure and general implementation of a new system for providing improve error messages when we skip loading a package during import because the plugin wasn't mounted. the plugin manager and the GameFeatureSubsystem now have an opportunity to provide additional information to the user about why the plugin wasn't loaded or the package wasn't found.
#jira UE-205029
[REVIEW] [at]will.brown [at]*eric.knapik [at]*danny.couture
[FYI] [at]francis.hurteau
#rb danny.couture, Eric.Knapik

[CL 31957199 by matt breindel in ue5-main branch]
2024-03-01 16:48:08 -05:00