Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Sun, 20 Aug 2017 05:50:15 +0000 (15:50 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 20 Aug 2017 05:50:15 +0000 (15:50 +1000)
1  2 
make.bat
source/blender/python/bmesh/bmesh_py_types.c
source/blender/python/bmesh/bmesh_py_types_customdata.c
source/blender/python/bmesh/bmesh_py_types_meshdata.c
source/blender/python/intern/bpy_rna.c
source/blender/python/mathutils/mathutils_bvhtree.c

diff --cc make.bat
Simple merge
index 532f85f87d707feff2fd1701c8e356935a239e34,cb95ded4f0dbc084b1ad843bcafa17465ca47516..e2241ade7f04fbad9edb9c6980ce8d277d0cbee5
@@@ -1068,11 -1074,10 +1069,11 @@@ int BPy_BMLayerItem_SetItem(BPy_BMElem 
                        break;
                }
                case CD_PROP_INT:
 +              case CD_FACEMAP:
                {
-                       int tmp_val = PyLong_AsLong(py_value);
+                       int tmp_val = PyC_Long_AsI32(py_value);
                        if (UNLIKELY(tmp_val == -1 && PyErr_Occurred())) {
-                               PyErr_Format(PyExc_TypeError, "expected an int, not a %.200s", Py_TYPE(py_value)->tp_name);
+                               /* error is set */
                                ret = -1;
                        }
                        else {
index f6926e8437d3ce6b984df06b88ba17bae591680e,b01d3f89d4e532d78cd8328045418d231245293f..574aef3d54f6f620b18beb7cb4d73dfc7407e6c4
  
  #include "bmesh_py_types_meshdata.h"
  
+ #include "../generic/py_capi_utils.h"
  #include "../generic/python_utildefines.h"
  
 -
 -/* Mesh BMTexPoly
 - * ************** */
 -
 -#define BPy_BMTexPoly_Check(v)  (Py_TYPE(v) == &BPy_BMTexPoly_Type)
 -
 -typedef struct BPy_BMTexPoly {
 -      PyObject_VAR_HEAD
 -      MTexPoly *data;
 -} BPy_BMTexPoly;
 -
 -extern PyObject *pyrna_id_CreatePyObject(ID *id);
 -extern bool      pyrna_id_FromPyObject(PyObject *obj, ID **id);
 -
 -PyDoc_STRVAR(bpy_bmtexpoly_image_doc,
 -"Image or None.\n\n:type: :class:`bpy.types.Image`"
 -);
 -static PyObject *bpy_bmtexpoly_image_get(BPy_BMTexPoly *self, void *UNUSED(closure))
 -{
 -      return pyrna_id_CreatePyObject((ID *)self->data->tpage);
 -}
 -
 -static int bpy_bmtexpoly_image_set(BPy_BMTexPoly *self, PyObject *value, void *UNUSED(closure))
 -{
 -      ID *id;
 -
 -      if (value == Py_None) {
 -              id = NULL;
 -      }
 -      else if (pyrna_id_FromPyObject(value, &id) && id && GS(id->name) == ID_IM) {
 -              /* pass */
 -      }
 -      else {
 -              PyErr_Format(PyExc_KeyError, "BMTexPoly.image = x"
 -                           "expected an image or None, not '%.200s'",
 -                           Py_TYPE(value)->tp_name);
 -              return -1;
 -      }
 -
 -      id_lib_extern(id);
 -      self->data->tpage = (struct Image *)id;
 -
 -      return 0;
 -}
 -
 -static PyGetSetDef bpy_bmtexpoly_getseters[] = {
 -      /* attributes match rna_def_mtpoly  */
 -      {(char *)"image", (getter)bpy_bmtexpoly_image_get, (setter)bpy_bmtexpoly_image_set, (char *)bpy_bmtexpoly_image_doc, NULL},
 -
 -      {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
 -};
 -
 -static PyTypeObject BPy_BMTexPoly_Type; /* bm.loops.layers.uv.active */
 -
 -static void bm_init_types_bmtexpoly(void)
 -{
 -      BPy_BMTexPoly_Type.tp_basicsize = sizeof(BPy_BMTexPoly);
 -
 -      BPy_BMTexPoly_Type.tp_name = "BMTexPoly";
 -
 -      BPy_BMTexPoly_Type.tp_doc = NULL; // todo
 -
 -      BPy_BMTexPoly_Type.tp_getset = bpy_bmtexpoly_getseters;
 -
 -      BPy_BMTexPoly_Type.tp_flags = Py_TPFLAGS_DEFAULT;
 -
 -      PyType_Ready(&BPy_BMTexPoly_Type);
 -}
 -
 -int BPy_BMTexPoly_AssignPyObject(struct MTexPoly *mtpoly, PyObject *value)
 -{
 -      if (UNLIKELY(!BPy_BMTexPoly_Check(value))) {
 -              PyErr_Format(PyExc_TypeError, "expected BMTexPoly, not a %.200s", Py_TYPE(value)->tp_name);
 -              return -1;
 -      }
 -      else {
 -              *((MTexPoly *)mtpoly) = *(((BPy_BMTexPoly *)value)->data);
 -              return 0;
 -      }
 -}
 -
 -PyObject *BPy_BMTexPoly_CreatePyObject(struct MTexPoly *mtpoly)
 -{
 -      BPy_BMTexPoly *self = PyObject_New(BPy_BMTexPoly, &BPy_BMTexPoly_Type);
 -      self->data = mtpoly;
 -      return (PyObject *)self;
 -}
 -
 -/* --- End Mesh BMTexPoly --- */
 -
  /* Mesh Loop UV
   * ************ */