diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-07-30 09:36:07 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-07-30 09:36:07 +0300 |
commit | ff6c6f18c1591a213d6dffb266b9f2136ef09c3b (patch) | |
tree | 2cf546390b7b748a3b7c8a680cd070afc5126652 /source/blender | |
parent | f4379f8b914eaf7aa1f17323f927836a3d9288fc (diff) |
Cleanup: id-property creation
D3473 by @JacquesLucke
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/python/generic/idprop_py_api.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/python/generic/idprop_py_api.c b/source/blender/python/generic/idprop_py_api.c index 4b56d4412e6..4d4d5232800 100644 --- a/source/blender/python/generic/idprop_py_api.c +++ b/source/blender/python/generic/idprop_py_api.c @@ -596,15 +596,15 @@ static IDProperty *idp_from_PyMapping(const char *name, PyObject *ob) return prop; } -static IDProperty *idp_from_DatablockPointer(const char *name, PyObject *ob, IDPropertyTemplate *val) +static IDProperty *idp_from_DatablockPointer(const char *name, PyObject *ob) { - pyrna_id_FromPyObject(ob, &val->id); - return IDP_New(IDP_ID, val, name); + IDPropertyTemplate val = {0}; + pyrna_id_FromPyObject(ob, &val.id); + return IDP_New(IDP_ID, &val, name); } static IDProperty *idp_from_PyObject(PyObject *name_obj, PyObject *ob) { - IDPropertyTemplate val = {0}; const char *name = idp_try_read_name(name_obj); if (name == NULL) { return NULL; @@ -626,7 +626,7 @@ static IDProperty *idp_from_PyObject(PyObject *name_obj, PyObject *ob) return idp_from_PySequence(name, ob); } else if (ob == Py_None || pyrna_id_CheckPyObject(ob)) { - return idp_from_DatablockPointer(name, ob, &val); + return idp_from_DatablockPointer(name, ob); } else if (PyMapping_Check(ob)) { return idp_from_PyMapping(name, ob); |