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>2010-02-21 15:15:38 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-02-21 15:15:38 +0300
commit1bb37bc10e1ecc6aaa34b99f4531ab0702f09f06 (patch)
tree9522fa1dcf28b68d20f08f6a942e9562e08c386c /source/blender/python
parent4cd088c19e95e3bcae2c43a2757317c3f40526be (diff)
py api: bpy.props
new properties without any arguments were failing.
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/intern/bpy_props.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c
index 68d89c06e70..3e4221011c0 100644
--- a/source/blender/python/intern/bpy_props.c
+++ b/source/blender/python/intern/bpy_props.c
@@ -82,8 +82,9 @@ static PyObject *bpy_prop_deferred_return(void *func, PyObject *kw)
{
PyObject *ret = PyTuple_New(2);
PyTuple_SET_ITEM(ret, 0, PyCapsule_New(func, NULL, NULL));
+ if(kw==NULL) kw= PyDict_New();
+ else Py_INCREF(kw);
PyTuple_SET_ITEM(ret, 1, kw);
- Py_INCREF(kw);
return ret;
}
@@ -111,7 +112,7 @@ PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw)
{
StructRNA *srna;
- if (PyTuple_GET_SIZE(args) > 0 || kw==NULL) {
+ if (PyTuple_GET_SIZE(args) > 0) {
PyErr_SetString(PyExc_ValueError, "all args must be keywords");
return NULL;
}
@@ -177,7 +178,7 @@ PyObject *BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject *kw)
{
StructRNA *srna;
- if (PyTuple_GET_SIZE(args) > 0 || kw==NULL) {
+ if (PyTuple_GET_SIZE(args) > 0) {
PyErr_SetString(PyExc_ValueError, "all args must be keywords");
return NULL;
}
@@ -254,7 +255,7 @@ PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw)
{
StructRNA *srna;
- if (PyTuple_GET_SIZE(args) > 0 || kw==NULL) {
+ if (PyTuple_GET_SIZE(args) > 0) {
PyErr_SetString(PyExc_ValueError, "all args must be keywords");
return NULL;
}
@@ -321,7 +322,7 @@ PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject *kw)
{
StructRNA *srna;
- if (PyTuple_GET_SIZE(args) > 0 || kw==NULL) {
+ if (PyTuple_GET_SIZE(args) > 0) {
PyErr_SetString(PyExc_ValueError, "all args must be keywords");
return NULL;
}
@@ -402,7 +403,7 @@ PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw)
{
StructRNA *srna;
- if (PyTuple_GET_SIZE(args) > 0 || kw==NULL) {
+ if (PyTuple_GET_SIZE(args) > 0) {
PyErr_SetString(PyExc_ValueError, "all args must be keywords");
return NULL;
}
@@ -477,7 +478,7 @@ PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObject *kw)
{
StructRNA *srna;
- if (PyTuple_GET_SIZE(args) > 0 || kw==NULL) {
+ if (PyTuple_GET_SIZE(args) > 0) {
PyErr_SetString(PyExc_ValueError, "all args must be keywords");
return NULL;
}
@@ -555,7 +556,7 @@ PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw)
{
StructRNA *srna;
- if (PyTuple_GET_SIZE(args) > 0 || kw==NULL) {
+ if (PyTuple_GET_SIZE(args) > 0) {
PyErr_SetString(PyExc_ValueError, "all args must be keywords");
return NULL;
}
@@ -667,7 +668,7 @@ PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw)
{
StructRNA *srna;
- if (PyTuple_GET_SIZE(args) > 0 || kw==NULL) {
+ if (PyTuple_GET_SIZE(args) > 0) {
PyErr_SetString(PyExc_ValueError, "all args must be keywords");
return NULL;
}
@@ -748,7 +749,7 @@ PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *kw)
{
StructRNA *srna;
- if (PyTuple_GET_SIZE(args) > 0 || kw==NULL) {
+ if (PyTuple_GET_SIZE(args) > 0) {
PyErr_SetString(PyExc_ValueError, "all args must be keywords");
return NULL;
}
@@ -809,7 +810,7 @@ PyObject *BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject *kw)
{
StructRNA *srna;
- if (PyTuple_GET_SIZE(args) > 0 || kw==NULL) {
+ if (PyTuple_GET_SIZE(args) > 0) {
PyErr_SetString(PyExc_ValueError, "all args must be keywords");
return NULL;
}