~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to release/scripts/startup/bl_ui/space_view3d.py

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
            sub.menu("VIEW3D_MT_view")
45
45
 
46
46
            # Select Menu
47
 
            if mode_string not in {'EDIT_TEXT', 'SCULPT', 'PAINT_WEIGHT', 'PAINT_VERTEX', 'PAINT_TEXTURE'}:
 
47
            if mode_string in {'PAINT_WEIGHT', 'PAINT_VERTEX', 'PAINT_TEXTURE'}:
 
48
                mesh = obj.data
 
49
                if mesh.use_paint_mask:
 
50
                    sub.menu("VIEW3D_MT_select_paint_mask")
 
51
                elif mesh.use_paint_mask_vertex and mode_string == 'PAINT_WEIGHT':
 
52
                    sub.menu("VIEW3D_MT_select_paint_mask_vertex")
 
53
            elif mode_string not in {'EDIT_TEXT', 'SCULPT'}:
48
54
                sub.menu("VIEW3D_MT_select_%s" % mode_string.lower())
49
55
 
50
56
            if edit_object:
55
61
                if mode_string in {'SCULPT', 'PAINT_VERTEX', 'PAINT_WEIGHT', 'PAINT_TEXTURE'}:
56
62
                    sub.menu("VIEW3D_MT_brush")
57
63
                if mode_string == 'SCULPT':
58
 
                    sub.menu("VIEW3D_MT_hide")
 
64
                    sub.menu("VIEW3D_MT_hide_mask")
59
65
            else:
60
66
                sub.menu("VIEW3D_MT_object")
61
67
 
64
70
        layout.template_header_3D()
65
71
 
66
72
        if obj:
 
73
            mode = obj.mode
67
74
            # Particle edit
68
 
            if obj.mode == 'PARTICLE_EDIT':
 
75
            if mode == 'PARTICLE_EDIT':
69
76
                row.prop(toolsettings.particle_edit, "select_mode", text="", expand=True)
70
77
 
71
78
            # Occlude geometry
72
 
            if view.viewport_shade not in {'BOUNDBOX', 'WIREFRAME'} and (obj.mode == 'PARTICLE_EDIT' or (obj.mode == 'EDIT' and obj.type == 'MESH')):
 
79
            if ((view.viewport_shade not in {'BOUNDBOX', 'WIREFRAME'} and (mode == 'PARTICLE_EDIT' or (mode == 'EDIT' and obj.type == 'MESH'))) or
 
80
                    (mode == 'WEIGHT_PAINT')):
73
81
                row.prop(view, "use_occlude_geometry", text="")
74
82
 
75
83
            # Proportional editing
76
 
            if obj.mode in {'EDIT', 'PARTICLE_EDIT'}:
 
84
            if mode in {'EDIT', 'PARTICLE_EDIT'}:
77
85
                row = layout.row(align=True)
78
86
                row.prop(toolsettings, "proportional_edit", text="", icon_only=True)
79
87
                if toolsettings.proportional_edit != 'DISABLED':
80
88
                    row.prop(toolsettings, "proportional_edit_falloff", text="", icon_only=True)
81
 
            elif obj.mode == 'OBJECT':
 
89
            elif mode == 'OBJECT':
82
90
                row = layout.row(align=True)
83
91
                row.prop(toolsettings, "use_proportional_edit_objects", text="", icon_only=True)
84
92
                if toolsettings.use_proportional_edit_objects:
85
93
                    row.prop(toolsettings, "proportional_edit_falloff", text="", icon_only=True)
86
94
 
87
95
        # Snap
88
 
        if not obj or obj.mode not in {'SCULPT', 'VERTEX_PAINT', 'WEIGHT_PAINT', 'TEXTURE_PAINT'}:
 
96
        if not obj or mode not in {'SCULPT', 'VERTEX_PAINT', 'WEIGHT_PAINT', 'TEXTURE_PAINT'}:
89
97
            snap_element = toolsettings.snap_element
90
98
            row = layout.row(align=True)
91
99
            row.prop(toolsettings, "use_snap", text="")
93
101
            if snap_element != 'INCREMENT':
94
102
                row.prop(toolsettings, "snap_target", text="")
95
103
                if obj:
96
 
                    if obj.mode == 'OBJECT' and snap_element != 'VOLUME':
 
104
                    if mode in {'OBJECT', 'POSE'} and snap_element != 'VOLUME':
97
105
                        row.prop(toolsettings, "use_snap_align_rotation", text="")
98
 
                    elif obj.mode == 'EDIT':
 
106
                    elif mode == 'EDIT':
99
107
                        row.prop(toolsettings, "use_snap_self", text="")
100
108
 
101
109
            if snap_element == 'VOLUME':
110
118
        props.animation = True
111
119
 
112
120
        # Pose
113
 
        if obj and obj.mode == 'POSE':
 
121
        if obj and mode == 'POSE':
114
122
            row = layout.row(align=True)
115
123
            row.operator("pose.copy", text="", icon='COPYDOWN')
116
124
            row.operator("pose.paste", text="", icon='PASTEDOWN')
164
172
    def draw(self, context):
165
173
        # base menu
166
174
        VIEW3D_MT_transform_base.draw(self, context)
167
 
        
 
175
 
168
176
        # generic...
169
177
        layout = self.layout
 
178
        layout.operator("transform.shrink_fatten", text="Shrink Fatten")
 
179
 
170
180
        layout.separator()
171
181
 
172
182
        layout.operator("transform.translate", text="Move Texture Space").texture_space = True
176
186
# Object-specific extensions to Transform menu
177
187
class VIEW3D_MT_transform_object(VIEW3D_MT_transform_base):
178
188
    def draw(self, context):
 
189
        layout = self.layout
 
190
 
179
191
        # base menu
180
192
        VIEW3D_MT_transform_base.draw(self, context)
181
 
        
 
193
 
182
194
        # object-specific option follow...
183
 
        layout = self.layout
184
195
        layout.separator()
185
196
 
186
197
        layout.operator("transform.translate", text="Move Texture Space").texture_space = True
187
198
        layout.operator("transform.resize", text="Scale Texture Space").texture_space = True
188
 
        
 
199
 
189
200
        layout.separator()
190
 
        
 
201
 
191
202
        layout.operator_context = 'EXEC_REGION_WIN'
192
203
        layout.operator("transform.transform", text="Align to Transform Orientation").mode = 'ALIGN'  # XXX see alignmenu() in edit.c of b2.4x to get this working
193
204
 
198
209
        layout.operator("object.origin_set", text="Geometry to Origin").type = 'GEOMETRY_ORIGIN'
199
210
        layout.operator("object.origin_set", text="Origin to Geometry").type = 'ORIGIN_GEOMETRY'
200
211
        layout.operator("object.origin_set", text="Origin to 3D Cursor").type = 'ORIGIN_CURSOR'
201
 
 
 
212
        layout.operator("object.origin_set", text="Origin to Center of Mass").type = 'ORIGIN_TO_CENTER_OF_MASS'
202
213
        layout.separator()
203
214
 
204
215
        layout.operator("object.randomize_transform")
212
223
# Armature EditMode extensions to Transform menu
213
224
class VIEW3D_MT_transform_armature(VIEW3D_MT_transform_base):
214
225
    def draw(self, context):
 
226
        layout = self.layout
 
227
 
215
228
        # base menu
216
229
        VIEW3D_MT_transform_base.draw(self, context)
217
 
        
 
230
 
218
231
        # armature specific extensions follow...
219
 
        layout = self.layout
220
232
        layout.separator()
221
233
 
222
234
        obj = context.object
223
 
        if (obj.type == 'ARMATURE' and obj.mode in {'EDIT', 'POSE'} and 
224
 
            obj.data.draw_type in {'BBONE', 'ENVELOPE'}):
 
235
        if     (obj.type == 'ARMATURE' and obj.mode in {'EDIT', 'POSE'} and
 
236
                obj.data.draw_type in {'BBONE', 'ENVELOPE'}):
225
237
            layout.operator("transform.transform", text="Scale Envelope/BBone").mode = 'BONE_SIZE'
226
238
 
227
239
        if context.edit_object and context.edit_object.type == 'ARMATURE':
353
365
 
354
366
        layout.operator("view3d.clip_border", text="Clipping Border...")
355
367
        layout.operator("view3d.zoom_border", text="Zoom Border...")
 
368
        layout.operator("view3d.render_border", text="Render Border...")
356
369
 
357
370
        layout.separator()
358
371
 
414
427
        layout.operator("view3d.view_selected")
415
428
        layout.operator("view3d.view_center_cursor")
416
429
 
 
430
        layout.separator()
 
431
 
 
432
        layout.operator("view3d.view_lock_to_active")
 
433
        layout.operator("view3d.view_lock_clear")
 
434
 
417
435
 
418
436
class VIEW3D_MT_view_align_selected(Menu):
419
437
    bl_label = "Align View to Selected"
424
442
        props = layout.operator("view3d.viewnumpad", text="Top")
425
443
        props.align_active = True
426
444
        props.type = 'TOP'
 
445
 
427
446
        props = layout.operator("view3d.viewnumpad", text="Bottom")
428
447
        props.align_active = True
429
448
        props.type = 'BOTTOM'
 
449
 
430
450
        props = layout.operator("view3d.viewnumpad", text="Front")
431
451
        props.align_active = True
432
452
        props.type = 'FRONT'
 
453
 
433
454
        props = layout.operator("view3d.viewnumpad", text="Back")
434
455
        props.align_active = True
435
456
        props.type = 'BACK'
 
457
 
436
458
        props = layout.operator("view3d.viewnumpad", text="Right")
437
459
        props.align_active = True
438
460
        props.type = 'RIGHT'
 
461
 
439
462
        props = layout.operator("view3d.viewnumpad", text="Left")
440
463
        props.align_active = True
441
464
        props.type = 'LEFT'
558
581
        layout.separator()
559
582
 
560
583
        layout.operator("mesh.select_random", text="Random")
561
 
        layout.operator("mesh.select_nth", text="Every N Number of Verts")
 
584
        layout.operator("mesh.select_nth")
562
585
        layout.operator("mesh.edges_select_sharp", text="Sharp Edges")
563
586
        layout.operator("mesh.faces_select_linked_flat", text="Linked Flat Faces")
564
587
        layout.operator("mesh.select_interior_faces", text="Interior Faces")
566
589
 
567
590
        layout.separator()
568
591
 
569
 
        layout.operator("mesh.select_by_number_vertices", text="By Number of Verts")
570
 
        if context.scene.tool_settings.mesh_select_mode[2] == False:
 
592
        layout.operator("mesh.select_face_by_sides")
 
593
        if context.scene.tool_settings.mesh_select_mode[2] is False:
571
594
            layout.operator("mesh.select_non_manifold", text="Non Manifold")
572
595
        layout.operator("mesh.select_loose_verts", text="Loose Verts/Edges")
573
 
        layout.operator("mesh.select_similar", text="Similar")
 
596
        layout.operator_menu_enum("mesh.select_similar", "type", text="Similar")
574
597
 
575
598
        layout.separator()
576
599
 
607
630
        layout.operator("curve.select_all", text="Inverse").action = 'INVERT'
608
631
        layout.operator("curve.select_random")
609
632
        layout.operator("curve.select_nth", text="Every Nth Number of Points")
 
633
        layout.operator("curve.select_linked", text="Select Linked")
610
634
 
611
635
        layout.separator()
612
636
 
636
660
        layout.operator("curve.select_all", text="Inverse").action = 'INVERT'
637
661
        layout.operator("curve.select_random")
638
662
        layout.operator("curve.select_nth", text="Every Nth Number of Points")
 
663
        layout.operator("curve.select_linked", text="Select Linked")
639
664
 
640
665
        layout.separator()
641
666
 
654
679
        layout = self.layout
655
680
 
656
681
        layout.operator("view3d.select_border")
 
682
        layout.operator("view3d.select_circle")
657
683
 
658
684
        layout.separator()
659
685
 
707
733
        props.extend = True
708
734
        props.direction = 'CHILD'
709
735
 
 
736
        layout.operator_menu_enum("armature.select_similar", "type", text="Similar")
710
737
        layout.operator("object.select_pattern", text="Select Pattern...")
711
738
 
712
739
 
713
 
class VIEW3D_MT_select_face(Menu):  # XXX no matching enum
714
 
    bl_label = "Select"
715
 
 
716
 
    def draw(self, context):
717
 
        # layout = self.layout
718
 
 
719
 
        # TODO
720
 
        # see view3d_select_faceselmenu
721
 
        pass
 
740
class VIEW3D_MT_select_paint_mask(Menu):
 
741
    bl_label = "Select"
 
742
 
 
743
    def draw(self, context):
 
744
        layout = self.layout
 
745
 
 
746
        layout.operator("view3d.select_border")
 
747
        layout.operator("view3d.select_circle")
 
748
 
 
749
        layout.separator()
 
750
 
 
751
        layout.operator("paint.face_select_all").action = 'TOGGLE'
 
752
        layout.operator("paint.face_select_all", text="Inverse").action = 'INVERT'
 
753
 
 
754
        layout.separator()
 
755
 
 
756
        layout.operator("paint.face_select_linked", text="Linked")
 
757
 
 
758
 
 
759
class VIEW3D_MT_select_paint_mask_vertex(Menu):
 
760
    bl_label = "Select"
 
761
 
 
762
    def draw(self, context):
 
763
        layout = self.layout
 
764
 
 
765
        layout.operator("view3d.select_border")
 
766
        layout.operator("view3d.select_circle")
 
767
 
 
768
        layout.separator()
 
769
 
 
770
        layout.operator("paint.vert_select_all").action = 'TOGGLE'
 
771
        layout.operator("paint.vert_select_all", text="Inverse").action = 'INVERT'
 
772
 
722
773
 
723
774
# ********** Object menu **********
724
775
 
791
842
        layout = self.layout
792
843
 
793
844
        layout.operator("anim.keyframe_insert_menu", text="Insert Keyframe...")
794
 
        layout.operator("anim.keyframe_delete_v3d", text="Delete Keyframe...")
 
845
        layout.operator("anim.keyframe_delete_v3d", text="Delete Keyframes...")
 
846
        layout.operator("anim.keyframe_clear_v3d", text="Clear Keyframes...")
795
847
        layout.operator("anim.keying_set_active_set", text="Change Keying Set...")
796
848
 
797
849
        layout.separator()
951
1003
    def draw(self, context):
952
1004
        layout = self.layout
953
1005
 
954
 
        layout.operator_menu_enum("object.parent_set", "type", text="Set")
955
 
        layout.operator_menu_enum("object.parent_clear", "type", text="Clear")
 
1006
        layout.operator_enum("object.parent_set", "type")
 
1007
        layout.separator()
 
1008
        layout.operator_enum("object.parent_clear", "type")
956
1009
 
957
1010
 
958
1011
class VIEW3D_MT_object_track(Menu):
961
1014
    def draw(self, context):
962
1015
        layout = self.layout
963
1016
 
964
 
        layout.operator_menu_enum("object.track_set", "type", text="Set")
965
 
        layout.operator_menu_enum("object.track_clear", "type", text="Clear")
 
1017
        layout.operator_enum("object.track_set", "type")
 
1018
        layout.separator()
 
1019
        layout.operator_enum("object.track_clear", "type")
966
1020
 
967
1021
 
968
1022
class VIEW3D_MT_object_group(Menu):
972
1026
        layout = self.layout
973
1027
 
974
1028
        layout.operator("group.create")
 
1029
        # layout.operator_menu_enum("group.objects_remove", "group")  # BUGGY
975
1030
        layout.operator("group.objects_remove")
 
1031
        layout.operator("group.objects_remove_all")
976
1032
 
977
1033
        layout.separator()
978
1034
 
1041
1097
 
1042
1098
    def draw(self, context):
1043
1099
        layout = self.layout
1044
 
 
 
1100
        operator_context_default = layout.operator_context
1045
1101
        if(len(bpy.data.scenes) > 10):
1046
 
            layout.operator_context = 'INVOKE_DEFAULT'
 
1102
            layout.operator_context = 'INVOKE_REGION_WIN'
1047
1103
            layout.operator("object.make_links_scene", text="Objects to Scene...", icon='OUTLINER_OB_EMPTY')
1048
1104
        else:
 
1105
            layout.operator_context = 'EXEC_REGION_WIN'
1049
1106
            layout.operator_menu_enum("object.make_links_scene", "scene", text="Objects to Scene...")
 
1107
        layout.operator_context = operator_context_default
1050
1108
 
1051
1109
        layout.operator_enum("object.make_links_data", "type")  # inline
1052
1110
 
1112
1170
            sculpt_tool = brush.sculpt_tool
1113
1171
 
1114
1172
            layout.separator()
1115
 
            layout.operator_menu_enum("brush.curve_preset", "shape", text='Curve Preset')
 
1173
            layout.operator_menu_enum("brush.curve_preset", "shape", text="Curve Preset")
1116
1174
            layout.separator()
1117
1175
 
1118
1176
            if sculpt_tool != 'GRAB':
1165
1223
        layout = self.layout
1166
1224
        layout.operator_context = 'EXEC_AREA'
1167
1225
        layout.operator("object.hook_add_newob")
1168
 
        layout.operator("object.hook_add_selob")
 
1226
        layout.operator("object.hook_add_selob").use_bone = False
 
1227
        layout.operator("object.hook_add_selob", text="Hook to Selected Object Bone").use_bone = True
1169
1228
 
1170
1229
        if [mod.type == 'HOOK' for mod in context.active_object.modifiers]:
1171
1230
            layout.separator()
1182
1241
 
1183
1242
    def draw(self, context):
1184
1243
        layout = self.layout
 
1244
 
1185
1245
        layout.operator_context = 'EXEC_AREA'
1186
1246
        layout.operator("object.vertex_group_assign", text="Assign to New Group").new = True
1187
1247
 
1189
1249
        if ob.mode == 'EDIT' or (ob.mode == 'WEIGHT_PAINT' and ob.type == 'MESH' and ob.data.use_paint_mask_vertex):
1190
1250
            if ob.vertex_groups.active:
1191
1251
                layout.separator()
1192
 
                layout.operator("object.vertex_group_assign", text="Assign to Active Group")
 
1252
                layout.operator("object.vertex_group_assign", text="Assign to Active Group").new = False
1193
1253
                layout.operator("object.vertex_group_remove_from", text="Remove from Active Group").all = False
1194
1254
                layout.operator("object.vertex_group_remove_from", text="Remove from All").all = True
1195
1255
                layout.separator()
1226
1286
        layout.operator("object.vertex_group_clean", text="Clean")
1227
1287
        layout.operator("object.vertex_group_levels", text="Levels")
1228
1288
        layout.operator("object.vertex_group_blend", text="Blend")
 
1289
        layout.operator("object.vertex_group_transfer_weight", text="Transfer Weights")
 
1290
        layout.operator("object.vertex_group_limit_total", text="Limit Total")
1229
1291
        layout.operator("object.vertex_group_fix", text="Fix Deforms")
1230
1292
 
1231
1293
        layout.separator()
1262
1324
        layout.prop(sculpt, "show_low_resolution")
1263
1325
        layout.prop(sculpt, "show_brush")
1264
1326
        layout.prop(sculpt, "use_deform_only")
1265
 
 
1266
 
 
1267
 
class VIEW3D_MT_hide(Menu):
1268
 
    bl_label = "Hide"
 
1327
        layout.prop(sculpt, "show_diffuse_color")
 
1328
 
 
1329
 
 
1330
class VIEW3D_MT_hide_mask(Menu):
 
1331
    bl_label = "Hide/Mask"
1269
1332
 
1270
1333
    def draw(self, context):
1271
1334
        layout = self.layout
1282
1345
        op.action = 'SHOW'
1283
1346
        op.area = 'INSIDE'
1284
1347
 
 
1348
        op = layout.operator("paint.hide_show", text="Hide Masked")
 
1349
        op.area = 'MASKED'
 
1350
        op.action = 'HIDE'
 
1351
 
 
1352
        layout.separator()
 
1353
 
 
1354
        op = layout.operator("paint.mask_flood_fill", text="Invert Mask")
 
1355
        op.mode = 'INVERT'
 
1356
 
 
1357
        op = layout.operator("paint.mask_flood_fill", text="Fill Mask")
 
1358
        op.mode = 'VALUE'
 
1359
        op.value = 1
 
1360
 
 
1361
        op = layout.operator("paint.mask_flood_fill", text="Clear Mask")
 
1362
        op.mode = 'VALUE'
 
1363
        op.value = 0
 
1364
 
1285
1365
 
1286
1366
# ********** Particle menu **********
1287
1367
 
1323
1403
 
1324
1404
    def draw(self, context):
1325
1405
        layout = self.layout
 
1406
 
1326
1407
        particle_edit = context.tool_settings.particle_edit
1327
1408
 
1328
1409
        layout.operator("particle.rekey")
1489
1570
 
1490
1571
    def draw(self, context):
1491
1572
        layout = self.layout
1492
 
        layout.operator("pose.group_add")
1493
 
        layout.operator("pose.group_remove")
1494
 
 
1495
 
        layout.separator()
1496
 
 
1497
 
        layout.operator("pose.group_assign")
1498
 
        layout.operator("pose.group_unassign")
 
1573
 
 
1574
        pose = context.active_object.pose
 
1575
 
 
1576
        layout.operator_context = 'EXEC_AREA'
 
1577
        layout.operator("pose.group_assign", text="Assign to New Group").type = 0
 
1578
        if pose.bone_groups:
 
1579
            active_group = pose.bone_groups.active_index + 1
 
1580
            layout.operator("pose.group_assign", text="Assign to Group").type = active_group
 
1581
 
 
1582
            layout.separator()
 
1583
 
 
1584
            #layout.operator_context = 'INVOKE_AREA'
 
1585
            layout.operator("pose.group_unassign")
 
1586
            layout.operator("pose.group_remove")
1499
1587
 
1500
1588
 
1501
1589
class VIEW3D_MT_pose_ik(Menu):
1533
1621
        layout.operator("pose.visual_transform_apply")
1534
1622
 
1535
1623
 
 
1624
class VIEW3D_MT_pose_specials(Menu):
 
1625
    bl_label = "Specials"
 
1626
 
 
1627
    def draw(self, context):
 
1628
        layout = self.layout
 
1629
        layout.operator("pose.select_constraint_target")
 
1630
        layout.operator("pose.flip_names")
 
1631
        layout.operator("pose.paths_calculate")
 
1632
        layout.operator("pose.paths_clear")
 
1633
        layout.operator("pose.user_transforms_clear")
 
1634
        layout.operator("pose.user_transforms_clear", text="Clear User Transforms (All)").only_selected = False
 
1635
        layout.operator("pose.relax")
 
1636
 
 
1637
        layout.separator()
 
1638
 
 
1639
        layout.operator_menu_enum("pose.autoside_names", "axis")
 
1640
 
 
1641
 
1536
1642
class BoneOptions:
1537
1643
    def draw(self, context):
1538
1644
        layout = self.layout
1602
1708
        layout.menu("VIEW3D_MT_uv_map", text="UV Unwrap...")
1603
1709
 
1604
1710
        layout.separator()
1605
 
 
 
1711
        layout.operator("mesh.symmetrize")
1606
1712
        layout.operator("view3d.edit_mesh_extrude_move_normal", text="Extrude Region")
1607
1713
        layout.operator("view3d.edit_mesh_extrude_individual_move", text="Extrude Individual")
1608
1714
        layout.operator("mesh.duplicate_move")
1609
1715
        layout.menu("VIEW3D_MT_edit_mesh_delete")
1610
 
        layout.menu("VIEW3D_MT_edit_mesh_dissolve")
1611
1716
 
1612
1717
        layout.separator()
1613
1718
 
1637
1742
 
1638
1743
        layout.operator("mesh.subdivide", text="Subdivide").smoothness = 0.0
1639
1744
        layout.operator("mesh.subdivide", text="Subdivide Smooth").smoothness = 1.0
 
1745
 
 
1746
        layout.separator()
 
1747
 
1640
1748
        layout.operator("mesh.merge", text="Merge...")
1641
1749
        layout.operator("mesh.remove_doubles")
 
1750
 
 
1751
        layout.separator()
 
1752
 
1642
1753
        layout.operator("mesh.hide", text="Hide").unselected = False
1643
1754
        layout.operator("mesh.reveal", text="Reveal")
1644
1755
        layout.operator("mesh.select_all", text="Select Inverse").action = 'INVERT'
 
1756
 
 
1757
        layout.separator()
 
1758
 
1645
1759
        layout.operator("mesh.flip_normals")
1646
1760
        layout.operator("mesh.vertices_smooth", text="Smooth")
 
1761
        layout.operator("mesh.vertices_smooth_laplacian", text="Laplacian Smooth")
 
1762
 
 
1763
        layout.separator()
 
1764
 
1647
1765
        layout.operator("mesh.inset")
1648
1766
        layout.operator("mesh.bevel", text="Bevel")
1649
1767
        layout.operator("mesh.bridge_edge_loops")
 
1768
 
 
1769
        layout.separator()
 
1770
 
1650
1771
        layout.operator("mesh.faces_shade_smooth")
1651
1772
        layout.operator("mesh.faces_shade_flat")
 
1773
 
 
1774
        layout.separator()
 
1775
 
1652
1776
        layout.operator("mesh.blend_from_shape")
1653
1777
        layout.operator("mesh.shape_propagate_to_all")
1654
1778
        layout.operator("mesh.select_vertex_path")
 
1779
        layout.operator("mesh.sort_elements")
 
1780
        layout.operator("mesh.symmetrize")
1655
1781
 
1656
1782
 
1657
1783
class VIEW3D_MT_edit_mesh_select_mode(Menu):
1661
1787
        layout = self.layout
1662
1788
 
1663
1789
        layout.operator_context = 'INVOKE_REGION_WIN'
1664
 
 
1665
 
        props = layout.operator("wm.context_set_value", text="Vertex", icon='VERTEXSEL')
1666
 
        props.value = "(True, False, False)"
1667
 
        props.data_path = "tool_settings.mesh_select_mode"
1668
 
 
1669
 
        props = layout.operator("wm.context_set_value", text="Edge", icon='EDGESEL')
1670
 
        props.value = "(False, True, False)"
1671
 
        props.data_path = "tool_settings.mesh_select_mode"
1672
 
 
1673
 
        props = layout.operator("wm.context_set_value", text="Face", icon='FACESEL')
1674
 
        props.value = "(False, False, True)"
1675
 
        props.data_path = "tool_settings.mesh_select_mode"
 
1790
        layout.operator("mesh.select_mode", text="Vertex", icon='VERTEXSEL').type = 'VERT'
 
1791
        layout.operator("mesh.select_mode", text="Edge", icon='EDGESEL').type = 'EDGE'
 
1792
        layout.operator("mesh.select_mode", text="Face", icon='FACESEL').type = 'FACE'
1676
1793
 
1677
1794
 
1678
1795
class VIEW3D_MT_edit_mesh_extrude(Menu):
1718
1835
 
1719
1836
        layout.operator("mesh.merge")
1720
1837
        layout.operator("mesh.rip_move")
 
1838
        layout.operator("mesh.rip_move_fill")
1721
1839
        layout.operator("mesh.split")
1722
1840
        layout.operator_menu_enum("mesh.separate", "type")
1723
1841
        layout.operator("mesh.vert_connect")
1724
 
        layout.operator("mesh.vert_slide")
 
1842
        layout.operator("transform.vert_slide")
1725
1843
 
1726
1844
        layout.separator()
1727
1845
 
 
1846
        layout.operator("mesh.bevel").vertex_only = True
1728
1847
        layout.operator("mesh.vertices_smooth")
1729
1848
        layout.operator("mesh.remove_doubles")
1730
 
        layout.operator("mesh.vertices_sort")
1731
 
        layout.operator("mesh.vertices_randomize")
 
1849
        layout.operator("mesh.sort_elements", text="Sort Vertices").elements = {'VERT'}
1732
1850
 
1733
1851
        layout.operator("mesh.select_vertex_path")
1734
1852
 
1748
1866
 
1749
1867
    def draw(self, context):
1750
1868
        layout = self.layout
 
1869
 
1751
1870
        layout.operator_context = 'INVOKE_REGION_WIN'
1752
1871
 
1753
1872
        layout.operator("mesh.edge_face_add")
1754
1873
        layout.operator("mesh.subdivide")
 
1874
        layout.operator("mesh.unsubdivide")
 
1875
 
 
1876
        layout.separator()
 
1877
 
 
1878
        layout.operator("transform.edge_crease")
 
1879
        layout.operator("transform.edge_bevelweight")
1755
1880
 
1756
1881
        layout.separator()
1757
1882
 
1765
1890
 
1766
1891
        layout.separator()
1767
1892
 
1768
 
        layout.operator("mesh.edge_rotate", text="Rotate Edge CW").direction = 'CW'
1769
 
        layout.operator("mesh.edge_rotate", text="Rotate Edge CCW").direction = 'CCW'
 
1893
        layout.operator("mesh.edge_rotate", text="Rotate Edge CW").use_ccw = False
 
1894
        layout.operator("mesh.edge_rotate", text="Rotate Edge CCW").use_ccw = True
1770
1895
 
1771
1896
        layout.separator()
1772
1897
 
1773
1898
        layout.operator("mesh.bevel")
1774
1899
        layout.operator("mesh.edge_split")
1775
1900
        layout.operator("mesh.bridge_edge_loops")
 
1901
        layout.operator("mesh.sort_elements", text="Sort Edges").elements = {'EDGE'}
1776
1902
 
1777
1903
        layout.separator()
1778
1904
 
1779
 
        layout.operator("TRANSFORM_OT_edge_slide")
1780
 
        layout.operator("TRANSFORM_OT_edge_crease")
 
1905
        layout.operator("transform.edge_slide")
1781
1906
        layout.operator("mesh.loop_multi_select", text="Edge Loop").ring = False
1782
 
 
1783
 
        #~ uiItemO(layout, "Loopcut", 0, "mesh.loop_cut"); // CutEdgeloop(em, 1);
1784
 
        #~ uiItemO(layout, "Edge Slide", 0, "mesh.edge_slide"); // EdgeSlide(em, 0,0.0);
1785
 
 
1786
1907
        layout.operator("mesh.loop_multi_select", text="Edge Ring").ring = True
1787
 
 
1788
1908
        layout.operator("mesh.loop_to_region")
1789
1909
        layout.operator("mesh.region_to_loop")
1790
1910
 
1795
1915
 
1796
1916
    def draw(self, context):
1797
1917
        layout = self.layout
 
1918
 
1798
1919
        layout.operator_context = 'INVOKE_REGION_WIN'
1799
1920
 
1800
1921
        layout.operator("mesh.flip_normals")
1804
1925
        layout.operator("mesh.inset")
1805
1926
        layout.operator("mesh.bevel")
1806
1927
        layout.operator("mesh.solidify")
1807
 
        layout.operator("mesh.sort_faces")
 
1928
        layout.operator("mesh.wireframe")
 
1929
        layout.operator("mesh.sort_elements", text="Sort Faces").elements = {'FACE'}
1808
1930
 
1809
1931
        layout.separator()
1810
1932
 
1818
1940
 
1819
1941
        layout.separator()
1820
1942
 
1821
 
        # uiItemO(layout, NULL, 0, "mesh.face_mode"); // mesh_set_face_flags(em, 1);
1822
 
        # uiItemBooleanO(layout, NULL, 0, "mesh.face_mode", "clear", 1); // mesh_set_face_flags(em, 0);
1823
 
 
1824
 
        layout.operator("mesh.edge_rotate", text="Rotate Edge CW").direction = 'CW'
 
1943
        layout.operator("mesh.edge_rotate", text="Rotate Edge CW").use_ccw = False
1825
1944
 
1826
1945
        layout.separator()
1827
1946
 
1828
 
        layout.operator_menu_enum("mesh.uvs_rotate", "direction")
 
1947
        layout.operator("mesh.uvs_rotate")
1829
1948
        layout.operator("mesh.uvs_reverse")
1830
 
        layout.operator_menu_enum("mesh.colors_rotate", "direction")
 
1949
        layout.operator("mesh.colors_rotate")
1831
1950
        layout.operator("mesh.colors_reverse")
1832
1951
 
1833
1952
 
1856
1975
        layout.separator()
1857
1976
 
1858
1977
        layout.operator("mesh.dissolve")
 
1978
        layout.operator("mesh.dissolve_limited")
 
1979
 
 
1980
        layout.separator()
 
1981
 
1859
1982
        layout.operator("mesh.edge_collapse")
1860
 
        layout.operator("mesh.delete_edgeloop")
1861
 
 
1862
 
 
1863
 
class VIEW3D_MT_edit_mesh_dissolve(Menu):
1864
 
    bl_label = "Dissolve"
1865
 
 
1866
 
    def draw(self, context):
1867
 
        layout = self.layout
1868
 
 
1869
 
        layout.operator("mesh.dissolve")
1870
 
 
1871
 
        layout.separator()
1872
 
 
1873
 
        layout.operator_enum("mesh.dissolve", "type")
1874
 
 
1875
 
        layout.separator()
1876
 
 
1877
 
        layout.operator("mesh.dissolve_limited")
 
1983
        layout.operator("mesh.delete_edgeloop", text="Edge Loop")
1878
1984
 
1879
1985
 
1880
1986
class VIEW3D_MT_edit_mesh_showhide(ShowHideMenu, Menu):
1895
2001
 
1896
2002
    layout.separator()
1897
2003
 
1898
 
    layout.operator("curve.extrude")
1899
 
    layout.operator("curve.duplicate")
 
2004
    layout.operator("curve.extrude_move")
 
2005
    layout.operator("curve.duplicate_move")
1900
2006
    layout.operator("curve.separate")
1901
2007
    layout.operator("curve.make_segment")
1902
2008
    layout.operator("curve.cyclic_toggle")
1942
2048
 
1943
2049
            layout.separator()
1944
2050
 
1945
 
            layout.menu("VIEW3D_MT_hook")
 
2051
        layout.menu("VIEW3D_MT_hook")
1946
2052
 
1947
2053
 
1948
2054
class VIEW3D_MT_edit_curve_segments(Menu):
2088
2194
        layout.menu("VIEW3D_MT_transform")
2089
2195
        layout.menu("VIEW3D_MT_mirror")
2090
2196
        layout.menu("VIEW3D_MT_snap")
 
2197
        layout.operator_menu_enum("lattice.flip", "axis")
2091
2198
 
2092
2199
        layout.separator()
2093
2200
 
2225
2332
            if lock_object.type == 'ARMATURE':
2226
2333
                col.prop_search(view, "lock_bone", lock_object.data,
2227
2334
                                "edit_bones" if lock_object.mode == 'EDIT'
2228
 
                                             else "bones",
 
2335
                                else "bones",
2229
2336
                                text="")
2230
2337
        else:
2231
2338
            col.prop(view, "lock_cursor", text="Lock to Cursor")
2243
2350
        subcol.label(text="Local Camera:")
2244
2351
        subcol.prop(view, "camera", text="")
2245
2352
 
 
2353
        col = layout.column(align=True)
 
2354
        col.prop(view, "use_render_border")
 
2355
 
2246
2356
 
2247
2357
class VIEW3D_PT_view3d_cursor(Panel):
2248
2358
    bl_space_type = 'VIEW_3D'
2252
2362
    @classmethod
2253
2363
    def poll(cls, context):
2254
2364
        view = context.space_data
2255
 
        return (view)
 
2365
        return (view is not None)
2256
2366
 
2257
2367
    def draw(self, context):
2258
2368
        layout = self.layout
2314
2424
        col.prop(view, "show_outline_selected")
2315
2425
        col.prop(view, "show_all_objects_origin")
2316
2426
        col.prop(view, "show_relationship_lines")
2317
 
        if ob and ob.type == 'MESH':
2318
 
            mesh = ob.data
2319
 
            col.prop(mesh, "show_all_edges")
2320
2427
 
2321
2428
        col = layout.column()
2322
2429
        col.active = display_all
2341
2448
            col.label(text="Shading:")
2342
2449
            col.prop(gs, "material_mode", text="")
2343
2450
            col.prop(view, "show_textured_solid")
 
2451
        if view.viewport_shade == 'SOLID':
 
2452
            col.prop(view, "use_matcap")
 
2453
            if view.use_matcap:
 
2454
                col.template_icon_view(view, "matcap_icon")
 
2455
        col.prop(view, "show_backface_culling")
2344
2456
 
2345
2457
        layout.separator()
2346
2458
 
2500
2612
                if bg.source == 'IMAGE':
2501
2613
                    row = box.row()
2502
2614
                    row.template_ID(bg, "image", open="image.open")
2503
 
                    if (bg.image):
 
2615
                    if bg.image is not None:
2504
2616
                        box.template_image(bg, "image", bg.image_user, compact=True)
2505
2617
                        has_bg = True
2506
2618
 
2507
2619
                elif bg.source == 'MOVIE_CLIP':
2508
 
                    box.prop(bg, 'use_camera_clip')
 
2620
                    box.prop(bg, "use_camera_clip")
2509
2621
 
2510
2622
                    column = box.column()
2511
2623
                    column.active = not bg.use_camera_clip
2524
2636
 
2525
2637
                if has_bg:
2526
2638
                    col = box.column()
2527
 
                    col.prop(bg, "show_on_foreground")
2528
2639
                    col.prop(bg, "opacity", slider=True)
 
2640
 
 
2641
                    rowsub = col.row()
 
2642
                    rowsub.prop(bg, "draw_depth", expand=True)
 
2643
 
 
2644
                    if bg.view_axis in {'CAMERA', 'ALL'}:
 
2645
                        rowsub = col.row()
 
2646
                        rowsub.prop(bg, "frame_method", expand=True)
 
2647
 
 
2648
                    row = col.row(align=True)
 
2649
                    row.prop(bg, "offset_x", text="X")
 
2650
                    row.prop(bg, "offset_y", text="Y")
 
2651
 
2529
2652
                    if bg.view_axis != 'CAMERA':
2530
2653
                        col.prop(bg, "size")
2531
 
                        row = col.row(align=True)
2532
 
                        row.prop(bg, "offset_x", text="X")
2533
 
                        row.prop(bg, "offset_y", text="Y")
2534
2654
 
2535
2655
 
2536
2656
class VIEW3D_PT_transform_orientations(Panel):
2580
2700
 
2581
2701
    def draw(self, context):
2582
2702
        layout = self.layout
 
2703
 
2583
2704
        toolsettings = context.scene.tool_settings
2584
2705
 
2585
2706
        col = layout.column()
2587
2708
        col.prop(toolsettings, "use_etch_quick")
2588
2709
        col.prop(toolsettings, "use_etch_overdraw")
2589
2710
 
 
2711
        col.separator()
 
2712
 
2590
2713
        col.prop(toolsettings, "etch_convert_mode")
2591
2714
 
2592
2715
        if toolsettings.etch_convert_mode == 'LENGTH':
2598
2721
        elif toolsettings.etch_convert_mode == 'RETARGET':
2599
2722
            col.prop(toolsettings, "etch_template")
2600
2723
            col.prop(toolsettings, "etch_roll_mode")
2601
 
            col.prop(toolsettings, "use_etch_autoname")
2602
 
            col.prop(toolsettings, "etch_number")
2603
 
            col.prop(toolsettings, "etch_side")
2604
 
 
2605
 
        col.operator("sketch.convert", text="Convert")
 
2724
 
 
2725
            col.separator()
 
2726
 
 
2727
            colsub = col.column(align=True)
 
2728
            colsub.prop(toolsettings, "use_etch_autoname")
 
2729
            sub = colsub.column()
 
2730
            sub.enabled = not toolsettings.use_etch_autoname
 
2731
            sub.prop(toolsettings, "etch_number")
 
2732
            sub.prop(toolsettings, "etch_side")
 
2733
 
 
2734
        col.separator()
 
2735
 
 
2736
        col.operator("sketch.convert", text="Convert to Bones")
 
2737
        col.operator("sketch.delete", text="Delete Strokes")
2606
2738
 
2607
2739
 
2608
2740
class VIEW3D_PT_context_properties(Panel):