Merged changes in the trunk up to revision 52546.
Conflicts resolved: release/datafiles/startup.blend release/scripts/startup/bl_ui/space_view3d.py source/blender/blenkernel/intern/idcode.c
This commit is contained in:
@@ -195,12 +195,12 @@ 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.debug_value);
|
||||
return PyLong_FromLong(G.debug_value);
|
||||
}
|
||||
|
||||
static int bpy_app_debug_value_set(PyObject *UNUSED(self), PyObject *value, void *UNUSED(closure))
|
||||
{
|
||||
int param = PyLong_AsSsize_t(value);
|
||||
int param = PyLong_AsLong(value);
|
||||
|
||||
if (param == -1 && PyErr_Occurred()) {
|
||||
PyErr_SetString(PyExc_TypeError, "bpy.app.debug_value can only be set to a whole number");
|
||||
|
||||
@@ -38,6 +38,8 @@ PyObject *bpy_intern_str_bl_rna;
|
||||
PyObject *bpy_intern_str_order;
|
||||
PyObject *bpy_intern_str_attr;
|
||||
PyObject *bpy_intern_str___slots__;
|
||||
PyObject *bpy_intern_str___name__;
|
||||
PyObject *bpy_intern_str___doc__;
|
||||
|
||||
void bpy_intern_string_init(void)
|
||||
{
|
||||
@@ -47,6 +49,8 @@ void bpy_intern_string_init(void)
|
||||
bpy_intern_str_order = PyUnicode_FromString("order");
|
||||
bpy_intern_str_attr = PyUnicode_FromString("attr");
|
||||
bpy_intern_str___slots__ = PyUnicode_FromString("__slots__");
|
||||
bpy_intern_str___name__ = PyUnicode_FromString("__name__");
|
||||
bpy_intern_str___doc__ = PyUnicode_FromString("__doc__");
|
||||
}
|
||||
|
||||
void bpy_intern_string_exit(void)
|
||||
@@ -57,4 +61,6 @@ void bpy_intern_string_exit(void)
|
||||
Py_DECREF(bpy_intern_str_order);
|
||||
Py_DECREF(bpy_intern_str_attr);
|
||||
Py_DECREF(bpy_intern_str___slots__);
|
||||
Py_DECREF(bpy_intern_str___name__);
|
||||
Py_DECREF(bpy_intern_str___doc__);
|
||||
}
|
||||
|
||||
@@ -33,3 +33,5 @@ extern PyObject *bpy_intern_str_bl_rna;
|
||||
extern PyObject *bpy_intern_str_order;
|
||||
extern PyObject *bpy_intern_str_attr;
|
||||
extern PyObject *bpy_intern_str___slots__;
|
||||
extern PyObject *bpy_intern_str___name__;
|
||||
extern PyObject *bpy_intern_str___doc__;
|
||||
|
||||
@@ -1344,7 +1344,7 @@ PyObject *pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop)
|
||||
ret = PyBool_FromLong(RNA_property_boolean_get(ptr, prop));
|
||||
break;
|
||||
case PROP_INT:
|
||||
ret = PyLong_FromSsize_t((Py_ssize_t)RNA_property_int_get(ptr, prop));
|
||||
ret = PyLong_FromLong(RNA_property_int_get(ptr, prop));
|
||||
break;
|
||||
case PROP_FLOAT:
|
||||
ret = PyFloat_FromDouble(RNA_property_float_get(ptr, prop));
|
||||
@@ -2371,7 +2371,7 @@ static PyObject *pyrna_prop_array_subscript_slice(BPy_PropertyArrayRNA *self, Po
|
||||
|
||||
RNA_property_int_get_array(ptr, prop, values);
|
||||
for (count = start; count < stop; count++)
|
||||
PyTuple_SET_ITEM(tuple, count - start, PyLong_FromSsize_t(values[count]));
|
||||
PyTuple_SET_ITEM(tuple, count - start, PyLong_FromLong(values[count]));
|
||||
|
||||
if (values != values_stack) {
|
||||
PyMem_FREE(values);
|
||||
@@ -4077,7 +4077,7 @@ static PyObject *pyrna_prop_collection_items(BPy_PropertyRNA *self)
|
||||
}
|
||||
else {
|
||||
/* a bit strange but better then returning an empty list */
|
||||
PyTuple_SET_ITEM(item, 0, PyLong_FromSsize_t(i));
|
||||
PyTuple_SET_ITEM(item, 0, PyLong_FromLong(i));
|
||||
}
|
||||
PyTuple_SET_ITEM(item, 1, pyrna_struct_CreatePyObject(&itemptr));
|
||||
|
||||
@@ -4256,7 +4256,7 @@ static PyObject *pyrna_prop_collection_find(BPy_PropertyRNA *self, PyObject *key
|
||||
}
|
||||
RNA_PROP_END;
|
||||
|
||||
return PyLong_FromSsize_t(index);
|
||||
return PyLong_FromLong(index);
|
||||
}
|
||||
|
||||
static void foreach_attr_type(BPy_PropertyRNA *self, const char *attr,
|
||||
@@ -4463,13 +4463,13 @@ static PyObject *foreach_getset(BPy_PropertyRNA *self, PyObject *args, int set)
|
||||
|
||||
switch (raw_type) {
|
||||
case PROP_RAW_CHAR:
|
||||
item = PyLong_FromSsize_t((Py_ssize_t) ((char *)array)[i]);
|
||||
item = PyLong_FromLong((long) ((char *)array)[i]);
|
||||
break;
|
||||
case PROP_RAW_SHORT:
|
||||
item = PyLong_FromSsize_t((Py_ssize_t) ((short *)array)[i]);
|
||||
item = PyLong_FromLong((long) ((short *)array)[i]);
|
||||
break;
|
||||
case PROP_RAW_INT:
|
||||
item = PyLong_FromSsize_t((Py_ssize_t) ((int *)array)[i]);
|
||||
item = PyLong_FromLong((long) ((int *)array)[i]);
|
||||
break;
|
||||
case PROP_RAW_FLOAT:
|
||||
item = PyFloat_FromDouble((double) ((float *)array)[i]);
|
||||
@@ -4756,7 +4756,7 @@ static PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *dat
|
||||
case PROP_INT:
|
||||
ret = PyTuple_New(len);
|
||||
for (a = 0; a < len; a++)
|
||||
PyTuple_SET_ITEM(ret, a, PyLong_FromSsize_t((Py_ssize_t)((int *)data)[a]));
|
||||
PyTuple_SET_ITEM(ret, a, PyLong_FromLong(((int *)data)[a]));
|
||||
break;
|
||||
case PROP_FLOAT:
|
||||
switch (RNA_property_subtype(prop)) {
|
||||
@@ -4797,7 +4797,7 @@ static PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *dat
|
||||
ret = PyBool_FromLong(*(int *)data);
|
||||
break;
|
||||
case PROP_INT:
|
||||
ret = PyLong_FromSsize_t((Py_ssize_t)*(int *)data);
|
||||
ret = PyLong_FromLong(*(int *)data);
|
||||
break;
|
||||
case PROP_FLOAT:
|
||||
ret = PyFloat_FromDouble(*(float *)data);
|
||||
@@ -6883,8 +6883,8 @@ static int bpy_class_validate_recursive(PointerRNA *dummyptr, StructRNA *srna, v
|
||||
/* Sneaky workaround to use the class name as the bl_idname */
|
||||
|
||||
#define BPY_REPLACEMENT_STRING(rna_attr, py_attr) \
|
||||
if (strcmp(identifier, rna_attr) == 0) { \
|
||||
item = PyObject_GetAttrString(py_class, py_attr); \
|
||||
(strcmp(identifier, rna_attr) == 0) { \
|
||||
item = PyObject_GetAttr(py_class, py_attr); \
|
||||
if (item && item != Py_None) { \
|
||||
if (pyrna_py_to_prop(dummyptr, prop, NULL, \
|
||||
item, "validating class:") != 0) \
|
||||
@@ -6894,11 +6894,10 @@ static int bpy_class_validate_recursive(PointerRNA *dummyptr, StructRNA *srna, v
|
||||
} \
|
||||
} \
|
||||
Py_XDECREF(item); \
|
||||
} (void)0
|
||||
} /* intendionally allow else here */
|
||||
|
||||
|
||||
BPY_REPLACEMENT_STRING("bl_idname", "__name__");
|
||||
BPY_REPLACEMENT_STRING("bl_description", "__doc__");
|
||||
if BPY_REPLACEMENT_STRING("bl_idname", bpy_intern_str___name__)
|
||||
else if BPY_REPLACEMENT_STRING("bl_description", bpy_intern_str___doc__)
|
||||
|
||||
#undef BPY_REPLACEMENT_STRING
|
||||
|
||||
@@ -6912,10 +6911,11 @@ static int bpy_class_validate_recursive(PointerRNA *dummyptr, StructRNA *srna, v
|
||||
PyErr_Clear();
|
||||
}
|
||||
else {
|
||||
Py_DECREF(item); /* no need to keep a ref, the class owns it */
|
||||
|
||||
if (pyrna_py_to_prop(dummyptr, prop, NULL, item, "validating class:") != 0)
|
||||
if (pyrna_py_to_prop(dummyptr, prop, NULL, item, "validating class:") != 0) {
|
||||
Py_DECREF(item);
|
||||
return -1;
|
||||
}
|
||||
Py_DECREF(item);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -507,7 +507,7 @@ static void py_to_float(PyObject *py, char *data)
|
||||
|
||||
static void py_to_int(PyObject *py, char *data)
|
||||
{
|
||||
*(int *)data = (int)PyLong_AsSsize_t(py);
|
||||
*(int *)data = (int)PyLong_AsLong(py);
|
||||
}
|
||||
|
||||
static void py_to_bool(PyObject *py, char *data)
|
||||
@@ -609,7 +609,7 @@ PyObject *pyrna_array_index(PointerRNA *ptr, PropertyRNA *prop, int index)
|
||||
item = PyBool_FromLong(RNA_property_boolean_get_index(ptr, prop, index));
|
||||
break;
|
||||
case PROP_INT:
|
||||
item = PyLong_FromSsize_t(RNA_property_int_get_index(ptr, prop, index));
|
||||
item = PyLong_FromLong(RNA_property_int_get_index(ptr, prop, index));
|
||||
break;
|
||||
default:
|
||||
PyErr_SetString(PyExc_TypeError, "not an array type");
|
||||
@@ -766,7 +766,7 @@ int pyrna_array_contains_py(PointerRNA *ptr, PropertyRNA *prop, PyObject *value)
|
||||
case PROP_BOOLEAN:
|
||||
case PROP_INT:
|
||||
{
|
||||
int value_i = PyLong_AsSsize_t(value);
|
||||
int value_i = PyLong_AsLong(value);
|
||||
if (value_i == -1 && PyErr_Occurred()) {
|
||||
PyErr_Clear();
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user