Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r--source/blender/editors/transform/transform.c138
-rw-r--r--source/blender/editors/transform/transform.h2
-rw-r--r--source/blender/editors/transform/transform_constraints.c4
-rw-r--r--source/blender/editors/transform/transform_conversions.c98
-rw-r--r--source/blender/editors/transform/transform_manipulator.c6
-rw-r--r--source/blender/editors/transform/transform_ops.c2
-rw-r--r--source/blender/editors/transform/transform_orientations.c4
-rw-r--r--source/blender/editors/transform/transform_snap.c18
8 files changed, 136 insertions, 136 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index fd21bd1922f..6d72ca99678 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -1189,12 +1189,12 @@ static void drawArrow(ArrowDirection d, short offset, short length, short size)
size = -size;
case RIGHT:
glBegin(GL_LINES);
- glVertex2s( offset, 0);
- glVertex2s( offset + length, 0);
- glVertex2s( offset + length, 0);
- glVertex2s( offset + length - size, -size);
- glVertex2s( offset + length, 0);
- glVertex2s( offset + length - size, size);
+ glVertex2s(offset, 0);
+ glVertex2s(offset + length, 0);
+ glVertex2s(offset + length, 0);
+ glVertex2s(offset + length - size, -size);
+ glVertex2s(offset + length, 0);
+ glVertex2s(offset + length - size, size);
glEnd();
break;
case DOWN:
@@ -1203,12 +1203,12 @@ static void drawArrow(ArrowDirection d, short offset, short length, short size)
size = -size;
case UP:
glBegin(GL_LINES);
- glVertex2s( 0, offset);
- glVertex2s( 0, offset + length);
- glVertex2s( 0, offset + length);
+ glVertex2s(0, offset);
+ glVertex2s(0, offset + length);
+ glVertex2s(0, offset + length);
glVertex2s(-size, offset + length - size);
- glVertex2s( 0, offset + length);
- glVertex2s( size, offset + length - size);
+ glVertex2s(0, offset + length);
+ glVertex2s(size, offset + length - size);
glEnd();
break;
}
@@ -1221,20 +1221,20 @@ static void drawArrowHead(ArrowDirection d, short size)
size = -size;
case RIGHT:
glBegin(GL_LINES);
- glVertex2s( 0, 0);
- glVertex2s( -size, -size);
- glVertex2s( 0, 0);
- glVertex2s( -size, size);
+ glVertex2s(0, 0);
+ glVertex2s(-size, -size);
+ glVertex2s(0, 0);
+ glVertex2s(-size, size);
glEnd();
break;
case DOWN:
size = -size;
case UP:
glBegin(GL_LINES);
- glVertex2s( 0, 0);
+ glVertex2s(0, 0);
glVertex2s(-size, -size);
- glVertex2s( 0, 0);
- glVertex2s( size, -size);
+ glVertex2s(0, 0);
+ glVertex2s(size, -size);
glEnd();
break;
}
@@ -1248,9 +1248,9 @@ static void drawArc(float size, float angle_start, float angle_end, int segments
glBegin(GL_LINE_STRIP);
for ( angle = angle_start; angle < angle_end; angle += delta) {
- glVertex2f( cosf(angle) * size, sinf(angle) * size);
+ glVertex2f(cosf(angle) * size, sinf(angle) * size);
}
- glVertex2f( cosf(angle_end) * size, sinf(angle_end) * size);
+ glVertex2f(cosf(angle_end) * size, sinf(angle_end) * size);
glEnd();
}
@@ -1943,8 +1943,8 @@ static void protectedAxisAngleBits(short protectflag, float axis[3], float *angl
/* axis-angle get limited with euler... */
float eul[3], oldeul[3];
- axis_angle_to_eulO( eul, EULER_ORDER_DEFAULT,axis, *angle);
- axis_angle_to_eulO( oldeul, EULER_ORDER_DEFAULT,oldAxis, oldAngle);
+ axis_angle_to_eulO(eul, EULER_ORDER_DEFAULT, axis, *angle);
+ axis_angle_to_eulO(oldeul, EULER_ORDER_DEFAULT, oldAxis, oldAngle);
if (protectflag & OB_LOCK_ROTX)
eul[0]= oldeul[0];
@@ -1953,7 +1953,7 @@ static void protectedAxisAngleBits(short protectflag, float axis[3], float *angl
if (protectflag & OB_LOCK_ROTZ)
eul[2]= oldeul[2];
- eulO_to_axis_angle( axis, angle,eul, EULER_ORDER_DEFAULT);
+ eulO_to_axis_angle(axis, angle, eul, EULER_ORDER_DEFAULT);
/* when converting to axis-angle, we need a special exception for the case when there is no axis */
if (IS_EQF(axis[0], axis[1]) && IS_EQF(axis[1], axis[2])) {
@@ -1999,7 +1999,7 @@ static void protectedQuaternionBits(short protectflag, float *quat, float *oldqu
if (protectflag & OB_LOCK_ROTZ)
eul[2]= oldeul[2];
- eul_to_quat( quat,eul);
+ eul_to_quat(quat, eul);
/* restore original quat size */
mul_qt_fl(quat, qlen);
@@ -2175,15 +2175,15 @@ static void constraintRotLim(TransInfo *UNUSED(t), TransData *td)
/* copy results from cob->matrix */
if (td->ext->rotOrder == ROT_MODE_QUAT) {
/* quats */
- mat4_to_quat( td->ext->quat,cob.matrix);
+ mat4_to_quat(td->ext->quat, cob.matrix);
}
else if (td->ext->rotOrder == ROT_MODE_AXISANGLE) {
/* axis angle */
- mat4_to_axis_angle( &td->ext->quat[1], &td->ext->quat[0],cob.matrix);
+ mat4_to_axis_angle(&td->ext->quat[1], &td->ext->quat[0], cob.matrix);
}
else {
/* eulers */
- mat4_to_eulO( td->ext->rot, td->ext->rotOrder,cob.matrix);
+ mat4_to_eulO(td->ext->rot, td->ext->rotOrder, cob.matrix);
}
}
}
@@ -2209,7 +2209,7 @@ static void constraintSizeLim(TransInfo *t, TransData *td)
if (td->flag & TD_SINGLESIZE)
return;
- size_to_mat4( cob.matrix,td->ext->size);
+ size_to_mat4(cob.matrix, td->ext->size);
}
/* Evaluate valid constraints */
@@ -2260,7 +2260,7 @@ static void constraintSizeLim(TransInfo *t, TransData *td)
if (td->flag & TD_SINGLESIZE)
return;
- mat4_to_size( td->ext->size,cob.matrix);
+ mat4_to_size(td->ext->size, cob.matrix);
}
}
}
@@ -2628,7 +2628,7 @@ static void headerResize(TransInfo *t, float vec[3], char *str)
#define VECSIGNFLIP(a, b) ((SIGN(a[0]) & SIGN(b[0]))==0 || (SIGN(a[1]) & SIGN(b[1]))==0 || (SIGN(a[2]) & SIGN(b[2]))==0)
/* smat is reference matrix, only scaled */
-static void TransMat3ToSize( float mat[][3], float smat[][3], float *size)
+static void TransMat3ToSize(float mat[][3], float smat[][3], float *size)
{
float vec[3];
@@ -2688,7 +2688,7 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3])
//print_v3("fsize", fsize);
}
else {
- mat3_to_size( fsize,tmat);
+ mat3_to_size(fsize, tmat);
}
protectedSizeBits(td->protectflag, fsize);
@@ -2775,7 +2775,7 @@ int Resize(TransInfo *t, const int mval[2])
copy_v3_v3(t->values, size);
- size_to_mat3( mat,size);
+ size_to_mat3(mat, size);
if (t->con.applySize) {
t->con.applySize(t, NULL, mat);
@@ -2797,7 +2797,7 @@ int Resize(TransInfo *t, const int mval[2])
/* evil hack - redo resize if cliping needed */
if (t->flag & T_CLIP_UV && clipUVTransform(t, size, 1)) {
- size_to_mat3( mat,size);
+ size_to_mat3(mat, size);
if (t->con.applySize)
t->con.applySize(t, NULL, mat);
@@ -2966,14 +2966,14 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
add_v3_v3v3(td->loc, vec, center);
- sub_v3_v3v3(vec,td->loc,td->iloc);
+ sub_v3_v3v3(vec, td->loc, td->iloc);
protectedTransBits(td->protectflag, vec);
add_v3_v3v3(td->loc, td->iloc, vec);
if (td->flag & TD_USEQUAT) {
mul_serie_m3(fmat, td->mtx, mat, td->smtx, NULL, NULL, NULL, NULL, NULL);
- mat3_to_quat( quat,fmat); // Actual transform
+ mat3_to_quat(quat, fmat); // Actual transform
if (td->ext->quat) {
mul_qt_qtqt(td->ext->quat, quat, td->ext->iquat);
@@ -3040,7 +3040,7 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
if (td->ext->rotOrder == ROT_MODE_QUAT) {
mul_serie_m3(fmat, td->mtx, mat, td->smtx, NULL, NULL, NULL, NULL, NULL);
- mat3_to_quat( quat,fmat); // Actual transform
+ mat3_to_quat(quat, fmat); // Actual transform
mul_qt_qtqt(td->ext->quat, quat, td->ext->iquat);
/* this function works on end result */
@@ -3054,10 +3054,10 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
axis_angle_to_quat(iquat, td->ext->irotAxis, td->ext->irotAngle);
mul_serie_m3(fmat, td->mtx, mat, td->smtx, NULL, NULL, NULL, NULL, NULL);
- mat3_to_quat( quat,fmat); // Actual transform
+ mat3_to_quat(quat, fmat); // Actual transform
mul_qt_qtqt(tquat, quat, iquat);
- quat_to_axis_angle( td->ext->rotAxis, td->ext->rotAngle,tquat);
+ quat_to_axis_angle(td->ext->rotAxis, td->ext->rotAngle, tquat);
/* this function works on end result */
protectedAxisAngleBits(td->protectflag, td->ext->rotAxis, td->ext->rotAngle, td->ext->irotAxis, td->ext->irotAngle);
@@ -3070,12 +3070,12 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
/* calculate the total rotatation in eulers */
copy_v3_v3(eul, td->ext->irot);
- eulO_to_mat3( eulmat,eul, td->ext->rotOrder);
+ eulO_to_mat3(eulmat, eul, td->ext->rotOrder);
/* mat = transform, obmat = bone rotation */
mul_m3_m3m3(fmat, smat, eulmat);
- mat3_to_compatible_eulO( eul, td->ext->rot, td->ext->rotOrder,fmat);
+ mat3_to_compatible_eulO(eul, td->ext->rot, td->ext->rotOrder, fmat);
/* and apply (to end result only) */
protectedRotateBits(td->protectflag, eul, td->ext->irot);
@@ -3108,7 +3108,7 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
/* euler or quaternion? */
if ((td->ext->rotOrder == ROT_MODE_QUAT) || (td->flag & TD_USEQUAT)) {
mul_serie_m3(fmat, td->mtx, mat, td->smtx, NULL, NULL, NULL, NULL, NULL);
- mat3_to_quat( quat,fmat); // Actual transform
+ mat3_to_quat(quat, fmat); // Actual transform
mul_qt_qtqt(td->ext->quat, quat, td->ext->iquat);
/* this function works on end result */
@@ -3121,10 +3121,10 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
axis_angle_to_quat(iquat, td->ext->irotAxis, td->ext->irotAngle);
mul_serie_m3(fmat, td->mtx, mat, td->smtx, NULL, NULL, NULL, NULL, NULL);
- mat3_to_quat( quat,fmat); // Actual transform
+ mat3_to_quat(quat, fmat); // Actual transform
mul_qt_qtqt(tquat, quat, iquat);
- quat_to_axis_angle( td->ext->rotAxis, td->ext->rotAngle,tquat);
+ quat_to_axis_angle(td->ext->rotAxis, td->ext->rotAngle, tquat);
/* this function works on end result */
protectedAxisAngleBits(td->protectflag, td->ext->rotAxis, td->ext->rotAngle, td->ext->irotAxis, td->ext->irotAngle);
@@ -3137,11 +3137,11 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
/* calculate the total rotatation in eulers */
add_v3_v3v3(eul, td->ext->irot, td->ext->drot); /* we have to correct for delta rot */
- eulO_to_mat3( obmat,eul, td->ext->rotOrder);
+ eulO_to_mat3(obmat, eul, td->ext->rotOrder);
/* mat = transform, obmat = object rotation */
mul_m3_m3m3(fmat, smat, obmat);
- mat3_to_compatible_eulO( eul, td->ext->rot, td->ext->rotOrder,fmat);
+ mat3_to_compatible_eulO(eul, td->ext->rot, td->ext->rotOrder, fmat);
/* correct back for delta rot */
sub_v3_v3v3(eul, eul, td->ext->drot);
@@ -3162,7 +3162,7 @@ static void applyRotation(TransInfo *t, float angle, float axis[3])
float mat[3][3];
int i;
- vec_rot_to_mat3( mat,axis, angle);
+ vec_rot_to_mat3(mat, axis, angle);
for (i = 0 ; i < t->total; i++, td++) {
@@ -3174,10 +3174,10 @@ static void applyRotation(TransInfo *t, float angle, float axis[3])
if (t->con.applyRot) {
t->con.applyRot(t, td, axis, NULL);
- vec_rot_to_mat3( mat,axis, angle * td->factor);
+ vec_rot_to_mat3(mat, axis, angle * td->factor);
}
else if (t->flag & T_PROP_EDIT) {
- vec_rot_to_mat3( mat,axis, angle * td->factor);
+ vec_rot_to_mat3(mat, axis, angle * td->factor);
}
ElementRotation(t, td, mat, t->around);
@@ -3263,8 +3263,8 @@ static void applyTrackball(TransInfo *t, float axis1[3], float axis2[3], float a
float mat[3][3], smat[3][3], totmat[3][3];
int i;
- vec_rot_to_mat3( smat,axis1, angles[0]);
- vec_rot_to_mat3( totmat,axis2, angles[1]);
+ vec_rot_to_mat3(smat, axis1, angles[0]);
+ vec_rot_to_mat3(totmat, axis2, angles[1]);
mul_m3_m3m3(mat, smat, totmat);
@@ -3276,8 +3276,8 @@ static void applyTrackball(TransInfo *t, float axis1[3], float axis2[3], float a
continue;
if (t->flag & T_PROP_EDIT) {
- vec_rot_to_mat3( smat,axis1, td->factor * angles[0]);
- vec_rot_to_mat3( totmat,axis2, td->factor * angles[1]);
+ vec_rot_to_mat3(smat, axis1, td->factor * angles[0]);
+ vec_rot_to_mat3(totmat, axis2, td->factor * angles[1]);
mul_m3_m3m3(mat, smat, totmat);
}
@@ -3324,8 +3324,8 @@ int Trackball(TransInfo *t, const int UNUSED(mval[2]))
}
(void)spos;
- vec_rot_to_mat3( smat,axis1, phi[0]);
- vec_rot_to_mat3( totmat,axis2, phi[1]);
+ vec_rot_to_mat3(smat, axis1, phi[0]);
+ vec_rot_to_mat3(totmat, axis2, phi[1]);
mul_m3_m3m3(mat, smat, totmat);
@@ -3483,7 +3483,7 @@ static void applyTranslation(TransInfo *t, float vec[3])
axis_angle_to_quat(quat, axis, angle);
- quat_to_mat3( mat,quat);
+ quat_to_mat3(mat, quat);
ElementRotation(t, td, mat, V3D_LOCAL);
}
@@ -3924,7 +3924,7 @@ int handleEventBevel(TransInfo *t, wmEvent *event)
int Bevel(TransInfo *t, const int UNUSED(mval[2]))
{
- float distance,d;
+ float distance, d;
int i;
char str[128];
const char *mode;
@@ -4177,9 +4177,9 @@ static void ElementBoneSize(TransInfo *t, TransData *td, float mat[3][3])
/* we've tucked the scale in loc */
oldy= td->iloc[1];
- size_to_mat3( sizemat,td->iloc);
+ size_to_mat3(sizemat, td->iloc);
mul_m3_m3m3(tmat, tmat, sizemat);
- mat3_to_size( td->loc,tmat);
+ mat3_to_size(td->loc, tmat);
td->loc[1]= oldy;
}
@@ -4209,7 +4209,7 @@ int BoneSize(TransInfo *t, const int mval[2])
constraintNumInput(t, size);
}
- size_to_mat3( mat,size);
+ size_to_mat3(mat, size);
if (t->con.applySize) {
t->con.applySize(t, NULL, mat);
@@ -4861,7 +4861,7 @@ void freeSlideVerts(TransInfo *t)
LinkNode *look = sld->vertlist;
GHash *vertgh = sld->vhash;
while (look) {
- sv = BLI_ghash_lookup(vertgh,(EditVert*)look->link);
+ sv = BLI_ghash_lookup(vertgh, (EditVert*)look->link);
if (sv != NULL) {
sv->up->f &= !SELECT;
sv->down->f &= !SELECT;
@@ -5167,7 +5167,7 @@ int Mirror(TransInfo *t, const int UNUSED(mval[2]))
if (t->con.mode & CON_APPLY) {
size[0] = size[1] = size[2] = -1;
- size_to_mat3( mat,size);
+ size_to_mat3(mat, size);
if (t->con.applySize) {
t->con.applySize(t, NULL, mat);
@@ -5192,7 +5192,7 @@ int Mirror(TransInfo *t, const int UNUSED(mval[2]))
else {
size[0] = size[1] = size[2] = 1;
- size_to_mat3( mat,size);
+ size_to_mat3(mat, size);
for (i = 0, td=t->data; i < t->total; i++, td++) {
if (td->flag & TD_NOACTION)
@@ -5460,7 +5460,7 @@ static void doAnimEdit_SnapFrame(TransInfo *t, TransData *td, TransData2D *td2d,
/* do the snapping to nearest frame/second */
if (doTime) {
- val= (float)( floor((val/secf) + 0.5f) * secf );
+ val= (float)(floor((val/secf) + 0.5f) * secf);
}
else
#endif
@@ -5599,9 +5599,9 @@ static void applyTimeTranslate(TransInfo *t, float UNUSED(sval))
if (autosnap == SACTSNAP_STEP) {
if (doTime)
- deltax= (float)( floor((deltax/secf) + 0.5f) * secf );
+ deltax= (float)(floor((deltax/secf) + 0.5f) * secf);
else
- deltax= (float)( floor(deltax + 0.5f) );
+ deltax= (float)(floor(deltax + 0.5f));
}
val = BKE_nla_tweakedit_remap(adt, td->ival, NLATIME_CONVERT_MAP);
@@ -5613,9 +5613,9 @@ static void applyTimeTranslate(TransInfo *t, float UNUSED(sval))
if (autosnap == SACTSNAP_STEP) {
if (doTime)
- val= (float)( floor((deltax/secf) + 0.5f) * secf );
+ val= (float)(floor((deltax/secf) + 0.5f) * secf);
else
- val= (float)( floor(val + 0.5f) );
+ val= (float)(floor(val + 0.5f));
}
*(td->val) = td->ival + val;
@@ -5865,9 +5865,9 @@ static void applyTimeScale(TransInfo *t)
if (autosnap == SACTSNAP_STEP) {
if (doTime)
- fac= (float)( floor(fac/secf + 0.5f) * secf );
+ fac= (float)(floor(fac/secf + 0.5f) * secf);
else
- fac= (float)( floor(fac + 0.5f) );
+ fac= (float)(floor(fac + 0.5f));
}
/* check if any need to apply nla-mapping */
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h
index 0bef33149d7..69af8cf2489 100644
--- a/source/blender/editors/transform/transform.h
+++ b/source/blender/editors/transform/transform.h
@@ -68,7 +68,7 @@ struct ReportList;
struct SmallHash;
typedef struct TransSnapPoint {
- struct TransSnapPoint *next,*prev;
+ struct TransSnapPoint *next, *prev;
float co[3];
} TransSnapPoint;
diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c
index ebded7b0a6e..b18d132f8df 100644
--- a/source/blender/editors/transform/transform_constraints.c
+++ b/source/blender/editors/transform/transform_constraints.c
@@ -664,7 +664,7 @@ void drawConstraint(TransInfo *t)
else {
if (tc->mode & CON_SELECT) {
float vec[3];
- char col2[3] = {255,255,255};
+ char col2[3] = {255, 255, 255};
int depth_test_enabled;
convertViewVec(t, vec, (t->mval[0] - t->con.imval[0]), (t->mval[1] - t->con.imval[1]));
@@ -767,7 +767,7 @@ static void drawObjectConstraint(TransInfo *t)
td++;
- for (i=1;i<t->total;i++,td++) {
+ for (i=1; i < t->total; i++, td++) {
if (t->con.mode & CON_AXIS0) {
drawLine(t, td->ob->obmat[3], td->axismtx[0], 'X', 0);
}
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index c4edeefa598..d38d3917177 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -266,7 +266,7 @@ static void createTransTexspace(TransInfo *t)
}
id = ob->data;
- if (id == NULL || !ELEM3( GS(id->name), ID_ME, ID_CU, ID_MB )) {
+ if (id == NULL || !ELEM3(GS(id->name), ID_ME, ID_CU, ID_MB )) {
t->total = 0;
return;
}
@@ -418,7 +418,7 @@ static short apply_targetless_ik(Object *ob)
/* pose_mat(b) = pose_mat(b-1) * offs_bone * channel * constraint * IK */
/* we put in channel the entire result of rmat= (channel * constraint * IK) */
/* pose_mat(b) = pose_mat(b-1) * offs_bone * rmat */
- /* rmat = pose_mat(b) * inv( pose_mat(b-1) * offs_bone ) */
+ /* rmat = pose_mat(b) * inv(pose_mat(b-1) * offs_bone ) */
parchan= chanlist[segcount-1];
bone= parchan->bone;
@@ -439,25 +439,25 @@ static short apply_targetless_ik(Object *ob)
* and applied poses.
*/
if (parchan->rotmode > 0)
- mat3_to_eulO(parchan->eul, parchan->rotmode,rmat3);
+ mat3_to_eulO(parchan->eul, parchan->rotmode, rmat3);
else if (parchan->rotmode == ROT_MODE_AXISANGLE)
- mat3_to_axis_angle(parchan->rotAxis, &parchan->rotAngle,rmat3);
+ mat3_to_axis_angle(parchan->rotAxis, &parchan->rotAngle, rmat3);
else
- mat3_to_quat(parchan->quat,rmat3);
+ mat3_to_quat(parchan->quat, rmat3);
/* for size, remove rotation */
/* causes problems with some constraints (so apply only if needed) */
if (data->flag & CONSTRAINT_IK_STRETCH) {
if (parchan->rotmode > 0)
- eulO_to_mat3( qrmat,parchan->eul, parchan->rotmode);
+ eulO_to_mat3(qrmat, parchan->eul, parchan->rotmode);
else if (parchan->rotmode == ROT_MODE_AXISANGLE)
- axis_angle_to_mat3( qrmat,parchan->rotAxis, parchan->rotAngle);
+ axis_angle_to_mat3(qrmat, parchan->rotAxis, parchan->rotAngle);
else
- quat_to_mat3( qrmat,parchan->quat);
+ quat_to_mat3(qrmat, parchan->quat);
invert_m3_m3(imat3, qrmat);
mul_m3_m3m3(smat, rmat3, imat3);
- mat3_to_size( parchan->size,smat);
+ mat3_to_size(parchan->size, smat);
}
/* causes problems with some constraints (e.g. childof), so disable this */
@@ -548,10 +548,10 @@ static void add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, Tr
if (constraints_list_needinv(t, &pchan->constraints)) {
copy_m3_m4(tmat, pchan->constinv);
invert_m3_m3(cmat, tmat);
- mul_serie_m3(td->mtx, pmat, omat, cmat, NULL,NULL,NULL,NULL,NULL);
+ mul_serie_m3(td->mtx, pmat, omat, cmat, NULL, NULL, NULL, NULL, NULL);
}
else
- mul_serie_m3(td->mtx, pmat, omat, NULL, NULL,NULL,NULL,NULL,NULL);
+ mul_serie_m3(td->mtx, pmat, omat, NULL, NULL, NULL, NULL, NULL, NULL);
}
invert_m3_m3(td->smtx, td->mtx);
@@ -681,7 +681,7 @@ int count_set_pose_transflags(int *out_mode, short around, Object *ob)
total++;
if (mode == TFM_TRANSLATION) {
- if ( has_targetless_ik(pchan)==NULL ) {
+ if (has_targetless_ik(pchan) == NULL) {
if (pchan->parent && (pchan->bone->flag & BONE_CONNECTED)) {
if (pchan->bone->flag & BONE_HINGE_CHILD_TRANSFORM)
hastranslation = 1;
@@ -1616,7 +1616,7 @@ static void createTransParticleVerts(bContext *C, TransInfo *t)
PTCacheEditPoint *point;
PTCacheEditKey *key;
float mat[4][4];
- int i,k, transformparticle;
+ int i, k, transformparticle;
int count = 0, hasselected = 0;
int propmode = t->flag & T_PROP_EDIT;
@@ -1625,7 +1625,7 @@ static void createTransParticleVerts(bContext *C, TransInfo *t)
psys = edit->psys;
if (psys)
- psmd = psys_get_modifier(ob,psys);
+ psmd = psys_get_modifier(ob, psys);
base->flag |= BA_HAS_RECALC_DATA;
@@ -1665,7 +1665,7 @@ static void createTransParticleVerts(bContext *C, TransInfo *t)
unit_m4(mat);
- invert_m4_m4(ob->imat,ob->obmat);
+ invert_m4_m4(ob->imat, ob->obmat);
for (i=0, point=edit->points; i<edit->totpoint; i++, point++) {
TransData *head, *tail;
@@ -1748,7 +1748,7 @@ void flushTransParticles(TransInfo *t)
if (psys && !(psys->flag & PSYS_GLOBAL_HAIR)) {
psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, psys->particles + i, mat);
- invert_m4_m4(imat,mat);
+ invert_m4_m4(imat, mat);
for (k=0, key=point->keys; k<point->totkey; k++, key++) {
copy_v3_v3(co, key->world_co);
@@ -2055,7 +2055,7 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
* the modifiers that support deform matrices (defcos) */
if (totleft > 0) {
mappedcos= crazyspace_get_mapped_editverts(t->scene, t->obedit);
- quats= MEM_mallocN( (t->total)*sizeof(float)*4, "crazy quats");
+ quats= MEM_mallocN((t->total)*sizeof(float)*4, "crazy quats");
crazyspace_set_quats_editmesh(em, (float*)defcos, mappedcos, quats); /* BMESH_TODO, abuses vertex index, should use an int array */
if (mappedcos)
MEM_freeN(mappedcos);
@@ -2133,7 +2133,7 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
}
/* Mirror? */
- if ( (mirror>0 && tob->iloc[0]>0.0f) || (mirror<0 && tob->iloc[0]<0.0f)) {
+ if ((mirror>0 && tob->iloc[0]>0.0f) || (mirror<0 && tob->iloc[0]<0.0f)) {
BMVert *vmir= EDBM_verts_mirror_get(em, eve); //t->obedit, em, eve, tob->iloc, a);
if (vmir && vmir != eve) {
tob->extra = vmir;
@@ -2147,7 +2147,7 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
if (mirror != 0)
{
tob = t->data;
- for ( a = 0; a < t->total; a++, tob++ )
+ for (a = 0; a < t->total; a++, tob++ )
{
if (ABS(tob->loc[0]) <= 0.00001f)
{
@@ -2294,7 +2294,7 @@ void flushTransSeq(TransInfo *t)
if (seq->depth==0) {
/* test overlap, displayes red outline */
seq->flag &= ~SEQ_OVERLAP;
- if ( seq_test_overlap(seqbasep, seq) ) {
+ if (seq_test_overlap(seqbasep, seq)) {
seq->flag |= SEQ_OVERLAP;
}
}
@@ -2994,7 +2994,7 @@ void flushTransGPactionData (TransInfo *t)
/* find the first one to start from */
if (t->mode == TFM_TIME_SLIDE)
- tfd= (tGPFtransdata *)( (float *)(t->customData) + 2 );
+ tfd= (tGPFtransdata *)((float *)(t->customData) + 2);
else
tfd= (tGPFtransdata *)(t->customData);
@@ -3113,7 +3113,7 @@ static void createTransActionData(bContext *C, TransInfo *t)
if (ac.datatype == ANIMCONT_GPENCIL) {
if (t->mode == TFM_TIME_SLIDE) {
t->customData= MEM_callocN((sizeof(float)*2)+(sizeof(tGPFtransdata)*count), "TimeSlide + tGPFtransdata");
- tfd= (tGPFtransdata *)( (float *)(t->customData) + 2 );
+ tfd= (tGPFtransdata *)((float *)(t->customData) + 2);
}
else {
t->customData= MEM_callocN(sizeof(tGPFtransdata)*count, "tGPFtransdata");
@@ -3468,9 +3468,9 @@ static void createTransGraphEditData(bContext *C, TransInfo *t)
* then check if we're using auto-handles.
* - If so, change them auto-handles to aligned handles so that handles get affected too
*/
- if ( ELEM(bezt->h1, HD_AUTO, HD_AUTO_ANIM) &&
- ELEM(bezt->h2, HD_AUTO, HD_AUTO_ANIM) &&
- ELEM(t->mode, TFM_ROTATION, TFM_RESIZE))
+ if (ELEM(bezt->h1, HD_AUTO, HD_AUTO_ANIM) &&
+ ELEM(bezt->h2, HD_AUTO, HD_AUTO_ANIM) &&
+ ELEM(t->mode, TFM_ROTATION, TFM_RESIZE))
{
if (hdata && (sel1) && (sel3)) {
bezt->h1= HD_ALIGN;
@@ -3559,8 +3559,8 @@ static void sort_time_beztmaps (BeztMap *bezms, int totvert, const short UNUSED(
* optimization: this only needs to be performed in the first loop
*/
if (bezm->swapHs == 0) {
- if ( (bezm->bezt->vec[0][0] > bezm->bezt->vec[1][0]) &&
- (bezm->bezt->vec[2][0] < bezm->bezt->vec[1][0]) )
+ if ((bezm->bezt->vec[0][0] > bezm->bezt->vec[1][0]) &&
+ (bezm->bezt->vec[2][0] < bezm->bezt->vec[1][0]) )
{
/* handles need to be swapped */
bezm->swapHs = 1;
@@ -3714,9 +3714,9 @@ void flushTransGraphData(TransInfo *t)
switch (sipo->autosnap) {
case SACTSNAP_FRAME: /* snap to nearest frame (or second if drawing seconds) */
if (sipo->flag & SIPO_DRAWTIME)
- td2d->loc[0]= (float)( floor((td2d->loc[0]/secf) + 0.5f) * secf );
+ td2d->loc[0]= (float)(floor((td2d->loc[0]/secf) + 0.5f) * secf);
else
- td2d->loc[0]= (float)( floor(td2d->loc[0]+0.5f) );
+ td2d->loc[0]= (float)(floor(td2d->loc[0]+0.5f));
break;
case SACTSNAP_MARKER: /* snap to nearest marker */
@@ -3879,7 +3879,7 @@ static int SeqTransCount(TransInfo *t, Sequence *parent, ListBase *seqbase, int
for (seq= seqbase->first; seq; seq= seq->next) {
seq->depth= depth;
- /* seq->tmp is used by seq_tx_get_final_{left,right} to check sequence's range and clamp to it if needed.
+ /* seq->tmp is used by seq_tx_get_final_{left, right} to check sequence's range and clamp to it if needed.
* it's first place where digging into sequences tree, so store link to parent here */
seq->tmp = parent;
@@ -4173,9 +4173,9 @@ static void createTransSeqData(bContext *C, TransInfo *t)
int i;
for (i=0; i<3; i++) {
seq_user= *((&seq->seq1) + i);
- if ( seq_user && (seq_user->flag & SELECT) &&
- !(seq_user->flag & SEQ_LOCK) &&
- !(seq_user->flag & (SEQ_LEFTSEL|SEQ_RIGHTSEL)))
+ if (seq_user && (seq_user->flag & SELECT) &&
+ !(seq_user->flag & SEQ_LOCK) &&
+ !(seq_user->flag & (SEQ_LEFTSEL|SEQ_RIGHTSEL)))
{
seq->flag |= SELECT;
}
@@ -4473,8 +4473,8 @@ static int count_proportional_objects(TransInfo *t)
/* mark all children */
for (base= scene->base.first; base; base= base->next) {
/* all base not already selected or marked that is editable */
- if ( (base->object->flag & (SELECT|BA_TRANSFORM_CHILD|BA_TRANSFORM_PARENT)) == 0 &&
- (BASE_EDITABLE_BGMODE(v3d, scene, base)))
+ if ((base->object->flag & (SELECT|BA_TRANSFORM_CHILD|BA_TRANSFORM_PARENT)) == 0 &&
+ (BASE_EDITABLE_BGMODE(v3d, scene, base)))
{
mark_children(base->object);
}
@@ -4485,8 +4485,8 @@ static int count_proportional_objects(TransInfo *t)
Object *ob= base->object;
/* if base is not selected, not a parent of selection or not a child of selection and it is editable */
- if ( (ob->flag & (SELECT|BA_TRANSFORM_CHILD|BA_TRANSFORM_PARENT)) == 0 &&
- (BASE_EDITABLE_BGMODE(v3d, scene, base)))
+ if ((ob->flag & (SELECT|BA_TRANSFORM_CHILD|BA_TRANSFORM_PARENT)) == 0 &&
+ (BASE_EDITABLE_BGMODE(v3d, scene, base)))
{
/* used for flush, depgraph will change recalcs if needed :) */
@@ -4877,8 +4877,8 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
* 2) canceled == 0 -> user confirmed the transform, so duplicates should be removed
* 3) canceled + duplicate -> user canceled the transform, but we made duplicates, so get rid of these
*/
- if ( (saction->flag & SACTION_NOTRANSKEYCULL)==0 &&
- ((canceled == 0) || (duplicate)) )
+ if ((saction->flag & SACTION_NOTRANSKEYCULL)==0 &&
+ ((canceled == 0) || (duplicate)) )
{
if (adt) {
ANIM_nla_mapping_apply_fcurve(adt, fcu, 0, 1);
@@ -4908,8 +4908,8 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
* 2) canceled == 0 -> user confirmed the transform, so duplicates should be removed
* 3) canceled + duplicate -> user canceled the transform, but we made duplicates, so get rid of these
*/
- if ( (saction->flag & SACTION_NOTRANSKEYCULL)==0 &&
- ((canceled == 0) || (duplicate)) )
+ if ((saction->flag & SACTION_NOTRANSKEYCULL)==0 &&
+ ((canceled == 0) || (duplicate)))
{
posttrans_action_clean(&ac, (bAction *)ac.data);
}
@@ -4921,8 +4921,8 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
* 2) canceled == 0 -> user confirmed the transform, so duplicates should be removed
* 3) canceled + duplicate -> user canceled the transform, but we made duplicates, so get rid of these
*/
- if ( (saction->flag & SACTION_NOTRANSKEYCULL)==0 &&
- ((canceled == 0) || (duplicate)) )
+ if ((saction->flag & SACTION_NOTRANSKEYCULL)==0 &&
+ ((canceled == 0) || (duplicate)))
{
bGPdata *gpd;
@@ -4989,8 +4989,8 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
* 2) canceled == 0 -> user confirmed the transform, so duplicates should be removed
* 3) canceled + duplicate -> user canceled the transform, but we made duplicates, so get rid of these
*/
- if ( (sipo->flag & SIPO_NOTRANSKEYCULL)==0 &&
- ((canceled == 0) || (duplicate)) )
+ if ((sipo->flag & SIPO_NOTRANSKEYCULL)==0 &&
+ ((canceled == 0) || (duplicate)))
{
if (adt) {
ANIM_nla_mapping_apply_fcurve(adt, fcu, 0, 0);
@@ -5101,10 +5101,10 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
}
- else if ( (t->scene->basact) &&
- (ob = t->scene->basact->object) &&
- (ob->mode & OB_MODE_PARTICLE_EDIT) &&
- PE_get_current(t->scene, ob))
+ else if ((t->scene->basact) &&
+ (ob = t->scene->basact->object) &&
+ (ob->mode & OB_MODE_PARTICLE_EDIT) &&
+ PE_get_current(t->scene, ob))
{
/* do nothing */
}
diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c
index f8a982c6b71..f15397f1fd6 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -297,7 +297,7 @@ int calc_manipulator_stats(const bContext *C)
if (obedit->type==OB_MESH) {
BMEditMesh *em = BMEdit_FromObject(obedit);
BMEditSelection ese;
- float vec[3]= {0,0,0};
+ float vec[3]= {0, 0, 0};
/* USE LAST SELECTE WITH ACTIVE */
if ((v3d->around == V3D_ACTIVE) && BM_select_history_active_get(em->bm, &ese)) {
@@ -508,7 +508,7 @@ int calc_manipulator_stats(const bContext *C)
if (edit) {
point = edit->points;
- for (a=0; a<edit->totpoint; a++,point++) {
+ for (a=0; a<edit->totpoint; a++, point++) {
if (point->flag & PEP_HIDE) continue;
for (k=0, ek=point->keys; k<point->totkey; k++, ek++) {
@@ -1512,7 +1512,7 @@ void BIF_draw_manipulator(const bContext *C)
if (v3d->twflag & V3D_DRAW_MANIPULATOR) {
- glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
if (v3d->twtype & V3D_MANIP_ROTATE) {
diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c
index b9ae3180591..83d4a5dfa6e 100644
--- a/source/blender/editors/transform/transform_ops.c
+++ b/source/blender/editors/transform/transform_ops.c
@@ -145,7 +145,7 @@ static int snap_type_exec(bContext *C, wmOperator *op)
{
ToolSettings *ts= CTX_data_tool_settings(C);
- ts->snap_mode = RNA_enum_get(op->ptr,"type");
+ ts->snap_mode = RNA_enum_get(op->ptr, "type");
WM_event_add_notifier(C, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c
index db974626b14..2b8c03a56ae 100644
--- a/source/blender/editors/transform/transform_orientations.c
+++ b/source/blender/editors/transform/transform_orientations.c
@@ -573,7 +573,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
BMEditMesh *em = me->edit_btmesh;
BMVert *eve;
BMEditSelection ese;
- float vec[3]= {0,0,0};
+ float vec[3]= {0, 0, 0};
/* USE LAST SELECTED WITH ACTIVE */
if (activeOnly && BM_select_history_active_get(em->bm, &ese)) {
@@ -769,7 +769,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
float mat[4][4];
/* Rotation of MetaElem is stored in quat */
- quat_to_mat4( mat,ml_sel->quat);
+ quat_to_mat4( mat, ml_sel->quat);
copy_v3_v3(normal, mat[2]);
diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c
index 0a5613bca22..a24679878bc 100644
--- a/source/blender/editors/transform/transform_snap.c
+++ b/source/blender/editors/transform/transform_snap.c
@@ -216,7 +216,7 @@ void drawSnapping(const struct bContext *C, TransInfo *t)
cpack(0xFFFFFF);
glTranslatef(t->tsnap.snapPoint[0], t->tsnap.snapPoint[1], 0.0f);
- //glRectf(0,0,1,1);
+ //glRectf(0, 0, 1, 1);
setlinestyle(0);
cpack(0x0);
@@ -700,7 +700,7 @@ static float RotationBetween(TransInfo *t, float p1[3], float p2[3])
mul_m3_v3(mtx, end);
mul_m3_v3(mtx, start);
- angle = atan2(start[1],start[0]) - atan2(end[1],end[0]);
+ angle = atan2(start[1], start[0]) - atan2(end[1], end[0]);
}
if (angle > (float)M_PI) {
@@ -1055,9 +1055,9 @@ static int snapFace(ARegion *ar, float v1co[3], float v2co[3], float v3co[3], fl
copy_v3_v3(location, intersect);
if (v4co)
- normal_quad_v3( normal,v1co, v2co, v3co, v4co);
+ normal_quad_v3(normal, v1co, v2co, v3co, v4co);
else
- normal_tri_v3( normal,v1co, v2co, v3co);
+ normal_tri_v3(normal, v1co, v2co, v3co);
mul_m4_v3(obmat, location);
@@ -1738,9 +1738,9 @@ static int peelDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4],
copy_v3_v3(location, intersect);
if (f->v4)
- normal_quad_v3( normal,verts[f->v1].co, verts[f->v2].co, verts[f->v3].co, verts[f->v4].co);
+ normal_quad_v3(normal, verts[f->v1].co, verts[f->v2].co, verts[f->v3].co, verts[f->v4].co);
else
- normal_tri_v3( normal,verts[f->v1].co, verts[f->v2].co, verts[f->v3].co);
+ normal_tri_v3(normal, verts[f->v1].co, verts[f->v2].co, verts[f->v3].co);
mul_m4_v3(obmat, location);
@@ -1767,13 +1767,13 @@ static int peelDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4],
copy_v3_v3(location, intersect);
if (f->v4)
- normal_quad_v3( normal,verts[f->v1].co, verts[f->v2].co, verts[f->v3].co, verts[f->v4].co);
+ normal_quad_v3(normal, verts[f->v1].co, verts[f->v2].co, verts[f->v3].co, verts[f->v4].co);
else
- normal_tri_v3( normal,verts[f->v1].co, verts[f->v2].co, verts[f->v3].co);
+ normal_tri_v3(normal, verts[f->v1].co, verts[f->v2].co, verts[f->v3].co);
mul_m4_v3(obmat, location);
- new_depth = len_v3v3(location, ray_start);
+ new_depth = len_v3v3(location, ray_start);
mul_m3_v3(timat, normal);
normalize_v3(normal);