diff options
Diffstat (limited to 'source/blender/editors/transform/transform_conversions.c')
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 60 |
1 files changed, 29 insertions, 31 deletions
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 1e207bb5376..befcac13514 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -35,8 +35,6 @@ #include <string.h> #include <math.h> -#include "MEM_guardedalloc.h" - #include "DNA_anim_types.h" #include "DNA_armature_types.h" #include "DNA_lattice_types.h" @@ -47,42 +45,31 @@ #include "DNA_sequence_types.h" #include "DNA_view3d_types.h" #include "DNA_constraint_types.h" +#include "DNA_scene_types.h" +#include "DNA_meshdata_types.h" + +#include "MEM_guardedalloc.h" -#include "BKE_anim.h" #include "BKE_action.h" #include "BKE_armature.h" -#include "BKE_blender.h" -#include "BKE_cloth.h" #include "BKE_context.h" #include "BKE_curve.h" #include "BKE_constraint.h" #include "BKE_depsgraph.h" -#include "BKE_displist.h" -#include "BKE_DerivedMesh.h" -#include "BKE_effect.h" -#include "BKE_font.h" #include "BKE_fcurve.h" #include "BKE_global.h" -#include "BKE_lattice.h" #include "BKE_key.h" #include "BKE_main.h" -#include "BKE_mball.h" -#include "BKE_mesh.h" #include "BKE_modifier.h" #include "BKE_nla.h" #include "BKE_object.h" #include "BKE_particle.h" #include "BKE_sequencer.h" #include "BKE_pointcache.h" -#include "BKE_softbody.h" -#include "BKE_utildefines.h" #include "BKE_bmesh.h" -#include "BKE_context.h" -#include "BKE_report.h" #include "BKE_tessmesh.h" #include "BKE_scene.h" -#include "BIF_gl.h" #include "ED_anim_api.h" #include "ED_armature.h" @@ -95,6 +82,7 @@ #include "ED_mesh.h" #include "ED_types.h" #include "ED_uvedit.h" +#include "ED_curve.h" /* for ED_curve_editnurbs */ #include "UI_view2d.h" @@ -667,7 +655,8 @@ static void bone_children_clear_transflag(int mode, short around, ListBase *lb) } } -/* sets transform flags in the bones, returns total */ +/* sets transform flags in the bones + * returns total number of bones with BONE_TRANSFORM */ int count_set_pose_transflags(int *out_mode, short around, Object *ob) { bArmature *arm= ob->data; @@ -1355,12 +1344,14 @@ static void createTransCurveVerts(bContext *C, TransInfo *t) int count=0, countsel=0; int propmode = t->flag & T_PROP_EDIT; short hide_handles = (cu->drawflag & CU_HIDE_HANDLES); - + ListBase *nurbs; + /* to be sure */ if(cu->editnurb==NULL) return; /* count total of vertices, check identical as in 2nd loop for making transdata! */ - for(nu= cu->editnurb->first; nu; nu= nu->next) { + nurbs= ED_curve_editnurbs(cu); + for(nu= nurbs->first; nu; nu= nu->next) { if(nu->type == CU_BEZIER) { for(a=0, bezt= nu->bezt; a<nu->pntsu; a++, bezt++) { if(bezt->hide==0) { @@ -1396,7 +1387,7 @@ static void createTransCurveVerts(bContext *C, TransInfo *t) invert_m3_m3(smtx, mtx); td = t->data; - for(nu= cu->editnurb->first; nu; nu= nu->next) { + for(nu= nurbs->first; nu; nu= nu->next) { if(nu->type == CU_BEZIER) { TransData *head, *tail; head = tail = td; @@ -1549,7 +1540,7 @@ static void createTransCurveVerts(bContext *C, TransInfo *t) static void createTransLatticeVerts(bContext *C, TransInfo *t) { - Lattice *latt = ((Lattice*)t->obedit->data)->editlatt; + Lattice *latt = ((Lattice*)t->obedit->data)->editlatt->latt; TransData *td = NULL; BPoint *bp; float mtx[3][3], smtx[3][3]; @@ -1780,14 +1771,17 @@ static int connectivity_edge(float mtx[][3], EditVert *v1, EditVert *v2) float edge_len; int done = 0; + /* note: hidden verts are not being checked for, this assumes + * flushing of hidden faces & edges is working right */ + + if (v1->f2 + v2->f2 == 4) + return 0; + sub_v3_v3v3(edge_vec, v1->co, v2->co); mul_m3_v3(mtx, edge_vec); edge_len = len_v3(edge_vec); - if (v1->f2 + v2->f2 == 4) - return 0; - if (v1->f2) { if (v2->f2) { if (v2->tmp.fp + edge_len + THRESHOLD < v1->tmp.fp) { @@ -1853,7 +1847,7 @@ static void editmesh_set_connectivity_distance(EditMesh *em, float mtx[][3]) /* do internal edges for quads */ for(efa= em->faces.first; efa; efa= efa->next) { - if (efa->v4) { + if (efa->v4 && efa->h==0) { done |= connectivity_edge(mtx, efa->v1, efa->v3); done |= connectivity_edge(mtx, efa->v2, efa->v4); } @@ -2383,7 +2377,7 @@ void flushTransNodes(TransInfo *t) #define XXX_DURIAN_ANIM_TX_HACK void flushTransSeq(TransInfo *t) { - ListBase *seqbasep= seq_give_editing(t->scene, FALSE)->seqbasep; /* Editing null check alredy done */ + ListBase *seqbasep= seq_give_editing(t->scene, FALSE)->seqbasep; /* Editing null check already done */ int a, new_frame; TransData *td= NULL; TransData2D *td2d= NULL; @@ -3133,7 +3127,7 @@ static TransData *ActionFCurveToTransData(TransData *td, TransData2D **td2dv, FC for (i=0, bezt=fcu->bezt; i < fcu->totvert; i++, bezt++) { /* only add selected keyframes (for now, proportional edit is not enabled) */ - if (BEZSELECTED(bezt)) { + if (bezt->f2 & SELECT) { /* note this MUST match count_fcurve_keys(), so can't use BEZSELECTED() macro */ /* only add if on the right 'side' of the current frame */ if (FrameOnMouseSide(side, bezt->vec[1][0], cfra)) { TimeToTransData(td, bezt->vec[1], adt); @@ -4477,7 +4471,11 @@ static void set_trans_object_base_flags(bContext *C, TransInfo *t) /* if parent selected, deselect */ while(parsel) { - if(parsel->flag & SELECT) break; + if(parsel->flag & SELECT) { + Base *parbase = object_in_scene(parsel, scene); + if TESTBASELIB_BGMODE(v3d, scene, parbase) + break; + } parsel= parsel->parent; } @@ -4497,7 +4495,7 @@ static void set_trans_object_base_flags(bContext *C, TransInfo *t) } /* all recalc flags get flushed to all layers, so a layer flip later on works fine */ - DAG_scene_flush_update(t->scene, -1, 0); + DAG_scene_flush_update(G.main, t->scene, -1, 0); /* and we store them temporal in base (only used for transform code) */ /* this because after doing updates, the object->recalc is cleared */ @@ -4575,7 +4573,7 @@ static int count_proportional_objects(TransInfo *t) /* all recalc flags get flushed to all layers, so a layer flip later on works fine */ - DAG_scene_flush_update(t->scene, -1, 0); + DAG_scene_flush_update(G.main, t->scene, -1, 0); /* and we store them temporal in base (only used for transform code) */ /* this because after doing updates, the object->recalc is cleared */ |