diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-14 21:59:26 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-14 21:59:26 +0400 |
commit | f1a745c436887d14c8dbe1029154c13dda127ecd (patch) | |
tree | 1ef6b5c15242baf1e910e3e7791ffc8e42dc71ca /source/blender/editors | |
parent | 4b3dafcaa765249c0787b41df014f32863cd202f (diff) |
2.5: Armature
* Bone Transform panel now works, using appropriate EditBone or
PoseChannel properties.
* Bone name and parent are now editable.
* Some other tweaks to the UI layouts for Armature and Bone.
* Notifiers for armature/editbone properties.
Diffstat (limited to 'source/blender/editors')
6 files changed, 14 insertions, 12 deletions
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index d00f4c770d1..49f13d99af9 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -5095,9 +5095,9 @@ static void constraint_bone_name_fix(Object *ob, ListBase *conlist, char *oldnam /* called by UI for renaming a bone */ /* warning: make sure the original bone was not renamed yet! */ /* seems messy, but thats what you get with not using pointers but channel names :) */ -void armature_bone_rename(Object *ob, char *oldnamep, char *newnamep) +void ED_armature_bone_rename(bArmature *arm, char *oldnamep, char *newnamep) { - bArmature *arm= ob->data; + Object *ob; char newname[MAXBONENAME]; char oldname[MAXBONENAME]; @@ -5242,7 +5242,7 @@ void armature_flip_names(Scene *scene) if (ebone->flag & BONE_SELECTED) { BLI_strncpy(newname, ebone->name, sizeof(newname)); bone_flip_name(newname, 1); // 1 = do strip off number extensions - armature_bone_rename(obedit, ebone->name, newname); + ED_armature_bone_rename(arm, ebone->name, newname); } } } @@ -5263,7 +5263,7 @@ void armature_autoside_names(Scene *scene, short axis) if (ebone->flag & BONE_SELECTED) { BLI_strncpy(newname, ebone->name, sizeof(newname)); bone_autoside_name(newname, 1, axis, ebone->head[axis], ebone->tail[axis]); - armature_bone_rename(obedit, ebone->name, newname); + ED_armature_bone_rename(arm, ebone->name, newname); } } } diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index 2913d1d13d9..f7d926ea18d 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -1346,7 +1346,7 @@ void pose_flip_names(Scene *scene) if(pchan->bone->flag & (BONE_ACTIVE|BONE_SELECTED)) { BLI_strncpy(newname, pchan->name, sizeof(newname)); bone_flip_name(newname, 1); // 1 = do strip off number extensions - armature_bone_rename(ob, pchan->name, newname); + ED_armature_bone_rename(arm, pchan->name, newname); } } } @@ -1375,7 +1375,7 @@ void pose_autoside_names(Scene *scene, short axis) if(pchan->bone->flag & (BONE_ACTIVE|BONE_SELECTED)) { BLI_strncpy(newname, pchan->name, sizeof(newname)); bone_autoside_name(newname, 1, axis, pchan->bone->head[axis], pchan->bone->tail[axis]); - armature_bone_rename(ob, pchan->name, newname); + ED_armature_bone_rename(arm, pchan->name, newname); } } } diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h index a9823bd9ff1..d699b0d46b2 100644 --- a/source/blender/editors/include/ED_armature.h +++ b/source/blender/editors/include/ED_armature.h @@ -116,7 +116,7 @@ void docenter_armature (struct Scene *scene, struct View3D *v3d, struct Object * void auto_align_armature(struct Scene *scene, struct View3D *v3d, short mode); void unique_editbone_name(struct ListBase *ebones, char *name, EditBone *bone); /* if bone is already in list, pass it as param to ignore it */ -void armature_bone_rename(struct Object *ob, char *oldnamep, char *newnamep); +void ED_armature_bone_rename(struct bArmature *arm, char *oldnamep, char *newnamep); void undo_push_armature(struct bContext *C, char *name); diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 24d5fcc648a..b7e2a3325cb 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -415,6 +415,8 @@ static int buttons_context_path(const bContext *C, ButsContextPath *path, int ma break; case BCONTEXT_BONE: found= buttons_context_path_bone(path); + if(!found) + found= buttons_context_path_data(path, OB_ARMATURE); break; default: found= 0; diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index e99774a8b9f..40324a5a65f 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -1559,7 +1559,7 @@ void OUTLINER_OT_renderability_toggle(wmOperatorType *ot) { /* identifiers */ ot->name= "Toggle Renderability"; - ot->idname= "OUTLINER_OT_renederability_toggle"; + ot->idname= "OUTLINER_OT_renderability_toggle"; ot->description= "Toggle the renderbility of selected items."; /* callbacks */ diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 54fb87904c8..fba263f30d5 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -481,7 +481,7 @@ static void validate_bonebutton_cb(bContext *C, void *bonev, void *namev) /* restore */ BLI_strncpy(bone->name, oldname, 32); - armature_bone_rename(ob, oldname, newname); // editarmature.c + ED_armature_bone_rename(ob->data, oldname, newname); // editarmature.c } } @@ -553,7 +553,7 @@ void validate_editbonebutton_cb(bContext *C, void *bonev, void *namev) /* restore */ BLI_strncpy(eBone->name, oldname, 32); - armature_bone_rename(CTX_data_edit_object(C), oldname, newname); // editarmature.c + ED_armature_bone_rename(CTX_data_edit_object(C)->data, oldname, newname); // editarmature.c WM_event_add_notifier(C, NC_OBJECT|ND_BONE_SELECT, CTX_data_edit_object(C)); // XXX fix } @@ -1215,7 +1215,7 @@ static void view3d_panel_object(const bContext *C, Panel *pa) Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); View3D *v3d= CTX_wm_view3d(C); - uiBut *bt; + //uiBut *bt; Object *ob= OBACT; TransformProperties *tfp; float lim; @@ -1764,7 +1764,7 @@ void view3d_buttons_register(ARegionType *art) pt->draw= view3d_panel_transform_spaces; BLI_addtail(&art->paneltypes, pt); - /*pt= MEM_callocN(sizeof(PanelType), "spacetype view3d panel gpencil"); + pt= MEM_callocN(sizeof(PanelType), "spacetype view3d panel gpencil"); strcpy(pt->idname, "VIEW3D_PT_gpencil"); strcpy(pt->label, "Greas Pencil"); pt->draw= view3d_panel_gpencil; |