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>2018-04-03 15:19:51 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-04-03 15:19:51 +0300
commita2c0a382cd00b9b1a3058ad0017887e451b73465 (patch)
treebe978c24be659a22afb22eb53c52c468e4087c06 /source/blender/python
parentfeb7852e1ba55b4c7f697ec52fee672a8cc2261c (diff)
parentb3004d30f5d5060035c5f8ac4cb6338463872877 (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/generic/py_capi_utils.c9
-rw-r--r--source/blender/python/generic/py_capi_utils.h3
-rw-r--r--source/blender/python/intern/bpy_rna.c16
3 files changed, 20 insertions, 8 deletions
diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c
index 62ef1b773c7..6f265b2ae87 100644
--- a/source/blender/python/generic/py_capi_utils.c
+++ b/source/blender/python/generic/py_capi_utils.c
@@ -146,6 +146,15 @@ PyObject *PyC_Tuple_PackArray_F32(const float *array, uint len)
return tuple;
}
+PyObject *PyC_Tuple_PackArray_F64(const double *array, uint len)
+{
+ PyObject *tuple = PyTuple_New(len);
+ for (uint i = 0; i < len; i++) {
+ PyTuple_SET_ITEM(tuple, i, PyFloat_FromDouble(array[i]));
+ }
+ return tuple;
+}
+
PyObject *PyC_Tuple_PackArray_I32(const int *array, uint len)
{
PyObject *tuple = PyTuple_New(len);
diff --git a/source/blender/python/generic/py_capi_utils.h b/source/blender/python/generic/py_capi_utils.h
index e4d6d3fe557..fe7a046d99c 100644
--- a/source/blender/python/generic/py_capi_utils.h
+++ b/source/blender/python/generic/py_capi_utils.h
@@ -51,12 +51,15 @@ int PyC_AsArray(
const PyTypeObject *type, const bool is_double, const char *error_prefix);
PyObject *PyC_Tuple_PackArray_F32(const float *array, uint len);
+PyObject *PyC_Tuple_PackArray_F64(const double *array, uint len);
PyObject *PyC_Tuple_PackArray_I32(const int *array, uint len);
PyObject *PyC_Tuple_PackArray_I32FromBool(const int *array, uint len);
PyObject *PyC_Tuple_PackArray_Bool(const bool *array, uint len);
#define PyC_Tuple_Pack_F32(...) \
PyC_Tuple_PackArray_F32(((const float []){__VA_ARGS__}), VA_NARGS_COUNT(__VA_ARGS__))
+#define PyC_Tuple_Pack_F64(...) \
+ PyC_Tuple_PackArray_F64(((const double []){__VA_ARGS__}), VA_NARGS_COUNT(__VA_ARGS__))
#define PyC_Tuple_Pack_I32(...) \
PyC_Tuple_PackArray_I32(((const int []){__VA_ARGS__}), VA_NARGS_COUNT(__VA_ARGS__))
#define PyC_Tuple_Pack_I32FromBool(...) \
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index a0009d407dc..12cce685533 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -1422,8 +1422,8 @@ static PyObject *pyrna_enum_to_py(PointerRNA *ptr, PropertyRNA *prop, int val)
/* prefer not fail silently in case of api errors, maybe disable it later */
CLOG_WARN(BPY_LOG_RNA,
- "Current value \"%d\" "
- "matches no enum in '%s', '%s', '%s'\n",
+ "current value '%d' "
+ "matches no enum in '%s', '%s', '%s'",
val, RNA_struct_identifier(ptr->type),
ptr_name, RNA_property_identifier(prop));
@@ -6609,7 +6609,7 @@ static PyObject *pyrna_srna_ExternalType(StructRNA *srna)
if (bpy_types == NULL) {
PyErr_Print();
PyErr_Clear();
- CLOG_ERROR(BPY_LOG_RNA, "failed to find 'bpy_types' module\n");
+ CLOG_ERROR(BPY_LOG_RNA, "failed to find 'bpy_types' module");
return NULL;
}
bpy_types_dict = PyModule_GetDict(bpy_types); /* borrow */
@@ -6627,7 +6627,7 @@ static PyObject *pyrna_srna_ExternalType(StructRNA *srna)
PyObject *tp_slots = PyDict_GetItem(((PyTypeObject *)newclass)->tp_dict, bpy_intern_str___slots__);
if (tp_slots == NULL) {
- CLOG_ERROR(BPY_LOG_RNA, "expected class '%s' to have __slots__ defined, see bpy_types.py\n", idname);
+ CLOG_ERROR(BPY_LOG_RNA, "expected class '%s' to have __slots__ defined, see bpy_types.py", idname);
newclass = NULL;
}
else if (PyTuple_GET_SIZE(tp_bases)) {
@@ -6637,12 +6637,12 @@ static PyObject *pyrna_srna_ExternalType(StructRNA *srna)
char pyob_info[256];
PyC_ObSpitStr(pyob_info, sizeof(pyob_info), base_compare);
CLOG_ERROR(BPY_LOG_RNA,
- "incorrect subclassing of SRNA '%s', expected '%s', see bpy_types.py\n",
+ "incorrect subclassing of SRNA '%s', expected '%s', see bpy_types.py",
idname, pyob_info);
newclass = NULL;
}
else {
- CLOG_INFO(BPY_LOG_RNA, 2, "SRNA sub-classed: '%s'\n", idname);
+ CLOG_INFO(BPY_LOG_RNA, 2, "SRNA sub-classed: '%s'", idname);
}
}
}
@@ -6740,7 +6740,7 @@ static PyObject *pyrna_srna_Subtype(StructRNA *srna)
}
else {
/* this should not happen */
- CLOG_ERROR(BPY_LOG_RNA, "error registering '%s'", idname);
+ CLOG_ERROR(BPY_LOG_RNA, "failed to register '%s'", idname);
PyErr_Print();
PyErr_Clear();
}
@@ -7613,7 +7613,7 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param
py_class = RNA_struct_py_type_get(ptr->type);
/* rare case. can happen when registering subclasses */
if (py_class == NULL) {
- CLOG_WARN(BPY_LOG_RNA, "unable to get Python class for rna struct '%.200s'\n", RNA_struct_identifier(ptr->type));
+ CLOG_WARN(BPY_LOG_RNA, "unable to get Python class for rna struct '%.200s'", RNA_struct_identifier(ptr->type));
return -1;
}