forked from bartvdbraak/blender
rna function api was overwriting useful errors with keyword errors.
fix some missing checks in the python interface.
This commit is contained in:
parent
4a15b40c37
commit
1934ee422a
@ -102,7 +102,8 @@ class DATA_PT_shape_keys(DataButtonsPanel):
|
|||||||
kb = ob.active_shape_key
|
kb = ob.active_shape_key
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.template_list(key, "keys", ob, "active_shape_key_index", rows=2)
|
if key: # XXX - looks crappy
|
||||||
|
row.template_list(key, "keys", ob, "active_shape_key_index", rows=2)
|
||||||
|
|
||||||
col = row.column()
|
col = row.column()
|
||||||
|
|
||||||
|
@ -65,8 +65,9 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel):
|
|||||||
elif mat:
|
elif mat:
|
||||||
split.template_ID(space, "pin_id")
|
split.template_ID(space, "pin_id")
|
||||||
split.itemS()
|
split.itemS()
|
||||||
|
|
||||||
layout.itemR(mat, "type", expand=True)
|
if mat:
|
||||||
|
layout.itemR(mat, "type", expand=True)
|
||||||
|
|
||||||
class MATERIAL_PT_shading(MaterialButtonsPanel):
|
class MATERIAL_PT_shading(MaterialButtonsPanel):
|
||||||
__label__ = "Shading"
|
__label__ = "Shading"
|
||||||
|
@ -1994,8 +1994,10 @@ static PyObject * pyrna_func_call(PyObject * self, PyObject *args, PyObject *kw)
|
|||||||
|
|
||||||
/* Check if we gave args that dont exist in the function
|
/* Check if we gave args that dont exist in the function
|
||||||
* printing the error is slow but it should only happen when developing.
|
* printing the error is slow but it should only happen when developing.
|
||||||
* the if below is quick, checking if it passed less keyword args then we gave */
|
* the if below is quick, checking if it passed less keyword args then we gave.
|
||||||
if(kw && (PyDict_Size(kw) > kw_tot)) {
|
* (Dont overwrite the error if we have one, otherwise can skip important messages and confuse with args)
|
||||||
|
*/
|
||||||
|
if(err == 0 && kw && (PyDict_Size(kw) > kw_tot)) {
|
||||||
PyObject *key, *value;
|
PyObject *key, *value;
|
||||||
Py_ssize_t pos = 0;
|
Py_ssize_t pos = 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user