diff options
author | Stefan Werner <stefan.werner@tangent-animation.com> | 2018-10-12 13:12:10 +0300 |
---|---|---|
committer | Stefan Werner <stefan.werner@tangent-animation.com> | 2018-10-12 13:12:10 +0300 |
commit | a8e894951a0b54d7cffd90b347ca64cb0789fe43 (patch) | |
tree | 553fa0fe2a2a1545672fde49ac17e05e4c2880ea /source/blender/editors/transform | |
parent | 7a89fa4a8550a7b3020bd762ab8b69ec836e2f6b (diff) | |
parent | b618c185cb7c5930980e459c84b8818a0fba1f1d (diff) |
Merge branch 'master' of git.blender.org:blender into cycles_embree
Diffstat (limited to 'source/blender/editors/transform')
7 files changed, 25 insertions, 23 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 79d06de8b41..cfe52197ca2 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1852,7 +1852,7 @@ static void drawTransformPixel(const struct bContext *UNUSED(C), ARegion *ar, vo /* draw autokeyframing hint in the corner * - only draw if enabled (advanced users may be distracted/annoyed), - * for objects that will be autokeyframed (no point ohterwise), + * for objects that will be autokeyframed (no point otherwise), * AND only for the active region (as showing all is too overwhelming) */ if ((U.autokey_flag & AUTOKEY_FLAG_NOWARNING) == 0) { @@ -2599,7 +2599,7 @@ static void constraintTransLim(TransInfo *t, TransData *td) mul_m4_m3m4(cob.matrix, td->mtx, cob.matrix); } else if (con->ownspace != CONSTRAINT_SPACE_LOCAL) { - /* skip... incompatable spacetype */ + /* skip... incompatible spacetype */ continue; } @@ -2675,7 +2675,7 @@ static void constraintRotLim(TransInfo *UNUSED(t), TransData *td) if ((data->flag2 & LIMIT_TRANSFORM) == 0) continue; - /* skip incompatable spacetypes */ + /* skip incompatible spacetypes */ if (!ELEM(con->ownspace, CONSTRAINT_SPACE_WORLD, CONSTRAINT_SPACE_LOCAL)) continue; @@ -5713,7 +5713,7 @@ static void calcEdgeSlideCustomPoints(struct TransInfo *t) setCustomPoints(t, &t->mouse, sld->mval_end, sld->mval_start); /* setCustomPoints isn't normally changing as the mouse moves, - * in this case apply mouse input immediatly so we don't refresh + * in this case apply mouse input immediately so we don't refresh * with the value from the previous points */ applyMouseInput(t, &t->mouse, t->mval, t->values); } @@ -7081,7 +7081,7 @@ static void calcVertSlideCustomPoints(struct TransInfo *t) } /* setCustomPoints isn't normally changing as the mouse moves, - * in this case apply mouse input immediatly so we don't refresh + * in this case apply mouse input immediately so we don't refresh * with the value from the previous points */ applyMouseInput(t, &t->mouse, t->mval, t->values); } diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index 5f738804579..5369fc05005 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -150,7 +150,7 @@ typedef struct TransDataExtension { float r_mtx[3][3]; /* The rotscale matrix of pose bone, to allow using snap-align in translation mode, * when td->mtx is the loc pose bone matrix (and hence can't be used to apply rotation in some cases, * namely when a bone is in "NoLocal" or "Hinge" mode)... */ - float r_smtx[3][3]; /* Invers of previous one. */ + float r_smtx[3][3]; /* Inverse of previous one. */ int rotOrder; /* rotation mode, as defined in eRotationModes (DNA_action_types.h) */ float oloc[3], orot[3], oquat[4], orotAxis[3], orotAngle; /* Original object transformation used for rigid bodies */ } TransDataExtension; @@ -163,7 +163,7 @@ typedef struct TransData2D { float ih1[2], ih2[2]; } TransData2D; -/* we need to store 2 handles for each transdata in case the other handle wasnt selected */ +/* we need to store 2 handles for each transdata in case the other handle wasn't selected */ typedef struct TransDataCurveHandleFlags { char ih1, ih2; char *h1, *h2; @@ -522,7 +522,7 @@ typedef struct TransInfo { #define T_AUTOVALUES (1 << 20) - /* to specificy if we save back settings at the end */ + /* to specify if we save back settings at the end */ #define T_MODAL (1 << 21) /* no retopo */ @@ -796,6 +796,8 @@ bool applyTransformOrientation(const struct bContext *C, float mat[3][3], char r #define ORIENTATION_VERT 2 #define ORIENTATION_EDGE 3 #define ORIENTATION_FACE 4 +#define ORIENTATION_USE_PLANE(ty) \ + ELEM(ty, ORIENTATION_NORMAL, ORIENTATION_EDGE, ORIENTATION_FACE) int getTransformOrientation_ex(const struct bContext *C, float normal[3], float plane[3], const short around); int getTransformOrientation(const struct bContext *C, float normal[3], float plane[3]); diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 2836ed0699d..6c67aef2884 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -2291,7 +2291,7 @@ static struct TransIslandData *editmesh_islands_info_calc( vert_map = MEM_mallocN(sizeof(*vert_map) * bm->totvert, __func__); /* we shouldn't need this, but with incorrect selection flushing - * its possible we have a selected vertex thats not in a face, for now best not crash in that case. */ + * its possible we have a selected vertex that's not in a face, for now best not crash in that case. */ copy_vn_i(vert_map, bm->totvert, -1); BM_mesh_elem_table_ensure(bm, htype); @@ -2895,7 +2895,7 @@ void flushTransSeq(TransInfo *t) if (seq != seq_prev) { if (seq->depth == 0) { - /* test overlap, displayes red outline */ + /* test overlap, displays red outline */ seq->flag &= ~SEQ_OVERLAP; if (BKE_sequence_test_overlap(seqbasep, seq)) { seq->flag |= SEQ_OVERLAP; @@ -5784,7 +5784,7 @@ static void clear_trans_object_base_flags(TransInfo *t) } /* auto-keyframing feature - for objects - * tmode: should be a transform mode + * tmode: should be a transform mode */ // NOTE: context may not always be available, so must check before using it as it's a luxury for a few cases void autokeyframe_ob_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *ob, int tmode) @@ -5900,8 +5900,8 @@ void autokeyframe_ob_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *ob, } /* auto-keyframing feature - for poses/pose-channels - * tmode: should be a transform mode - * targetless_ik: has targetless ik been done on any channels? + * tmode: should be a transform mode + * targetless_ik: has targetless ik been done on any channels? */ // NOTE: context may not always be available, so must check before using it as it's a luxury for a few cases void autokeyframe_pose_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *ob, int tmode, short targetless_ik) diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 9a2c3674d2a..fa3bf6c81e2 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -303,7 +303,7 @@ static void animrecord_check_state(Scene *scene, ID *id, wmTimer *animtimer) * NOTE: An alternative way would have been to instead hack the influence * to not get always get reset to full strength if NLASTRIP_FLAG_USR_INFLUENCE * is disabled but auto-blending isn't being used. However, that approach - * is a bit hacky/hard to discover, and may cause backwards compatability issues, + * is a bit hacky/hard to discover, and may cause backwards compatibility issues, * so it's better to just do it this way. */ strip->flag |= NLASTRIP_FLAG_USR_INFLUENCE; diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index c38fb15fc89..8cd31c32911 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -662,7 +662,7 @@ int getTransformOrientation_ex(const bContext *C, float normal[3], float plane[3 } if (em->bm->totedgesel >= 1) { - /* find an edge thats apart of v_tri (no need to search all edges) */ + /* find an edge that's apart of v_tri (no need to search all edges) */ float e_length; int j; @@ -796,12 +796,7 @@ int getTransformOrientation_ex(const bContext *C, float normal[3], float plane[3 } } - if (is_zero_v3(plane)) { - result = ORIENTATION_VERT; - } - else { - result = ORIENTATION_EDGE; - } + result = is_zero_v3(plane) ? ORIENTATION_VERT : ORIENTATION_EDGE; } else if (em->bm->totvertsel > 3) { BMIter iter; @@ -1104,6 +1099,11 @@ void ED_getTransformOrientationMatrix(const bContext *C, float orientation_mat[3 type = getTransformOrientation_ex(C, normal, plane, around); + /* Fallback, when the plane can't be calculated. */ + if (ORIENTATION_USE_PLANE(type) && is_zero_v3(plane)) { + type = ORIENTATION_VERT; + } + switch (type) { case ORIENTATION_NORMAL: if (createSpaceNormalTangent(orientation_mat, normal, plane) == 0) { diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index 8bc53127b4c..b06f22f50cc 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -611,7 +611,7 @@ static void initSnappingMode(TransInfo *t) (bool (*)(BMVert *, void *))BM_elem_cb_check_hflag_disabled, bm_edge_is_snap_target, bm_face_is_snap_target, - SET_UINT_IN_POINTER((BM_ELEM_SELECT | BM_ELEM_HIDDEN))); + POINTER_FROM_UINT((BM_ELEM_SELECT | BM_ELEM_HIDDEN))); } } } diff --git a/source/blender/editors/transform/transform_snap_object.c b/source/blender/editors/transform/transform_snap_object.c index f9c628877c1..1c6ad1fe752 100644 --- a/source/blender/editors/transform/transform_snap_object.c +++ b/source/blender/editors/transform/transform_snap_object.c @@ -2425,7 +2425,7 @@ bool ED_transform_snap_object_project_all_view3d_ex( { float ray_start[3], ray_normal[3]; - if (!ED_view3d_win_to_ray_ex( + if (!ED_view3d_win_to_ray_clipped_ex( sctx->v3d_data.ar, sctx->v3d_data.v3d, mval, NULL, ray_normal, ray_start, true)) { |