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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-06-19 18:56:49 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-06-19 18:56:49 +0400
commit6c139156cf2b47ea9d8e7606204205cb01d4ad21 (patch)
tree7cd43541d4d0b2e67f64d7c105fdb1036f9faeac /source/blender/editors
parent42e60acce669a425a3ce3a588a2bd649cd6963eb (diff)
RNA:
* EditBone wrapped, using manual get/set function, and used in the UI code. Makes the RNA wrapping code here more complicated, but works.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/space_buttons/buttons_context.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c
index 42180e7902f..fc280d9b551 100644
--- a/source/blender/editors/space_buttons/buttons_context.c
+++ b/source/blender/editors/space_buttons/buttons_context.c
@@ -54,6 +54,7 @@
#include "RNA_access.h"
+#include "ED_armature.h"
#include "ED_screen.h"
#include "UI_interface.h"
@@ -249,16 +250,29 @@ static int buttons_context_path_bone(ButsContextPath *path)
{
bArmature *arm;
Bone *bone;
+ EditBone *edbo;
/* if we have an armature, get the active bone */
if(buttons_context_path_data(path, OB_ARMATURE)) {
arm= path->ptr[path->len-1].data;
- bone= find_active_bone(arm->bonebase.first);
- if(bone) {
- RNA_pointer_create(&arm->id, &RNA_Bone, bone, &path->ptr[path->len]);
- path->len++;
- return 1;
+ if(arm->edbo) {
+ for(edbo=arm->edbo->first; edbo; edbo=edbo->next) {
+ if(edbo->flag & BONE_ACTIVE) {
+ RNA_pointer_create(&arm->id, &RNA_EditBone, edbo, &path->ptr[path->len]);
+ path->len++;
+ return 1;
+ }
+ }
+ }
+ else {
+ bone= find_active_bone(arm->bonebase.first);
+
+ if(bone) {
+ RNA_pointer_create(&arm->id, &RNA_Bone, bone, &path->ptr[path->len]);
+ path->len++;
+ return 1;
+ }
}
}
@@ -569,6 +583,10 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
set_pointer_type(path, result, &RNA_Bone);
return 1;
}
+ else if(CTX_data_equals(member, "edit_bone")) {
+ set_pointer_type(path, result, &RNA_EditBone);
+ return 1;
+ }
else if(CTX_data_equals(member, "particle_system")) {
set_pointer_type(path, result, &RNA_ParticleSystem);
return 1;