diff options
Diffstat (limited to 'source/blender/editors/armature')
-rw-r--r-- | source/blender/editors/armature/editarmature.c | 1 | ||||
-rw-r--r-- | source/blender/editors/armature/editarmature_sketch.c | 2 | ||||
-rw-r--r-- | source/blender/editors/armature/poseobject.c | 27 | ||||
-rw-r--r-- | source/blender/editors/armature/reeb.c | 2 |
4 files changed, 21 insertions, 11 deletions
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 1c113c25720..9c9be51f010 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -734,6 +734,7 @@ int join_armature(Scene *scene, View3D *v3d) VecSubf(delta, curbone->tail, curbone->head); vec_roll_to_mat3(delta, curbone->roll, temp); + Mat4One(premat); /* Mat4MulMat34 only sets 3x3 part */ Mat4MulMat34(premat, temp, mat); Mat4MulVecfl(mat, curbone->head); diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c index 45605ad472d..f010abdb7e7 100644 --- a/source/blender/editors/armature/editarmature_sketch.c +++ b/source/blender/editors/armature/editarmature_sketch.c @@ -2273,6 +2273,7 @@ void sk_applyCutGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) pt.type = PT_EXACT; pt.mode = PT_PROJECT; /* take mode from neighbouring points */ VECCOPY(pt.p, isect->p); + VECCOPY(pt.no, isect->stroke->points[isect->before].no); sk_insertStrokePoint(isect->stroke, &pt, isect->after); } @@ -2314,6 +2315,7 @@ void sk_applyTrimGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) pt.type = PT_EXACT; pt.mode = PT_PROJECT; /* take mode from neighbouring points */ VECCOPY(pt.p, isect->p); + VECCOPY(pt.no, isect->stroke->points[isect->before].no); VecSubf(stroke_dir, isect->stroke->points[isect->after].p, isect->stroke->points[isect->before].p); diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index 3d8d446c579..0d7bb3c63cc 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -1688,18 +1688,25 @@ void pose_clear_user_transforms(Scene *scene, Object *ob) if (ob->pose == NULL) return; - /* find selected bones */ - for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if (pchan->bone && (pchan->bone->flag & BONE_SELECTED) && (pchan->bone->layer & arm->layer)) { - /* just clear the BONE_UNKEYED flag, allowing this bone to get overwritten by actions again */ - pchan->bone->flag &= ~BONE_UNKEYED; + /* if the object has an action, restore pose to the pose defined by the action by clearing pose on selected bones */ + if (ob->action) { + /* find selected bones */ + for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { + if (pchan->bone && (pchan->bone->flag & BONE_SELECTED) && (pchan->bone->layer & arm->layer)) { + /* just clear the BONE_UNKEYED flag, allowing this bone to get overwritten by actions again */ + pchan->bone->flag &= ~BONE_UNKEYED; + } } + + /* clear pose locking flag + * - this will only clear the user-defined pose in the selected bones, where BONE_UNKEYED has been cleared + */ + ob->pose->flag |= POSE_DO_UNLOCK; + } + else { + /* no action, so restore entire pose to rest pose (cannot restore only selected bones) */ + rest_pose(ob->pose); } - - /* clear pose locking flag - * - this will only clear the user-defined pose in the selected bones, where BONE_UNKEYED has been cleared - */ - ob->pose->flag |= POSE_DO_UNLOCK; DAG_object_flush_update(scene, ob, OB_RECALC_DATA); BIF_undo_push("Clear User Transform"); diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c index 7e6c84764ae..ea794b2c7c1 100644 --- a/source/blender/editors/armature/reeb.c +++ b/source/blender/editors/armature/reeb.c @@ -2702,7 +2702,7 @@ static float cotan_weight(float *v1, float *v2, float *v3) return Inpf(a, b)/clen; } -void addTriangle(EditVert *v1, EditVert *v2, EditVert *v3, long e1, long e2, long e3) +void addTriangle(EditVert *v1, EditVert *v2, EditVert *v3, int e1, int e2, int e3) { /* Angle opposite e1 */ float t1= cotan_weight(v1->co, v2->co, v3->co) / e2; |