diff options
author | Ton Roosendaal <ton@blender.org> | 2004-10-11 15:54:14 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2004-10-11 15:54:14 +0400 |
commit | b024faabe5ac0704c074db3e6d14e72ad396bd8e (patch) | |
tree | eee38c5ee41513e7d5b276c74fb2716e23e8e9f3 /source/blender/src/buttons_editing.c | |
parent | 2d833b37220cee02bbde27eb8c37261d9da47db3 (diff) |
Outliner features:
- Rename!
CTRL+leftmouse click on name, makes it a text button. Works for all items as
currently being displayed.
Most work was doing the Bones, which is a nightmare :) But it uses same
code as buttons in Armature-Editmode now, without even needing EditMode :)
When renaming a bone, the Outliner makes the Object active though.
- PageUp / PageDown keys
Do what you expect.
Diffstat (limited to 'source/blender/src/buttons_editing.c')
-rw-r--r-- | source/blender/src/buttons_editing.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 30c1d5da8cd..94e074dfe3f 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -1683,6 +1683,36 @@ static void validate_editbonebutton_cb(void *bonev, void *arg2_unused) validate_editbonebutton(curBone); } +/* called from outliner now, can be used for buttons in posemode too */ +/* current Armature should be active Object */ +/* after this function, the Bones in Armature are re-allocced! */ +void rename_bone_ext(char *oldname, char *newname) +{ + EditBone *ebone; + int temp_editmode= 0; + + /* since the naming functions work only on editArmature, we have to... */ + if(G.obedit!=OBACT) exit_editmode(2); + if(G.obedit==NULL) { + G.obedit= OBACT; + make_editArmature(); + temp_editmode= 1; + } + + /* now find the eBone with oldname */ + for(ebone= G.edbo.first; ebone; ebone= ebone->next) + if(strcmp(ebone->name, oldname)==0) break; + + if(ebone) { + strcpy(ebone->oldname, oldname); + strcpy(ebone->name, newname); + validate_editbonebutton(ebone); // does exit_editmode... tsk, so armature bones pointers are invalid now + } + if(temp_editmode) exit_editmode(2); + +} + + static void armature_rest_pos_func(void *notused1, void *notused2) { clear_object_constraint_status(OBACT); |