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.c40
-rw-r--r--source/blender/editors/transform/transform_convert_action.c4
-rw-r--r--source/blender/editors/transform/transform_convert_armature.c24
-rw-r--r--source/blender/editors/transform/transform_convert_graph.c2
-rw-r--r--source/blender/editors/transform/transform_convert_mesh_edge.c2
-rw-r--r--source/blender/editors/transform/transform_convert_nla.c4
-rw-r--r--source/blender/editors/transform/transform_convert_object.c11
-rw-r--r--source/blender/editors/transform/transform_convert_sequencer.c4
-rw-r--r--source/blender/editors/transform/transform_data.h10
-rw-r--r--source/blender/editors/transform/transform_generics.c10
-rw-r--r--source/blender/editors/transform/transform_gizmo_3d.c8
-rw-r--r--source/blender/editors/transform/transform_mode.c36
-rw-r--r--source/blender/editors/transform/transform_mode_bbone_resize.c2
-rw-r--r--source/blender/editors/transform/transform_mode_resize.c2
-rw-r--r--source/blender/editors/transform/transform_mode_rotate.c2
-rw-r--r--source/blender/editors/transform/transform_mode_shrink_fatten.c2
-rw-r--r--source/blender/editors/transform/transform_mode_timeslide.c2
-rw-r--r--source/blender/editors/transform/transform_mode_tosphere.c2
-rw-r--r--source/blender/editors/transform/transform_mode_trackball.c4
-rw-r--r--source/blender/editors/transform/transform_ops.c10
-rw-r--r--source/blender/editors/transform/transform_snap.c20
21 files changed, 106 insertions, 95 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index e2e7611a6b6..4e08b6b1c5d 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -70,7 +70,7 @@
/* Disabling, since when you type you know what you are doing,
* and being able to set it to zero is handy. */
-// #define USE_NUM_NO_ZERO
+/* #define USE_NUM_NO_ZERO */
static void drawTransformApply(const struct bContext *C, ARegion *region, void *arg);
@@ -269,7 +269,7 @@ void projectIntViewEx(TransInfo *t, const float vec[3], int adr[2], const eV3DPr
SpaceAction *sact = t->area->spacedata.first;
if (sact->flag & SACTION_DRAWTIME) {
- //vec[0] = vec[0]/((t->scene->r.frs_sec / t->scene->r.frs_sec_base));
+ // vec[0] = vec[0] / ((t->scene->r.frs_sec / t->scene->r.frs_sec_base));
/* same as below */
UI_view2d_view_to_region((View2D *)t->view, vec[0], vec[1], &out[0], &out[1]);
}
@@ -447,7 +447,7 @@ static void viewRedrawForce(const bContext *C, TransInfo *t)
}
/* For real-time animation record - send notifiers recognized by animation editors */
- // XXX: is this notifier a lame duck?
+ /* XXX: is this notifier a lame duck? */
if ((t->animtimer) && IS_AUTOKEY_ON(t->scene)) {
WM_event_add_notifier(C, NC_OBJECT | ND_KEYS, NULL);
}
@@ -487,7 +487,7 @@ static void viewRedrawForce(const bContext *C, TransInfo *t)
ED_area_tag_redraw(t->area);
}
else {
- // XXX how to deal with lock?
+ /* XXX how to deal with lock? */
SpaceImage *sima = (SpaceImage *)t->area->spacedata.first;
if (sima->lock) {
WM_event_add_notifier(C, NC_GEOM | ND_DATA, OBEDIT_FROM_VIEW_LAYER(t->view_layer)->data);
@@ -539,7 +539,7 @@ static void viewRedrawPost(bContext *C, TransInfo *t)
WM_event_add_notifier(C, NC_SCENE | ND_TRANSFORM_DONE, CTX_data_scene(C));
}
-#if 0 // TRANSFORM_FIX_ME
+#if 0 /* TRANSFORM_FIX_ME */
if (t->spacetype == SPACE_VIEW3D) {
allqueue(REDRAWBUTSOBJECT, 0);
allqueue(REDRAWVIEW3D, 0);
@@ -814,7 +814,7 @@ int transformEvent(TransInfo *t, const wmEvent *event)
applyMouseInput(t, &t->mouse, t->mval, t->values);
- // Snapping mouse move events
+ /* Snapping mouse move events. */
t->redraw |= handleSnapping(t, event);
handled = true;
}
@@ -854,7 +854,7 @@ int transformEvent(TransInfo *t, const wmEvent *event)
resetTransRestrictions(t);
transform_mode_init(t, NULL, TFM_TRANSLATION);
}
- initSnapping(t, NULL); // need to reinit after mode change
+ initSnapping(t, NULL); /* need to reinit after mode change */
t->redraw |= TREDRAW_HARD;
handled = true;
}
@@ -876,7 +876,7 @@ int transformEvent(TransInfo *t, const wmEvent *event)
resetTransModal(t);
resetTransRestrictions(t);
transform_mode_init(t, NULL, TFM_TRANSLATION);
- initSnapping(t, NULL); // need to reinit after mode change
+ initSnapping(t, NULL); /* need to reinit after mode change */
t->redraw |= TREDRAW_HARD;
handled = true;
}
@@ -895,7 +895,7 @@ int transformEvent(TransInfo *t, const wmEvent *event)
else {
transform_mode_init(t, NULL, TFM_ROTATION);
}
- initSnapping(t, NULL); // need to reinit after mode change
+ initSnapping(t, NULL); /* need to reinit after mode change */
t->redraw |= TREDRAW_HARD;
handled = true;
}
@@ -927,7 +927,7 @@ int transformEvent(TransInfo *t, const wmEvent *event)
resetTransModal(t);
resetTransRestrictions(t);
transform_mode_init(t, NULL, TFM_RESIZE);
- initSnapping(t, NULL); // need to reinit after mode change
+ initSnapping(t, NULL); /* need to reinit after mode change */
t->redraw |= TREDRAW_HARD;
handled = true;
}
@@ -1275,9 +1275,9 @@ bool calculateTransformCenter(bContext *C, int centerMode, float cent3d[3], floa
/* avoid doing connectivity lookups (when V3D_AROUND_LOCAL_ORIGINS is set) */
t->around = V3D_AROUND_CENTER_BOUNDS;
- createTransData(C, t); // make TransData structs from selection
+ createTransData(C, t); /* make TransData structs from selection */
- t->around = centerMode; // override userdefined mode
+ t->around = centerMode; /* override userdefined mode */
if (t->data_len_all == 0) {
success = false;
@@ -1292,7 +1292,7 @@ bool calculateTransformCenter(bContext *C, int centerMode, float cent3d[3], floa
}
if (cent3d) {
- // Copy center from constraint center. Transform center can be local
+ /* Copy center from constraint center. Transform center can be local */
copy_v3_v3(cent3d, t->center_global);
}
}
@@ -1447,7 +1447,7 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op)
t->orient[0].type = V3D_ORIENT_GLOBAL;
}
- // Save back mode in case we're in the generic operator
+ /* Save back mode in case we're in the generic operator */
if ((prop = RNA_struct_find_property(op->ptr, "mode"))) {
RNA_property_enum_set(op->ptr, prop, t->mode);
}
@@ -1475,7 +1475,7 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op)
}
}
- // If modal, save settings back in scene if not set as operator argument
+ /* If modal, save settings back in scene if not set as operator argument */
if ((t->flag & T_MODAL) || (op->flag & OP_IS_REPEAT)) {
/* save settings if not set in operator */
@@ -1753,7 +1753,7 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
SPACE_TYPE_ANY, RGN_TYPE_ANY, transform_draw_cursor_poll, transform_draw_cursor_draw, t);
}
- createTransData(C, t); // make TransData structs from selection
+ createTransData(C, t); /* Make #TransData structs from selection. */
if (t->data_len_all == 0) {
postTrans(C, t);
@@ -1812,7 +1812,7 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
}
}
- initSnapping(t, op); // Initialize snapping data AFTER mode flags
+ initSnapping(t, op); /* Initialize snapping data AFTER mode flags */
initSnapSpatial(t, t->snap_spatial);
@@ -1874,7 +1874,7 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
FOREACH_TRANS_DATA_CONTAINER (t, tc) {
if ((((Mesh *)(tc->obedit->data))->flag & ME_AUTOSMOOTH)) {
- BMEditMesh *em = NULL; // BKE_editmesh_from_object(t->obedit);
+ BMEditMesh *em = NULL; /* BKE_editmesh_from_object(t->obedit); */
bool do_skip = false;
/* Currently only used for two of three most frequent transform ops,
@@ -1916,7 +1916,7 @@ void transformApply(bContext *C, TransInfo *t)
if ((t->redraw & TREDRAW_HARD) || (t->draw_handle_apply == NULL && (t->redraw & TREDRAW_SOFT))) {
selectConstraint(t);
if (t->transform) {
- t->transform(t, t->mval); // calls recalcData()
+ t->transform(t, t->mval); /* calls recalcData() */
viewRedrawForce(C, t);
}
t->redraw = TREDRAW_NOTHING;
@@ -1953,7 +1953,7 @@ int transformEnd(bContext *C, TransInfo *t)
/* handle restoring objects */
if (t->state == TRANS_CANCEL) {
exit_code = OPERATOR_CANCELLED;
- restoreTransObjects(t); // calls recalcData()
+ restoreTransObjects(t); /* calls recalcData() */
}
else {
if (t->flag & T_CLNOR_REBUILD) {
diff --git a/source/blender/editors/transform/transform_convert_action.c b/source/blender/editors/transform/transform_convert_action.c
index 40e60544642..da68f9c13de 100644
--- a/source/blender/editors/transform/transform_convert_action.c
+++ b/source/blender/editors/transform/transform_convert_action.c
@@ -796,9 +796,9 @@ void special_aftertrans_update__actedit(bContext *C, TransInfo *t)
/* free temp memory */
ANIM_animdata_freelist(&anim_data);
}
- else if (ac.datatype == ANIMCONT_ACTION) { // TODO: just integrate into the above...
+ else if (ac.datatype == ANIMCONT_ACTION) { /* TODO: just integrate into the above. */
/* Depending on the lock status, draw necessary views */
- // fixme... some of this stuff is not good
+ /* FIXME: some of this stuff is not good. */
if (ob) {
if (ob->pose || BKE_key_from_object(ob)) {
DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION);
diff --git a/source/blender/editors/transform/transform_convert_armature.c b/source/blender/editors/transform/transform_convert_armature.c
index dd35ed3cbf5..a14ff6c500d 100644
--- a/source/blender/editors/transform/transform_convert_armature.c
+++ b/source/blender/editors/transform/transform_convert_armature.c
@@ -99,7 +99,7 @@ static void autokeyframe_pose(
bPoseChannel *pchan;
FCurve *fcu;
- // TODO: this should probably be done per channel instead...
+ /* TODO: this should probably be done per channel instead. */
if (!autokeyframe_cfra_can_key(scene, id)) {
/* tag channels that should have unkeyed data */
for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) {
@@ -337,7 +337,7 @@ static short pose_grab_with_ik_add(bPoseChannel *pchan)
if (data->rootbone == 0) {
for (bPoseChannel *pchan_iter = pchan; pchan_iter; pchan_iter = pchan_iter->parent) {
/* here, we set ik-settings for bone from pchan->protectflag */
- // XXX: careful with quats/axis-angle rotations where we're locking 4d components
+ /* XXX: careful with quats/axis-angle rotations where we're locking 4d components. */
if (pchan_iter->protectflag & OB_LOCK_ROTX) {
pchan_iter->ikflag |= BONE_IK_NO_XDOF_TEMP;
}
@@ -373,7 +373,7 @@ static short pose_grab_with_ik_add(bPoseChannel *pchan)
/* we only include bones that are part of a continual connected chain */
do {
/* here, we set ik-settings for bone from pchan->protectflag */
- // XXX: careful with quats/axis-angle rotations where we're locking 4d components
+ /* XXX: careful with quats/axis-angle rotations where we're locking 4d components. */
if (pchan->protectflag & OB_LOCK_ROTX) {
pchan->ikflag |= BONE_IK_NO_XDOF_TEMP;
}
@@ -683,7 +683,7 @@ static void add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, Tr
td->ival = bone->dist;
}
else if (t->mode == TFM_BONESIZE) {
- // abusive storage of scale in the loc pointer :)
+ /* Abusive storage of scale in the loc pointer :) */
td->loc = &bone->xwidth;
copy_v3_v3(td->iloc, td->loc);
td->val = NULL;
@@ -957,8 +957,9 @@ void createTransArmatureVerts(TransInfo *t)
for (ebo = edbo->first; ebo; ebo = ebo->next) {
td_old = td;
- ebo->oldlength =
- ebo->length; // length==0.0 on extrude, used for scaling radius of bone points
+
+ /* (length == 0.0) on extrude, used for scaling radius of bone points. */
+ ebo->oldlength = ebo->length;
if (EBONE_VISIBLE(arm, ebo) && !(ebo->flag & BONE_EDITMODE_LOCKED)) {
if (t->mode == TFM_BONE_ENVELOPE) {
@@ -1002,7 +1003,7 @@ void createTransArmatureVerts(TransInfo *t)
td->ival = ebo->dist;
}
else {
- // abusive storage of scale in the loc pointer :)
+ /* Abusive storage of scale in the loc pointer :). */
td->loc = &ebo->xwidth;
copy_v3_v3(td->iloc, td->loc);
td->val = NULL;
@@ -1330,8 +1331,8 @@ static void pose_transform_mirror_update(TransInfo *t, TransDataContainer *tc, O
/* We assume X-axis flipping for now. */
pchan->curve_in_x = pchan_orig->curve_in_x * -1;
pchan->curve_out_x = pchan_orig->curve_out_x * -1;
- pchan->roll1 = pchan_orig->roll1 * -1; // XXX?
- pchan->roll2 = pchan_orig->roll2 * -1; // XXX?
+ pchan->roll1 = pchan_orig->roll1 * -1; /* XXX? */
+ pchan->roll2 = pchan_orig->roll2 * -1; /* XXX? */
float pchan_mtx_final[4][4];
BKE_pchan_to_mat4(pchan_orig, pchan_mtx_final);
@@ -1465,7 +1466,8 @@ void recalcData_pose(TransInfo *t)
* (FPoints) instead of keyframes? */
if ((t->animtimer) && (t->context) && IS_AUTOKEY_ON(t->scene)) {
int targetless_ik =
- (t->flag & T_AUTOIK); // XXX this currently doesn't work, since flags aren't set yet!
+ (t->flag &
+ T_AUTOIK); /* XXX this currently doesn't work, since flags aren't set yet! */
animrecord_check_state(t, ob);
autokeyframe_pose(t->context, t->scene, ob, t->mode, targetless_ik);
@@ -1617,7 +1619,7 @@ static short apply_targetless_ik(Object *ob)
segcount++;
if (segcount == data->rootbone || segcount > 255) {
- break; // 255 is weak
+ break; /* 255 is weak */
}
}
for (; segcount; segcount--) {
diff --git a/source/blender/editors/transform/transform_convert_graph.c b/source/blender/editors/transform/transform_convert_graph.c
index 8886be9ac85..7daa6498334 100644
--- a/source/blender/editors/transform/transform_convert_graph.c
+++ b/source/blender/editors/transform/transform_convert_graph.c
@@ -260,7 +260,7 @@ void createTransGraphEditData(bContext *C, TransInfo *t)
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
/* which side of the current frame should be allowed */
- // XXX we still want this mode, but how to get this using standard transform too?
+ /* XXX we still want this mode, but how to get this using standard transform too? */
if (t->mode == TFM_TIME_EXTEND) {
t->frame_side = transform_convert_frame_side_dir_get(t, (float)CFRA);
}
diff --git a/source/blender/editors/transform/transform_convert_mesh_edge.c b/source/blender/editors/transform/transform_convert_mesh_edge.c
index febfa4cd367..7bdd33192da 100644
--- a/source/blender/editors/transform/transform_convert_mesh_edge.c
+++ b/source/blender/editors/transform/transform_convert_mesh_edge.c
@@ -86,7 +86,7 @@ void createTransEdge(TransInfo *t)
BM_mesh_cd_flag_ensure(em->bm, BKE_mesh_from_object(tc->obedit), ME_CDFLAG_EDGE_BWEIGHT);
cd_edge_float_offset = CustomData_get_offset(&em->bm->edata, CD_BWEIGHT);
}
- else { // if (t->mode == TFM_CREASE) {
+ else { /* if (t->mode == TFM_CREASE) { */
BLI_assert(t->mode == TFM_CREASE);
BM_mesh_cd_flag_ensure(em->bm, BKE_mesh_from_object(tc->obedit), ME_CDFLAG_EDGE_CREASE);
cd_edge_float_offset = CustomData_get_offset(&em->bm->edata, CD_CREASE);
diff --git a/source/blender/editors/transform/transform_convert_nla.c b/source/blender/editors/transform/transform_convert_nla.c
index afebf1c46a4..8f18f6a8c96 100644
--- a/source/blender/editors/transform/transform_convert_nla.c
+++ b/source/blender/editors/transform/transform_convert_nla.c
@@ -117,7 +117,7 @@ void createTransNlaData(bContext *C, TransInfo *t)
/* only consider selected strips */
for (strip = nlt->strips.first; strip; strip = strip->next) {
- // TODO: we can make strips have handles later on...
+ /* TODO: we can make strips have handles later on. */
/* transition strips can't get directly transformed */
if (strip->type != NLASTRIP_TYPE_TRANSITION) {
if (strip->flag & NLASTRIP_FLAG_SELECT) {
@@ -166,7 +166,7 @@ void createTransNlaData(bContext *C, TransInfo *t)
/* only consider selected strips */
for (strip = nlt->strips.first; strip; strip = strip->next) {
- // TODO: we can make strips have handles later on...
+ /* TODO: we can make strips have handles later on. */
/* transition strips can't get directly transformed */
if (strip->type != NLASTRIP_TYPE_TRANSITION) {
if (strip->flag & NLASTRIP_FLAG_SELECT) {
diff --git a/source/blender/editors/transform/transform_convert_object.c b/source/blender/editors/transform/transform_convert_object.c
index 97ef1e94d45..6664c41b0b6 100644
--- a/source/blender/editors/transform/transform_convert_object.c
+++ b/source/blender/editors/transform/transform_convert_object.c
@@ -251,8 +251,11 @@ static void ObjectToTransData(TransInfo *t, TransData *td, Object *ob)
td->ext->irotAngle = ob->rotAngle;
copy_v3_v3(td->ext->irotAxis, ob->rotAxis);
- // td->ext->drotAngle = ob->drotAngle; // XXX, not implemented
- // copy_v3_v3(td->ext->drotAxis, ob->drotAxis); // XXX, not implemented
+ /* XXX, not implemented. */
+#if 0
+ td->ext->drotAngle = ob->drotAngle;
+ copy_v3_v3(td->ext->drotAxis, ob->drotAxis);
+#endif
}
else {
td->ext->rot = NULL;
@@ -726,7 +729,7 @@ void createTransTexspace(TransInfo *t)
ob = OBACT(view_layer);
- if (ob == NULL) { // Shouldn't logically happen, but still...
+ if (ob == NULL) { /* Shouldn't logically happen, but still. */
return;
}
@@ -788,7 +791,7 @@ static void autokeyframe_object(
ID *id = &ob->id;
FCurve *fcu;
- // TODO: this should probably be done per channel instead...
+ /* TODO: this should probably be done per channel instead. */
if (autokeyframe_cfra_can_key(scene, id)) {
ReportList *reports = CTX_wm_reports(C);
ToolSettings *ts = scene->toolsettings;
diff --git a/source/blender/editors/transform/transform_convert_sequencer.c b/source/blender/editors/transform/transform_convert_sequencer.c
index 80ce4770984..307fbbdf80b 100644
--- a/source/blender/editors/transform/transform_convert_sequencer.c
+++ b/source/blender/editors/transform/transform_convert_sequencer.c
@@ -381,7 +381,7 @@ static void freeSeqData(TransInfo *t, TransDataContainer *tc, TransCustomData *c
if (!(t->state == TRANS_CANCEL)) {
-#if 0 // default 2.4 behavior
+#if 0 /* Default 2.4 behavior. */
/* flush to 2d vector from internally used 3d vector */
for (a = 0; a < t->total; a++, td++) {
@@ -393,7 +393,7 @@ static void freeSeqData(TransInfo *t, TransDataContainer *tc, TransCustomData *c
seq_prev = seq;
}
-#else // durian hack
+#else /* durian hack */
{
int overlap = 0;
diff --git a/source/blender/editors/transform/transform_data.h b/source/blender/editors/transform/transform_data.h
index 726e70c5e4d..b59197fcd39 100644
--- a/source/blender/editors/transform/transform_data.h
+++ b/source/blender/editors/transform/transform_data.h
@@ -53,10 +53,12 @@ typedef struct TransDataMirror {
typedef struct TransDataExtension {
/** Initial object drot. */
float drot[3];
- // /* Initial object drotAngle, TODO: not yet implemented */
- // float drotAngle;
- // /* Initial object drotAxis, TODO: not yet implemented */
- // float drotAxis[3];
+#if 0 /* TODO: not yet implemented */
+ /* Initial object drotAngle */
+ float drotAngle;
+ /* Initial object drotAxis */
+ float drotAxis[3];
+#endif
/** Initial object delta quat. */
float dquat[4];
/** Initial object delta scale. */
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index e3ee6f51a26..1b8c9b47c04 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -390,7 +390,7 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
}
else if (t->spacetype == SPACE_IMAGE) {
SpaceImage *sima = area->spacedata.first;
- // XXX for now, get View2D from the active region
+ /* XXX for now, get View2D from the active region. */
t->view = &region->v2d;
t->around = sima->around;
@@ -409,7 +409,7 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
/* image not in uv edit, nor in mask mode, can happen for some tools */
}
else if (t->spacetype == SPACE_NODE) {
- // XXX for now, get View2D from the active region
+ /* XXX for now, get View2D from the active region. */
t->view = &region->v2d;
t->around = V3D_AROUND_CENTER_BOUNDS;
}
@@ -432,9 +432,9 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
}
else {
if (region) {
- // XXX for now, get View2D from the active region
+ /* XXX for now, get View2D from the active region */
t->view = &region->v2d;
- // XXX for now, the center point is the midpoint of the data
+ /* XXX for now, the center point is the midpoint of the data */
}
else {
t->view = NULL;
@@ -715,7 +715,7 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
}
}
- // Mirror is not supported with PET, turn it off.
+ /* Mirror is not supported with PET, turn it off. */
#if 0
if (t->flag & T_PROP_EDIT) {
t->flag &= ~T_MIRROR;
diff --git a/source/blender/editors/transform/transform_gizmo_3d.c b/source/blender/editors/transform/transform_gizmo_3d.c
index 017cccdee15..a22f6c35139 100644
--- a/source/blender/editors/transform/transform_gizmo_3d.c
+++ b/source/blender/editors/transform/transform_gizmo_3d.c
@@ -915,7 +915,7 @@ int ED_transform_calc_gizmo_stats(const bContext *C,
/* selection center */
if (totsel) {
- mul_v3_fl(tbounds->center, 1.0f / (float)totsel); // centroid!
+ mul_v3_fl(tbounds->center, 1.0f / (float)totsel); /* centroid! */
mul_m4_v3(obedit->obmat, tbounds->center);
mul_m4_v3(obedit->obmat, tbounds->min);
mul_m4_v3(obedit->obmat, tbounds->max);
@@ -958,7 +958,7 @@ int ED_transform_calc_gizmo_stats(const bContext *C,
MEM_freeN(objects);
if (totsel) {
- mul_v3_fl(tbounds->center, 1.0f / (float)totsel); // centroid!
+ mul_v3_fl(tbounds->center, 1.0f / (float)totsel); /* centroid! */
mul_m4_v3(ob->obmat, tbounds->center);
mul_m4_v3(ob->obmat, tbounds->min);
mul_m4_v3(ob->obmat, tbounds->max);
@@ -996,7 +996,7 @@ int ED_transform_calc_gizmo_stats(const bContext *C,
/* selection center */
if (totsel) {
- mul_v3_fl(tbounds->center, 1.0f / (float)totsel); // centroid!
+ mul_v3_fl(tbounds->center, 1.0f / (float)totsel); /* centroid! */
}
}
}
@@ -1044,7 +1044,7 @@ int ED_transform_calc_gizmo_stats(const bContext *C,
/* selection center */
if (totsel) {
- mul_v3_fl(tbounds->center, 1.0f / (float)totsel); // centroid!
+ mul_v3_fl(tbounds->center, 1.0f / (float)totsel); /* centroid! */
}
}
diff --git a/source/blender/editors/transform/transform_mode.c b/source/blender/editors/transform/transform_mode.c
index edc0781e18e..c525bc0e6ea 100644
--- a/source/blender/editors/transform/transform_mode.c
+++ b/source/blender/editors/transform/transform_mode.c
@@ -446,7 +446,7 @@ static void constraintSizeLim(TransInfo *t, TransData *td)
*/
if ((td->flag & TD_SINGLESIZE) && !(t->con.mode & CON_APPLY)) {
/* scale val and reset size */
- return; // TODO: fix this case
+ return; /* TODO: fix this case */
}
/* Reset val if SINGLESIZE but using a constraint */
@@ -505,7 +505,7 @@ static void constraintSizeLim(TransInfo *t, TransData *td)
/* copy results from cob->matrix */
if ((td->flag & TD_SINGLESIZE) && !(t->con.mode & CON_APPLY)) {
/* scale val and reset size */
- return; // TODO: fix this case
+ return; /* TODO: fix this case. */
}
/* Reset val if SINGLESIZE but using a constraint */
@@ -605,7 +605,7 @@ void ElementRotation_ex(TransInfo *t,
if (td->flag & TD_USEQUAT) {
mul_m3_series(fmat, td->smtx, mat, td->mtx);
- 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);
@@ -628,31 +628,31 @@ void ElementRotation_ex(TransInfo *t,
* has been computed, it has to be converted back into the bone's space.
*/
else if (t->flag & T_POSE) {
- // Extract and invert armature object matrix
+ /* Extract and invert armature object matrix */
if ((td->flag & TD_NO_LOC) == 0) {
sub_v3_v3v3(vec, td->center, center);
- mul_m3_v3(tc->mat3, vec); // To Global space
- mul_m3_v3(mat, vec); // Applying rotation
- mul_m3_v3(tc->imat3, vec); // To Local space
+ mul_m3_v3(tc->mat3, vec); /* To Global space. */
+ mul_m3_v3(mat, vec); /* Applying rotation. */
+ mul_m3_v3(tc->imat3, vec); /* To Local space. */
add_v3_v3(vec, center);
/* vec now is the location where the object has to be */
- sub_v3_v3v3(vec, vec, td->center); // Translation needed from the initial location
+ sub_v3_v3v3(vec, vec, td->center); /* Translation needed from the initial location */
/* special exception, see TD_PBONE_LOCAL_MTX definition comments */
if (td->flag & TD_PBONE_LOCAL_MTX_P) {
/* do nothing */
}
else if (td->flag & TD_PBONE_LOCAL_MTX_C) {
- mul_m3_v3(tc->mat3, vec); // To Global space
- mul_m3_v3(td->ext->l_smtx, vec); // To Pose space (Local Location)
+ mul_m3_v3(tc->mat3, vec); /* To Global space. */
+ mul_m3_v3(td->ext->l_smtx, vec); /* To Pose space (Local Location). */
}
else {
- mul_m3_v3(tc->mat3, vec); // To Global space
- mul_m3_v3(td->smtx, vec); // To Pose space
+ mul_m3_v3(tc->mat3, vec); /* To Global space. */
+ mul_m3_v3(td->smtx, vec); /* To Pose space. */
}
protectedTransBits(td->protectflag, vec);
@@ -738,13 +738,13 @@ void ElementRotation_ex(TransInfo *t,
constraintTransLim(t, td);
/* rotation */
- if ((t->flag & T_V3D_ALIGN) == 0) { // align mode doesn't rotate objects itself
+ if ((t->flag & T_V3D_ALIGN) == 0) { /* Align mode doesn't rotate objects itself. */
/* euler or quaternion? */
if ((td->ext->rotOrder == ROT_MODE_QUAT) || (td->flag & TD_USEQUAT)) {
/* can be called for texture space translate for example, then opt out */
if (td->ext->quat) {
mul_m3_series(fmat, td->smtx, mat, td->mtx);
- 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 */
@@ -758,7 +758,7 @@ void ElementRotation_ex(TransInfo *t,
axis_angle_to_quat(iquat, td->ext->irotAxis, td->ext->irotAngle);
mul_m3_series(fmat, td->smtx, mat, td->mtx);
- 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);
@@ -1045,10 +1045,12 @@ void ElementResize(TransInfo *t, TransDataContainer *tc, TransData *td, float ma
/** \name Transform Frame Utils
* \{ */
-/* This function returns the snapping 'mode' for Animation Editors only
+/**
+ * This function returns the snapping 'mode' for Animation Editors only.
* We cannot use the standard snapping due to NLA-strip scaling complexities.
+ *
+ * TODO: these modifier checks should be key-mappable.
*/
-// XXX these modifier checks should be keymappable
short getAnimEdit_SnapMode(TransInfo *t)
{
short autosnap = SACTSNAP_OFF;
diff --git a/source/blender/editors/transform/transform_mode_bbone_resize.c b/source/blender/editors/transform/transform_mode_bbone_resize.c
index 05c4bbedcb4..57e809a566a 100644
--- a/source/blender/editors/transform/transform_mode_bbone_resize.c
+++ b/source/blender/editors/transform/transform_mode_bbone_resize.c
@@ -142,7 +142,7 @@ static void applyBoneSize(TransInfo *t, const int UNUSED(mval[2]))
}
}
- copy_m3_m3(t->mat, mat); // used in gizmo
+ copy_m3_m3(t->mat, mat); /* used in gizmo */
headerBoneSize(t, t->values_final, str);
diff --git a/source/blender/editors/transform/transform_mode_resize.c b/source/blender/editors/transform/transform_mode_resize.c
index 06d61dd9ec8..33303b82567 100644
--- a/source/blender/editors/transform/transform_mode_resize.c
+++ b/source/blender/editors/transform/transform_mode_resize.c
@@ -121,7 +121,7 @@ static void applyResize(TransInfo *t, const int UNUSED(mval[2]))
headerResize(t, t->values_final, str);
}
- copy_m3_m3(t->mat, mat); // used in gizmo
+ copy_m3_m3(t->mat, mat); /* used in gizmo */
FOREACH_TRANS_DATA_CONTAINER (t, tc) {
TransData *td = tc->data;
diff --git a/source/blender/editors/transform/transform_mode_rotate.c b/source/blender/editors/transform/transform_mode_rotate.c
index 943410e009d..d8857dbc31e 100644
--- a/source/blender/editors/transform/transform_mode_rotate.c
+++ b/source/blender/editors/transform/transform_mode_rotate.c
@@ -49,7 +49,7 @@ static float RotationBetween(TransInfo *t, const float p1[3], const float p2[3])
sub_v3_v3v3(start, p1, t->center_global);
sub_v3_v3v3(end, p2, t->center_global);
- // Angle around a constraint axis (error prone, will need debug)
+ /* Angle around a constraint axis (error prone, will need debug). */
if (t->con.applyRot != NULL && (t->con.mode & CON_APPLY)) {
float axis[3], tmp[3];
diff --git a/source/blender/editors/transform/transform_mode_shrink_fatten.c b/source/blender/editors/transform/transform_mode_shrink_fatten.c
index 679584cbfee..af33c2bb090 100644
--- a/source/blender/editors/transform/transform_mode_shrink_fatten.c
+++ b/source/blender/editors/transform/transform_mode_shrink_fatten.c
@@ -116,7 +116,7 @@ static void applyShrinkFatten(TransInfo *t, const int UNUSED(mval[2]))
void initShrinkFatten(TransInfo *t)
{
- // If not in mesh edit mode, fallback to Resize
+ /* If not in mesh edit mode, fallback to Resize. */
if ((t->flag & T_EDIT) == 0 || (t->obedit_type != OB_MESH)) {
initResize(t);
}
diff --git a/source/blender/editors/transform/transform_mode_timeslide.c b/source/blender/editors/transform/transform_mode_timeslide.c
index 9d112013398..9636b4f6e42 100644
--- a/source/blender/editors/transform/transform_mode_timeslide.c
+++ b/source/blender/editors/transform/transform_mode_timeslide.c
@@ -147,7 +147,7 @@ static void applyTimeSlide(TransInfo *t, const int mval[2])
UI_view2d_region_to_view(v2d, t->mouse.imval[0], t->mouse.imval[1], &sval[0], &sval[1]);
/* t->values_final[0] stores cval[0], which is the current mouse-pointer location (in frames) */
- // XXX Need to be able to repeat this
+ /* XXX Need to be able to repeat this. */
/* t->values_final[0] = cval[0]; */ /* UNUSED (reset again later). */
/* handle numeric-input stuff */
diff --git a/source/blender/editors/transform/transform_mode_tosphere.c b/source/blender/editors/transform/transform_mode_tosphere.c
index de85d586550..f49462ccc65 100644
--- a/source/blender/editors/transform/transform_mode_tosphere.c
+++ b/source/blender/editors/transform/transform_mode_tosphere.c
@@ -121,7 +121,7 @@ void initToSphere(TransInfo *t)
t->num.val_flag[0] |= NUM_NULL_ONE | NUM_NO_NEGATIVE;
t->flag |= T_NO_CONSTRAINT;
- // Calculate average radius
+ /* Calculate average radius */
FOREACH_TRANS_DATA_CONTAINER (t, tc) {
TransData *td = tc->data;
for (i = 0; i < tc->data_len; i++, td++) {
diff --git a/source/blender/editors/transform/transform_mode_trackball.c b/source/blender/editors/transform/transform_mode_trackball.c
index a0d3bbac8e3..32019e151a1 100644
--- a/source/blender/editors/transform/transform_mode_trackball.c
+++ b/source/blender/editors/transform/transform_mode_trackball.c
@@ -131,8 +131,8 @@ static void applyTrackball(TransInfo *t, const int UNUSED(mval[2]))
mul_m3_m3m3(mat, smat, totmat);
- // TRANSFORM_FIX_ME
- //copy_m3_m3(t->mat, mat); // used in gizmo
+ /* TRANSFORM_FIX_ME */
+ // copy_m3_m3(t->mat, mat); /* used in gizmo. */
#endif
applyTrackballValue(t, axis1, axis2, phi);
diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c
index 6b6cab5c2a4..b164d0d443f 100644
--- a/source/blender/editors/transform/transform_ops.c
+++ b/source/blender/editors/transform/transform_ops.c
@@ -414,9 +414,9 @@ static int transform_modal(bContext *C, wmOperator *op, const wmEvent *event)
const enum TfmMode mode_prev = t->mode;
#if defined(WITH_INPUT_NDOF) && 0
- // stable 2D mouse coords map to different 3D coords while the 3D mouse is active
- // in other words, 2D deltas are no longer good enough!
- // disable until individual 'transformers' behave better
+ /* Stable 2D mouse coords map to different 3D coords while the 3D mouse is active
+ * in other words, 2D deltas are no longer good enough!
+ * disable until individual 'transformers' behave better. */
if (event->type == NDOF_MOTION) {
return OPERATOR_PASS_THROUGH;
@@ -520,7 +520,7 @@ static int transform_invoke(bContext *C, wmOperator *op, const wmEvent *event)
/* add temp handler */
WM_event_add_modal_handler(C, op);
- op->flag |= OP_IS_MODAL_GRAB_CURSOR; // XXX maybe we want this with the gizmo only?
+ op->flag |= OP_IS_MODAL_GRAB_CURSOR; /* XXX maybe we want this with the gizmo only? */
/* Use when modal input has some transformation to begin with. */
TransInfo *t = op->customdata;
@@ -888,7 +888,7 @@ static void TRANSFORM_OT_bend(struct wmOperatorType *ot)
/* api callbacks */
ot->invoke = transform_invoke;
- // ot->exec = transform_exec; // unsupported
+ // ot->exec = transform_exec; /* unsupported */
ot->modal = transform_modal;
ot->cancel = transform_cancel;
ot->poll = ED_operator_region_view3d_active;
diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c
index 1ab81ada398..e461bcb88e9 100644
--- a/source/blender/editors/transform/transform_snap.c
+++ b/source/blender/editors/transform/transform_snap.c
@@ -280,7 +280,7 @@ eRedrawFlag handleSnapping(TransInfo *t, const wmEvent *event)
{
eRedrawFlag status = TREDRAW_NOTHING;
-#if 0 // XXX need a proper selector for all snap mode
+#if 0 /* XXX need a proper selector for all snap mode */
if (BIF_snappingSupported(t->obedit) && event->type == TABKEY && event->shift) {
/* toggle snap and reinit */
t->settings->snap_flag ^= SCE_SNAP;
@@ -370,7 +370,9 @@ void applyProject(TransInfo *t)
}
}
- // XXX constraintTransLim(t, td);
+#if 0 /* TODO: sipport this? */
+ constraintTransLim(t, td);
+#endif
}
}
}
@@ -447,8 +449,8 @@ void applySnapping(TransInfo *t, float *vec)
activeSnap(t)) {
double current = PIL_check_seconds_timer();
- // Time base quirky code to go around findnearest slowness
- /* !TODO! add exception for object mode, no need to slow it down then */
+ /* Time base quirky code to go around findnearest slowness */
+ /* TODO: add exception for object mode, no need to slow it down then. */
if (current - t->tsnap.last >= 0.01) {
t->tsnap.calcSnap(t, vec);
t->tsnap.targetSnap(t);
@@ -831,7 +833,7 @@ static void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec))
float mval[2];
bool found = false;
short snap_elem = 0;
- float dist_px = SNAP_MIN_DISTANCE; // Use a user defined value here
+ float dist_px = SNAP_MIN_DISTANCE; /* Use a user defined value here. */
mval[0] = t->mval[0];
mval[1] = t->mval[1];
@@ -890,7 +892,7 @@ static void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec))
else if (t->spacetype == SPACE_NODE) {
if (t->tsnap.mode & (SCE_SNAP_MODE_NODE_X | SCE_SNAP_MODE_NODE_Y)) {
float loc[2];
- float dist_px = SNAP_MIN_DISTANCE; // Use a user defined value here
+ float dist_px = SNAP_MIN_DISTANCE; /* Use a user defined value here. */
char node_border;
if (snapNodesTransform(t, t->mval, loc, &dist_px, &node_border)) {
@@ -981,7 +983,7 @@ static void TargetSnapActive(TransInfo *t)
static void TargetSnapMedian(TransInfo *t)
{
- // Only need to calculate once
+ /* Only need to calculate once. */
if ((t->tsnap.status & TARGET_INIT) == 0) {
int i_accum = 0;
@@ -1024,7 +1026,7 @@ static void TargetSnapMedian(TransInfo *t)
static void TargetSnapClosest(TransInfo *t)
{
- // Only valid if a snap point has been selected
+ /* Only valid if a snap point has been selected. */
if (t->tsnap.status & POINT_INIT) {
float dist_closest = 0.0f;
TransData *closest = NULL;
@@ -1370,7 +1372,7 @@ void snapFrameTransform(TransInfo *t,
break;
case SACTSNAP_MARKER:
/* snap to nearest marker */
- // TODO: need some more careful checks for where data comes from
+ /* TODO: need some more careful checks for where data comes from. */
val = ED_markers_find_nearest_marker_time(&t->scene->markers, (float)val);
break;
case SACTSNAP_SECOND: