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>2011-12-16 07:06:56 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-12-16 07:06:56 +0400
commitcad9cb563d48bd6787eb7ac8bc773ce625a8ae1a (patch)
treec76746c28114e53c5eaf9ad37d1e6b33fbaff0fa /source/blender/python/intern/bpy_driver.c
parentdbebf4ff5370a5b99899c71d2911c8e0835acdc6 (diff)
fix own error [#29631] frame is lost from driver namespace after reload
Diffstat (limited to 'source/blender/python/intern/bpy_driver.c')
-rw-r--r--source/blender/python/intern/bpy_driver.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/python/intern/bpy_driver.c b/source/blender/python/intern/bpy_driver.c
index db408374b7f..e628cb891d8 100644
--- a/source/blender/python/intern/bpy_driver.c
+++ b/source/blender/python/intern/bpy_driver.c
@@ -94,13 +94,12 @@ int bpy_pydriver_create_dict(void)
/* note, this function should do nothing most runs, only when changing frame */
static PyObject *bpy_pydriver_InternStr__frame= NULL;
+/* not thread safe but neither is python */
+static float bpy_pydriver_evaltime_prev= FLT_MAX;
static void bpy_pydriver_update_dict(const float evaltime)
{
- /* not thread safe but neither is python */
- static float evaltime_prev= FLT_MAX;
-
- if (evaltime_prev != evaltime) {
+ if (bpy_pydriver_evaltime_prev != evaltime) {
/* currently only update the frame */
if (bpy_pydriver_InternStr__frame == NULL) {
@@ -111,7 +110,7 @@ static void bpy_pydriver_update_dict(const float evaltime)
bpy_pydriver_InternStr__frame,
PyFloat_FromDouble(evaltime));
- evaltime_prev= evaltime;
+ bpy_pydriver_evaltime_prev= evaltime;
}
}
@@ -137,6 +136,7 @@ void BPY_driver_reset(void)
if (bpy_pydriver_InternStr__frame) {
Py_DECREF(bpy_pydriver_InternStr__frame);
bpy_pydriver_InternStr__frame= NULL;
+ bpy_pydriver_evaltime_prev= FLT_MAX;
}
if (use_gil)