diff options
Diffstat (limited to 'source/blender/freestyle/intern/python/BPy_Freestyle.cpp')
-rw-r--r-- | source/blender/freestyle/intern/python/BPy_Freestyle.cpp | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/source/blender/freestyle/intern/python/BPy_Freestyle.cpp b/source/blender/freestyle/intern/python/BPy_Freestyle.cpp index 5b8d50eb5eb..487a473b7bd 100644 --- a/source/blender/freestyle/intern/python/BPy_Freestyle.cpp +++ b/source/blender/freestyle/intern/python/BPy_Freestyle.cpp @@ -60,6 +60,7 @@ extern "C" { #include "FRS_freestyle.h" #include "RNA_access.h" +#include "BKE_appdir.h" #include "DNA_scene_types.h" #include "bpy_rna.h" /* pyrna_struct_CreatePyObject() */ @@ -86,24 +87,24 @@ static PyObject *Freestyle_getCurrentScene(PyObject *self) static int ramp_blend_type(const char *type) { - if (!strcmp(type, "MIX")) return MA_RAMP_BLEND; - if (!strcmp(type, "ADD")) return MA_RAMP_ADD; - if (!strcmp(type, "MULTIPLY")) return MA_RAMP_MULT; - if (!strcmp(type, "SUBTRACT")) return MA_RAMP_SUB; - if (!strcmp(type, "SCREEN")) return MA_RAMP_SCREEN; - if (!strcmp(type, "DIVIDE")) return MA_RAMP_DIV; - if (!strcmp(type, "DIFFERENCE")) return MA_RAMP_DIFF; - if (!strcmp(type, "DARKEN")) return MA_RAMP_DARK; - if (!strcmp(type, "LIGHTEN")) return MA_RAMP_LIGHT; - if (!strcmp(type, "OVERLAY")) return MA_RAMP_OVERLAY; - if (!strcmp(type, "DODGE")) return MA_RAMP_DODGE; - if (!strcmp(type, "BURN")) return MA_RAMP_BURN; - if (!strcmp(type, "HUE")) return MA_RAMP_HUE; - if (!strcmp(type, "SATURATION")) return MA_RAMP_SAT; - if (!strcmp(type, "VALUE")) return MA_RAMP_VAL; - if (!strcmp(type, "COLOR")) return MA_RAMP_COLOR; - if (!strcmp(type, "SOFT_LIGHT")) return MA_RAMP_SOFT; - if (!strcmp(type, "LINEAR_LIGHT")) return MA_RAMP_LINEAR; + if (STREQ(type, "MIX")) return MA_RAMP_BLEND; + if (STREQ(type, "ADD")) return MA_RAMP_ADD; + if (STREQ(type, "MULTIPLY")) return MA_RAMP_MULT; + if (STREQ(type, "SUBTRACT")) return MA_RAMP_SUB; + if (STREQ(type, "SCREEN")) return MA_RAMP_SCREEN; + if (STREQ(type, "DIVIDE")) return MA_RAMP_DIV; + if (STREQ(type, "DIFFERENCE")) return MA_RAMP_DIFF; + if (STREQ(type, "DARKEN")) return MA_RAMP_DARK; + if (STREQ(type, "LIGHTEN")) return MA_RAMP_LIGHT; + if (STREQ(type, "OVERLAY")) return MA_RAMP_OVERLAY; + if (STREQ(type, "DODGE")) return MA_RAMP_DODGE; + if (STREQ(type, "BURN")) return MA_RAMP_BURN; + if (STREQ(type, "HUE")) return MA_RAMP_HUE; + if (STREQ(type, "SATURATION")) return MA_RAMP_SAT; + if (STREQ(type, "VALUE")) return MA_RAMP_VAL; + if (STREQ(type, "COLOR")) return MA_RAMP_COLOR; + if (STREQ(type, "SOFT_LIGHT")) return MA_RAMP_SOFT; + if (STREQ(type, "LINEAR_LIGHT")) return MA_RAMP_LINEAR; return -1; } @@ -152,7 +153,7 @@ static PyObject *Freestyle_blendRamp(PyObject *self, PyObject *args) return NULL; } ramp_blend(type, a, fac, b); - return Vector_CreatePyObject(a, 3, Py_NEW, NULL); + return Vector_CreatePyObject(a, 3, NULL); } #include "BKE_texture.h" /* do_colorband() */ @@ -186,7 +187,7 @@ static PyObject *Freestyle_evaluateColorRamp(PyObject *self, PyObject *args) PyErr_SetString(PyExc_ValueError, "failed to evaluate the color ramp"); return NULL; } - return Vector_CreatePyObject(out, 4, Py_NEW, NULL); + return Vector_CreatePyObject(out, 4, NULL); } #include "DNA_color_types.h" @@ -492,7 +493,7 @@ PyObject *Freestyle_Init(void) PyDict_SetItemString(PySys_GetObject("modules"), module_definition.m_name, module); // update 'sys.path' for Freestyle Python API modules - const char * const path = BLI_get_folder(BLENDER_SYSTEM_SCRIPTS, "freestyle"); + const char * const path = BKE_appdir_folder_id(BLENDER_SYSTEM_SCRIPTS, "freestyle"); if (path) { char modpath[FILE_MAX]; BLI_join_dirfile(modpath, sizeof(modpath), path, "modules"); |