diff options
author | Campbell Barton <campbell@blender.org> | 2022-09-21 16:52:10 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-09-21 16:53:38 +0300 |
commit | 78b7a1c3a8b982d0081c9071e5b1d90444f902b8 (patch) | |
tree | 05374d3909773facbe2e16d448a622b0ca1583a7 /source | |
parent | 1b95784aad1e823b2d9fbcb19a9b58f4cb2e166e (diff) |
PyAPI: disable IMB color management methods for stand-alone mathutils
Allow building a standalone mathutils without including imbuf.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/python/mathutils/mathutils_Color.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/python/mathutils/mathutils_Color.c b/source/blender/python/mathutils/mathutils_Color.c index 955fa4b6f92..a66178baefc 100644 --- a/source/blender/python/mathutils/mathutils_Color.c +++ b/source/blender/python/mathutils/mathutils_Color.c @@ -14,7 +14,9 @@ #include "../generic/py_capi_utils.h" #include "../generic/python_utildefines.h" -#include "IMB_colormanagement.h" +#ifndef MATH_STANDALONE +# include "IMB_colormanagement.h" +#endif #ifndef MATH_STANDALONE # include "BLI_dynstr.h" @@ -92,6 +94,8 @@ static PyObject *Color_new(PyTypeObject *type, PyObject *args, PyObject *kwds) /** \name Color Methods: Color Space Conversion * \{ */ +#ifndef MATH_STANDALONE + PyDoc_STRVAR(Color_from_scene_linear_to_srgb_doc, ".. function:: from_scene_linear_to_srgb()\n" "\n" @@ -204,6 +208,8 @@ static PyObject *Color_from_rec709_linear_to_scene_linear(ColorObject *self) return Color_CreatePyObject(col, Py_TYPE(self)); } +#endif /* MATH_STANDALONE */ + /** \} */ /* -------------------------------------------------------------------- */ @@ -1050,7 +1056,8 @@ static struct PyMethodDef Color_methods[] = { /* base-math methods */ {"freeze", (PyCFunction)BaseMathObject_freeze, METH_NOARGS, BaseMathObject_freeze_doc}, - /* Color-space methods. */ +/* Color-space methods. */ +#ifndef MATH_STANDALONE {"from_scene_linear_to_srgb", (PyCFunction)Color_from_scene_linear_to_srgb, METH_NOARGS, @@ -1083,6 +1090,8 @@ static struct PyMethodDef Color_methods[] = { (PyCFunction)Color_from_rec709_linear_to_scene_linear, METH_NOARGS, Color_from_rec709_linear_to_scene_linear_doc}, +#endif /* MATH_STANDALONE */ + {NULL, NULL, 0, NULL}, }; |