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-11-10 18:09:53 +0300
committerCampbell Barton <ideasman42@gmail.com>2009-11-10 18:09:53 +0300
commit7efc2c2375bb591d57f6f3d63b274de48172e43b (patch)
tree5bf49f58ed3fb4cf6be8a953645d692503afc1c5 /source/blender/editors/space_buttons
parent1f2fe7ec1409298527d757cb395358bc02d494c1 (diff)
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.
Diffstat (limited to 'source/blender/editors/space_buttons')
-rw-r--r--source/blender/editors/space_buttons/buttons_context.c5
1 files changed, 4 insertions, 1 deletions
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 ************************/