Multiple Orientation for the Local manipulator
Needs ReviewPublic

Authored by cris (InsigMathK) on Apr 21 2017, 12:23 AM.

Details

Summary

This patch allows for users to specifies an orientation for different transformations for the local manipulator. So, a user could choose a local orientation for the translation transformation and choose gimbal for the rotation transformation, while choosing none for the scale.

I added two new orientations:

V3D_MANIP_MULTI_TRANSF
V3D_MANIP_NONE

Diff Detail

Repository
rB Blender
Branch
multi_orientation
Build Status
Buildable 608
Build 608: arc lint + arc unit
cris (InsigMathK) retitled this revision from Multi-orientation to Multiple Orientation for the Local manipulator.Apr 21 2017, 3:06 PM
cris (InsigMathK) edited the summary of this revision. (Show Details)
  • I added some constants for the different v3d->mode instead of just using magic numbers.
source/blender/editors/transform/transform.c
940–976

I'd add some {} in here to make it more obvious which "if" the "elses" belong to

956

Indentation messed up?

  • Fixed some bracket and spacing issues so to avoid weird dangling else statements.
cris (InsigMathK) marked 2 inline comments as done.
  • More braces fixes, replaced some magic numbers with constants.

When building using Xcode 7.2.1, your code throws compiler warnings. Details in the inline code comments.

source/blender/editors/transform/transform_manipulator.c
668

I see compiler warnings in all lines using mtx_tranf. It is an array of float*, where all the following lines of code assume float[4][4]. I'm not sure if there's a truly elegant way of handling this, but this slightly convoluted variable declaration allows the code to build without warnings or having to use casts:

				float (*(mtx_tranf[3]))[4][4];
				mtx_tranf[0] = &rv3d->twmattrans;
				mtx_tranf[1] = &rv3d->twmatrots;
				mtx_tranf[2] = &rv3d->twmatscale;

Later, the calls to the copy matrix functions will then need to dereference the pointers in the array:

				copy_m4_m3(*mtx_tranf[i], mat);
  • Made some suggested changes to transform_manipulator.c based on stefan's suggestion to use "float(*(mtx_tranf[3]))[4][4];"