From 7efc2c2375bb591d57f6f3d63b274de48172e43b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 10 Nov 2009 15:09:53 +0000 Subject: modify the python context access so invalid names will raise an exception rather then returning None. this way the UI scripts are less likely to fail silently and wont let typos work ok. also allow subclassing of the context, added a copy function, bpy.context.copy(), returns the context as a python dict to be modified and used in python. This also showed up an invalid brush member in the screen context. --- source/blender/editors/space_buttons/buttons_context.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/space_buttons') diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 71d5b59f253..0e2769a3557 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -707,8 +707,11 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r set_pointer_type(path, result, &RNA_Brush); return 1; } + else { + return 0; /* not found */ + } - return 0; + return -1; /* found but not available */ } /************************* Drawing the Path ************************/ -- cgit v1.2.3