diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-10-13 05:29:08 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-10-13 05:29:08 +0400 |
commit | 276e5f709518e0a64c7bf520062de9ed9337572f (patch) | |
tree | 6da5f0feebe6cb810a47aa1ec4683d4cb34ca822 /source/blender/python/intern/bpy_driver.c | |
parent | 6955c47faca1c772c9278136d53337c2083aea18 (diff) |
formatting edits & remove debug print.
Diffstat (limited to 'source/blender/python/intern/bpy_driver.c')
-rw-r--r-- | source/blender/python/intern/bpy_driver.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/source/blender/python/intern/bpy_driver.c b/source/blender/python/intern/bpy_driver.c index 319790340ca..c5d15145ab2 100644 --- a/source/blender/python/intern/bpy_driver.c +++ b/source/blender/python/intern/bpy_driver.c @@ -99,7 +99,7 @@ void BPY_driver_reset(void) PyGILState_STATE gilstate; int use_gil= 1; /* !PYC_INTERPRETER_ACTIVE; */ - if(use_gil) + if (use_gil) gilstate= PyGILState_Ensure(); if (bpy_pydriver_Dict) { /* free the global dict used by pydrivers */ @@ -108,7 +108,7 @@ void BPY_driver_reset(void) bpy_pydriver_Dict= NULL; } - if(use_gil) + if (use_gil) PyGILState_Release(gilstate); return; @@ -157,14 +157,14 @@ float BPY_driver_exec(ChannelDriver *driver) if ((expr == NULL) || (expr[0]=='\0')) return 0.0f; - if(!(G.f & G_SCRIPT_AUTOEXEC)) { + if (!(G.f & G_SCRIPT_AUTOEXEC)) { printf("skipping driver '%s', automatic scripts are disabled\n", driver->expression); return 0.0f; } use_gil= 1; /* !PYC_INTERPRETER_ACTIVE; */ - if(use_gil) + if (use_gil) gilstate= PyGILState_Ensure(); /* needed since drivers are updated directly after undo where 'main' is @@ -175,17 +175,17 @@ float BPY_driver_exec(ChannelDriver *driver) if (!bpy_pydriver_Dict) { if (bpy_pydriver_create_dict() != 0) { fprintf(stderr, "Pydriver error: couldn't create Python dictionary"); - if(use_gil) + if (use_gil) PyGILState_Release(gilstate); return 0.0f; } } - if(driver->expr_comp==NULL) + if (driver->expr_comp==NULL) driver->flag |= DRIVER_FLAG_RECOMPILE; /* compile the expression first if it hasn't been compiled or needs to be rebuilt */ - if(driver->flag & DRIVER_FLAG_RECOMPILE) { + if (driver->flag & DRIVER_FLAG_RECOMPILE) { Py_XDECREF(driver->expr_comp); driver->expr_comp= PyTuple_New(2); @@ -199,7 +199,7 @@ float BPY_driver_exec(ChannelDriver *driver) expr_code= PyTuple_GET_ITEM(((PyObject *)driver->expr_comp), 0); } - if(driver->flag & DRIVER_FLAG_RENAMEVAR) { + if (driver->flag & DRIVER_FLAG_RENAMEVAR) { /* may not be set */ expr_vars= PyTuple_GET_ITEM(((PyObject *)driver->expr_comp), 1); Py_XDECREF(expr_vars); @@ -260,7 +260,7 @@ float BPY_driver_exec(ChannelDriver *driver) if (retval == NULL) { pydriver_error(driver); } - else if((result= PyFloat_AsDouble(retval)) == -1.0 && PyErr_Occurred()) { + else if ((result= PyFloat_AsDouble(retval)) == -1.0 && PyErr_Occurred()) { pydriver_error(driver); Py_DECREF(retval); result= 0.0; @@ -271,10 +271,10 @@ float BPY_driver_exec(ChannelDriver *driver) Py_DECREF(retval); } - if(use_gil) + if (use_gil) PyGILState_Release(gilstate); - if(finite(result)) { + if (finite(result)) { return (float)result; } else { |