Cleanup: Move transform recaldata functions to their respective files
This commit is contained in:
parent
536a2fe7cc
commit
c2a0ca622b
|
@ -1644,38 +1644,6 @@ void animrecord_check_state(TransInfo *t, struct Object *ob)
|
|||
}
|
||||
}
|
||||
|
||||
static void recalcData_cursor_image(TransInfo *t)
|
||||
{
|
||||
TransDataContainer *tc = t->data_container;
|
||||
TransData *td = tc->data;
|
||||
float aspect_inv[2];
|
||||
|
||||
aspect_inv[0] = 1.0f / t->aspect[0];
|
||||
aspect_inv[1] = 1.0f / t->aspect[1];
|
||||
|
||||
td->loc[0] = td->loc[0] * aspect_inv[0];
|
||||
td->loc[1] = td->loc[1] * aspect_inv[1];
|
||||
|
||||
DEG_id_tag_update(&t->scene->id, ID_RECALC_COPY_ON_WRITE);
|
||||
}
|
||||
|
||||
static void recalcData_cursor(TransInfo *t)
|
||||
{
|
||||
DEG_id_tag_update(&t->scene->id, ID_RECALC_COPY_ON_WRITE);
|
||||
}
|
||||
|
||||
static void recalcData_obedit(TransInfo *t)
|
||||
{
|
||||
if (t->state != TRANS_CANCEL) {
|
||||
applyProject(t);
|
||||
}
|
||||
FOREACH_TRANS_DATA_CONTAINER (t, tc) {
|
||||
if (tc->data_len) {
|
||||
DEG_id_tag_update(tc->obedit->data, 0); /* sets recalc flags */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* called for updating while transform acts, once per redraw */
|
||||
void recalcData(TransInfo *t)
|
||||
{
|
||||
|
@ -1742,7 +1710,7 @@ void recalcData(TransInfo *t)
|
|||
recalcData_tracking(t);
|
||||
break;
|
||||
case TC_MBALL_VERTS:
|
||||
recalcData_obedit(t);
|
||||
recalcData_mball(t);
|
||||
break;
|
||||
case TC_LATTICE_VERTS:
|
||||
recalcData_lattice(t);
|
||||
|
|
|
@ -84,6 +84,8 @@ void special_aftertrans_update__pose(bContext *C, TransInfo *t);
|
|||
/* transform_convert_cursor.c */
|
||||
void createTransCursor_image(TransInfo *t);
|
||||
void createTransCursor_view3d(TransInfo *t);
|
||||
void recalcData_cursor_image(TransInfo *t);
|
||||
void recalcData_cursor(TransInfo *t);
|
||||
|
||||
/* transform_convert_curve.c */
|
||||
void createTransCurveVerts(TransInfo *t);
|
||||
|
@ -109,6 +111,7 @@ void special_aftertrans_update__mask(bContext *C, TransInfo *t);
|
|||
|
||||
/* transform_convert_mball.c */
|
||||
void createTransMBallVerts(TransInfo *t);
|
||||
void recalcData_mball(TransInfo *t);
|
||||
|
||||
/* transform_convert_mesh.c */
|
||||
struct TransIslandData {
|
||||
|
|
|
@ -134,3 +134,29 @@ void createTransCursor_view3d(TransInfo *t)
|
|||
}
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Recalc Cursor
|
||||
* \{ */
|
||||
|
||||
void recalcData_cursor_image(TransInfo *t)
|
||||
{
|
||||
TransDataContainer *tc = t->data_container;
|
||||
TransData *td = tc->data;
|
||||
float aspect_inv[2];
|
||||
|
||||
aspect_inv[0] = 1.0f / t->aspect[0];
|
||||
aspect_inv[1] = 1.0f / t->aspect[1];
|
||||
|
||||
td->loc[0] = td->loc[0] * aspect_inv[0];
|
||||
td->loc[1] = td->loc[1] * aspect_inv[1];
|
||||
|
||||
DEG_id_tag_update(&t->scene->id, ID_RECALC_COPY_ON_WRITE);
|
||||
}
|
||||
|
||||
void recalcData_cursor(TransInfo *t)
|
||||
{
|
||||
DEG_id_tag_update(&t->scene->id, ID_RECALC_COPY_ON_WRITE);
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
|
|
@ -30,6 +30,8 @@
|
|||
#include "BKE_context.h"
|
||||
|
||||
#include "transform.h"
|
||||
#include "transform_snap.h"
|
||||
|
||||
#include "transform_convert.h"
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
@ -128,3 +130,21 @@ void createTransMBallVerts(TransInfo *t)
|
|||
}
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Recalc Meta Ball
|
||||
* \{ */
|
||||
|
||||
void recalcData_mball(TransInfo *t)
|
||||
{
|
||||
if (t->state != TRANS_CANCEL) {
|
||||
applyProject(t);
|
||||
}
|
||||
FOREACH_TRANS_DATA_CONTAINER (t, tc) {
|
||||
if (tc->data_len) {
|
||||
DEG_id_tag_update(tc->obedit->data, 0); /* sets recalc flags */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
|
Loading…
Reference in New Issue