added missing notifyer/depsgraph call to loopcut, fixed tweaking the edge slide opera...
authorJoseph Eagar <joeedh@gmail.com>
Mon, 28 Sep 2009 03:28:28 +0000 (03:28 +0000)
committerJoseph Eagar <joeedh@gmail.com>
Mon, 28 Sep 2009 03:28:28 +0000 (03:28 +0000)
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/mesh/loopcut.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_ops.c

index 6e5ce92c9048ac16e6fa5bdf45b691abf6fe1a64..510f6ab464bec00c95ac3368e9a3cf509c3dca9b 100644 (file)
@@ -483,9 +483,8 @@ static int removedoublesflag_exec(bContext *C, wmOperator *op)
 {
        Object *obedit= CTX_data_edit_object(C);
        EditMesh *em= BKE_mesh_get_editmesh(((Mesh *)obedit->data));
-       /*char msg[100];
-
-       int cnt = removedoublesflag(em,1,0,RNA_float_get(op->ptr, "limit"));*/
+       /*char msg[100];*/
+       int cnt = removedoublesflag(em,1,0,RNA_float_get(op->ptr, "limit"));
 
        /*XXX this messes up last operator panel
        if(cnt)
@@ -515,7 +514,7 @@ void MESH_OT_remove_doubles(wmOperatorType *ot)
        /* flags */
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 
-       RNA_def_float(ot->srna, "limit", 0.00001f, 0.000001f, 50.0f, "Merge Threshold", "Minimum distance between merged verts", 0.00001f, 10.0f);
+       RNA_def_float(ot->srna, "limit", 0.0001f, 0.000001f, 50.0f, "Merge Threshold", "Minimum distance between merged verts", 0.00001f, 2.0f);
 }
 
 // XXX is this needed?
index 1adac71f40e04af23c39a8a527a186ead2cb5650..d1ef4ebc233a48e60ad57b1ffbb1606f4e01c16a 100644 (file)
@@ -265,7 +265,10 @@ static void ringsel_finish(bContext *C, wmOperator *op)
                        EditMesh *em = BKE_mesh_get_editmesh(lcd->ob->data);
                        esubdivideflag(lcd->ob, em, SELECT, 0.0f, 
                                       0.0f, 0, 1, SUBDIV_SELECT_LOOPCUT);
+                       
+                       DAG_id_flush_update(lcd->ob->data, OB_RECALC_DATA);
                }
+               WM_event_add_notifier(C, NC_GEOM|ND_DATA, lcd->ob->data);
        }
 }
 
index ca9981bc5903fa133c5dc6035d109bc28baf314b..bc5294860854f67041f85d2f81b7a2ebdb9f6bf6 100644 (file)
@@ -4069,7 +4069,12 @@ static int createSlideVerts(TransInfo *t)
        //short mval[2], mvalo[2];
        float labda = 0.0f, totvec=0.0;
 
-       view3d_get_object_project_mat(v3d, t->obedit, projectMat);
+       if (!v3d) {
+               /*ok, let's try to survive this*/
+               Mat4One(projectMat);
+       } else {
+               view3d_get_object_project_mat(v3d, t->obedit, projectMat);
+       }
 
        //mvalo[0] = -1; mvalo[1] = -1;
        numsel =0;
@@ -4354,9 +4359,11 @@ static int createSlideVerts(TransInfo *t)
                                        sv->down = swap;
                                }
                                
-                               view3d_project_float(t->ar, tempsv->up->v1->co, co, projectMat);
-                               view3d_project_float(t->ar, tempsv->up->v2->co, co2, projectMat);
-                               
+                               if (v3d) {
+                                       view3d_project_float(t->ar, tempsv->up->v1->co, co, projectMat);
+                                       view3d_project_float(t->ar, tempsv->up->v2->co, co2, projectMat);
+                               }
+
                                if (ev == tempsv->up->v1) {
                                        VecSubf(vec, co, co2);
                                } else {
@@ -4365,9 +4372,11 @@ static int createSlideVerts(TransInfo *t)
 
                                VecAddf(start, start, vec);
 
-                               view3d_project_float(t->ar, tempsv->down->v1->co, co, projectMat);
-                               view3d_project_float(t->ar, tempsv->down->v2->co, co2, projectMat);
-                               
+                               if (v3d) {
+                                       view3d_project_float(t->ar, tempsv->down->v1->co, co, projectMat);
+                                       view3d_project_float(t->ar, tempsv->down->v2->co, co2, projectMat);
+                               }
+
                                if (ev == tempsv->down->v1) {
                                        VecSubf(vec, co2, co);
                                } else {
@@ -4520,8 +4529,6 @@ void freeSlideVerts(TransInfo *t)
                for (uvlay_idx=0; uvlay_idx<sld->uvlay_tot; uvlay_idx++) {
                        BLI_ghash_free(sld->uvhash[uvlay_idx], NULL, NULL);
                }
-               MEM_freeN(sld->slideuv);
-               MEM_freeN(sld->uvhash);
 
                suv = sld->suv_last-1;
                while (suv >= sld->slideuv) {
@@ -4530,6 +4537,9 @@ void freeSlideVerts(TransInfo *t)
                        }
                        suv--;
                }
+
+               MEM_freeN(sld->slideuv);
+               MEM_freeN(sld->uvhash);
        }
 
        MEM_freeN(sld);
@@ -4703,7 +4713,12 @@ int EdgeSlide(TransInfo *t, short mval[2])
        CLAMP(final, -1.0f, 1.0f);
 
        /*do stuff here*/
-       doEdgeSlide(t, final);
+       if (t->customData)
+               doEdgeSlide(t, final);
+       else {
+               strcpy(str, "Invalid Edge Selection");
+               t->state = TRANS_CANCEL;
+       }
 
        recalcData(t);
 
index b6f8d2c8c2218724f9cf44954bd9ffd989e41e30..f369fba79df61bbb36d1bf96cf6061c90b242bc9 100644 (file)
@@ -554,8 +554,8 @@ void TFM_OT_mirror(struct wmOperatorType *ot)
 void TFM_OT_edge_slide(struct wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name   = "Tilt";
-       ot->description= "Tilt selected control vertices of 3d curve."; 
+       ot->name   = "Edge Slide";
+       ot->description= "Slide an edge loop along a mesh."; 
        ot->idname = OP_EDGE_SLIDE;
        ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
 
@@ -566,7 +566,7 @@ void TFM_OT_edge_slide(struct wmOperatorType *ot)
        ot->cancel  = transform_cancel;
        ot->poll   = ED_operator_editmesh;
 
-       RNA_def_float_factor(ot->srna, "value", 0, 0, 1, "Factor", "", 0, 1);
+       RNA_def_float_factor(ot->srna, "value", 0, -1.0f, 1.0f, "Factor", "", -1.0f, 1.0f);
 
        RNA_def_boolean(ot->srna, "mirror", 0, "Mirror Editing", "");
 }