mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-03-02 13:27:14 -05:00
UI: Add support for OBS_PLUGINS*_PATH env variables
Allow to load obs plugins from arbitary directory, specified by OBS_PLUGINS_PATH and OBS_PLUGINS_DATA_PATH environment variables.
This commit is contained in:
@@ -136,6 +136,16 @@ template<typename T> static void SetOBSRef(QListWidgetItem *item, T &&val)
|
||||
|
||||
static void AddExtraModulePaths()
|
||||
{
|
||||
char *plugins_path = getenv("OBS_PLUGINS_PATH");
|
||||
char *plugins_data_path = getenv("OBS_PLUGINS_DATA_PATH");
|
||||
if (plugins_path && plugins_data_path) {
|
||||
string data_path_with_module_suffix;
|
||||
data_path_with_module_suffix += plugins_data_path;
|
||||
data_path_with_module_suffix += "/%module%";
|
||||
obs_add_module_path(plugins_path,
|
||||
data_path_with_module_suffix.c_str());
|
||||
}
|
||||
|
||||
char base_module_dir[512];
|
||||
#if defined(_WIN32) || defined(__APPLE__)
|
||||
int ret = GetProgramDataPath(base_module_dir, sizeof(base_module_dir),
|
||||
|
||||
Reference in New Issue
Block a user