diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-05-04 15:00:33 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-05-04 15:00:33 +0400 |
commit | 5e3f871f65c2d11109683b21f49d5dcc9d5792f5 (patch) | |
tree | f8fbbf1c0f4bb4539254644a5065b7c7bb4da4fc /source/blender | |
parent | 0dfd373c3983de147589d6d488037c572621db64 (diff) |
also look for ndof plugin in $HOME/.blender/plugins/3DxNdofBlender.plug, for linux distro's where blender is installed in /usr/bin/blender, installing plugins in /usr/bin/plugins would not be acceptable.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/src/ghostwinlay.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/source/blender/src/ghostwinlay.c b/source/blender/src/ghostwinlay.c index 90a9ae9e406..7179f2fae57 100644 --- a/source/blender/src/ghostwinlay.c +++ b/source/blender/src/ghostwinlay.c @@ -927,6 +927,42 @@ void window_open_ndof(Window* win) } ndofLib = PIL_dynlib_open(plug_path); + + /* On systems where blender is installed in /usr/bin/blender, ~/.blender/plugins/ is a better place to look */ + if (ndofLib==NULL) { + + if (plug_path) { + MEM_freeN(plug_path); + } + + inst_path = BLI_gethome(); + if (inst_path) { + size_t len = strlen(inst_path) + strlen(plug_dir) + strlen(PATH_SEP)*2 + + strlen(plug_name) + 1; + + if (!strstr(inst_path, ".blender")) { + len += strlen(".blender") + strlen(PATH_SEP); + } + + plug_path = MEM_mallocN(len, "ndofpluginpath"); + if (plug_path) { + strncpy(plug_path, inst_path, len); + strcat(plug_path, PATH_SEP); + if (!strstr(inst_path, ".blender")) { + strcat(plug_path, ".blender"); + strcat(plug_path, PATH_SEP); + } + strcat(plug_path, plug_dir); + strcat(plug_path, PATH_SEP); + strcat(plug_path, plug_name); + } + } + + ndofLib = PIL_dynlib_open(plug_path); + } + + + #if 0 fprintf(stderr, "plugin path=%s; ndofLib=%p\n", plug_path, (void*)ndofLib); #endif |