diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-08-12 04:09:57 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-08-12 04:09:57 +0400 |
commit | 44e4c5f8316b34835c7900dc649bf8a1570afc0a (patch) | |
tree | 99027196ffd166c78c336126d36c36bbc1621a29 /source/blender/python | |
parent | 8a340981be174cae842d339f0458ba6b558330c3 (diff) | |
parent | 0682c3f1aefe315df5fe64ba8c814adacbd739e5 (diff) |
Merged changes in the trunk up to revision 49797.
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/bmesh/bmesh_py_types.c | 8 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_app.c | 4 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_interface.c | 2 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_props.c | 7 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 2 |
5 files changed, 13 insertions, 10 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c index 2867cba8129..9270aec8d95 100644 --- a/source/blender/python/bmesh/bmesh_py_types.c +++ b/source/blender/python/bmesh/bmesh_py_types.c @@ -2155,10 +2155,10 @@ static PyObject *bpy_bmelemseq_sort(BPy_BMElemSeq *self, PyObject *args, PyObjec BPY_BM_CHECK_OBJ(self); if (args != NULL) { - if(!PyArg_ParseTupleAndKeywords(args, kw, - "|Oi:BMElemSeq.sort", - (char **)kwlist, - &keyfunc, &reverse)) + if (!PyArg_ParseTupleAndKeywords(args, kw, + "|Oi:BMElemSeq.sort", + (char **)kwlist, + &keyfunc, &reverse)) return NULL; } diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c index 44979700d94..ccce0d8c5ae 100644 --- a/source/blender/python/intern/bpy_app.c +++ b/source/blender/python/intern/bpy_app.c @@ -195,7 +195,7 @@ PyDoc_STRVAR(bpy_app_debug_value_doc, ); static PyObject *bpy_app_debug_value_get(PyObject *UNUSED(self), void *UNUSED(closure)) { - return PyLong_FromSsize_t(G.rt); + return PyLong_FromSsize_t(G.debug_value); } static int bpy_app_debug_value_set(PyObject *UNUSED(self), PyObject *value, void *UNUSED(closure)) @@ -207,7 +207,7 @@ static int bpy_app_debug_value_set(PyObject *UNUSED(self), PyObject *value, void return -1; } - G.rt = param; + G.debug_value = param; return 0; } diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 93f49fd72c9..aa9d81389da 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -639,7 +639,7 @@ void BPY_modules_load_user(bContext *C) bpy_context_set(C, &gilstate); - for (text = CTX_data_main(C)->text.first; text; text = text->id.next) { + for (text = bmain->text.first; text; text = text->id.next) { if (text->flags & TXT_ISSCRIPT && BLI_testextensie(text->id.name + 2, ".py")) { if (!(G.f & G_SCRIPT_AUTOEXEC)) { printf("scripts disabled for \"%s\", skipping '%s'\n", bmain->name, text->id.name + 2); diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index a781dbb33b5..abf609cd235 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -1298,9 +1298,8 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw) eitems = enum_items_from_py(items_fast, def, &defvalue, (opts & PROP_ENUM_FLAG) != 0); - Py_DECREF(items_fast); - if (!eitems) { + Py_DECREF(items_fast); return NULL; } } @@ -1327,6 +1326,10 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw) RNA_def_property_duplicate_pointers(srna, prop); if (is_itemf == FALSE) { + /* note: this must be postponed until after #RNA_def_property_duplicate_pointers + * otherwise if this is a generator it may free the strings before we copy them */ + Py_DECREF(items_fast); + MEM_freeN(eitems); } } diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 03e20322a59..bd660ae0001 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -435,7 +435,7 @@ static int mathutils_rna_vector_set(BaseMathObject *bmo, int subtype) RNA_property_float_range(&self->ptr, self->prop, &min, &max); - if (min != FLT_MIN || max != FLT_MAX) { + if (min != -FLT_MAX || max != FLT_MAX) { int i, len = RNA_property_array_length(&self->ptr, self->prop); for (i = 0; i < len; i++) { CLAMP(bmo->data[i], min, max); |