Merging r39717 through r39983 from trunk into soc-2011-tomato
[blender.git] / release / scripts / startup / bl_ui / space_view3d.py
index aef6accb4e1bff3011260bf21313f4ce3ebe0786..6a9767f6743c6b90d09b50944b9f39fe63649fe3 100644 (file)
 
 # <pep8 compliant>
 import bpy
+from bpy.types import Header, Menu, Operator, Panel
 
 
-class VIEW3D_HT_header(bpy.types.Header):
+class VIEW3D_HT_header(Header):
     bl_space_type = 'VIEW_3D'
 
     def draw(self, context):
@@ -54,21 +55,13 @@ class VIEW3D_HT_header(bpy.types.Header):
                 sub.menu("VIEW3D_MT_object")
 
         row = layout.row()
+        # Contains buttons like Mode, Pivot, Manipulator, Layer, Mesh Select Mode...
         row.template_header_3D()
 
-        # do in C for now since these buttons cant be both toggle AND exclusive.
-        '''
-        if obj and obj.mode == 'EDIT' and obj.type == 'MESH':
-            row_sub = row.row(align=True)
-            row_sub.prop(toolsettings, "mesh_select_mode", text="", index=0, icon='VERTEXSEL')
-            row_sub.prop(toolsettings, "mesh_select_mode", text="", index=1, icon='EDGESEL')
-            row_sub.prop(toolsettings, "mesh_select_mode", text="", index=2, icon='FACESEL')
-        '''
-
         if obj:
             # Particle edit
             if obj.mode == 'PARTICLE_EDIT':
-                row.prop(toolsettings.particle_edit, "select_mode", text="", expand=True, toggle=True)
+                row.prop(toolsettings.particle_edit, "select_mode", text="", expand=True)
 
             # Occlude geometry
             if view.viewport_shade in {'SOLID', 'SHADED', 'TEXTURED'} and (obj.mode == 'PARTICLE_EDIT' or (obj.mode == 'EDIT' and obj.type == 'MESH')):
@@ -87,19 +80,22 @@ class VIEW3D_HT_header(bpy.types.Header):
                     row.prop(toolsettings, "proportional_edit_falloff", text="", icon_only=True)
 
         # Snap
+        snap_element = toolsettings.snap_element
         row = layout.row(align=True)
         row.prop(toolsettings, "use_snap", text="")
         row.prop(toolsettings, "snap_element", text="", icon_only=True)
-        if toolsettings.snap_element != 'INCREMENT':
+        if snap_element != 'INCREMENT':
             row.prop(toolsettings, "snap_target", text="")
-            if obj and obj.mode == 'OBJECT':
-                row.prop(toolsettings, "use_snap_align_rotation", text="")
-        if toolsettings.snap_element == 'VOLUME':
+            if obj:
+                if obj.mode == 'OBJECT':
+                    row.prop(toolsettings, "use_snap_align_rotation", text="")
+                elif obj.mode == 'EDIT':
+                    row.prop(toolsettings, "use_snap_self", text="")
+
+        if snap_element == 'VOLUME':
             row.prop(toolsettings, "use_snap_peel_object", text="")
-        elif toolsettings.snap_element == 'FACE':
+        elif snap_element == 'FACE':
             row.prop(toolsettings, "use_snap_project", text="")
-            if toolsettings.use_snap_project and obj.mode == 'EDIT':
-                row.prop(toolsettings, "use_snap_project_self", text="")
 
         # OpenGL render
         row = layout.row(align=True)
@@ -133,7 +129,7 @@ class ShowHideMenu():
         layout.operator("%s.hide" % self._operator_name, text="Hide Unselected").unselected = True
 
 
-class VIEW3D_MT_transform(bpy.types.Menu):
+class VIEW3D_MT_transform(Menu):
     bl_label = "Transform"
 
     # TODO: get rid of the custom text strings?
@@ -184,8 +180,12 @@ class VIEW3D_MT_transform(bpy.types.Menu):
         layout.operator("object.randomize_transform")
         layout.operator("object.align")
 
+        layout.separator()
+
+        layout.operator("object.anim_transforms_to_deltas")
 
-class VIEW3D_MT_mirror(bpy.types.Menu):
+
+class VIEW3D_MT_mirror(Menu):
     bl_label = "Mirror"
 
     def draw(self, context):
@@ -223,7 +223,7 @@ class VIEW3D_MT_mirror(bpy.types.Menu):
             layout.operator("object.vertex_group_mirror")
 
 
-class VIEW3D_MT_snap(bpy.types.Menu):
+class VIEW3D_MT_snap(Menu):
     bl_label = "Snap"
 
     def draw(self, context):
@@ -240,7 +240,7 @@ class VIEW3D_MT_snap(bpy.types.Menu):
         layout.operator("view3d.snap_cursor_to_active", text="Cursor to Active")
 
 
-class VIEW3D_MT_uv_map(bpy.types.Menu):
+class VIEW3D_MT_uv_map(Menu):
     bl_label = "UV Mapping"
 
     def draw(self, context):
@@ -273,7 +273,7 @@ class VIEW3D_MT_uv_map(bpy.types.Menu):
 # ********** View menus **********
 
 
-class VIEW3D_MT_view(bpy.types.Menu):
+class VIEW3D_MT_view(Menu):
     bl_label = "View"
 
     def draw(self, context):
@@ -331,7 +331,7 @@ class VIEW3D_MT_view(bpy.types.Menu):
         layout.operator("screen.screen_full_area")
 
 
-class VIEW3D_MT_view_navigation(bpy.types.Menu):
+class VIEW3D_MT_view_navigation(Menu):
     bl_label = "Navigation"
 
     def draw(self, context):
@@ -354,7 +354,7 @@ class VIEW3D_MT_view_navigation(bpy.types.Menu):
         layout.operator("view3d.fly")
 
 
-class VIEW3D_MT_view_align(bpy.types.Menu):
+class VIEW3D_MT_view_align(Menu):
     bl_label = "Align View"
 
     def draw(self, context):
@@ -370,7 +370,7 @@ class VIEW3D_MT_view_align(bpy.types.Menu):
         layout.operator("view3d.view_center_cursor")
 
 
-class VIEW3D_MT_view_align_selected(bpy.types.Menu):
+class VIEW3D_MT_view_align_selected(Menu):
     bl_label = "Align View to Selected"
 
     def draw(self, context):
@@ -396,7 +396,7 @@ class VIEW3D_MT_view_align_selected(bpy.types.Menu):
         props.type = 'LEFT'
 
 
-class VIEW3D_MT_view_cameras(bpy.types.Menu):
+class VIEW3D_MT_view_cameras(Menu):
     bl_label = "Cameras"
 
     def draw(self, context):
@@ -408,7 +408,7 @@ class VIEW3D_MT_view_cameras(bpy.types.Menu):
 # ********** Select menus, suffix from context.mode **********
 
 
-class VIEW3D_MT_select_object(bpy.types.Menu):
+class VIEW3D_MT_select_object(Menu):
     bl_label = "Select"
 
     def draw(self, context):
@@ -434,7 +434,7 @@ class VIEW3D_MT_select_object(bpy.types.Menu):
         layout.operator("object.select_pattern", text="Select Pattern...")
 
 
-class VIEW3D_MT_select_pose(bpy.types.Menu):
+class VIEW3D_MT_select_pose(Menu):
     bl_label = "Select"
 
     def draw(self, context):
@@ -471,7 +471,7 @@ class VIEW3D_MT_select_pose(bpy.types.Menu):
         layout.operator("object.select_pattern", text="Select Pattern...")
 
 
-class VIEW3D_MT_select_particle(bpy.types.Menu):
+class VIEW3D_MT_select_particle(Menu):
     bl_label = "Select"
 
     def draw(self, context):
@@ -496,7 +496,7 @@ class VIEW3D_MT_select_particle(bpy.types.Menu):
         layout.operator("particle.select_tips", text="Tips")
 
 
-class VIEW3D_MT_select_edit_mesh(bpy.types.Menu):
+class VIEW3D_MT_select_edit_mesh(Menu):
     bl_label = "Select"
 
     def draw(self, context):
@@ -548,7 +548,7 @@ class VIEW3D_MT_select_edit_mesh(bpy.types.Menu):
         layout.operator("mesh.region_to_loop")
 
 
-class VIEW3D_MT_select_edit_curve(bpy.types.Menu):
+class VIEW3D_MT_select_edit_curve(Menu):
     bl_label = "Select"
 
     def draw(self, context):
@@ -577,7 +577,7 @@ class VIEW3D_MT_select_edit_curve(bpy.types.Menu):
         layout.operator("curve.select_less")
 
 
-class VIEW3D_MT_select_edit_surface(bpy.types.Menu):
+class VIEW3D_MT_select_edit_surface(Menu):
     bl_label = "Select"
 
     def draw(self, context):
@@ -603,7 +603,7 @@ class VIEW3D_MT_select_edit_surface(bpy.types.Menu):
         layout.operator("curve.select_less")
 
 
-class VIEW3D_MT_select_edit_metaball(bpy.types.Menu):
+class VIEW3D_MT_select_edit_metaball(Menu):
     bl_label = "Select"
 
     def draw(self, context):
@@ -621,7 +621,7 @@ class VIEW3D_MT_select_edit_metaball(bpy.types.Menu):
         layout.operator("mball.select_random_metaelems")
 
 
-class VIEW3D_MT_select_edit_lattice(bpy.types.Menu):
+class VIEW3D_MT_select_edit_lattice(Menu):
     bl_label = "Select"
 
     def draw(self, context):
@@ -634,7 +634,7 @@ class VIEW3D_MT_select_edit_lattice(bpy.types.Menu):
         layout.operator("lattice.select_all", text="Select/Deselect All")
 
 
-class VIEW3D_MT_select_edit_armature(bpy.types.Menu):
+class VIEW3D_MT_select_edit_armature(Menu):
     bl_label = "Select"
 
     def draw(self, context):
@@ -665,7 +665,7 @@ class VIEW3D_MT_select_edit_armature(bpy.types.Menu):
         layout.operator("object.select_pattern", text="Select Pattern...")
 
 
-class VIEW3D_MT_select_face(bpy.types.Menu):  # XXX no matching enum
+class VIEW3D_MT_select_face(Menu):  # XXX no matching enum
     bl_label = "Select"
 
     def draw(self, context):
@@ -678,7 +678,7 @@ class VIEW3D_MT_select_face(bpy.types.Menu):  # XXX no matching enum
 # ********** Object menu **********
 
 
-class VIEW3D_MT_object(bpy.types.Menu):
+class VIEW3D_MT_object(Menu):
     bl_context = "objectmode"
     bl_label = "Object"
 
@@ -736,7 +736,7 @@ class VIEW3D_MT_object(bpy.types.Menu):
         layout.operator_menu_enum("object.convert", "target")
 
 
-class VIEW3D_MT_object_animation(bpy.types.Menu):
+class VIEW3D_MT_object_animation(Menu):
     bl_label = "Animation"
 
     def draw(self, context):
@@ -747,7 +747,7 @@ class VIEW3D_MT_object_animation(bpy.types.Menu):
         layout.operator("anim.keying_set_active_set", text="Change Keying Set...")
 
 
-class VIEW3D_MT_object_clear(bpy.types.Menu):
+class VIEW3D_MT_object_clear(Menu):
     bl_label = "Clear"
 
     def draw(self, context):
@@ -759,7 +759,7 @@ class VIEW3D_MT_object_clear(bpy.types.Menu):
         layout.operator("object.origin_clear", text="Origin")
 
 
-class VIEW3D_MT_object_specials(bpy.types.Menu):
+class VIEW3D_MT_object_specials(Menu):
     bl_label = "Specials"
 
     @classmethod
@@ -854,7 +854,7 @@ class VIEW3D_MT_object_specials(bpy.types.Menu):
         props = layout.operator("object.hide_render_clear_all")
 
 
-class VIEW3D_MT_object_apply(bpy.types.Menu):
+class VIEW3D_MT_object_apply(Menu):
     bl_label = "Apply"
 
     def draw(self, context):
@@ -873,7 +873,7 @@ class VIEW3D_MT_object_apply(bpy.types.Menu):
         layout.operator("object.duplicates_make_real")
 
 
-class VIEW3D_MT_object_parent(bpy.types.Menu):
+class VIEW3D_MT_object_parent(Menu):
     bl_label = "Parent"
 
     def draw(self, context):
@@ -883,7 +883,7 @@ class VIEW3D_MT_object_parent(bpy.types.Menu):
         layout.operator("object.parent_clear", text="Clear")
 
 
-class VIEW3D_MT_object_track(bpy.types.Menu):
+class VIEW3D_MT_object_track(Menu):
     bl_label = "Track"
 
     def draw(self, context):
@@ -893,7 +893,7 @@ class VIEW3D_MT_object_track(bpy.types.Menu):
         layout.operator("object.track_clear", text="Clear")
 
 
-class VIEW3D_MT_object_group(bpy.types.Menu):
+class VIEW3D_MT_object_group(Menu):
     bl_label = "Group"
 
     def draw(self, context):
@@ -908,7 +908,7 @@ class VIEW3D_MT_object_group(bpy.types.Menu):
         layout.operator("group.objects_remove_active")
 
 
-class VIEW3D_MT_object_constraints(bpy.types.Menu):
+class VIEW3D_MT_object_constraints(Menu):
     bl_label = "Constraints"
 
     def draw(self, context):
@@ -919,7 +919,7 @@ class VIEW3D_MT_object_constraints(bpy.types.Menu):
         layout.operator("object.constraints_clear")
 
 
-class VIEW3D_MT_object_showhide(bpy.types.Menu):
+class VIEW3D_MT_object_showhide(Menu):
     bl_label = "Show/Hide"
 
     def draw(self, context):
@@ -930,7 +930,7 @@ class VIEW3D_MT_object_showhide(bpy.types.Menu):
         layout.operator("object.hide_view_set", text="Hide Unselected").unselected = True
 
 
-class VIEW3D_MT_make_single_user(bpy.types.Menu):
+class VIEW3D_MT_make_single_user(Menu):
     bl_label = "Make Single User"
 
     def draw(self, context):
@@ -952,7 +952,7 @@ class VIEW3D_MT_make_single_user(bpy.types.Menu):
         props.animation = True
 
 
-class VIEW3D_MT_make_links(bpy.types.Menu):
+class VIEW3D_MT_make_links(Menu):
     bl_label = "Make Links"
 
     def draw(self, context):
@@ -969,7 +969,7 @@ class VIEW3D_MT_make_links(bpy.types.Menu):
         layout.operator_enum("object.make_links_data", "type")  # inline
 
 
-class VIEW3D_MT_object_game(bpy.types.Menu):
+class VIEW3D_MT_object_game(Menu):
     bl_label = "Game"
 
     def draw(self, context):
@@ -991,7 +991,7 @@ class VIEW3D_MT_object_game(bpy.types.Menu):
 # ********** Vertex paint menu **********
 
 
-class VIEW3D_MT_paint_vertex(bpy.types.Menu):
+class VIEW3D_MT_paint_vertex(Menu):
     bl_label = "Paint"
 
     def draw(self, context):
@@ -1006,7 +1006,7 @@ class VIEW3D_MT_paint_vertex(bpy.types.Menu):
         layout.operator("paint.vertex_color_dirt")
 
 
-class VIEW3D_MT_hook(bpy.types.Menu):
+class VIEW3D_MT_hook(Menu):
     bl_label = "Hooks"
 
     def draw(self, context):
@@ -1025,7 +1025,7 @@ class VIEW3D_MT_hook(bpy.types.Menu):
             layout.operator_menu_enum("object.hook_recenter", "modifier")
 
 
-class VIEW3D_MT_vertex_group(bpy.types.Menu):
+class VIEW3D_MT_vertex_group(Menu):
     bl_label = "Vertex Groups"
 
     def draw(self, context):
@@ -1050,7 +1050,7 @@ class VIEW3D_MT_vertex_group(bpy.types.Menu):
 # ********** Weight paint menu **********
 
 
-class VIEW3D_MT_paint_weight(bpy.types.Menu):
+class VIEW3D_MT_paint_weight(Menu):
     bl_label = "Weights"
 
     def draw(self, context):
@@ -1080,7 +1080,7 @@ class VIEW3D_MT_paint_weight(bpy.types.Menu):
 # ********** Sculpt menu **********
 
 
-class VIEW3D_MT_sculpt(bpy.types.Menu):
+class VIEW3D_MT_sculpt(Menu):
     bl_label = "Sculpt"
 
     def draw(self, context):
@@ -1130,7 +1130,7 @@ class VIEW3D_MT_sculpt(bpy.types.Menu):
 # ********** Particle menu **********
 
 
-class VIEW3D_MT_particle(bpy.types.Menu):
+class VIEW3D_MT_particle(Menu):
     bl_label = "Particle"
 
     def draw(self, context):
@@ -1162,7 +1162,7 @@ class VIEW3D_MT_particle(bpy.types.Menu):
         layout.menu("VIEW3D_MT_particle_showhide")
 
 
-class VIEW3D_MT_particle_specials(bpy.types.Menu):
+class VIEW3D_MT_particle_specials(Menu):
     bl_label = "Specials"
 
     def draw(self, context):
@@ -1180,13 +1180,13 @@ class VIEW3D_MT_particle_specials(bpy.types.Menu):
         layout.operator("particle.remove_doubles")
 
 
-class VIEW3D_MT_particle_showhide(ShowHideMenu, bpy.types.Menu):
+class VIEW3D_MT_particle_showhide(ShowHideMenu, Menu):
     _operator_name = "particle"
 
 # ********** Pose Menu **********
 
 
-class VIEW3D_MT_pose(bpy.types.Menu):
+class VIEW3D_MT_pose(Menu):
     bl_label = "Pose"
 
     def draw(self, context):
@@ -1255,7 +1255,7 @@ class VIEW3D_MT_pose(bpy.types.Menu):
         layout.menu("VIEW3D_MT_bone_options_toggle", text="Bone Settings")
 
 
-class VIEW3D_MT_pose_transform(bpy.types.Menu):
+class VIEW3D_MT_pose_transform(Menu):
     bl_label = "Clear Transform"
 
     def draw(self, context):
@@ -1263,14 +1263,18 @@ class VIEW3D_MT_pose_transform(bpy.types.Menu):
 
         layout.operator("pose.transforms_clear", text="All")
 
+        layout.separator()
+
         layout.operator("pose.loc_clear", text="Location")
         layout.operator("pose.rot_clear", text="Rotation")
         layout.operator("pose.scale_clear", text="Scale")
 
-        layout.label(text="Origin")
+        layout.separator()
+
+        layout.operator("pose.user_transforms_clear", text="Reset unkeyed")
 
 
-class VIEW3D_MT_pose_slide(bpy.types.Menu):
+class VIEW3D_MT_pose_slide(Menu):
     bl_label = "In-Betweens"
 
     def draw(self, context):
@@ -1281,7 +1285,7 @@ class VIEW3D_MT_pose_slide(bpy.types.Menu):
         layout.operator("pose.breakdown")
 
 
-class VIEW3D_MT_pose_propagate(bpy.types.Menu):
+class VIEW3D_MT_pose_propagate(Menu):
     bl_label = "Propagate"
 
     def draw(self, context):
@@ -1299,7 +1303,7 @@ class VIEW3D_MT_pose_propagate(bpy.types.Menu):
         layout.operator("pose.propagate", text="On Selected Markers").mode = 'SELECTED_MARKERS'
 
 
-class VIEW3D_MT_pose_library(bpy.types.Menu):
+class VIEW3D_MT_pose_library(Menu):
     bl_label = "Pose Library"
 
     def draw(self, context):
@@ -1314,7 +1318,7 @@ class VIEW3D_MT_pose_library(bpy.types.Menu):
         layout.operator("poselib.pose_remove", text="Remove Pose...")
 
 
-class VIEW3D_MT_pose_motion(bpy.types.Menu):
+class VIEW3D_MT_pose_motion(Menu):
     bl_label = "Motion Paths"
 
     def draw(self, context):
@@ -1324,7 +1328,7 @@ class VIEW3D_MT_pose_motion(bpy.types.Menu):
         layout.operator("pose.paths_clear", text="Clear")
 
 
-class VIEW3D_MT_pose_group(bpy.types.Menu):
+class VIEW3D_MT_pose_group(Menu):
     bl_label = "Bone Groups"
 
     def draw(self, context):
@@ -1338,7 +1342,7 @@ class VIEW3D_MT_pose_group(bpy.types.Menu):
         layout.operator("pose.group_unassign")
 
 
-class VIEW3D_MT_pose_ik(bpy.types.Menu):
+class VIEW3D_MT_pose_ik(Menu):
     bl_label = "Inverse Kinematics"
 
     def draw(self, context):
@@ -1348,7 +1352,7 @@ class VIEW3D_MT_pose_ik(bpy.types.Menu):
         layout.operator("pose.ik_clear")
 
 
-class VIEW3D_MT_pose_constraints(bpy.types.Menu):
+class VIEW3D_MT_pose_constraints(Menu):
     bl_label = "Constraints"
 
     def draw(self, context):
@@ -1359,11 +1363,11 @@ class VIEW3D_MT_pose_constraints(bpy.types.Menu):
         layout.operator("pose.constraints_clear")
 
 
-class VIEW3D_MT_pose_showhide(ShowHideMenu, bpy.types.Menu):
+class VIEW3D_MT_pose_showhide(ShowHideMenu, Menu):
     _operator_name = "pose"
 
 
-class VIEW3D_MT_pose_apply(bpy.types.Menu):
+class VIEW3D_MT_pose_apply(Menu):
     bl_label = "Apply"
 
     def draw(self, context):
@@ -1402,24 +1406,24 @@ class BoneOptions:
             props.type = self.type
 
 
-class VIEW3D_MT_bone_options_toggle(bpy.types.Menu, BoneOptions):
+class VIEW3D_MT_bone_options_toggle(Menu, BoneOptions):
     bl_label = "Toggle Bone Options"
     type = 'TOGGLE'
 
 
-class VIEW3D_MT_bone_options_enable(bpy.types.Menu, BoneOptions):
+class VIEW3D_MT_bone_options_enable(Menu, BoneOptions):
     bl_label = "Enable Bone Options"
     type = 'ENABLE'
 
 
-class VIEW3D_MT_bone_options_disable(bpy.types.Menu, BoneOptions):
+class VIEW3D_MT_bone_options_disable(Menu, BoneOptions):
     bl_label = "Disable Bone Options"
     type = 'DISABLE'
 
 # ********** Edit Menus, suffix from ob.type **********
 
 
-class VIEW3D_MT_edit_mesh(bpy.types.Menu):
+class VIEW3D_MT_edit_mesh(Menu):
     bl_label = "Mesh"
 
     def draw(self, context):
@@ -1466,7 +1470,7 @@ class VIEW3D_MT_edit_mesh(bpy.types.Menu):
         layout.menu("VIEW3D_MT_edit_mesh_showhide")
 
 
-class VIEW3D_MT_edit_mesh_specials(bpy.types.Menu):
+class VIEW3D_MT_edit_mesh_specials(Menu):
     bl_label = "Specials"
 
     def draw(self, context):
@@ -1491,7 +1495,7 @@ class VIEW3D_MT_edit_mesh_specials(bpy.types.Menu):
         layout.operator("mesh.select_vertex_path")
 
 
-class VIEW3D_MT_edit_mesh_select_mode(bpy.types.Menu):
+class VIEW3D_MT_edit_mesh_select_mode(Menu):
     bl_label = "Mesh Select Mode"
 
     def draw(self, context):
@@ -1512,7 +1516,7 @@ class VIEW3D_MT_edit_mesh_select_mode(bpy.types.Menu):
         prop.data_path = "tool_settings.mesh_select_mode"
 
 
-class VIEW3D_MT_edit_mesh_extrude(bpy.types.Menu):
+class VIEW3D_MT_edit_mesh_extrude(Menu):
     bl_label = "Extrude"
 
     _extrude_funcs = { \
@@ -1546,7 +1550,7 @@ class VIEW3D_MT_edit_mesh_extrude(bpy.types.Menu):
             self._extrude_funcs[menu_id](layout)
 
 
-class VIEW3D_OT_edit_mesh_extrude_individual_move(bpy.types.Operator):
+class VIEW3D_OT_edit_mesh_extrude_individual_move(Operator):
     "Extrude individual elements and move"
     bl_label = "Extrude Individual and Move"
     bl_idname = "view3d.edit_mesh_extrude_individual_move"
@@ -1575,7 +1579,7 @@ class VIEW3D_OT_edit_mesh_extrude_individual_move(bpy.types.Operator):
         return self.execute(context)
 
 
-class VIEW3D_OT_edit_mesh_extrude_move(bpy.types.Operator):
+class VIEW3D_OT_edit_mesh_extrude_move(Operator):
     "Extrude and move along normals"
     bl_label = "Extrude and Move on Normals"
     bl_idname = "view3d.edit_mesh_extrude_move_normal"
@@ -1601,7 +1605,7 @@ class VIEW3D_OT_edit_mesh_extrude_move(bpy.types.Operator):
         return self.execute(context)
 
 
-class VIEW3D_MT_edit_mesh_vertices(bpy.types.Menu):
+class VIEW3D_MT_edit_mesh_vertices(Menu):
     bl_label = "Vertices"
 
     def draw(self, context):
@@ -1633,7 +1637,7 @@ class VIEW3D_MT_edit_mesh_vertices(bpy.types.Menu):
         layout.menu("VIEW3D_MT_hook")
 
 
-class VIEW3D_MT_edit_mesh_edges(bpy.types.Menu):
+class VIEW3D_MT_edit_mesh_edges(Menu):
     bl_label = "Edges"
 
     def draw(self, context):
@@ -1673,7 +1677,7 @@ class VIEW3D_MT_edit_mesh_edges(bpy.types.Menu):
         layout.operator("mesh.region_to_loop")
 
 
-class VIEW3D_MT_edit_mesh_faces(bpy.types.Menu):
+class VIEW3D_MT_edit_mesh_faces(Menu):
     bl_label = "Faces"
     bl_idname = "VIEW3D_MT_edit_mesh_faces"
 
@@ -1721,7 +1725,7 @@ class VIEW3D_MT_edit_mesh_faces(bpy.types.Menu):
         layout.operator_menu_enum("mesh.colors_mirror", "axis")
 
 
-class VIEW3D_MT_edit_mesh_normals(bpy.types.Menu):
+class VIEW3D_MT_edit_mesh_normals(Menu):
     bl_label = "Normals"
 
     def draw(self, context):
@@ -1735,7 +1739,7 @@ class VIEW3D_MT_edit_mesh_normals(bpy.types.Menu):
         layout.operator("mesh.flip_normals")
 
 
-class VIEW3D_MT_edit_mesh_showhide(ShowHideMenu, bpy.types.Menu):
+class VIEW3D_MT_edit_mesh_showhide(ShowHideMenu, Menu):
     _operator_name = "mesh"
 
 # Edit Curve
@@ -1775,13 +1779,13 @@ def draw_curve(self, context):
     layout.menu("VIEW3D_MT_edit_curve_showhide")
 
 
-class VIEW3D_MT_edit_curve(bpy.types.Menu):
+class VIEW3D_MT_edit_curve(Menu):
     bl_label = "Curve"
 
     draw = draw_curve
 
 
-class VIEW3D_MT_edit_curve_ctrlpoints(bpy.types.Menu):
+class VIEW3D_MT_edit_curve_ctrlpoints(Menu):
     bl_label = "Control Points"
 
     def draw(self, context):
@@ -1803,7 +1807,7 @@ class VIEW3D_MT_edit_curve_ctrlpoints(bpy.types.Menu):
             layout.menu("VIEW3D_MT_hook")
 
 
-class VIEW3D_MT_edit_curve_segments(bpy.types.Menu):
+class VIEW3D_MT_edit_curve_segments(Menu):
     bl_label = "Segments"
 
     def draw(self, context):
@@ -1813,7 +1817,7 @@ class VIEW3D_MT_edit_curve_segments(bpy.types.Menu):
         layout.operator("curve.switch_direction")
 
 
-class VIEW3D_MT_edit_curve_specials(bpy.types.Menu):
+class VIEW3D_MT_edit_curve_specials(Menu):
     bl_label = "Specials"
 
     def draw(self, context):
@@ -1827,17 +1831,17 @@ class VIEW3D_MT_edit_curve_specials(bpy.types.Menu):
         layout.operator("curve.smooth_radius")
 
 
-class VIEW3D_MT_edit_curve_showhide(ShowHideMenu, bpy.types.Menu):
+class VIEW3D_MT_edit_curve_showhide(ShowHideMenu, Menu):
     _operator_name = "curve"
 
 
-class VIEW3D_MT_edit_surface(bpy.types.Menu):
+class VIEW3D_MT_edit_surface(Menu):
     bl_label = "Surface"
 
     draw = draw_curve
 
 
-class VIEW3D_MT_edit_font(bpy.types.Menu):
+class VIEW3D_MT_edit_font(Menu):
     bl_label = "Text"
 
     def draw(self, context):
@@ -1857,7 +1861,7 @@ class VIEW3D_MT_edit_font(bpy.types.Menu):
         layout.operator("font.style_toggle", text="Toggle Small Caps").style = 'SMALL_CAPS'
 
 
-class VIEW3D_MT_edit_text_chars(bpy.types.Menu):
+class VIEW3D_MT_edit_text_chars(Menu):
     bl_label = "Special Characters"
 
     def draw(self, context):
@@ -1891,7 +1895,7 @@ class VIEW3D_MT_edit_text_chars(bpy.types.Menu):
         layout.operator("font.text_insert", text="Spanish Exclamation Mark|Alt !").text = b'\xC2\xA1'.decode()
 
 
-class VIEW3D_MT_edit_meta(bpy.types.Menu):
+class VIEW3D_MT_edit_meta(Menu):
     bl_label = "Metaball"
 
     def draw(self, context):
@@ -1924,7 +1928,7 @@ class VIEW3D_MT_edit_meta(bpy.types.Menu):
         layout.menu("VIEW3D_MT_edit_meta_showhide")
 
 
-class VIEW3D_MT_edit_meta_showhide(bpy.types.Menu):
+class VIEW3D_MT_edit_meta_showhide(Menu):
     bl_label = "Show/Hide"
 
     def draw(self, context):
@@ -1935,7 +1939,7 @@ class VIEW3D_MT_edit_meta_showhide(bpy.types.Menu):
         layout.operator("mball.hide_metaelems", text="Hide Unselected").unselected = True
 
 
-class VIEW3D_MT_edit_lattice(bpy.types.Menu):
+class VIEW3D_MT_edit_lattice(Menu):
     bl_label = "Lattice"
 
     def draw(self, context):
@@ -1957,7 +1961,7 @@ class VIEW3D_MT_edit_lattice(bpy.types.Menu):
         layout.prop_menu_enum(settings, "proportional_edit_falloff")
 
 
-class VIEW3D_MT_edit_armature(bpy.types.Menu):
+class VIEW3D_MT_edit_armature(Menu):
     bl_label = "Armature"
 
     def draw(self, context):
@@ -2012,7 +2016,7 @@ class VIEW3D_MT_edit_armature(bpy.types.Menu):
         layout.menu("VIEW3D_MT_bone_options_toggle", text="Bone Settings")
 
 
-class VIEW3D_MT_armature_specials(bpy.types.Menu):
+class VIEW3D_MT_armature_specials(Menu):
     bl_label = "Specials"
 
     def draw(self, context):
@@ -2032,7 +2036,7 @@ class VIEW3D_MT_armature_specials(bpy.types.Menu):
         layout.operator("armature.flip_names", text="Flip Names")
 
 
-class VIEW3D_MT_edit_armature_parent(bpy.types.Menu):
+class VIEW3D_MT_edit_armature_parent(Menu):
     bl_label = "Parent"
 
     def draw(self, context):
@@ -2042,7 +2046,7 @@ class VIEW3D_MT_edit_armature_parent(bpy.types.Menu):
         layout.operator("armature.parent_clear", text="Clear")
 
 
-class VIEW3D_MT_edit_armature_roll(bpy.types.Menu):
+class VIEW3D_MT_edit_armature_roll(Menu):
     bl_label = "Bone Roll"
 
     def draw(self, context):
@@ -2057,7 +2061,7 @@ class VIEW3D_MT_edit_armature_roll(bpy.types.Menu):
 # ********** Panel **********
 
 
-class VIEW3D_PT_view3d_properties(bpy.types.Panel):
+class VIEW3D_PT_view3d_properties(Panel):
     bl_space_type = 'VIEW_3D'
     bl_region_type = 'UI'
     bl_label = "View"
@@ -2077,9 +2081,11 @@ class VIEW3D_PT_view3d_properties(bpy.types.Panel):
         col.prop(view, "lens")
         col.label(text="Lock to Object:")
         col.prop(view, "lock_object", text="")
-        if view.lock_object and view.lock_object.type == 'ARMATURE':
-            col.prop_search(view, "lock_bone", view.lock_object.data, "bones", text="")
-        elif not view.lock_object:
+        lock_object = view.lock_object
+        if lock_object:
+            if lock_object.type == 'ARMATURE':
+                col.prop_search(view, "lock_bone", lock_object.data, "edit_bones" if lock_object.mode == 'EDIT' else "bones", text="")
+        else:
             col.prop(view, "lock_cursor", text="Lock to Cursor")
 
         col = layout.column()
@@ -2098,7 +2104,7 @@ class VIEW3D_PT_view3d_properties(bpy.types.Panel):
         layout.column().prop(view, "cursor_location")
 
 
-class VIEW3D_PT_view3d_name(bpy.types.Panel):
+class VIEW3D_PT_view3d_name(Panel):
     bl_space_type = 'VIEW_3D'
     bl_region_type = 'UI'
     bl_label = "Item"
@@ -2123,7 +2129,7 @@ class VIEW3D_PT_view3d_name(bpy.types.Panel):
                 row.prop(bone, "name", text="")
 
 
-class VIEW3D_PT_view3d_display(bpy.types.Panel):
+class VIEW3D_PT_view3d_display(Panel):
     bl_space_type = 'VIEW_3D'
     bl_region_type = 'UI'
     bl_label = "Display"
@@ -2180,6 +2186,16 @@ class VIEW3D_PT_view3d_display(bpy.types.Panel):
 
         layout.separator()
 
+        layout.prop(view, "show_reconstruction")
+        if view.show_reconstruction:
+            layout.label(text="Bundle type:")
+            layout.prop(view, "bundle_draw_type", text="")
+            layout.prop(view, "bundle_draw_size")
+            layout.prop(view, "show_bundle_name")
+            layout.prop(view, "show_camera_path")
+
+        layout.separator()
+
         region = view.region_quadview
 
         layout.operator("screen.region_quadview", text="Toggle Quad View")
@@ -2195,7 +2211,7 @@ class VIEW3D_PT_view3d_display(bpy.types.Panel):
             row.prop(region, "use_box_clip")
 
 
-class VIEW3D_PT_view3d_meshdisplay(bpy.types.Panel):
+class VIEW3D_PT_view3d_meshdisplay(Panel):
     bl_space_type = 'VIEW_3D'
     bl_region_type = 'UI'
     bl_label = "Mesh Display"
@@ -2232,7 +2248,7 @@ class VIEW3D_PT_view3d_meshdisplay(bpy.types.Panel):
         col.prop(mesh, "show_extra_face_area")
 
 
-class VIEW3D_PT_view3d_curvedisplay(bpy.types.Panel):
+class VIEW3D_PT_view3d_curvedisplay(Panel):
     bl_space_type = 'VIEW_3D'
     bl_region_type = 'UI'
     bl_label = "Curve Display"
@@ -2254,7 +2270,7 @@ class VIEW3D_PT_view3d_curvedisplay(bpy.types.Panel):
         col.prop(context.scene.tool_settings, "normal_size", text="Normal Size")
 
 
-class VIEW3D_PT_background_image(bpy.types.Panel):
+class VIEW3D_PT_background_image(Panel):
     bl_space_type = 'VIEW_3D'
     bl_region_type = 'UI'
     bl_label = "Background Images"
@@ -2285,8 +2301,10 @@ class VIEW3D_PT_background_image(bpy.types.Panel):
             box = layout.box()
             row = box.row(align=True)
             row.prop(bg, "show_expanded", text="", emboss=False)
-            if bg.image:
+            if bg.source == 'IMAGE' and bg.image:
                 row.prop(bg.image, "name", text="", emboss=False)
+            if bg.source == 'MOVIE' and bg.clip:
+                row.prop(bg.clip, "name", text="", emboss=False)
             else:
                 row.label(text="Not Set")
             row.operator("view3d.background_image_remove", text="", emboss=False, icon='X').index = i
@@ -2295,10 +2313,25 @@ class VIEW3D_PT_background_image(bpy.types.Panel):
 
             if bg.show_expanded:
                 row = box.row()
-                row.template_ID(bg, "image", open="image.open")
-                if (bg.image):
-                    box.template_image(bg, "image", bg.image_user, compact=True)
+                row.prop(bg, "source", expand=True)
+
+                hasbg = False
+                if bg.source == 'IMAGE':
+                    row = box.row()
+                    row.template_ID(bg, "image", open="image.open")
+                    if (bg.image):
+                        box.template_image(bg, "image", bg.image_user, compact=True)
+                        hasbg = True
+
+                elif bg.source == 'MOVIE':
+                    row = box.row()
+                    row.template_ID(bg, "clip", open="clip.open")
+
+                    if bg.clip:
+                        box.template_movieclip(bg, "clip", compact=True)
+                        hasbg = True
 
+                if hasbg:
                     box.prop(bg, "opacity", slider=True)
                     if bg.view_axis != 'CAMERA':
                         box.prop(bg, "size")
@@ -2307,7 +2340,7 @@ class VIEW3D_PT_background_image(bpy.types.Panel):
                         row.prop(bg, "offset_y", text="Y")
 
 
-class VIEW3D_PT_transform_orientations(bpy.types.Panel):
+class VIEW3D_PT_transform_orientations(Panel):
     bl_space_type = 'VIEW_3D'
     bl_region_type = 'UI'
     bl_label = "Transform Orientations"
@@ -2335,7 +2368,7 @@ class VIEW3D_PT_transform_orientations(bpy.types.Panel):
             col.operator("transform.delete_orientation", text="Delete")
 
 
-class VIEW3D_PT_etch_a_ton(bpy.types.Panel):
+class VIEW3D_PT_etch_a_ton(Panel):
     bl_space_type = 'VIEW_3D'
     bl_region_type = 'UI'
     bl_label = "Skeleton Sketching"
@@ -2380,7 +2413,7 @@ class VIEW3D_PT_etch_a_ton(bpy.types.Panel):
         col.operator("sketch.convert", text="Convert")
 
 
-class VIEW3D_PT_context_properties(bpy.types.Panel):
+class VIEW3D_PT_context_properties(Panel):
     bl_space_type = 'VIEW_3D'
     bl_region_type = 'UI'
     bl_label = "Properties"