merge with trunk at r31523
[blender.git] / source / blender / editors / space_view3d / view3d_buttons.c
index 93a045dad9d6dfca8ea29d1a515960ea6a925e86..77172ed2c966e9995e370c56261b321ac35fda54 100644 (file)
 #include "BLI_rand.h"
 
 #include "BKE_action.h"
-#include "BKE_brush.h"
 #include "BKE_context.h"
 #include "BKE_curve.h"
 #include "BKE_customdata.h"
 #include "BKE_depsgraph.h"
-#include "BKE_idprop.h"
+#include "BKE_main.h"
 #include "BKE_mesh.h"
-#include "BKE_object.h"
-#include "BKE_global.h"
-#include "BKE_scene.h"
 #include "BKE_screen.h"
-#include "BKE_utildefines.h"
 #include "BKE_tessmesh.h"
 #include "BKE_deform.h"
 
-#include "BIF_gl.h"
 
 #include "WM_api.h"
 #include "WM_types.h"
@@ -74,6 +68,7 @@
 #include "ED_mesh.h"
 #include "ED_screen.h"
 #include "ED_transform.h"
+#include "ED_curve.h"
 
 #include "UI_interface.h"
 #include "UI_resources.h"
@@ -205,8 +200,9 @@ static void v3d_editvertex_buts(const bContext *C, uiLayout *layout, View3D *v3d
                BPoint *bp;
                BezTriple *bezt;
                int a;
-               
-               nu= cu->editnurb->first;
+               ListBase *nurbs= ED_curve_editnurbs(cu);
+
+               nu= nurbs->first;
                while(nu) {
                        if(nu->type == CU_BEZIER) {
                                bezt= nu->bezt;
@@ -258,8 +254,8 @@ static void v3d_editvertex_buts(const bContext *C, uiLayout *layout, View3D *v3d
                BPoint *bp;
                int a;
                
-               a= lt->editlatt->pntsu*lt->editlatt->pntsv*lt->editlatt->pntsw;
-               bp= lt->editlatt->def;
+               a= lt->editlatt->latt->pntsu*lt->editlatt->latt->pntsv*lt->editlatt->latt->pntsw;
+               bp= lt->editlatt->latt->def;
                while(a--) {
                        if(bp->f1 & SELECT) {
                                add_v3_v3(median, bp->vec);
@@ -358,7 +354,7 @@ static void v3d_editvertex_buts(const bContext *C, uiLayout *layout, View3D *v3d
                if(totedge==1)
                        uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Crease:",   0, 20, 200, 20, &(tfp->ve_median[3]), 0.0, 1.0, 10, 3, "");
                else if(totedge>1)
-                       uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Median Crease:",    0, 20, 200, 20, &(tfp->ve_median[3]), 0.0, 1.0, 10, 3, "");
+                       uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Mean Crease:",      0, 20, 200, 20, &(tfp->ve_median[3]), 0.0, 1.0, 10, 3, "");
                
        }
        else {  // apply
@@ -410,8 +406,9 @@ static void v3d_editvertex_buts(const bContext *C, uiLayout *layout, View3D *v3d
                        BPoint *bp;
                        BezTriple *bezt;
                        int a;
-                       
-                       nu= cu->editnurb->first;
+                       ListBase *nurbs= ED_curve_editnurbs(cu);
+
+                       nu= nurbs->first;
                        while(nu) {
                                if(nu->type == CU_BEZIER) {
                                        bezt= nu->bezt;
@@ -459,8 +456,8 @@ static void v3d_editvertex_buts(const bContext *C, uiLayout *layout, View3D *v3d
                        BPoint *bp;
                        int a;
                        
-                       a= lt->editlatt->pntsu*lt->editlatt->pntsv*lt->editlatt->pntsw;
-                       bp= lt->editlatt->def;
+                       a= lt->editlatt->latt->pntsu*lt->editlatt->latt->pntsv*lt->editlatt->latt->pntsw;
+                       bp= lt->editlatt->latt->def;
                        while(a--) {
                                if(bp->f1 & SELECT) {
                                        add_v3_v3(bp->vec, median);
@@ -999,6 +996,7 @@ static int test_parent_loop(Object *par, Object *ob)
 
 static void do_view3d_region_buttons(bContext *C, void *arg, int event)
 {
+       Main *bmain= CTX_data_main(C);
        Scene *scene= CTX_data_scene(C);
 //     Object *obedit= CTX_data_edit_object(C);
        View3D *v3d= CTX_wm_view3d(C);
@@ -1030,7 +1028,7 @@ static void do_view3d_region_buttons(bContext *C, void *arg, int event)
                        if(ob->id.lib || test_parent_loop(ob->parent, ob) ) 
                                ob->parent= NULL;
                        else {
-                               DAG_scene_sort(scene);
+                               DAG_scene_sort(bmain, scene);
                                DAG_id_flush_update(&ob->id, OB_RECALC_OB);
                        }
                }