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>2017-11-12 07:48:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-11-12 07:48:24 +0300
commitaae8e211006a1d9099397727b48201b865504750 (patch)
tree352e1d3a11b2506b280ef7d0570a35eb765b761c /source/blender/python/bmesh/bmesh_py_types_meshdata.c
parente389ae9dcadb658bff5931a92606f43525d5af2e (diff)
BMesh Py API: Expose color alpha
Diffstat (limited to 'source/blender/python/bmesh/bmesh_py_types_meshdata.c')
-rw-r--r--source/blender/python/bmesh/bmesh_py_types_meshdata.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_types_meshdata.c b/source/blender/python/bmesh/bmesh_py_types_meshdata.c
index b01d3f89d4e..7984f625d96 100644
--- a/source/blender/python/bmesh/bmesh_py_types_meshdata.c
+++ b/source/blender/python/bmesh/bmesh_py_types_meshdata.c
@@ -370,12 +370,12 @@ PyObject *BPy_BMVertSkin_CreatePyObject(struct MVertSkin *mvertskin)
static void mloopcol_to_float(const MLoopCol *mloopcol, float r_col[3])
{
- rgb_uchar_to_float(r_col, (const unsigned char *)&mloopcol->r);
+ rgba_uchar_to_float(r_col, (const unsigned char *)&mloopcol->r);
}
static void mloopcol_from_float(MLoopCol *mloopcol, const float col[3])
{
- rgb_float_to_uchar((unsigned char *)&mloopcol->r, col);
+ rgba_float_to_uchar((unsigned char *)&mloopcol->r, col);
}
static unsigned char mathutils_bmloopcol_cb_index = -1;
@@ -436,8 +436,8 @@ static void bm_init_types_bmloopcol(void)
int BPy_BMLoopColor_AssignPyObject(struct MLoopCol *mloopcol, PyObject *value)
{
- float tvec[3];
- if (mathutils_array_parse(tvec, 3, 3, value, "BMLoopCol") != -1) {
+ float tvec[4];
+ if (mathutils_array_parse(tvec, 4, 4, value, "BMLoopCol") != -1) {
mloopcol_from_float(mloopcol, tvec);
return 0;
}
@@ -450,7 +450,7 @@ PyObject *BPy_BMLoopColor_CreatePyObject(struct MLoopCol *data)
{
PyObject *color_capsule;
color_capsule = PyCapsule_New(data, NULL, NULL);
- return Color_CreatePyObject_cb(color_capsule, mathutils_bmloopcol_cb_index, 0);
+ return Vector_CreatePyObject_cb(color_capsule, 4, mathutils_bmloopcol_cb_index, 0);
}
#undef MLOOPCOL_FROM_CAPSULE