mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-09-19 20:32:15 +02:00
obs-scripting: Load obspython.py from Resources on macOS
This commit is contained in:
parent
b65ee7e7fb
commit
afa8527723
22
deps/obs-scripting/obs-scripting-python.c
vendored
22
deps/obs-scripting/obs-scripting-python.c
vendored
@ -1676,10 +1676,24 @@ bool obs_scripting_load_python(const char *python_path)
|
||||
bfree(absolute_script_path);
|
||||
|
||||
#if __APPLE__
|
||||
char *exec_path = os_get_executable_path_ptr("");
|
||||
if (exec_path)
|
||||
add_to_python_path(exec_path);
|
||||
bfree(exec_path);
|
||||
char *absolute_exec_path = os_get_executable_path_ptr("");
|
||||
|
||||
if (absolute_exec_path != NULL) {
|
||||
add_to_python_path(absolute_exec_path);
|
||||
|
||||
struct dstr resources_path;
|
||||
dstr_init_move_array(&resources_path, absolute_exec_path);
|
||||
dstr_cat(&resources_path, "../Resources");
|
||||
|
||||
char *absolute_resources_path = os_get_abs_path_ptr(resources_path.array);
|
||||
if (absolute_resources_path != NULL) {
|
||||
add_to_python_path(absolute_resources_path);
|
||||
bfree(absolute_resources_path);
|
||||
}
|
||||
|
||||
dstr_free(&resources_path);
|
||||
bfree(absolute_exec_path);
|
||||
}
|
||||
#endif
|
||||
|
||||
py_obspython = PyImport_ImportModule("obspython");
|
||||
|
Loading…
Reference in New Issue
Block a user