Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-06-01 12:15:43 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-06-01 12:15:43 +0400
commited3a7bd299c4b6a0ed2712065be7ca59da9931fe (patch)
treeae6cb5bf7ae0f3e055af57b2dd9198227d5c025b /source/blender/editors/space_script/script_edit.c
parentc902eb8d7e6b737f04c9fa0897db8a75af1fd8ec (diff)
script reload (f8), is closer to working.
there are internal memory problems which can make it crash still. If you remove all directories in the scripts folder except for 'modules' and 'ui', it runs without crashes.
Diffstat (limited to 'source/blender/editors/space_script/script_edit.c')
-rw-r--r--source/blender/editors/space_script/script_edit.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/editors/space_script/script_edit.c b/source/blender/editors/space_script/script_edit.c
index 6ef9a96b478..02993549c94 100644
--- a/source/blender/editors/space_script/script_edit.c
+++ b/source/blender/editors/space_script/script_edit.c
@@ -84,3 +84,23 @@ void SCRIPT_OT_python_file_run(wmOperatorType *ot)
RNA_def_string_file_path(ot->srna, "path", "", 512, "Path", "");
}
+
+static int script_reload_exec(bContext *C, wmOperator *op)
+{
+#ifndef DISABLE_PYTHON
+ BPY_eval_string(C, "__import__('bpy').utils.load_scripts(reload_scripts=True)");
+ return OPERATOR_FINISHED;
+#endif
+ return OPERATOR_CANCELLED;
+}
+
+void SCRIPT_OT_reload(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Reload Scripts";
+ ot->description= "Reload Scripts";
+ ot->idname= "SCRIPT_OT_reload";
+
+ /* api callbacks */
+ ot->exec= script_reload_exec;
+}