diff options
Diffstat (limited to 'source/blender/editors/transform/transform_conversions.c')
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 114 |
1 files changed, 81 insertions, 33 deletions
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 6be095fa98b..0a5e290643a 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -87,6 +87,7 @@ #include "ED_object.h" #include "ED_markers.h" #include "ED_mesh.h" +#include "ED_node.h" #include "ED_types.h" #include "ED_uvedit.h" #include "ED_curve.h" /* for ED_curve_editnurbs */ @@ -690,7 +691,7 @@ int count_set_pose_transflags(int *out_mode, short around, Object *ob) for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { bone = pchan->bone; if (PBONE_VISIBLE(arm, bone)) { - if ((bone->flag & BONE_SELECTED) && !(ob->proxy && pchan->bone->layer & arm->layer_protected)) + if ((bone->flag & BONE_SELECTED)) bone->flag |= BONE_TRANSFORM; else bone->flag &= ~BONE_TRANSFORM; @@ -2182,6 +2183,12 @@ void flushTransNodes(TransInfo *t) td->loc2d[0]= td->loc[0]; td->loc2d[1]= td->loc[1]; } + + /* handle intersection with noodles */ + if(t->total==1) { + ED_node_link_intersect_test(t->sa, 1); + } + } /* *** SEQUENCE EDITOR *** */ @@ -3699,7 +3706,7 @@ void flushTransGraphData(TransInfo *t) /* if int-values only, truncate to integers */ if (td->flag & TD_INTVALUES) - td2d->loc2d[1]= (float)((int)td2d->loc[1]); + td2d->loc2d[1]= floorf(td2d->loc[1] + 0.5f); else td2d->loc2d[1]= td2d->loc[1]; @@ -3725,27 +3732,8 @@ void flushTransGraphData(TransInfo *t) * seq->depth must be set before running this function so we know if the strips * are root level or not */ -#define XXX_DURIAN_ANIM_TX_HACK static void SeqTransInfo(TransInfo *t, Sequence *seq, int *recursive, int *count, int *flag) { - -#ifdef XXX_DURIAN_ANIM_TX_HACK - /* hack */ - if((seq->flag & SELECT)==0 && seq->type & SEQ_EFFECT) { - Sequence *seq_t[3]; - int i; - - seq_t[0]= seq->seq1; - seq_t[1]= seq->seq2; - seq_t[2]= seq->seq3; - - for(i=0; i<3; i++) { - if (seq_t[i] && ((seq_t[i])->flag & SELECT) && !(seq_t[i]->flag & SEQ_LOCK) && !(seq_t[i]->flag & (SEQ_LEFTSEL|SEQ_RIGHTSEL))) - seq->flag |= SELECT; - } - } -#endif - /* for extend we need to do some tricks */ if (t->mode == TFM_TIME_EXTEND) { @@ -4016,6 +4004,7 @@ static void freeSeqData(TransInfo *t) } if(overlap) { + int has_effect= 0; for(seq= seqbasep->first; seq; seq= seq->next) seq->tmp= NULL; @@ -4024,12 +4013,47 @@ static void freeSeqData(TransInfo *t) for(a=0; a<t->total; a++, td++) { seq= ((TransDataSeq *)td->extra)->seq; if ((seq != seq_prev)) { - /* Tag seq with a non zero value, used by shuffle_seq_time to identify the ones to shuffle */ - seq->tmp= (void*)1; + /* check effects strips, we cant change their time */ + if((seq->type & SEQ_EFFECT) && seq->seq1) { + has_effect= TRUE; + } + else { + /* Tag seq with a non zero value, used by shuffle_seq_time to identify the ones to shuffle */ + seq->tmp= (void*)1; + } } } shuffle_seq_time(seqbasep, t->scene); + + if(has_effect) { + /* update effects strips based on strips just moved in time */ + td= t->data; + seq_prev= NULL; + for(a=0; a<t->total; a++, td++) { + seq= ((TransDataSeq *)td->extra)->seq; + if ((seq != seq_prev)) { + if((seq->type & SEQ_EFFECT) && seq->seq1) { + calc_sequence(t->scene, seq); + } + } + } + + /* now if any effects _still_ overlap, we need to move them up */ + td= t->data; + seq_prev= NULL; + for(a=0; a<t->total; a++, td++) { + seq= ((TransDataSeq *)td->extra)->seq; + if ((seq != seq_prev)) { + if((seq->type & SEQ_EFFECT) && seq->seq1) { + if(seq_test_overlap(seqbasep, seq)) { + shuffle_seq(seqbasep, seq, t->scene); + } + } + } + } + /* done with effects */ + } } } #endif @@ -4069,6 +4093,7 @@ static void freeSeqData(TransInfo *t) static void createTransSeqData(bContext *C, TransInfo *t) { +#define XXX_DURIAN_ANIM_TX_HACK View2D *v2d= UI_view2d_fromcontext(C); Scene *scene= t->scene; @@ -4099,6 +4124,24 @@ static void createTransSeqData(bContext *C, TransInfo *t) t->frame_side = 'B'; } +#ifdef XXX_DURIAN_ANIM_TX_HACK + { + Sequence *seq; + for(seq= ed->seqbasep->first; seq; seq= seq->next) { + /* hack */ + if((seq->flag & SELECT)==0 && seq->type & SEQ_EFFECT) { + Sequence *seq_user; + 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))) { + seq->flag |= SELECT; + } + } + } + } + } +#endif count = SeqTransCount(t, ed->seqbasep, 0); @@ -4118,6 +4161,8 @@ static void createTransSeqData(bContext *C, TransInfo *t) /* loop 2: build transdata array */ SeqToTransData_Recursive(t, ed->seqbasep, td, td2d, tdsq); + +#undef XXX_DURIAN_ANIM_TX_HACK } @@ -4718,7 +4763,12 @@ void special_aftertrans_update(bContext *C, TransInfo *t) } else if (t->spacetype == SPACE_NODE) { - /* pass */ + if(cancelled == 0) + ED_node_link_insert(t->sa); + + /* clear link line */ + ED_node_link_intersect_test(t->sa, 0); + } else if (t->spacetype == SPACE_ACTION) { SpaceAction *saction= (SpaceAction *)t->sa->spacedata.first; @@ -4927,22 +4977,24 @@ void special_aftertrans_update(bContext *C, TransInfo *t) } else if ((t->flag & T_POSE) && (t->poseobj)) { bArmature *arm; - bPose *pose; bPoseChannel *pchan; short targetless_ik= 0; ob= t->poseobj; arm= ob->data; - pose= ob->pose; if((t->flag & T_AUTOIK) && (t->options & CTX_AUTOCONFIRM)) { /* when running transform non-interactively (operator exec), * we need to update the pose otherwise no updates get called during * transform and the auto-ik is not applied. see [#26164] */ - struct Object *ob=t->poseobj; - where_is_pose(t->scene, ob); + struct Object *pose_ob=t->poseobj; + where_is_pose(t->scene, pose_ob); } + /* set BONE_TRANSFORM flags for autokey, manipulator draw might have changed them */ + if (!cancelled && (t->mode != TFM_DUMMY)) + count_set_pose_transflags(&t->mode, t->around, ob); + /* if target-less IK grabbing, we calculate the pchan transforms and clear flag */ if (!cancelled && t->mode==TFM_TRANSLATION) targetless_ik= apply_targetless_ik(ob); @@ -5043,10 +5095,6 @@ void special_aftertrans_update(bContext *C, TransInfo *t) #if 0 // TRANSFORM_FIX_ME if(resetslowpar) reset_slowparents(); - - /* note; should actually only be done for all objects when a lamp is moved... (ton) */ - if(t->spacetype==SPACE_VIEW3D && G.vd->drawtype == OB_SHADED) - reshadeall_displist(); #endif } @@ -5325,7 +5373,7 @@ void createTransData(bContext *C, TransInfo *t) sort_trans_data_dist(t); } - if (t->ar->regiontype == RGN_TYPE_WINDOW) + if ((t->spacetype == SPACE_VIEW3D) && (t->ar->regiontype == RGN_TYPE_WINDOW)) { View3D *v3d = t->view; RegionView3D *rv3d = CTX_wm_region_view3d(C); |