diff options
Diffstat (limited to 'source/blender/editors/armature/editarmature.c')
-rw-r--r-- | source/blender/editors/armature/editarmature.c | 293 |
1 files changed, 127 insertions, 166 deletions
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 96ef3fc4999..1ae5889ea32 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -141,7 +141,7 @@ void ED_armature_validate_active(struct bArmature *arm) } } -void free_edit_bone(bArmature *arm, EditBone *bone) +static void bone_free(bArmature *arm, EditBone *bone) { if(arm->act_edbone==bone) arm->act_edbone= NULL; @@ -154,6 +154,22 @@ void free_edit_bone(bArmature *arm, EditBone *bone) BLI_freelinkN(arm->edbo, bone); } +void ED_armature_edit_bone_remove(bArmature *arm, EditBone* exBone) +{ + EditBone *curBone; + + /* Find any bones that refer to this bone */ + for (curBone=arm->edbo->first; curBone; curBone=curBone->next) { + if (curBone->parent==exBone) { + curBone->parent=exBone->parent; + curBone->flag &= ~BONE_CONNECTED; + } + } + + bone_free(arm, exBone); +} + + /* converts Bones to EditBone list, used for tools as well */ EditBone *make_boneList(ListBase *edbo, ListBase *bones, EditBone *parent, Bone *actBone) { @@ -305,7 +321,7 @@ void ED_armature_from_edit(Object *obedit) fBone->parent= eBone->parent; } printf("Warning: removed zero sized bone: %s\n", eBone->name); - free_edit_bone(arm, eBone); + bone_free(arm, eBone); } } @@ -318,7 +334,7 @@ void ED_armature_from_edit(Object *obedit) memcpy(newBone->head, eBone->head, sizeof(float)*3); memcpy(newBone->tail, eBone->tail, sizeof(float)*3); newBone->flag= eBone->flag; - + if (eBone == arm->act_edbone) { newBone->flag |= BONE_SELECTED; /* important, editbones can be active with only 1 point selected */ arm->act_edbone= NULL; @@ -337,7 +353,7 @@ void ED_armature_from_edit(Object *obedit) newBone->rad_tail= eBone->rad_tail; newBone->segments= eBone->segments; newBone->layer = eBone->layer; - + if(eBone->prop) newBone->prop= IDP_CopyProperty(eBone->prop); } @@ -604,8 +620,9 @@ static int apply_armature_pose2bones_exec (bContext *C, wmOperator *op) curbone->flag |= BONE_UNKEYED; } - /* convert editbones back to bones */ + /* convert editbones back to bones, and then free the edit-data */ ED_armature_from_edit(ob); + ED_armature_edit_free(ob); /* flush positions of posebones */ where_is_pose(scene, ob); @@ -1035,7 +1052,7 @@ static void separate_armature_bones (Scene *scene, Object *ob, short sel) free_pose_channel(pchan); /* get rid of unneeded bone */ - free_edit_bone(arm, curbone); + bone_free(arm, curbone); BLI_freelinkN(&ob->pose->chanbase, pchan); } } @@ -1122,7 +1139,7 @@ static int separate_armature_exec (bContext *C, wmOperator *op) void ARMATURE_OT_separate (wmOperatorType *ot) { /* identifiers */ - ot->name= "Separate Armature"; + ot->name= "Separate Bones"; ot->idname= "ARMATURE_OT_separate"; ot->description= "Isolate selected bones into a separate armature."; @@ -1300,7 +1317,7 @@ static int pose_setflag_exec (bContext *C, wmOperator *op) int mode= RNA_enum_get(op->ptr, "mode"); /* loop over all selected pchans */ - CTX_DATA_BEGIN(C, bPoseChannel *, pchan, selected_pchans) + CTX_DATA_BEGIN(C, bPoseChannel *, pchan, selected_pose_bones) { bone_setflag(&pchan->bone->flag, flag, mode); } @@ -1671,22 +1688,6 @@ static EditBone *get_nearest_editbonepoint (ViewContext *vc, short mval[2], List return NULL; } -/* warning, wont clear the active bone */ -static void delete_bone(bArmature *arm, EditBone* exBone) -{ - EditBone *curBone; - - /* Find any bones that refer to this bone */ - for (curBone=arm->edbo->first; curBone; curBone=curBone->next) { - if (curBone->parent==exBone) { - curBone->parent=exBone->parent; - curBone->flag &= ~BONE_CONNECTED; - } - } - - free_edit_bone(arm, exBone); -} - /* context: editmode armature */ EditBone *ED_armature_bone_get_mirrored(ListBase *edbo, EditBone *ebo) { @@ -1783,7 +1784,7 @@ static int armature_delete_selected_exec(bContext *C, wmOperator *op) if (arm->layer & curBone->layer) { if (curBone->flag & BONE_SELECTED) { if(curBone==arm->act_edbone) arm->act_edbone= NULL; - delete_bone(arm, curBone); + ED_armature_edit_bone_remove(arm, curBone); } } } @@ -1875,7 +1876,7 @@ void ED_armature_deselectall(Object *obedit, int toggle, int doundo) /* context: editmode armature in view3d */ -void mouse_armature(bContext *C, short mval[2], int extend) +int mouse_armature(bContext *C, short mval[2], int extend) { Object *obedit= CTX_data_edit_object(C); bArmature *arm= obedit->data; @@ -1946,7 +1947,10 @@ void mouse_armature(bContext *C, short mval[2], int extend) } WM_event_add_notifier(C, NC_OBJECT|ND_BONE_SELECT, vc.obedit); + return 1; } + + return 0; } void ED_armature_edit_free(struct Object *ob) @@ -2022,7 +2026,7 @@ float ED_rollBoneToVector(EditBone *bone, float new_up_axis[3]) /* Set roll value for given bone -> Z-Axis Point up (original method) */ -void auto_align_ebone_zaxisup(Scene *scene, View3D *v3d, EditBone *ebone) +static void auto_align_ebone_zaxisup(Scene *scene, View3D *v3d, EditBone *ebone) { float delta[3], curmat[3][3]; float xaxis[3]={1.0f, 0.0f, 0.0f}, yaxis[3], zaxis[3]={0.0f, 0.0f, 1.0f}; @@ -2050,16 +2054,13 @@ void auto_align_ebone_zaxisup(Scene *scene, View3D *v3d, EditBone *ebone) mat3_to_vec_roll(diffmat, delta, &ebone->roll); } -/* Set roll value for given bone -> Z-Axis point towards cursor */ -void auto_align_ebone_tocursor(Scene *scene, View3D *v3d, EditBone *ebone) +void auto_align_ebone_topoint(EditBone *ebone, float *cursor) { - Object *obedit= scene->obedit; // XXX get from context - float *cursor= give_cursor(scene, v3d); float delta[3], curmat[3][3]; float mat[4][4], tmat[4][4], imat[4][4]; float rmat[4][4], rot[3]; float vec[3]; - + /* find the current bone matrix as a 4x4 matrix (in Armature Space) */ sub_v3_v3v3(delta, ebone->tail, ebone->head); vec_roll_to_mat3(delta, ebone->roll, curmat); @@ -2067,8 +2068,7 @@ void auto_align_ebone_tocursor(Scene *scene, View3D *v3d, EditBone *ebone) VECCOPY(mat[3], ebone->head); /* multiply bone-matrix by object matrix (so that bone-matrix is in WorldSpace) */ - mul_m4_m4m4(tmat, mat, obedit->obmat); - invert_m4_m4(imat, tmat); + invert_m4_m4(imat, mat); /* find position of cursor relative to bone */ mul_v3_m4v3(vec, imat, cursor); @@ -2089,6 +2089,18 @@ void auto_align_ebone_tocursor(Scene *scene, View3D *v3d, EditBone *ebone) } } +static void auto_align_ebone_tocursor(Scene *scene, View3D *v3d, EditBone *ebone) +{ + float cursor_local[3]; + float *cursor= give_cursor(scene, v3d); + float imat[3][3]; + + copy_m3_m4(imat, scene->obedit->obmat); + invert_m3(imat); + copy_v3_v3(cursor_local, cursor); + mul_m3_v3(imat, cursor_local); + auto_align_ebone_topoint(ebone, cursor_local); +} static EnumPropertyItem prop_calc_roll_types[] = { {0, "GLOBALUP", 0, "Z-Axis Up", ""}, @@ -2242,7 +2254,7 @@ void undo_push_armature(bContext *C, char *name) /* *************** Adding stuff in editmode *************** */ /* default bone add, returns it selected, but without tail set */ -EditBone *addEditBone(bArmature *arm, char *name) +EditBone *ED_armature_edit_bone_add(bArmature *arm, char *name) { EditBone *bone= MEM_callocN(sizeof(EditBone), "eBone"); @@ -2266,14 +2278,6 @@ EditBone *addEditBone(bArmature *arm, char *name) return bone; } -/* default bone add, returns it selected, but without tail set */ -static EditBone *add_editbone(Object *obedit, char *name) -{ - bArmature *arm= obedit->data; - - return addEditBone(arm, name); -} - /* v3d and rv3d are allowed to be NULL */ void add_primitive_bone(Scene *scene, View3D *v3d, RegionView3D *rv3d) { @@ -2298,7 +2302,7 @@ void add_primitive_bone(Scene *scene, View3D *v3d, RegionView3D *rv3d) ED_armature_deselectall(obedit, 0, 0); /* Create a bone */ - bone= add_editbone(obedit, "Bone"); + bone= ED_armature_edit_bone_add(obedit->data, "Bone"); VECCOPY(bone->head, curs); @@ -2364,7 +2368,7 @@ static int armature_click_extrude_exec(bContext *C, wmOperator *op) } } - newbone= add_editbone(obedit, ebone->name); + newbone= ED_armature_edit_bone_add(arm, ebone->name); arm->act_edbone= newbone; if (to_root) { @@ -2481,7 +2485,7 @@ static EditBone *add_points_bone (Object *obedit, float head[], float tail[]) { EditBone *ebo; - ebo= add_editbone(obedit, "Bone"); + ebo= ED_armature_edit_bone_add(obedit->data, "Bone"); VECCOPY(ebo->head, head); VECCOPY(ebo->tail, tail); @@ -2578,7 +2582,7 @@ void updateDuplicateSubtarget(EditBone *dupBone, ListBase *editbones, Object *ob EditBone *duplicateEditBoneObjects(EditBone *curBone, char *name, ListBase *editbones, Object *src_ob, Object *dst_ob) { - EditBone *eBone = MEM_callocN(sizeof(EditBone), "addup_editbone"); + EditBone *eBone = MEM_mallocN(sizeof(EditBone), "addup_editbone"); /* Copy data from old bone to new bone */ memcpy(eBone, curBone, sizeof(EditBone)); @@ -2594,45 +2598,25 @@ EditBone *duplicateEditBoneObjects(EditBone *curBone, char *name, ListBase *edit unique_editbone_name(editbones, eBone->name, NULL); BLI_addtail(editbones, eBone); + /* copy the ID property */ + if(curBone->prop) + eBone->prop= IDP_CopyProperty(curBone->prop); + /* Lets duplicate the list of constraints that the * current bone has. */ if (src_ob->pose) { bPoseChannel *chanold, *channew; - ListBase *listold, *listnew; chanold = verify_pose_channel(src_ob->pose, curBone->name); if (chanold) { - listold = &chanold->constraints; - if (listold) { - /* WARNING: this creates a new posechannel, but there will not be an attached bone - * yet as the new bones created here are still 'EditBones' not 'Bones'. - */ - channew = - verify_pose_channel(dst_ob->pose, eBone->name); - if (channew) { - /* copy transform locks */ - channew->protectflag = chanold->protectflag; - - /* copy bone group */ - channew->agrp_index= chanold->agrp_index; - - /* ik (dof) settings */ - channew->ikflag = chanold->ikflag; - VECCOPY(channew->limitmin, chanold->limitmin); - VECCOPY(channew->limitmax, chanold->limitmax); - VECCOPY(channew->stiffness, chanold->stiffness); - channew->ikstretch= chanold->ikstretch; - channew->ikrotweight= chanold->ikrotweight; - channew->iklinweight= chanold->iklinweight; - - /* constraints */ - listnew = &channew->constraints; - copy_constraints(listnew, listold); - - /* custom shape */ - channew->custom= chanold->custom; - } + /* WARNING: this creates a new posechannel, but there will not be an attached bone + * yet as the new bones created here are still 'EditBones' not 'Bones'. + */ + channew= verify_pose_channel(dst_ob->pose, eBone->name); + + if(channew) { + duplicate_pose_channel_data(channew, chanold); } } } @@ -2682,65 +2666,12 @@ static int armature_duplicate_selected_exec(bContext *C, wmOperator *op) for (curBone=arm->edbo->first; curBone && curBone!=firstDup; curBone=curBone->next) { if (EBONE_VISIBLE(arm, curBone)) { if (curBone->flag & BONE_SELECTED) { - eBone=MEM_callocN(sizeof(EditBone), "addup_editbone"); - eBone->flag |= BONE_SELECTED; - /* Copy data from old bone to new bone */ - memcpy(eBone, curBone, sizeof(EditBone)); + eBone= duplicateEditBone(curBone, curBone->name, arm->edbo, obedit); - curBone->temp = eBone; - eBone->temp = curBone; - - unique_editbone_name(arm->edbo, eBone->name, NULL); - BLI_addtail(arm->edbo, eBone); if (!firstDup) firstDup=eBone; - /* Lets duplicate the list of constraints that the - * current bone has. - */ - if (obedit->pose) { - bPoseChannel *chanold, *channew; - ListBase *listold, *listnew; - - chanold = verify_pose_channel(obedit->pose, curBone->name); - if (chanold) { - listold = &chanold->constraints; - if (listold) { - /* WARNING: this creates a new posechannel, but there will not be an attached bone - * yet as the new bones created here are still 'EditBones' not 'Bones'. - */ - channew = - verify_pose_channel(obedit->pose, eBone->name); - if (channew) { - /* copy transform locks */ - channew->protectflag = chanold->protectflag; - - /* copy rotation mode */ - channew->rotmode = chanold->rotmode; - - /* copy bone group */ - channew->agrp_index= chanold->agrp_index; - - /* ik (dof) settings */ - channew->ikflag = chanold->ikflag; - VECCOPY(channew->limitmin, chanold->limitmin); - VECCOPY(channew->limitmax, chanold->limitmax); - VECCOPY(channew->stiffness, chanold->stiffness); - channew->ikstretch= chanold->ikstretch; - channew->ikrotweight= chanold->ikrotweight; - channew->iklinweight= chanold->iklinweight; - - /* constraints */ - listnew = &channew->constraints; - copy_constraints(listnew, listold); - - /* custom shape */ - channew->custom= chanold->custom; - } - } - } - } } } } @@ -3159,7 +3090,7 @@ static void bones_merge(Object *obedit, EditBone *start, EditBone *end, EditBone /* step 3: delete all bones between and including start and end */ for (ebo= end; ebo; ebo= ebone) { ebone= (ebo == start) ? (NULL) : (ebo->parent); - free_edit_bone(arm, ebo); + bone_free(arm, ebo); } } @@ -3514,7 +3445,7 @@ static int armature_bone_primitive_add_exec(bContext *C, wmOperator *op) ED_armature_deselectall(obedit, 0, 0); /* Create a bone */ - bone= add_editbone(obedit, name); + bone= ED_armature_edit_bone_add(obedit->data, name); VECCOPY(bone->head, curs); @@ -3650,7 +3581,7 @@ void ARMATURE_OT_subdivide_multi(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* Properties */ - RNA_def_int(ot->srna, "number_cuts", 2, 1, 10, "Number of Cuts", "", 1, INT_MAX); + RNA_def_int(ot->srna, "number_cuts", 2, 1, INT_MAX, "Number of Cuts", "", 1, 10); } @@ -3708,7 +3639,7 @@ void ARMATURE_OT_subdivs(wmOperatorType *ot) RNA_def_enum(ot->srna, "type", type_items, 0, "Type", ""); /* this is temp, the ops are different, but they are called from subdivs, so all the possible props should be here as well*/ - RNA_def_int(ot->srna, "number_cuts", 2, 1, 10, "Number of Cuts", "", 1, INT_MAX); + RNA_def_int(ot->srna, "number_cuts", 2, 1, INT_MAX, "Number of Cuts", "", 1, 10); } /* ----------- */ @@ -4070,25 +4001,38 @@ void ARMATURE_OT_select_inverse(wmOperatorType *ot) } static int armature_de_select_all_exec(bContext *C, wmOperator *op) { - int sel=1; + int action = RNA_enum_get(op->ptr, "action"); - /* Determine if there are any selected bones - And therefore whether we are selecting or deselecting */ - if (CTX_DATA_COUNT(C, selected_bones) > 0) sel=0; + if (action == SEL_TOGGLE) { + action = SEL_SELECT; + /* Determine if there are any selected bones + And therefore whether we are selecting or deselecting */ + if (CTX_DATA_COUNT(C, selected_bones) > 0) + action = SEL_DESELECT; + } /* Set the flags */ CTX_DATA_BEGIN(C, EditBone *, ebone, visible_bones) { /* ignore bone if selection can't change */ if ((ebone->flag & BONE_UNSELECTABLE) == 0) { - if (sel==1) { - /* select bone */ + switch (action) { + case SEL_SELECT: ebone->flag |= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL); if(ebone->parent) ebone->parent->flag |= (BONE_TIPSEL); - } - else { - /* deselect bone */ + break; + case SEL_DESELECT: ebone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL); + break; + case SEL_INVERT: + if (ebone->flag & BONE_SELECTED) { + ebone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL); + } else { + ebone->flag |= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL); + if(ebone->parent) + ebone->parent->flag |= (BONE_TIPSEL); + } + break; } } } @@ -4099,12 +4043,12 @@ static int armature_de_select_all_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void ARMATURE_OT_select_all_toggle(wmOperatorType *ot) +void ARMATURE_OT_select_all(wmOperatorType *ot) { /* identifiers */ ot->name= "deselect all editbone"; - ot->idname= "ARMATURE_OT_select_all_toggle"; + ot->idname= "ARMATURE_OT_select_all"; /* api callbacks */ ot->exec= armature_de_select_all_exec; @@ -4113,6 +4057,7 @@ void ARMATURE_OT_select_all_toggle(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + WM_operator_properties_select_all(ot); } /* ********************* select hierarchy operator ************** */ @@ -4857,7 +4802,7 @@ static int pose_clear_scale_exec(bContext *C, wmOperator *op) cks.id= &ob->id; /* only clear those channels that are not locked */ - CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pchans) { + CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pose_bones) { if ((pchan->protectflag & OB_LOCK_SCALEX)==0) pchan->size[0]= 1.0f; if ((pchan->protectflag & OB_LOCK_SCALEY)==0) @@ -4920,7 +4865,7 @@ static int pose_clear_loc_exec(bContext *C, wmOperator *op) cks.id= &ob->id; /* only clear those channels that are not locked */ - CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pchans) { + CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pose_bones) { /* clear location */ if ((pchan->protectflag & OB_LOCK_LOCX)==0) pchan->loc[0]= 0.0f; @@ -4984,7 +4929,7 @@ static int pose_clear_rot_exec(bContext *C, wmOperator *op) cks.id= &ob->id; /* only clear those channels that are not locked */ - CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pchans) { + CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pose_bones) { if (pchan->protectflag & (OB_LOCK_ROTX|OB_LOCK_ROTY|OB_LOCK_ROTZ|OB_LOCK_ROTW)) { /* check if convert to eulers for locking... */ if (pchan->protectflag & OB_LOCK_ROT4D) { @@ -5125,7 +5070,7 @@ static int pose_select_inverse_exec(bContext *C, wmOperator *op) { /* Set the flags */ - CTX_DATA_BEGIN(C, bPoseChannel *, pchan, visible_pchans) { + CTX_DATA_BEGIN(C, bPoseChannel *, pchan, visible_pose_bones) { if ((pchan->bone->flag & BONE_UNSELECTABLE) == 0) { pchan->bone->flag ^= (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL); } @@ -5154,20 +5099,35 @@ void POSE_OT_select_inverse(wmOperatorType *ot) } static int pose_de_select_all_exec(bContext *C, wmOperator *op) { - int sel=1; + int action = RNA_enum_get(op->ptr, "action"); - /* Determine if there are any selected bones and therefore whether we are selecting or deselecting */ - // NOTE: we have to check for > 1 not > 0, since there is almost always an active bone that can't be cleared... - if (CTX_DATA_COUNT(C, selected_pchans) > 1) sel=0; + if (action == SEL_TOGGLE) { + action = SEL_SELECT; + /* Determine if there are any selected bones and therefore whether we are selecting or deselecting */ + // NOTE: we have to check for > 1 not > 0, since there is almost always an active bone that can't be cleared... + if (CTX_DATA_COUNT(C, selected_pose_bones) > 1) + action = SEL_DESELECT; + } /* Set the flags */ - CTX_DATA_BEGIN(C, bPoseChannel *, pchan, visible_pchans) { + CTX_DATA_BEGIN(C, bPoseChannel *, pchan, visible_pose_bones) { /* select pchan only if selectable, but deselect works always */ - if (sel==0) { + switch (action) { + case SEL_SELECT: + if ((pchan->bone->flag & BONE_UNSELECTABLE)==0) + pchan->bone->flag |= BONE_SELECTED; + break; + case SEL_DESELECT: pchan->bone->flag &= ~(BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL); + break; + case SEL_INVERT: + if (pchan->bone->flag & BONE_SELECTED) { + pchan->bone->flag &= ~(BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL); + } else if ((pchan->bone->flag & BONE_UNSELECTABLE)==0) { + pchan->bone->flag |= BONE_SELECTED; + } + break; } - else if ((pchan->bone->flag & BONE_UNSELECTABLE)==0) - pchan->bone->flag |= BONE_SELECTED; } CTX_DATA_END; @@ -5176,12 +5136,12 @@ static int pose_de_select_all_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void POSE_OT_select_all_toggle(wmOperatorType *ot) +void POSE_OT_select_all(wmOperatorType *ot) { /* identifiers */ ot->name= "deselect all bones"; - ot->idname= "POSE_OT_select_all_toggle"; + ot->idname= "POSE_OT_select_all"; /* api callbacks */ ot->exec= pose_de_select_all_exec; @@ -5190,6 +5150,7 @@ void POSE_OT_select_all_toggle(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + WM_operator_properties_select_all(ot); } static int pose_select_parent_exec(bContext *C, wmOperator *op) @@ -5198,7 +5159,7 @@ static int pose_select_parent_exec(bContext *C, wmOperator *op) bPoseChannel *pchan,*parent; /* Determine if there is an active bone */ - pchan=CTX_data_active_pchan(C); + pchan=CTX_data_active_pose_bone(C); if (pchan) { bArmature *arm= ob->data; parent=pchan->parent; @@ -5672,7 +5633,7 @@ EditBone * subdivideByAngle(Scene *scene, Object *obedit, ReebArc *arc, ReebNode EditBone *root = NULL; float angleLimit = (float)cos(scene->toolsettings->skgen_angle_limit * M_PI / 180.0f); - parent = add_editbone(obedit, "Bone"); + parent = ED_armature_edit_bone_add(arm, "Bone"); parent->flag |= BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL; VECCOPY(parent->head, head->p); @@ -5701,7 +5662,7 @@ EditBone * subdivideByAngle(Scene *scene, Object *obedit, ReebArc *arc, ReebNode { VECCOPY(parent->tail, previous); - child = add_editbone(obedit, "Bone"); + child = ED_armature_edit_bone_add(arm, "Bone"); VECCOPY(child->head, parent->tail); child->parent = parent; child->flag |= BONE_CONNECTED|BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL; @@ -5717,7 +5678,7 @@ EditBone * subdivideByAngle(Scene *scene, Object *obedit, ReebArc *arc, ReebNode if (parent == root) { if(parent==arm->act_edbone) arm->act_edbone= NULL; - delete_bone(arm, parent); + ED_armature_edit_bone_remove(arm, parent); parent = NULL; } @@ -5907,7 +5868,7 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg) if (lastBone == NULL) { EditBone *bone; - bone = add_editbone(obedit, "Bone"); + bone = ED_armature_edit_bone_add(obedit->data, "Bone"); bone->flag |= BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL; VECCOPY(bone->head, head->p); |