obs-scripting: Add Resources to python path on macOS
Also changes indentation of this block back to tabs to be consistent with the rest of the file Co-authored-by: PatTheMav <patthemav+github@gmail.com>
This commit is contained in:
parent
ebd6520f25
commit
178ec005bd
35
deps/obs-scripting/obs-scripting-python.c
vendored
35
deps/obs-scripting/obs-scripting-python.c
vendored
@ -1672,22 +1672,33 @@ bool obs_scripting_load_python(const char *python_path)
|
|||||||
/* Load main interface module */
|
/* Load main interface module */
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
struct dstr bundle_path;
|
struct dstr plugin_path;
|
||||||
|
struct dstr resource_path;
|
||||||
dstr_init_move_array(&bundle_path, os_get_executable_path_ptr(""));
|
|
||||||
dstr_cat(&bundle_path, "../PlugIns");
|
|
||||||
char *absolute_plugin_path = os_get_abs_path_ptr(bundle_path.array);
|
|
||||||
|
|
||||||
if(absolute_plugin_path != NULL) {
|
|
||||||
add_to_python_path(absolute_plugin_path);
|
|
||||||
bfree(absolute_plugin_path);
|
|
||||||
}
|
|
||||||
dstr_free(&bundle_path);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
dstr_init_move_array(&plugin_path, os_get_executable_path_ptr(""));
|
||||||
|
dstr_init_copy(&resource_path, plugin_path.array);
|
||||||
|
dstr_cat(&plugin_path, "../PlugIns");
|
||||||
|
dstr_cat(&resource_path, "../Resources");
|
||||||
|
|
||||||
|
char *absolute_plugin_path = os_get_abs_path_ptr(plugin_path.array);
|
||||||
|
char *absolute_resource_path = os_get_abs_path_ptr(resource_path.array);
|
||||||
|
|
||||||
|
if(absolute_plugin_path != NULL) {
|
||||||
|
add_to_python_path(absolute_plugin_path);
|
||||||
|
bfree(absolute_plugin_path);
|
||||||
|
}
|
||||||
|
dstr_free(&plugin_path);
|
||||||
|
|
||||||
|
if(absolute_resource_path != NULL) {
|
||||||
|
add_to_python_path(absolute_resource_path);
|
||||||
|
bfree(absolute_resource_path);
|
||||||
|
}
|
||||||
|
dstr_free(&resource_path);
|
||||||
|
#else
|
||||||
char *absolute_script_path = os_get_abs_path_ptr(SCRIPT_DIR);
|
char *absolute_script_path = os_get_abs_path_ptr(SCRIPT_DIR);
|
||||||
add_to_python_path(absolute_script_path);
|
add_to_python_path(absolute_script_path);
|
||||||
bfree(absolute_script_path);
|
bfree(absolute_script_path);
|
||||||
|
#endif
|
||||||
|
|
||||||
py_obspython = PyImport_ImportModule("obspython");
|
py_obspython = PyImport_ImportModule("obspython");
|
||||||
bool success = !py_error();
|
bool success = !py_error();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user