diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-04-29 12:12:44 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-04-29 12:13:20 +0400 |
commit | 409fb4da0ce671d9c5cf54cb327770d6b4e97cb2 (patch) | |
tree | 37f4c7705463122fdf3d3e16a16a9d1feb89c967 /source/blender/editors | |
parent | d8282da5452b9bb8487d9bce611b922244a74a08 (diff) |
Code cleanup: remove redundant matrix initialization
Diffstat (limited to 'source/blender/editors')
5 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index d8816e73dff..b2e5207a69c 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -781,7 +781,8 @@ static float calc_overlap(StrokeCache *cache, const char symm, const char axis, flip_v3_v3(mirror, cache->true_location, symm); if (axis != 0) { - float mat[4][4] = MAT4_UNITY; + float mat[4][4]; + unit_m4(mat); rotate_m4(mat, axis, angle); mul_m4_v3(mat, mirror); } diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c index 26ebd1ddf63..8e6deeddc39 100644 --- a/source/blender/editors/space_view3d/view3d_snap.c +++ b/source/blender/editors/space_view3d/view3d_snap.c @@ -414,7 +414,7 @@ static void bundle_midpoint(Scene *scene, Object *ob, float vec[3]) MovieTracking *tracking; MovieTrackingObject *object; bool ok = false; - float min[3], max[3], mat[4][4], pos[3], cammat[4][4] = MAT4_UNITY; + float min[3], max[3], mat[4][4], pos[3], cammat[4][4]; if (!clip) return; diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index b52fba36cac..2cec4d61e3e 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -945,7 +945,6 @@ static void transform_event_xyz_constraint(TransInfo *t, short key_type, char cm int transformEvent(TransInfo *t, const wmEvent *event) { - float mati[3][3] = MAT3_UNITY; char cmode = constraintModeToChar(t); bool handled = false; @@ -1306,7 +1305,9 @@ int transformEvent(TransInfo *t, const wmEvent *event) } else { /* bit hackish... but it prevents mmb select to print the orientation from menu */ + float mati[3][3]; strcpy(t->spacename, "global"); + unit_m3(mati); initSelectConstraint(t, mati); } postSelectConstraint(t); diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c index 4cc8833ba1e..749c45e316b 100644 --- a/source/blender/editors/transform/transform_constraints.c +++ b/source/blender/editors/transform/transform_constraints.c @@ -625,8 +625,9 @@ void setUserConstraint(TransInfo *t, short orientation, int mode, const char fte switch (orientation) { case V3D_MANIP_GLOBAL: { - float mtx[3][3] = MAT3_UNITY; + float mtx[3][3]; BLI_snprintf(text, sizeof(text), ftext, IFACE_("global")); + unit_m3(mtx); setConstraint(t, mtx, mode, text); break; } diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index a2b53da831b..aaa67e58eaf 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -1507,7 +1507,9 @@ static void draw_manipulator_rotate_cyl( /* Screen aligned view rot circle */ if (drawflags & MAN_ROT_V) { - float unitmat[4][4] = MAT4_UNITY; + float unitmat[4][4]; + + unit_m4(unitmat); if (is_picksel) glLoadName(MAN_ROT_V); UI_ThemeColor(TH_TRANSFORM); |