Split up recalcData() function in transform_generics.c into smaller
functions based on editor types This could be split up further in future if there's such a need, but this should already be sufficient. Most notably required since the NLA recalc stuff was taking quite a few lines within that block
This commit is contained in:
@@ -323,18 +323,9 @@ static int fcu_test_selected(FCurve *fcu)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* called for updating while transform acts, once per redraw */
|
/* helper for recalcData() - for Action Editor transforms */
|
||||||
void recalcData(TransInfo *t)
|
static void recalcData_actedit(TransInfo *t)
|
||||||
{
|
{
|
||||||
Base *base = t->scene->basact;
|
|
||||||
|
|
||||||
if (t->spacetype==SPACE_NODE) {
|
|
||||||
flushTransNodes(t);
|
|
||||||
}
|
|
||||||
else if (t->spacetype==SPACE_SEQ) {
|
|
||||||
flushTransSeq(t);
|
|
||||||
}
|
|
||||||
else if (t->spacetype == SPACE_ACTION) {
|
|
||||||
Scene *scene= t->scene;
|
Scene *scene= t->scene;
|
||||||
SpaceAction *saction= (SpaceAction *)t->sa->spacedata.first;
|
SpaceAction *saction= (SpaceAction *)t->sa->spacedata.first;
|
||||||
|
|
||||||
@@ -379,9 +370,12 @@ void recalcData(TransInfo *t)
|
|||||||
BLI_freelistN(&anim_data);
|
BLI_freelistN(&anim_data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (t->spacetype == SPACE_IPO) {
|
|
||||||
Scene *scene;
|
/* helper for recalcData() - for Graph Editor transforms */
|
||||||
|
static void recalcData_graphedit(TransInfo *t)
|
||||||
|
{
|
||||||
SpaceIpo *sipo= (SpaceIpo *)t->sa->spacedata.first;
|
SpaceIpo *sipo= (SpaceIpo *)t->sa->spacedata.first;
|
||||||
|
Scene *scene;
|
||||||
|
|
||||||
ListBase anim_data = {NULL, NULL};
|
ListBase anim_data = {NULL, NULL};
|
||||||
bAnimContext ac= {NULL};
|
bAnimContext ac= {NULL};
|
||||||
@@ -441,7 +435,10 @@ void recalcData(TransInfo *t)
|
|||||||
/* now free temp channels */
|
/* now free temp channels */
|
||||||
BLI_freelistN(&anim_data);
|
BLI_freelistN(&anim_data);
|
||||||
}
|
}
|
||||||
else if (t->spacetype == SPACE_NLA) {
|
|
||||||
|
/* helper for recalcData() - for NLA Editor transforms */
|
||||||
|
static void recalcData_nla(TransInfo *t)
|
||||||
|
{
|
||||||
TransDataNla *tdn= (TransDataNla *)t->customData;
|
TransDataNla *tdn= (TransDataNla *)t->customData;
|
||||||
SpaceNla *snla= (SpaceNla *)t->sa->spacedata.first;
|
SpaceNla *snla= (SpaceNla *)t->sa->spacedata.first;
|
||||||
Scene *scene= t->scene;
|
Scene *scene= t->scene;
|
||||||
@@ -620,18 +617,11 @@ void recalcData(TransInfo *t)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (t->spacetype == SPACE_IMAGE) {
|
|
||||||
if (t->obedit && t->obedit->type == OB_MESH) {
|
|
||||||
SpaceImage *sima= t->sa->spacedata.first;
|
|
||||||
|
|
||||||
flushTransUVs(t);
|
/* helper for recalcData() - for 3d-view transforms */
|
||||||
if(sima->flag & SI_LIVE_UNWRAP)
|
static void recalcData_view3d(TransInfo *t)
|
||||||
ED_uvedit_live_unwrap_re_solve();
|
{
|
||||||
|
Base *base = t->scene->basact;
|
||||||
DAG_id_tag_update(t->obedit->data, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (t->spacetype == SPACE_VIEW3D) {
|
|
||||||
|
|
||||||
if (t->obedit) {
|
if (t->obedit) {
|
||||||
if ELEM(t->obedit->type, OB_CURVE, OB_SURF) {
|
if ELEM(t->obedit->type, OB_CURVE, OB_SURF) {
|
||||||
@@ -651,7 +641,8 @@ void recalcData(TransInfo *t)
|
|||||||
calchandlesNurb(nu); /* Cant do testhandlesNurb here, it messes up the h1 and h2 flags */
|
calchandlesNurb(nu); /* Cant do testhandlesNurb here, it messes up the h1 and h2 flags */
|
||||||
nu= nu->next;
|
nu= nu->next;
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
/* Normal updating */
|
/* Normal updating */
|
||||||
while(nu) {
|
while(nu) {
|
||||||
test2DNurb(nu);
|
test2DNurb(nu);
|
||||||
@@ -841,6 +832,39 @@ void recalcData(TransInfo *t)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* called for updating while transform acts, once per redraw */
|
||||||
|
void recalcData(TransInfo *t)
|
||||||
|
{
|
||||||
|
if (t->spacetype==SPACE_NODE) {
|
||||||
|
flushTransNodes(t);
|
||||||
|
}
|
||||||
|
else if (t->spacetype==SPACE_SEQ) {
|
||||||
|
flushTransSeq(t);
|
||||||
|
}
|
||||||
|
else if (t->spacetype == SPACE_ACTION) {
|
||||||
|
recalcData_actedit(t);
|
||||||
|
}
|
||||||
|
else if (t->spacetype == SPACE_IPO) {
|
||||||
|
recalcData_graphedit(t);
|
||||||
|
}
|
||||||
|
else if (t->spacetype == SPACE_NLA) {
|
||||||
|
recalcData_nla(t);
|
||||||
|
}
|
||||||
|
else if (t->spacetype == SPACE_IMAGE) {
|
||||||
|
if (t->obedit && t->obedit->type == OB_MESH) {
|
||||||
|
SpaceImage *sima= t->sa->spacedata.first;
|
||||||
|
|
||||||
|
flushTransUVs(t);
|
||||||
|
if(sima->flag & SI_LIVE_UNWRAP)
|
||||||
|
ED_uvedit_live_unwrap_re_solve();
|
||||||
|
|
||||||
|
DAG_id_tag_update(t->obedit->data, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (t->spacetype == SPACE_VIEW3D) {
|
||||||
|
recalcData_view3d(t);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawLine(TransInfo *t, float *center, float *dir, char axis, short options)
|
void drawLine(TransInfo *t, float *center, float *dir, char axis, short options)
|
||||||
|
|||||||
Reference in New Issue
Block a user