Merge branch 'master' into blender2.8
This commit is contained in:
@@ -253,7 +253,7 @@ PyObject *bpy_text_reimport(PyObject *module, int *found)
|
||||
if (module_file == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
filepath = (char *)_PyUnicode_AsString(module_file);
|
||||
filepath = _PyUnicode_AsString(module_file);
|
||||
Py_DECREF(module_file);
|
||||
if (filepath == NULL) {
|
||||
return NULL;
|
||||
@@ -285,13 +285,13 @@ static PyObject *blender_import(PyObject *UNUSED(self), PyObject *args, PyObject
|
||||
int found = 0;
|
||||
PyObject *globals = NULL, *locals = NULL, *fromlist = NULL;
|
||||
int level = 0; /* relative imports */
|
||||
|
||||
PyObject *newmodule;
|
||||
//PyObject_Print(args, stderr, 0);
|
||||
static const char *kwlist[] = {"name", "globals", "locals", "fromlist", "level", NULL};
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kw, "s|OOOi:bpy_import_meth", (char **)kwlist,
|
||||
&name, &globals, &locals, &fromlist, &level))
|
||||
|
||||
static const char *_keywords[] = {"name", "globals", "locals", "fromlist", "level", NULL};
|
||||
static _PyArg_Parser _parser = {"s|OOOi:bpy_import_meth", _keywords, 0};
|
||||
if (!_PyArg_ParseTupleAndKeywordsFast(
|
||||
args, kw, &_parser,
|
||||
&name, &globals, &locals, &fromlist, &level))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
@@ -1995,8 +1995,6 @@ static PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw)
|
||||
BPY_PROPDEF_HEAD(BoolProperty);
|
||||
|
||||
if (srna) {
|
||||
static const char *kwlist[] = {"attr", "name", "description", "default",
|
||||
"options", "subtype", "update", "get", "set", NULL};
|
||||
const char *id = NULL, *name = NULL, *description = "";
|
||||
int id_len;
|
||||
bool def = false;
|
||||
@@ -2009,12 +2007,17 @@ static PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw)
|
||||
PyObject *get_cb = NULL;
|
||||
PyObject *set_cb = NULL;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kw,
|
||||
"s#|ssO&O!sOOO:BoolProperty",
|
||||
(char **)kwlist, &id, &id_len,
|
||||
&name, &description, PyC_ParseBool, &def,
|
||||
&PySet_Type, &pyopts, &pysubtype,
|
||||
&update_cb, &get_cb, &set_cb))
|
||||
static const char *_keywords[] = {
|
||||
"attr", "name", "description", "default",
|
||||
"options", "subtype", "update", "get", "set", NULL,
|
||||
};
|
||||
static _PyArg_Parser _parser = {"s#|ssO&O!sOOO:BoolProperty", _keywords, 0};
|
||||
if (!_PyArg_ParseTupleAndKeywordsFast(
|
||||
args, kw, &_parser,
|
||||
&id, &id_len,
|
||||
&name, &description, PyC_ParseBool, &def,
|
||||
&PySet_Type, &pyopts, &pysubtype,
|
||||
&update_cb, &get_cb, &set_cb))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@@ -2077,8 +2080,6 @@ static PyObject *BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject
|
||||
BPY_PROPDEF_HEAD(BoolVectorProperty);
|
||||
|
||||
if (srna) {
|
||||
static const char *kwlist[] = {"attr", "name", "description", "default",
|
||||
"options", "subtype", "size", "update", "get", "set", NULL};
|
||||
const char *id = NULL, *name = NULL, *description = "";
|
||||
int id_len;
|
||||
int def[PYRNA_STACK_ARRAY] = {0};
|
||||
@@ -2093,12 +2094,17 @@ static PyObject *BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject
|
||||
PyObject *get_cb = NULL;
|
||||
PyObject *set_cb = NULL;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kw,
|
||||
"s#|ssOO!siOOO:BoolVectorProperty",
|
||||
(char **)kwlist, &id, &id_len,
|
||||
&name, &description, &pydef,
|
||||
&PySet_Type, &pyopts, &pysubtype, &size,
|
||||
&update_cb, &get_cb, &set_cb))
|
||||
static const char *_keywords[] = {
|
||||
"attr", "name", "description", "default",
|
||||
"options", "subtype", "size", "update", "get", "set", NULL,
|
||||
};
|
||||
static _PyArg_Parser _parser = {"s#|ssOO!siOOO:BoolVectorProperty", _keywords, 0};
|
||||
if (!_PyArg_ParseTupleAndKeywordsFast(
|
||||
args, kw, &_parser,
|
||||
&id, &id_len,
|
||||
&name, &description, &pydef,
|
||||
&PySet_Type, &pyopts, &pysubtype, &size,
|
||||
&update_cb, &get_cb, &set_cb))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@@ -2181,9 +2187,6 @@ static PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw)
|
||||
BPY_PROPDEF_HEAD(IntProperty);
|
||||
|
||||
if (srna) {
|
||||
static const char *kwlist[] = {"attr", "name", "description", "default",
|
||||
"min", "max", "soft_min", "soft_max",
|
||||
"step", "options", "subtype", "update", "get", "set", NULL};
|
||||
const char *id = NULL, *name = NULL, *description = "";
|
||||
int id_len;
|
||||
int min = INT_MIN, max = INT_MAX, soft_min = INT_MIN, soft_max = INT_MAX, step = 1, def = 0;
|
||||
@@ -2196,13 +2199,19 @@ static PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw)
|
||||
PyObject *get_cb = NULL;
|
||||
PyObject *set_cb = NULL;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kw,
|
||||
"s#|ssiiiiiiO!sOOO:IntProperty",
|
||||
(char **)kwlist, &id, &id_len,
|
||||
&name, &description, &def,
|
||||
&min, &max, &soft_min, &soft_max,
|
||||
&step, &PySet_Type, &pyopts, &pysubtype,
|
||||
&update_cb, &get_cb, &set_cb))
|
||||
static const char *_keywords[] = {
|
||||
"attr", "name", "description", "default",
|
||||
"min", "max", "soft_min", "soft_max",
|
||||
"step", "options", "subtype", "update", "get", "set", NULL,
|
||||
};
|
||||
static _PyArg_Parser _parser = {"s#|ssiiiiiiO!sOOO:IntProperty", _keywords, 0};
|
||||
if (!_PyArg_ParseTupleAndKeywordsFast(
|
||||
args, kw, &_parser,
|
||||
&id, &id_len,
|
||||
&name, &description, &def,
|
||||
&min, &max, &soft_min, &soft_max,
|
||||
&step, &PySet_Type, &pyopts, &pysubtype,
|
||||
&update_cb, &get_cb, &set_cb))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@@ -2278,9 +2287,6 @@ static PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject
|
||||
BPY_PROPDEF_HEAD(IntVectorProperty);
|
||||
|
||||
if (srna) {
|
||||
static const char *kwlist[] = {"attr", "name", "description", "default",
|
||||
"min", "max", "soft_min", "soft_max",
|
||||
"step", "options", "subtype", "size", "update", "get", "set", NULL};
|
||||
const char *id = NULL, *name = NULL, *description = "";
|
||||
int id_len;
|
||||
int min = INT_MIN, max = INT_MAX, soft_min = INT_MIN, soft_max = INT_MAX, step = 1;
|
||||
@@ -2296,14 +2302,20 @@ static PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject
|
||||
PyObject *get_cb = NULL;
|
||||
PyObject *set_cb = NULL;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kw,
|
||||
"s#|ssOiiiiiO!siOOO:IntVectorProperty",
|
||||
(char **)kwlist, &id, &id_len,
|
||||
&name, &description, &pydef,
|
||||
&min, &max, &soft_min, &soft_max,
|
||||
&step, &PySet_Type, &pyopts,
|
||||
&pysubtype, &size,
|
||||
&update_cb, &get_cb, &set_cb))
|
||||
static const char *_keywords[] = {
|
||||
"attr", "name", "description", "default",
|
||||
"min", "max", "soft_min", "soft_max",
|
||||
"step", "options", "subtype", "size", "update", "get", "set", NULL,
|
||||
};
|
||||
static _PyArg_Parser _parser = {"s#|ssOiiiiiO!siOOO:IntVectorProperty", _keywords, 0};
|
||||
if (!_PyArg_ParseTupleAndKeywordsFast(
|
||||
args, kw, &_parser,
|
||||
&id, &id_len,
|
||||
&name, &description, &pydef,
|
||||
&min, &max, &soft_min, &soft_max,
|
||||
&step, &PySet_Type, &pyopts,
|
||||
&pysubtype, &size,
|
||||
&update_cb, &get_cb, &set_cb))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@@ -2391,10 +2403,6 @@ static PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw)
|
||||
BPY_PROPDEF_HEAD(FloatProperty);
|
||||
|
||||
if (srna) {
|
||||
static const char *kwlist[] = {"attr", "name", "description", "default",
|
||||
"min", "max", "soft_min", "soft_max",
|
||||
"step", "precision", "options", "subtype",
|
||||
"unit", "update", "get", "set", NULL};
|
||||
const char *id = NULL, *name = NULL, *description = "";
|
||||
int id_len;
|
||||
float min = -FLT_MAX, max = FLT_MAX, soft_min = -FLT_MAX, soft_max = FLT_MAX, step = 3, def = 0.0f;
|
||||
@@ -2410,14 +2418,21 @@ static PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw)
|
||||
PyObject *get_cb = NULL;
|
||||
PyObject *set_cb = NULL;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kw,
|
||||
"s#|ssffffffiO!ssOOO:FloatProperty",
|
||||
(char **)kwlist, &id, &id_len,
|
||||
&name, &description, &def,
|
||||
&min, &max, &soft_min, &soft_max,
|
||||
&step, &precision, &PySet_Type,
|
||||
&pyopts, &pysubtype, &pyunit,
|
||||
&update_cb, &get_cb, &set_cb))
|
||||
static const char *_keywords[] = {
|
||||
"attr", "name", "description", "default",
|
||||
"min", "max", "soft_min", "soft_max",
|
||||
"step", "precision", "options", "subtype",
|
||||
"unit", "update", "get", "set", NULL,
|
||||
};
|
||||
static _PyArg_Parser _parser = {"s#|ssffffffiO!ssOOO:FloatProperty", _keywords, 0};
|
||||
if (!_PyArg_ParseTupleAndKeywordsFast(
|
||||
args, kw, &_parser,
|
||||
&id, &id_len,
|
||||
&name, &description, &def,
|
||||
&min, &max, &soft_min, &soft_max,
|
||||
&step, &precision, &PySet_Type,
|
||||
&pyopts, &pysubtype, &pyunit,
|
||||
&update_cb, &get_cb, &set_cb))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@@ -2502,10 +2517,6 @@ static PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObjec
|
||||
BPY_PROPDEF_HEAD(FloatVectorProperty);
|
||||
|
||||
if (srna) {
|
||||
static const char *kwlist[] = {"attr", "name", "description", "default",
|
||||
"min", "max", "soft_min", "soft_max",
|
||||
"step", "precision", "options", "subtype",
|
||||
"unit", "size", "update", "get", "set", NULL};
|
||||
const char *id = NULL, *name = NULL, *description = "";
|
||||
int id_len;
|
||||
float min = -FLT_MAX, max = FLT_MAX, soft_min = -FLT_MAX, soft_max = FLT_MAX, step = 3;
|
||||
@@ -2523,14 +2534,21 @@ static PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObjec
|
||||
PyObject *get_cb = NULL;
|
||||
PyObject *set_cb = NULL;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kw,
|
||||
"s#|ssOfffffiO!ssiOOO:FloatVectorProperty",
|
||||
(char **)kwlist, &id, &id_len,
|
||||
&name, &description, &pydef,
|
||||
&min, &max, &soft_min, &soft_max,
|
||||
&step, &precision, &PySet_Type,
|
||||
&pyopts, &pysubtype, &pyunit, &size,
|
||||
&update_cb, &get_cb, &set_cb))
|
||||
static const char *_keywords[] = {
|
||||
"attr", "name", "description", "default",
|
||||
"min", "max", "soft_min", "soft_max",
|
||||
"step", "precision", "options", "subtype",
|
||||
"unit", "size", "update", "get", "set", NULL,
|
||||
};
|
||||
static _PyArg_Parser _parser = {"s#|ssOfffffiO!ssiOOO:FloatVectorProperty", _keywords, 0};
|
||||
if (!_PyArg_ParseTupleAndKeywordsFast(
|
||||
args, kw, &_parser,
|
||||
&id, &id_len,
|
||||
&name, &description, &pydef,
|
||||
&min, &max, &soft_min, &soft_max,
|
||||
&step, &precision, &PySet_Type,
|
||||
&pyopts, &pysubtype, &pyunit, &size,
|
||||
&update_cb, &get_cb, &set_cb))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@@ -2611,8 +2629,6 @@ static PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw
|
||||
BPY_PROPDEF_HEAD(StringProperty);
|
||||
|
||||
if (srna) {
|
||||
static const char *kwlist[] = {"attr", "name", "description", "default",
|
||||
"maxlen", "options", "subtype", "update", "get", "set", NULL};
|
||||
const char *id = NULL, *name = NULL, *description = "", *def = "";
|
||||
int id_len;
|
||||
int maxlen = 0;
|
||||
@@ -2625,12 +2641,17 @@ static PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw
|
||||
PyObject *get_cb = NULL;
|
||||
PyObject *set_cb = NULL;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kw,
|
||||
"s#|sssiO!sOOO:StringProperty",
|
||||
(char **)kwlist, &id, &id_len,
|
||||
&name, &description, &def,
|
||||
&maxlen, &PySet_Type, &pyopts, &pysubtype,
|
||||
&update_cb, &get_cb, &set_cb))
|
||||
static const char *_keywords[] = {
|
||||
"attr", "name", "description", "default",
|
||||
"maxlen", "options", "subtype", "update", "get", "set", NULL,
|
||||
};
|
||||
static _PyArg_Parser _parser = {"s#|sssiO!sOOO:StringProperty", _keywords, 0};
|
||||
if (!_PyArg_ParseTupleAndKeywordsFast(
|
||||
args, kw, &_parser,
|
||||
&id, &id_len,
|
||||
&name, &description, &def,
|
||||
&maxlen, &PySet_Type, &pyopts, &pysubtype,
|
||||
&update_cb, &get_cb, &set_cb))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@@ -2720,8 +2741,6 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw)
|
||||
BPY_PROPDEF_HEAD(EnumProperty);
|
||||
|
||||
if (srna) {
|
||||
static const char *kwlist[] = {"attr", "items", "name", "description", "default",
|
||||
"options", "update", "get", "set", NULL};
|
||||
const char *id = NULL, *name = NULL, *description = "";
|
||||
PyObject *def = NULL;
|
||||
int id_len;
|
||||
@@ -2736,12 +2755,17 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw)
|
||||
PyObject *get_cb = NULL;
|
||||
PyObject *set_cb = NULL;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kw,
|
||||
"s#O|ssOO!OOO:EnumProperty",
|
||||
(char **)kwlist, &id, &id_len,
|
||||
&items, &name, &description,
|
||||
&def, &PySet_Type, &pyopts,
|
||||
&update_cb, &get_cb, &set_cb))
|
||||
static const char *_keywords[] = {
|
||||
"attr", "items", "name", "description", "default",
|
||||
"options", "update", "get", "set", NULL,
|
||||
};
|
||||
static _PyArg_Parser _parser = {"s#O|ssOO!OOO:EnumProperty", _keywords, 0};
|
||||
if (!_PyArg_ParseTupleAndKeywordsFast(
|
||||
args, kw, &_parser,
|
||||
&id, &id_len,
|
||||
&items, &name, &description,
|
||||
&def, &PySet_Type, &pyopts,
|
||||
&update_cb, &get_cb, &set_cb))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@@ -2869,7 +2893,6 @@ PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *kw)
|
||||
BPY_PROPDEF_HEAD(PointerProperty);
|
||||
|
||||
if (srna) {
|
||||
static const char *kwlist[] = {"attr", "type", "name", "description", "options", "poll", "update", NULL};
|
||||
const char *id = NULL, *name = NULL, *description = "";
|
||||
int id_len;
|
||||
PropertyRNA *prop;
|
||||
@@ -2879,12 +2902,16 @@ PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *kw)
|
||||
int opts = 0;
|
||||
PyObject *update_cb = NULL, *poll_cb = NULL;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kw,
|
||||
"s#O|ssO!OO:PointerProperty",
|
||||
(char **)kwlist, &id, &id_len,
|
||||
&type, &name, &description,
|
||||
&PySet_Type, &pyopts,
|
||||
&poll_cb, &update_cb))
|
||||
static const char *_keywords[] = {
|
||||
"attr", "type", "name", "description", "options", "poll", "update", NULL,
|
||||
};
|
||||
static _PyArg_Parser _parser = {"s#O|ssO!OO:PointerProperty", _keywords, 0};
|
||||
if (!_PyArg_ParseTupleAndKeywordsFast(
|
||||
args, kw, &_parser,
|
||||
&id, &id_len,
|
||||
&type, &name, &description,
|
||||
&PySet_Type, &pyopts,
|
||||
&poll_cb, &update_cb))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@@ -2943,20 +2970,23 @@ PyObject *BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject *kw)
|
||||
BPY_PROPDEF_HEAD(CollectionProperty);
|
||||
|
||||
if (srna) {
|
||||
static const char *kwlist[] = {"attr", "type", "name", "description", "options", NULL};
|
||||
const char *id = NULL, *name = NULL, *description = "";
|
||||
int id_len;
|
||||
const char *id = NULL, *name = NULL, *description = "";
|
||||
PropertyRNA *prop;
|
||||
StructRNA *ptype;
|
||||
PyObject *type = Py_None;
|
||||
PyObject *pyopts = NULL;
|
||||
int opts = 0;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kw,
|
||||
"s#O|ssO!:CollectionProperty",
|
||||
(char **)kwlist, &id, &id_len,
|
||||
&type, &name, &description,
|
||||
&PySet_Type, &pyopts))
|
||||
static const char *_keywords[] = {
|
||||
"attr", "type", "name", "description", "options", NULL,
|
||||
};
|
||||
static _PyArg_Parser _parser = {"s#O|ssO!:CollectionProperty", _keywords, 0};
|
||||
if (!_PyArg_ParseTupleAndKeywordsFast(
|
||||
args, kw, &_parser,
|
||||
&id, &id_len,
|
||||
&type, &name, &description,
|
||||
&PySet_Type, &pyopts))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@@ -3028,13 +3058,15 @@ static PyObject *BPy_RemoveProperty(PyObject *self, PyObject *args, PyObject *kw
|
||||
return NULL;
|
||||
}
|
||||
else {
|
||||
static const char *kwlist[] = {"attr", NULL};
|
||||
|
||||
const char *id = NULL;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kw,
|
||||
"s:RemoveProperty",
|
||||
(char **)kwlist, &id))
|
||||
static const char *_keywords[] = {
|
||||
"attr", NULL,
|
||||
};
|
||||
static _PyArg_Parser _parser = {"s:RemoveProperty", _keywords, 0};
|
||||
if (!_PyArg_ParseTupleAndKeywordsFast(
|
||||
args, kw, &_parser,
|
||||
&id))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
@@ -27,8 +27,8 @@
|
||||
#ifndef __BPY_UTIL_H__
|
||||
#define __BPY_UTIL_H__
|
||||
|
||||
#if PY_VERSION_HEX < 0x03050000
|
||||
# error "Python 3.5 or greater is required, you'll need to update your python."
|
||||
#if PY_VERSION_HEX < 0x03060000
|
||||
# error "Python 3.6 or greater is required, you'll need to update your python."
|
||||
#endif
|
||||
|
||||
struct EnumPropertyItem;
|
||||
|
Reference in New Issue
Block a user