diff options
Diffstat (limited to 'source/blender/editors/armature/editarmature.c')
-rw-r--r-- | source/blender/editors/armature/editarmature.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 7d196d23c98..402715dbb02 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -1736,7 +1736,7 @@ static int armature_delete_selected_exec(bContext *C, wmOperator *op) ED_armature_sync_selection(arm->edbo); - WM_event_add_notifier(C, NC_OBJECT, obedit); + WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, obedit); return OPERATOR_FINISHED; } @@ -2539,6 +2539,8 @@ EditBone *duplicateEditBoneObjects(EditBone *curBone, char *name, ListBase *edit 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; @@ -2630,6 +2632,9 @@ static int armature_duplicate_selected_exec(bContext *C, wmOperator *op) /* copy transform locks */ channew->protectflag = chanold->protectflag; + /* copy rotation mode */ + channew->rotmode = chanold->rotmode; + /* copy bone group */ channew->agrp_index= chanold->agrp_index; @@ -2639,6 +2644,8 @@ static int armature_duplicate_selected_exec(bContext *C, wmOperator *op) 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; @@ -3441,7 +3448,8 @@ static int armature_bone_primitive_add_exec(bContext *C, wmOperator *op) else VecAddf(bone->tail, bone->head, imat[2]); // bone with unit length 1, pointing up Z - WM_event_add_notifier(C, NC_OBJECT, obedit); + /* note, notifier might evolve */ + WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, obedit); return OPERATOR_FINISHED; } @@ -3930,7 +3938,7 @@ static int armature_parent_clear_exec(bContext *C, wmOperator *op) ED_armature_sync_selection(arm->edbo); /* note, notifier might evolve */ - WM_event_add_notifier(C, NC_OBJECT, ob); + WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, ob); return OPERATOR_FINISHED; } @@ -4330,7 +4338,7 @@ int ED_do_pose_selectbuffer(Scene *scene, Base *base, unsigned int *buffer, shor } /* in weightpaint we select the associated vertex group too */ - if (ob->mode & OB_MODE_WEIGHT_PAINT) { + if (OBACT && OBACT->mode & OB_MODE_WEIGHT_PAINT) { if (nearBone->flag & BONE_ACTIVE) { ED_vgroup_select_by_name(OBACT, nearBone->name); DAG_id_flush_update(&OBACT->id, OB_RECALC_DATA); @@ -4854,7 +4862,7 @@ static int pose_clear_rot_exec(bContext *C, wmOperator *op) if (pchan->protectflag & OB_LOCK_ROT4D) { /* perform clamping on a component by component basis */ if ((pchan->protectflag & OB_LOCK_ROTW) == 0) - pchan->quat[0]= (pchan->rotmode == PCHAN_ROT_AXISANGLE) ? 0.0f : 1.0f; + pchan->quat[0]= (pchan->rotmode == ROT_MODE_AXISANGLE) ? 0.0f : 1.0f; if ((pchan->protectflag & OB_LOCK_ROTX) == 0) pchan->quat[1]= 0.0f; if ((pchan->protectflag & OB_LOCK_ROTY) == 0) @@ -4866,11 +4874,11 @@ static int pose_clear_rot_exec(bContext *C, wmOperator *op) /* perform clamping using euler form (3-components) */ float eul[3], oldeul[3], quat1[4]; - if (pchan->rotmode == PCHAN_ROT_QUAT) { + if (pchan->rotmode == ROT_MODE_QUAT) { QUATCOPY(quat1, pchan->quat); QuatToEul(pchan->quat, oldeul); } - else if (pchan->rotmode == PCHAN_ROT_AXISANGLE) { + else if (pchan->rotmode == ROT_MODE_AXISANGLE) { AxisAngleToEulO(&pchan->quat[1], pchan->quat[0], oldeul, EULER_ORDER_DEFAULT); } else { @@ -4886,14 +4894,14 @@ static int pose_clear_rot_exec(bContext *C, wmOperator *op) if (pchan->protectflag & OB_LOCK_ROTZ) eul[2]= oldeul[2]; - if (pchan->rotmode == PCHAN_ROT_QUAT) { + if (pchan->rotmode == ROT_MODE_QUAT) { EulToQuat(eul, pchan->quat); /* quaternions flip w sign to accumulate rotations correctly */ if ((quat1[0]<0.0f && pchan->quat[0]>0.0f) || (quat1[0]>0.0f && pchan->quat[0]<0.0f)) { QuatMulf(pchan->quat, -1.0f); } } - else if (pchan->rotmode == PCHAN_ROT_AXISANGLE) { + else if (pchan->rotmode == ROT_MODE_AXISANGLE) { AxisAngleToEulO(&pchan->quat[1], pchan->quat[0], oldeul, EULER_ORDER_DEFAULT); } else { @@ -4902,11 +4910,11 @@ static int pose_clear_rot_exec(bContext *C, wmOperator *op) } } else { - if (pchan->rotmode == PCHAN_ROT_QUAT) { + if (pchan->rotmode == ROT_MODE_QUAT) { pchan->quat[1]=pchan->quat[2]=pchan->quat[3]= 0.0f; pchan->quat[0]= 1.0f; } - else if (pchan->rotmode == PCHAN_ROT_AXISANGLE) { + else if (pchan->rotmode == ROT_MODE_AXISANGLE) { /* by default, make rotation of 0 radians around y-axis (roll) */ pchan->quat[0]=pchan->quat[1]=pchan->quat[3]= 0.0f; pchan->quat[2]= 1.0f; |