diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-03-07 00:25:15 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-03-07 00:25:15 +0300 |
commit | 08f306c81cb8015db59fe63ad1ef2c977751652e (patch) | |
tree | 94f656dbf98fba2bf3d47547d34c06131d0a88cf /source/blender/python/api2_2x | |
parent | 3796abf092c9de4d43131dbce05102b126e14896 (diff) |
Made python scripts save and load in the blend file so you can have the same scripts running when you open a blend file.
Also scripts will re-run on undo rather then closing.
This is done by saving and loading the name of the script or textblock of the 'Script' datablock, connected to the ScriptSpace. This way when there is a name but the script dosnt run.
Blender runs the script or text block if available.
Diffstat (limited to 'source/blender/python/api2_2x')
-rw-r--r-- | source/blender/python/api2_2x/Blender.c | 2 | ||||
-rw-r--r-- | source/blender/python/api2_2x/Draw.c | 4 | ||||
-rw-r--r-- | source/blender/python/api2_2x/Window.c | 1 |
3 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/python/api2_2x/Blender.c b/source/blender/python/api2_2x/Blender.c index a93316d308f..d520dded486 100644 --- a/source/blender/python/api2_2x/Blender.c +++ b/source/blender/python/api2_2x/Blender.c @@ -54,7 +54,7 @@ struct ID; /*keep me up here */ #include "BKE_library.h" #include "BKE_main.h" #include "BIF_space.h" -#include "BPI_script.h" +#include "DNA_space_types.h" /* script struct */ #include "BSE_headerbuttons.h" #include "DNA_screen_types.h" /* for SPACE_VIEW3D */ #include "DNA_userdef_types.h" diff --git a/source/blender/python/api2_2x/Draw.c b/source/blender/python/api2_2x/Draw.c index 284a6d92ba2..a4bbeba65ac 100644 --- a/source/blender/python/api2_2x/Draw.c +++ b/source/blender/python/api2_2x/Draw.c @@ -52,7 +52,7 @@ #include "BIF_space.h" #include "BIF_interface.h" #include "BIF_toolbox.h" -#include "BPI_script.h" /* script struct */ +#include "DNA_space_types.h" /* script struct */ #include "Image.h" /* for accessing Blender.Image objects */ #include "IMB_imbuf_types.h" /* for the IB_rect define */ #include "interface.h" @@ -912,6 +912,8 @@ static PyObject *Method_Exit( PyObject * self ) /* remove our lock to the current namespace */ script->flags &= ~SCRIPT_GUI; + script->scriptname[0] = '\0'; + script->scriptarg[0] = '\0'; Py_RETURN_NONE; } diff --git a/source/blender/python/api2_2x/Window.c b/source/blender/python/api2_2x/Window.c index 7d346ed9cd9..21caab3e697 100644 --- a/source/blender/python/api2_2x/Window.c +++ b/source/blender/python/api2_2x/Window.c @@ -38,7 +38,6 @@ #include "BKE_main.h" #include "BKE_object.h" /* for during_script() and during_scriptlink() */ #include "BKE_scene.h" /* scene_find_camera() */ -#include "BPI_script.h" #include "BIF_mywindow.h" #include "BIF_imasel.h" #include "BSE_headerbuttons.h" |