diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-04-23 18:04:05 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-04-23 18:04:05 +0400 |
commit | 4f49a3b906bd4974056ca734beda7241b70031dc (patch) | |
tree | c64ae47ea0432e7ca17b1279523827b23d5557f9 /source | |
parent | 3552afeef2998b927ac5828a1904bd6c2d5034b6 (diff) |
added ipo script template from blenderartists forTe, made scripts refresh on load factory settings and replaced elysiun with blenderartist.org in headers
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 2 | ||||
-rw-r--r-- | source/blender/python/BPY_extern.h | 3 | ||||
-rw-r--r-- | source/blender/python/BPY_interface.c | 10 | ||||
-rw-r--r-- | source/blender/python/api2_2x/doc/API_related.py | 6 | ||||
-rw-r--r-- | source/blender/src/header_script.c | 6 | ||||
-rw-r--r-- | source/blender/src/headerbuttons.c | 10 | ||||
-rw-r--r-- | source/blender/src/usiblender.c | 4 |
7 files changed, 27 insertions, 14 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 7a5385def17..be790f6b9c1 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -1372,7 +1372,7 @@ void object_make_proxy(Object *ob, Object *target, Object *gob) ob->mat = MEM_dupallocN(target->mat); for(i=0; i<target->totcol; i++) { /* dont need to run test_object_materials since we know this object is new and not used elsewhere */ - id_us_plus(ob->mat[i]); + id_us_plus((ID *)ob->mat[i]); } } diff --git a/source/blender/python/BPY_extern.h b/source/blender/python/BPY_extern.h index 41e8004e25b..f6a27b80733 100644 --- a/source/blender/python/BPY_extern.h +++ b/source/blender/python/BPY_extern.h @@ -84,7 +84,8 @@ extern "C" { void init_syspath( int first_time ); void syspath_append( char *dir ); void BPY_rebuild_syspath( void ); - + int BPY_path_update( void ); + int BPY_Err_getLinenumber( void ); const char *BPY_Err_getFilename( void ); diff --git a/source/blender/python/BPY_interface.c b/source/blender/python/BPY_interface.c index 9bdb4425766..9d1d0e0f7d6 100644 --- a/source/blender/python/BPY_interface.c +++ b/source/blender/python/BPY_interface.c @@ -462,6 +462,16 @@ void BPY_rebuild_syspath( void ) PyGILState_Release(gilstate); } +int BPY_path_update( void ) +{ + BPyMenu_RemoveAllEntries(); /* free old data */ + BPY_rebuild_syspath(); + if (BPyMenu_Init(1) == -1) { /* re-eval scripts registration in menus */ + return 0; + } + return 1; +} + /**************************************************************************** * Description: This function finishes Python initialization in Blender. diff --git a/source/blender/python/api2_2x/doc/API_related.py b/source/blender/python/api2_2x/doc/API_related.py index 87b29e7f524..4e29f95e76d 100644 --- a/source/blender/python/api2_2x/doc/API_related.py +++ b/source/blender/python/api2_2x/doc/API_related.py @@ -351,8 +351,8 @@ Introduction: expected format for each url entry is e.g. "Author's site, http://www.somewhere.com". The first part, before the comma (','), is used as the button's tooltip. There are two preset - options: "blender" and "elysiun", which link to the Python forums at - blender.org and elysiun.com, respectively. + options: "blender" and "blenderartists.org", which link to the Python forums at + blender.org and blenderartists.org, respectively. - __email__ (optional, type: string or list of strings): - Equivalent to __url__, but opens the user's default email client. You @@ -369,7 +369,7 @@ Introduction: __author__ = 'Mr. Author' __version__ = '1.0 2005/01/01' __url__ = ["Author's site, http://somewhere.com", - "Support forum, http://somewhere.com/forum/", "blender", "elysiun"] + "Support forum, http://somewhere.com/forum/", "blender", "blenderartists.org"] __email__ = ["Mr. Author, mrauthor:somewhere*com", "scripts"] __bpydoc__ = \"\"\"\\ This script does this and that. diff --git a/source/blender/src/header_script.c b/source/blender/src/header_script.c index f0a042f27c0..3c96e1692bf 100644 --- a/source/blender/src/header_script.c +++ b/source/blender/src/header_script.c @@ -112,9 +112,9 @@ static void do_script_scriptsmenu(void *arg, int event) /* these are no defines, easier this way, the codes are in the function below */ switch(event) { case 0: /* update menus */ - BPyMenu_RemoveAllEntries(); - BPY_rebuild_syspath(); - if (BPyMenu_Init(1) == -1) error("Invalid scripts dir: check console"); + if (BPY_path_update()==0) { + error("Invalid scripts dir: check console"); + } break; } diff --git a/source/blender/src/headerbuttons.c b/source/blender/src/headerbuttons.c index fcc1dcb42b4..b91a8f74f80 100644 --- a/source/blender/src/headerbuttons.c +++ b/source/blender/src/headerbuttons.c @@ -545,9 +545,9 @@ static void filesel_u_pythondir(char *name) allqueue(REDRAWALL, 0); /* act on the change */ - BPyMenu_RemoveAllEntries(); - BPY_rebuild_syspath(); - if (BPyMenu_Init(1) == -1) error("Invalid scripts dir: check console"); + if (BPY_path_update()==0) { + error("Invalid scripts dir: check console"); + } } static void filesel_u_sounddir(char *name) @@ -1525,9 +1525,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 */ + if (BPY_path_update() == 0) { /* re-eval scripts registration in menus */ waitcursor( 0 ); error("Invalid scripts dir: check console"); } diff --git a/source/blender/src/usiblender.c b/source/blender/src/usiblender.c index 36bb36e0642..dfcfc0d57f7 100644 --- a/source/blender/src/usiblender.c +++ b/source/blender/src/usiblender.c @@ -641,6 +641,10 @@ int BIF_read_homefile(int from_memory) BKE_reset_undo(); BKE_write_undo("original"); /* save current state */ + /* if from memory, need to refresh python scripts */ + if (from_memory) { + BPY_path_update(); + } return success; } |