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>2009-09-17 04:14:47 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-09-17 04:14:47 +0400
commit1934ee422a47f7dcc5e63cfff5811873798561d8 (patch)
tree52608f0324495db3a54bababc9357218528e0d8e
parent4a15b40c37fc36a041c2d20dbcadbcf9d258c583 (diff)
rna function api was overwriting useful errors with keyword errors.
fix some missing checks in the python interface.
-rw-r--r--release/ui/buttons_data_mesh.py3
-rw-r--r--release/ui/buttons_material.py5
-rw-r--r--source/blender/python/intern/bpy_rna.c6
3 files changed, 9 insertions, 5 deletions
diff --git a/release/ui/buttons_data_mesh.py b/release/ui/buttons_data_mesh.py
index 33b3960b381..8796d7a46a8 100644
--- a/release/ui/buttons_data_mesh.py
+++ b/release/ui/buttons_data_mesh.py
@@ -102,7 +102,8 @@ class DATA_PT_shape_keys(DataButtonsPanel):
kb = ob.active_shape_key
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()
diff --git a/release/ui/buttons_material.py b/release/ui/buttons_material.py
index 9f1c216c36b..8b58c2b8953 100644
--- a/release/ui/buttons_material.py
+++ b/release/ui/buttons_material.py
@@ -65,8 +65,9 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel):
elif mat:
split.template_ID(space, "pin_id")
split.itemS()
-
- layout.itemR(mat, "type", expand=True)
+
+ if mat:
+ layout.itemR(mat, "type", expand=True)
class MATERIAL_PT_shading(MaterialButtonsPanel):
__label__ = "Shading"
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index 65c701c0041..50e32f34594 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -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
* 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 */
- if(kw && (PyDict_Size(kw) > kw_tot)) {
+ * the if below is quick, checking if it passed less keyword args then we gave.
+ * (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;
Py_ssize_t pos = 0;