diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-05-24 16:14:32 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-05-24 16:38:15 +0300 |
commit | 7a9ad029dd1d1afe42d54c9c181de887636db7c0 (patch) | |
tree | e9281cbe8bb01365a699ffd6f4bbd09a6a91015f /source/blender/python/bmesh/bmesh_py_types_meshdata.c | |
parent | 707340edd703ff1fd7c8157eb3cc811913698c8d (diff) |
Remove TexFace, per-face images
TexFace complicates the now more popular shading pipeline by having
per-face images, see: T51382 for details.
To keep the ability to select a per-material edit-image
(used with UV-mapping workflow), the material now stores an image
which will be set when changing images in edit-mode.
This is used as a bake-target when not using Cycles too.
Diffstat (limited to 'source/blender/python/bmesh/bmesh_py_types_meshdata.c')
-rw-r--r-- | source/blender/python/bmesh/bmesh_py_types_meshdata.c | 40 |
1 files changed, 5 insertions, 35 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_types_meshdata.c b/source/blender/python/bmesh/bmesh_py_types_meshdata.c index 92c11a03433..7bbe030dc7e 100644 --- a/source/blender/python/bmesh/bmesh_py_types_meshdata.c +++ b/source/blender/python/bmesh/bmesh_py_types_meshdata.c @@ -58,46 +58,14 @@ typedef struct BPy_BMTexPoly { 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; -} - +/* TODO, flag access */ +#if 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 */ }; +#endif static PyTypeObject BPy_BMTexPoly_Type; /* bm.loops.layers.uv.active */ @@ -109,7 +77,9 @@ static void bm_init_types_bmtexpoly(void) BPy_BMTexPoly_Type.tp_doc = NULL; // todo +#if 0 BPy_BMTexPoly_Type.tp_getset = bpy_bmtexpoly_getseters; +#endif BPy_BMTexPoly_Type.tp_flags = Py_TPFLAGS_DEFAULT; |