Merged changes in the trunk up to revision 42692.
This commit is contained in:
@@ -260,6 +260,7 @@ PyObject *BPY_app_struct(void)
|
||||
/* prevent user from creating new instances */
|
||||
BlenderAppType.tp_init= NULL;
|
||||
BlenderAppType.tp_new= NULL;
|
||||
BlenderAppType.tp_hash= (hashfunc)_Py_HashPointer; /* without this we can't do set(sys.modules) [#29635] */
|
||||
|
||||
/* kindof a hack ontop of PyStructSequence */
|
||||
py_struct_seq_getset_init();
|
||||
|
||||
@@ -210,6 +210,7 @@ PyObject *BPY_app_handlers_struct(void)
|
||||
/* prevent user from creating new instances */
|
||||
BlenderAppCbType.tp_init= NULL;
|
||||
BlenderAppCbType.tp_new= NULL;
|
||||
BlenderAppCbType.tp_hash= (hashfunc)_Py_HashPointer; /* without this we can't do set(sys.modules) [#29635] */
|
||||
|
||||
/* assign the C callbacks */
|
||||
if (ret) {
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user