- update bl_run_operators.py for change in blender.
authorCampbell Barton <ideasman42@gmail.com>
Sun, 15 Sep 2013 01:46:25 +0000 (01:46 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 15 Sep 2013 01:46:25 +0000 (01:46 +0000)
- rename curve delete operator vertices enum to match mesh delete operator.
- add missing NULL checks to view3d_lock_poll() to prevent crashes when called outside a view3d.

source/blender/editors/curve/editcurve.c
source/blender/editors/space_view3d/view3d_edit.c
source/tests/bl_run_operators.py

index ce0881b2e116240c28eaaa98c96c9b278a35ac52..d2eab3e8deaa669d2f6c665f8252dbb847862fa9 100644 (file)
@@ -6245,7 +6245,7 @@ static int curve_delete_exec(bContext *C, wmOperator *op)
 }
 
 static EnumPropertyItem curve_delete_type_items[] = {
-       {CURVE_VERTEX, "VERTICES", 0, "Vertices", ""},
+       {CURVE_VERTEX, "VERT", 0, "Vertices", ""},
        {CURVE_SEGMENT, "SEGMENT", 0, "Segments", ""},
        {0, NULL, 0, NULL, NULL}
 };
index d0d1a48e83205e4f33042acb33e56332d8020aac..4765ff6364a78c2f2d1db5c29e463785ce910499 100644 (file)
@@ -1012,9 +1012,13 @@ static int view3d_camera_user_poll(bContext *C)
 static int view3d_lock_poll(bContext *C)
 {
        View3D *v3d = CTX_wm_view3d(C);
-       RegionView3D *rv3d = CTX_wm_region_view3d(C);
-
-       return ED_view3d_offset_lock_check(v3d, rv3d);
+       if (v3d) {
+               RegionView3D *rv3d = CTX_wm_region_view3d(C);
+               if (rv3d) {
+                       return ED_view3d_offset_lock_check(v3d, rv3d);
+               }
+       }
+       return false;
 }
 
 static int viewrotate_cancel(bContext *C, wmOperator *op)
index effc06cd15f60326251703dee3ed900c178cb399..ad8a6919c9186714b2e4d7500013620bebd39bc4 100644 (file)
@@ -342,7 +342,8 @@ def ctx_editmode_curves():
 def ctx_editmode_curves_empty():
     bpy.ops.curve.primitive_nurbs_circle_add()
     bpy.ops.object.mode_set(mode='EDIT')
-    bpy.ops.curve.delete(type='ALL')
+    bpy.ops.curve.select_all(action='SELECT')
+    bpy.ops.curve.delete(type='VERT')
 
 
 def ctx_editmode_surface():