[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [42492] trunk/blender/source/blender/ editors/space_view3d/view3d_snap.c: Grumpf. Stupid usual copy&paste mistake in a comment, no functional changes.
Bastien Montagne
montagne29 at wanadoo.fr
Wed Dec 7 17:21:09 CET 2011
Revision: 42492
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42492
Author: mont29
Date: 2011-12-07 16:21:01 +0000 (Wed, 07 Dec 2011)
Log Message:
-----------
Grumpf. Stupid usual copy&paste mistake in a comment, no functional changes.
Not that important, but let's stay consistent! And as I was at it, I also cleared some dummy trailing white spaces...
Modified Paths:
--------------
trunk/blender/source/blender/editors/space_view3d/view3d_snap.c
Modified: trunk/blender/source/blender/editors/space_view3d/view3d_snap.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/view3d_snap.c 2011-12-07 15:55:37 UTC (rev 42491)
+++ trunk/blender/source/blender/editors/space_view3d/view3d_snap.c 2011-12-07 16:21:01 UTC (rev 42492)
@@ -91,9 +91,7 @@
/* copied from editobject.c, now uses (almost) proper depgraph */
static void special_transvert_update(Object *obedit)
{
-
if(obedit) {
-
DAG_id_tag_update(obedit->data, 0);
if(obedit->type==OB_MESH) {
@@ -177,7 +175,7 @@
}
}
}
- if(arm->flag & ARM_MIRROR_EDIT)
+ if(arm->flag & ARM_MIRROR_EDIT)
transform_armature_mirror_update(obedit);
}
else if(obedit->type==OB_LATTICE) {
@@ -193,7 +191,7 @@
/* mode flags: */
#define TM_ALL_JOINTS 1 /* all joints (for bones only) */
#define TM_SKIP_HANDLES 2 /* skip handles when control point is selected (for curves only) */
-static void make_trans_verts(Object *obedit, float *min, float *max, int mode)
+static void make_trans_verts(Object *obedit, float *min, float *max, int mode)
{
Nurb *nu;
BezTriple *bezt;
@@ -278,7 +276,7 @@
if ((tipsel && rootsel) || (rootsel)) {
/* Don't add the tip (unless mode & TM_ALL_JOINTS, for getting all joints),
* otherwise we get zero-length bones as tips will snap to the same
- * location as heads.
+ * location as heads.
*/
if (rootok) {
copy_v3_v3(tv->oldloc, ebo->head);
@@ -296,7 +294,7 @@
tv->flag= 1;
tv++;
tottrans++;
- }
+ }
}
else if (tipsel) {
copy_v3_v3(tv->oldloc, ebo->tail);
@@ -306,7 +304,7 @@
tv++;
tottrans++;
}
- }
+ }
}
}
else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) {
@@ -465,7 +463,7 @@
if(obedit) {
tottrans= 0;
- if ELEM6(obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE, OB_MBALL)
+ if ELEM6(obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE, OB_MBALL)
make_trans_verts(obedit, bmat[0], bmat[1], 0);
if(tottrans==0) return OPERATOR_CANCELLED;
@@ -474,7 +472,6 @@
tv= transvmain;
for(a=0; a<tottrans; a++, tv++) {
-
copy_v3_v3(vec, tv->loc);
mul_m3_v3(bmat, vec);
add_v3_v3(vec, obedit->obmat[3]);
@@ -491,7 +488,6 @@
MEM_freeN(transvmain);
transvmain= NULL;
-
}
else {
struct KeyingSet *ks = ANIM_get_keyingset_for_autokeying(scene, ANIM_KS_LOCATION_ID);
@@ -506,8 +502,8 @@
for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
if(pchan->bone->flag & BONE_SELECTED) {
if(pchan->bone->layer & arm->layer) {
- if((pchan->bone->flag & BONE_CONNECTED)==0) {
- float nLoc[3];
+ if((pchan->bone->flag & BONE_CONNECTED)==0) {
+ float nLoc[3];
float inv_restmat[4][4];
/* get nearest grid point to snap to */
@@ -520,23 +516,23 @@
/* Back in object space... */
mul_m4_v3(ob->imat, vec);
- /* get location of cursor in *rest* bone-space */
+ /* get location of grid point in *rest* bone-space */
invert_m4_m4(inv_restmat, pchan->bone->arm_mat);
mul_m4_v3(inv_restmat, vec);
/* adjust location */
- if ((pchan->protectflag & OB_LOCK_LOCX)==0)
+ if ((pchan->protectflag & OB_LOCK_LOCX)==0)
pchan->loc[0]= vec[0];
- if ((pchan->protectflag & OB_LOCK_LOCY)==0)
+ if ((pchan->protectflag & OB_LOCK_LOCY)==0)
pchan->loc[1]= vec[1];
- if ((pchan->protectflag & OB_LOCK_LOCZ)==0)
+ if ((pchan->protectflag & OB_LOCK_LOCZ)==0)
pchan->loc[2]= vec[2];
/* auto-keyframing */
ED_autokeyframe_pchan(C, scene, ob, pchan, ks);
}
- /* if the bone has a parent and is connected to the parent,
- * don't do anything - will break chain unless we do auto-ik.
+ /* if the bone has a parent and is connected to the parent,
+ * don't do anything - will break chain unless we do auto-ik.
*/
}
}
@@ -580,7 +576,6 @@
void VIEW3D_OT_snap_selected_to_grid(wmOperatorType *ot)
{
-
/* identifiers */
ot->name= "Snap Selection to Grid";
ot->description= "Snap selected item(s) to nearest grid node";
@@ -611,7 +606,7 @@
if(obedit) {
tottrans= 0;
- if ELEM6(obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE, OB_MBALL)
+ if ELEM6(obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE, OB_MBALL)
make_trans_verts(obedit, bmat[0], bmat[1], 0);
if(tottrans==0) return OPERATOR_CANCELLED;
@@ -629,7 +624,6 @@
MEM_freeN(transvmain);
transvmain= NULL;
-
}
else {
struct KeyingSet *ks = ANIM_get_keyingset_for_autokeying(scene, ANIM_KS_LOCATION_ID);
@@ -646,7 +640,7 @@
for (pchan = ob->pose->chanbase.first; pchan; pchan=pchan->next) {
if(pchan->bone->flag & BONE_SELECTED) {
if(pchan->bone->layer & arm->layer) {
- if((pchan->bone->flag & BONE_CONNECTED)==0) {
+ if((pchan->bone->flag & BONE_CONNECTED)==0) {
float inv_restmat[4][4];
/* get location of cursor in *rest* bone-space */
@@ -664,8 +658,8 @@
/* auto-keyframing */
ED_autokeyframe_pchan(C, scene, ob, pchan, ks);
}
- /* if the bone has a parent and is connected to the parent,
- * don't do anything - will break chain unless we do auto-ik.
+ /* if the bone has a parent and is connected to the parent,
+ * don't do anything - will break chain unless we do auto-ik.
*/
}
}
@@ -709,7 +703,6 @@
void VIEW3D_OT_snap_selected_to_cursor(wmOperatorType *ot)
{
-
/* identifiers */
ot->name= "Snap Selection to Cursor";
ot->description= "Snap selected item(s) to cursor";
@@ -746,7 +739,6 @@
void VIEW3D_OT_snap_cursor_to_grid(wmOperatorType *ot)
{
-
/* identifiers */
ot->name= "Snap Cursor to Grid";
ot->description= "Snap cursor to nearest grid node";
@@ -811,7 +803,7 @@
if(obedit) {
tottrans=0;
- if ELEM6(obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE, OB_MBALL)
+ if ELEM6(obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE, OB_MBALL)
make_trans_verts(obedit, bmat[0], bmat[1], TM_ALL_JOINTS|TM_SKIP_HANDLES);
if(tottrans==0) return OPERATOR_CANCELLED;
@@ -889,10 +881,9 @@
void VIEW3D_OT_snap_cursor_to_selected(wmOperatorType *ot)
{
-
/* identifiers */
ot->name= "Snap Cursor to Selected";
- ot->description= "Snap cursor to center of selected item(s)";
+ ot->description= "Snap cursor to center of selected item(s)";
ot->idname= "VIEW3D_OT_snap_cursor_to_selected";
/* api callbacks */
@@ -940,7 +931,6 @@
void VIEW3D_OT_snap_cursor_to_active(wmOperatorType *ot)
{
-
/* identifiers */
ot->name= "Snap Cursor to Active";
ot->description= "Snap cursor to active item";
@@ -974,13 +964,12 @@
void VIEW3D_OT_snap_cursor_to_center(wmOperatorType *ot)
{
-
/* identifiers */
ot->name= "Snap Cursor to Center";
ot->description= "Snap cursor to the Center";
ot->idname= "VIEW3D_OT_snap_cursor_to_center";
- /* api callbacks */
+ /* api callbacks */
ot->exec= snap_curs_to_center;
ot->poll= ED_operator_view3d_active;
@@ -998,7 +987,7 @@
int a;
tottrans=0;
- if ELEM5(obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE)
+ if ELEM5(obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE)
make_trans_verts(obedit, bmat[0], bmat[1], TM_ALL_JOINTS);
if(tottrans==0) return 0;
@@ -1006,12 +995,12 @@
copy_m3_m4(bmat, obedit->obmat);
tv= transvmain;
- for(a=0; a<tottrans; a++, tv++) {
+ for(a=0; a<tottrans; a++, tv++) {
copy_v3_v3(vec, tv->loc);
mul_m3_v3(bmat, vec);
add_v3_v3(vec, obedit->obmat[3]);
add_v3_v3(centroid, vec);
- DO_MINMAX(vec, min, max);
+ DO_MINMAX(vec, min, max);
}
MEM_freeN(transvmain);
More information about the Bf-blender-cvs
mailing list