diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-02-20 16:42:15 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-02-20 16:42:15 +0300 |
commit | cf27a896faf6e5fee7eeea9e70fbee1a9447572f (patch) | |
tree | e84b3e2a3ffd6d7f92138771d5ecb0929e1a3669 /source/blender/src | |
parent | 6862acc1b3fca36cdbd629b7300d03f30c914874 (diff) |
Python Bugfix,
Setting the user preference for python scripts didnt add the bpymodules subdirectory to sys.path (python module search path).
Also problems with entering and exiting- the old path was used until next restart.
Diffstat (limited to 'source/blender/src')
-rw-r--r-- | source/blender/src/header_script.c | 1 | ||||
-rw-r--r-- | source/blender/src/headerbuttons.c | 1 | ||||
-rw-r--r-- | source/blender/src/space.c | 6 |
3 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/src/header_script.c b/source/blender/src/header_script.c index 98f18c4e2ac..de76a30ecdd 100644 --- a/source/blender/src/header_script.c +++ b/source/blender/src/header_script.c @@ -117,6 +117,7 @@ static void do_script_scriptsmenu(void *arg, int event) switch(event) { case 0: /* update menus */ BPyMenu_RemoveAllEntries(); + BPY_rebuild_syspath(); if (BPyMenu_Init(1) == -1) error("Invalid scripts dir: check console"); break; } diff --git a/source/blender/src/headerbuttons.c b/source/blender/src/headerbuttons.c index d6e0b054a8b..e3c594f4ea3 100644 --- a/source/blender/src/headerbuttons.c +++ b/source/blender/src/headerbuttons.c @@ -1496,6 +1496,7 @@ void do_global_buttons(unsigned short event) case B_PYMENUEVAL: /* is button from space.c *info* */ waitcursor( 1 ); /* can take some time */ BPyMenu_RemoveAllEntries(); /* free old data */ + BPY_rebuild_syspath(); if (BPyMenu_Init(1) == -1) { /* re-eval scripts registration in menus */ waitcursor( 0 ); error("Invalid scripts dir: check console"); diff --git a/source/blender/src/space.c b/source/blender/src/space.c index a586d1e0e36..382b72967bc 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -4214,12 +4214,12 @@ void drawinfospace(ScrArea *sa, void *spacedata) uiBlockEndAlign(block); uiBlockBeginAlign(block); - uiDefBut(block, TEX, 0, "Python: ", + uiDefBut(block, TEX, B_PYMENUEVAL, "Python Scripts: ", (xpos+edgsp+lpref+midsp),y1,(lpref-2*smfileselbut),buth, - U.pythondir, 1.0, 63.0, 0, 0, "The default directory to search for Python scripts"); + U.pythondir, 1.0, 63.0, 0, 0, "The default directory to search for Python scripts (resets python module search path: sys.path)"); uiDefIconBut(block, BUT, B_PYMENUEVAL, ICON_SCRIPT, (xpos+edgsp+(2*lpref)+midsp-2*smfileselbut),y1,smfileselbut,buth, - 0, 0, 0, 0, 0, "Re-evaluate scripts registration in menus"); + 0, 0, 0, 0, 0, "Re-evaluate scripts registration in menus (resets python module search path: sys.path)"); uiDefIconBut(block, BUT, B_PYTHONDIRFILESEL, ICON_FILESEL, (xpos+edgsp+(2*lpref)+midsp-smfileselbut),y1,smfileselbut,buth, 0, 0, 0, 0, 0, "Select the default Python script location"); |