From 08f306c81cb8015db59fe63ad1ef2c977751652e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 6 Mar 2008 21:25:15 +0000 Subject: 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. --- source/blender/blenkernel/intern/script.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenkernel/intern/script.c') diff --git a/source/blender/blenkernel/intern/script.c b/source/blender/blenkernel/intern/script.c index b99c2c51441..099fedf460a 100644 --- a/source/blender/blenkernel/intern/script.c +++ b/source/blender/blenkernel/intern/script.c @@ -35,7 +35,7 @@ */ #include "BKE_script.h" -#include "BPI_script.h" +#include "DNA_space_types.h" #include "MEM_guardedalloc.h" #include "BKE_bad_level_calls.h" /* for BPY_clear_script */ -- cgit v1.2.3 From a5d31fc28e7737b9e6ef3d56986cb2e2f0493047 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 15 Mar 2008 18:53:42 +0000 Subject: fix for [#8559] Python script that uses FIleSelector and has an error in it segfaults Blender --- source/blender/blenkernel/intern/script.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'source/blender/blenkernel/intern/script.c') diff --git a/source/blender/blenkernel/intern/script.c b/source/blender/blenkernel/intern/script.c index 099fedf460a..2836f5fd507 100644 --- a/source/blender/blenkernel/intern/script.c +++ b/source/blender/blenkernel/intern/script.c @@ -60,12 +60,5 @@ void free_script (Script *script) { if (!script) return; - - if (script->py_globaldict || script->py_button || - script->py_event || script->py_draw) - { - BPY_clear_script(script); - } - - return; + BPY_clear_script(script); } -- cgit v1.2.3 From 5d0a207ecb843c4c73be897cfccbf3a0d2db574b Mon Sep 17 00:00:00 2001 From: Chris Want Date: Wed, 16 Apr 2008 22:40:48 +0000 Subject: Patch from GSR that a) fixes a whole bunch of GPL/BL license blocks that were previously missed; and b) greatly increase my ohloh stats! --- source/blender/blenkernel/intern/script.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'source/blender/blenkernel/intern/script.c') diff --git a/source/blender/blenkernel/intern/script.c b/source/blender/blenkernel/intern/script.c index 2836f5fd507..b93821da218 100644 --- a/source/blender/blenkernel/intern/script.c +++ b/source/blender/blenkernel/intern/script.c @@ -5,15 +5,12 @@ * * Function(s) related to struct script management. * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** + * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -31,7 +28,7 @@ * * Contributor(s): Willian P. Germano. * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** + * ***** END GPL LICENSE BLOCK ***** */ #include "BKE_script.h" -- cgit v1.2.3 From ac4ff83ca6b5795f4451a7e743d3975aeb17ae3b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 28 Oct 2008 18:47:13 +0000 Subject: added scons option BF_WITH_PYTHON (defined as DISABLE_PYTHON) --- source/blender/blenkernel/intern/script.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender/blenkernel/intern/script.c') diff --git a/source/blender/blenkernel/intern/script.c b/source/blender/blenkernel/intern/script.c index b93821da218..6145f6c3063 100644 --- a/source/blender/blenkernel/intern/script.c +++ b/source/blender/blenkernel/intern/script.c @@ -44,7 +44,9 @@ #include "BKE_global.h" #include "BKE_main.h" +#ifndef DISABLE_PYTHON #include "BPY_extern.h" // Blender Python library +#endif #ifdef HAVE_CONFIG_H #include @@ -57,5 +59,7 @@ void free_script (Script *script) { if (!script) return; +#ifndef DISABLE_PYTHON BPY_clear_script(script); +#endif } -- cgit v1.2.3