Newer
Older
layout.operator("view3d.snap_cursor_selected_to_center2",
text="Selection and Cursor to Center")
UseSeparator(self, context)
layout.operator("view3d.pivot_cursor2",
text="Set Cursor as Pivot Point")
layout.operator("view3d.revert_pivot2",
text="Revert Pivot Point")
# ********** Object Interactive Mode **********
class InteractiveMode2(Menu):
bl_idname = "VIEW3D_MT_Object_Interactive_Mode2"
bl_label = "Interactive Mode"
bl_description = "Menu of objects interactive modes (Window Types)"
def draw(self, context):
layout = self.layout
layout.operator(SetObjectMode2.bl_idname, text="Object", icon="OBJECT_DATAMODE").mode = "OBJECT"
layout.operator(SetObjectMode2.bl_idname, text="Edit", icon="EDITMODE_HLT").mode = "EDIT"
layout.operator(SetObjectMode2.bl_idname, text="Sculpt", icon="SCULPTMODE_HLT").mode = "SCULPT"
layout.operator(SetObjectMode2.bl_idname, text="Vertex Paint", icon="VPAINT_HLT").mode = "VERTEX_PAINT"
layout.operator(SetObjectMode2.bl_idname, text="Weight Paint", icon="WPAINT_HLT").mode = "WEIGHT_PAINT"
layout.operator(SetObjectMode2.bl_idname, text="Texture Paint", icon="TPAINT_HLT").mode = "TEXTURE_PAINT"
layout.operator(SetObjectMode2.bl_idname, text="Particle Edit", icon="PARTICLEMODE").mode = "PARTICLE_EDIT"
if context.gpencil_data:
layout.operator("view3d.interactive_mode_grease_pencil2", icon="GREASEPENCIL")
# ********** Object Armature Interactive Mode **********
class InteractiveModeArmature2(Menu):
bl_idname = "VIEW3D_MT_Object_Interactive_Armature2"
bl_label = "Interactive Mode"
bl_description = "Menu of objects interactive mode"
def draw(self, context):
layout = self.layout
layout.operator(SetObjectMode2.bl_idname, text="Object", icon="OBJECT_DATAMODE").mode = "OBJECT"
layout.operator(SetObjectMode2.bl_idname, text="Edit", icon="EDITMODE_HLT").mode = "EDIT"
layout.operator(SetObjectMode2.bl_idname, text="Pose", icon="POSE_HLT").mode = "POSE"
if context.gpencil_data:
layout.operator("view3d.interactive_mode_grease_pencil2", icon="GREASEPENCIL")
# ********** Interactive Mode Other **********
class InteractiveModeOther2(Menu):
bl_idname = "VIEW3D_MT_Object_Interactive_Other2"
bl_label = "Interactive Mode"
bl_description = "Menu of objects interactive mode"
def draw(self, context):
layout = self.layout
layout.operator("object.editmode_toggle", text="Edit/Object Toggle",
icon='OBJECT_DATA')
if context.gpencil_data:
layout.operator("view3d.interactive_mode_grease_pencil2", icon="GREASEPENCIL")
# ********** Grease Pencil Interactive Mode **********
class VIEW3D_OT_Interactive_Mode_Grease_Pencil2(Operator):
bl_idname = "view3d.interactive_mode_grease_pencil2"
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
bl_label = "Edit Strokes"
bl_description = "Toggle Edit Strokes for Grease Pencil"
@classmethod
def poll(cls, context):
return (context.gpencil_data is not None)
def execute(self, context):
try:
bpy.ops.gpencil.editmode_toggle()
except:
self.report({'WARNING'}, "It is not possible to enter into the interactive mode")
return {'FINISHED'}
class VIEW3D_MT_Edit_Gpencil2(Menu):
bl_label = "GPencil"
def draw(self, context):
toolsettings = context.tool_settings
layout = self.layout
layout.operator("gpencil.brush_paint", text="Sculpt Strokes").wait_for_input = True
layout.prop_menu_enum(toolsettings.gpencil_sculpt, "tool", text="Sculpt Brush")
Brendon Murphy
committed
layout.separator()
layout.menu("VIEW3D_MT_edit_gpencil_transform")
layout.operator("transform.mirror", text="Mirror")
layout.menu("GPENCIL_MT_snap")
Brendon Murphy
committed
layout.separator()
layout.menu("VIEW3D_MT_object_animation") # NOTE: provides keyingset access...
Brendon Murphy
committed
layout.separator()
layout.menu("VIEW3D_MT_edit_gpencil_delete")
layout.operator("gpencil.duplicate_move", text="Duplicate")
Brendon Murphy
committed
layout.separator()
layout.menu("VIEW3D_MT_select_gpencil")
Brendon Murphy
committed
layout.separator()
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
layout.operator("gpencil.copy", text="Copy")
layout.operator("gpencil.paste", text="Paste")
layout.separator()
layout.prop_menu_enum(toolsettings, "proportional_edit")
layout.prop_menu_enum(toolsettings, "proportional_edit_falloff")
layout.separator()
layout.operator("gpencil.reveal")
layout.operator("gpencil.hide", text="Show Active Layer Only").unselected = True
layout.operator("gpencil.hide", text="Hide Active Layer").unselected = False
layout.separator()
layout.operator_menu_enum("gpencil.move_to_layer", "layer", text="Move to Layer")
layout.operator_menu_enum("gpencil.convert", "type", text="Convert to Geometry...")
# ********** Text Interactive Mode **********
class VIEW3D_OT_Interactive_Mode_Text2(Operator):
bl_idname = "view3d.interactive_mode_text2"
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
bl_label = "Enter Edit Mode"
bl_description = "Toggle object's editmode"
@classmethod
def poll(cls, context):
return (context.active_object is not None)
def execute(self, context):
bpy.ops.object.editmode_toggle()
self.report({'INFO'}, "Spacebar shortcut won't work in the Text Edit mode")
return {'FINISHED'}
# ********** Object Parent **********
class VIEW3D_MT_ParentMenu2(Menu):
bl_label = "Parent"
def draw(self, context):
layout = self.layout
layout.operator("object.parent_set", text="Set")
layout.operator("object.parent_clear", text="Clear")
# ********** Object Group **********
class VIEW3D_MT_GroupMenu2(Menu):
bl_label = "Group"
def draw(self, context):
layout = self.layout
layout.operator("collection.create")
layout.operator("collection.objects_add_active")
UseSeparator(self, context)
layout.operator("collection.objects_remove")
layout.operator("collection.objects_remove_all")
layout.operator("collection.objects_remove_active")
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
# ********** Object Camera Options **********
class VIEW3D_MT_Camera_Options2(Menu):
bl_label = "Camera"
def draw(self, context):
layout = self.layout
layout.operator_context = 'EXEC_REGION_WIN'
layout.operator("object.camera_add", text="Add Camera", icon='OUTLINER_OB_CAMERA')
self.layout.operator("view3d.object_as_camera", text="Object As Camera", icon='OUTLINER_OB_CAMERA')
self.layout.operator("view3d.viewnumpad", text="View Active Camera", icon='OUTLINER_OB_CAMERA').type = 'CAMERA'
class VIEW3D_MT_Object_Data_Link2(Menu):
bl_label = "Object Data"
def draw(self, context):
layout = self.layout
layout.operator_menu_enum("object.make_local", "type", text="Make Local...")
layout.menu("VIEW3D_MT_make_single_user")
layout.operator("object.proxy_make", text="Make Proxy...")
layout.operator("object.make_dupli_face")
UseSeparator(self, context)
layout.operator("object.data_transfer")
layout.operator("object.datalayout_transfer")
class VIEW3D_MT_Duplicate2(Menu):
bl_label = "Duplicate"
def draw(self, context):
layout = self.layout
layout.operator("object.duplicate_move")
layout.operator("object.duplicate_move_linked")
class VIEW3D_MT_KeyframeMenu2(Menu):
bl_label = "Keyframe"
def draw(self, context):
layout = self.layout
layout.operator("anim.keyframe_insert_menu",
text="Insert Keyframe...")
layout.operator("anim.keyframe_delete_v3d",
text="Delete Keyframe...")
layout.operator("anim.keying_set_active_set",
text="Change Keying Set...")
class VIEW3D_MT_UndoS2(Menu):
bl_label = "Undo/Redo"
def draw(self, context):
layout = self.layout
layout.operator("ed.undo")
layout.operator("ed.redo")
UseSeparator(self, context)
layout.operator("ed.undo_history")
# ********** Normals / Auto Smooth Menu **********
# Thanks to marvin.k.breuer for the Autosmooth part of the menu
class VIEW3D_MT_AutoSmooth2(Menu):
bl_label = "Normals / Auto Smooth"
def draw(self, context):
layout = self.layout
obj = context.object
obj_data = context.active_object.data
# moved the VIEW3D_MT_edit_mesh_normals contents here under an Edit mode check
if obj and obj.type == 'MESH' and obj.mode in {'EDIT'}:
layout.operator("mesh.normals_make_consistent",
text="Recalculate Outside").inside = False
layout.operator("mesh.normals_make_consistent",
text="Recalculate Inside").inside = True
layout.operator("mesh.flip_normals")
UseSeparator(self, context)
layout.prop(obj_data, "show_double_sided", text="Normals: Double Sided")
UseSeparator(self, context)
layout.prop(obj_data, "use_auto_smooth", text="Normals: Auto Smooth")
# Auto Smooth Angle - two tab spaces to align it with the rest of the menu
layout.prop(obj_data, "auto_smooth_angle",
text=" Auto Smooth Angle")
# Edit Mode Menu's #
# ********** Edit Mesh **********
class VIEW3D_MT_Edit_Mesh2(Menu):
bl_label = "Mesh"
def draw(self, context):
layout = self.layout
toolsettings = context.tool_settings
view = context.space_data
layout.menu("VIEW3D_MT_edit_mesh_vertices", icon='VERTEXSEL')
layout.menu("VIEW3D_MT_edit_mesh_edges", icon='EDGESEL')
layout.menu("VIEW3D_MT_edit_mesh_faces", icon='FACESEL')
UseSeparator(self, context)
layout.operator("mesh.duplicate_move")
UseSeparator(self, context)
layout.menu("VIEW3D_MT_edit_mesh_clean", icon='AUTO')
layout.prop(view, "use_occlude_geometry")
UseSeparator(self, context)
layout.menu("VIEW3D_MT_AutoSmooth2", icon='META_DATA')
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
layout.operator("mesh.loopcut_slide",
text="Loopcut", icon='UV_EDGESEL')
UseSeparator(self, context)
layout.operator("mesh.symmetrize")
layout.operator("mesh.symmetry_snap")
UseSeparator(self, context)
layout.operator("mesh.bisect")
layout.operator_menu_enum("mesh.sort_elements", "type", text="Sort Elements...")
UseSeparator(self, context)
layout.prop_menu_enum(toolsettings, "proportional_edit")
layout.prop_menu_enum(toolsettings, "proportional_edit_falloff")
UseSeparator(self, context)
layout.prop(toolsettings, "use_mesh_automerge")
# Double Threshold - two tab spaces to align it with the rest of the menu
layout.prop(toolsettings, "double_threshold", text=" Double Threshold")
UseSeparator(self, context)
layout.menu("VIEW3D_MT_edit_mesh_showhide")
# ********** Edit Multiselect **********
class VIEW3D_MT_Edit_Multi2(Menu):
bl_label = "Multi Select"
def draw(self, context):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
prop = layout.operator("wm.context_set_value", text="Vertex Select",
icon='VERTEXSEL')
prop.value = "(True, False, False)"
prop.data_path = "tool_settings.mesh_select_mode"
prop = layout.operator("wm.context_set_value", text="Edge Select",
icon='EDGESEL')
prop.value = "(False, True, False)"
prop.data_path = "tool_settings.mesh_select_mode"
prop = layout.operator("wm.context_set_value", text="Face Select",
icon='FACESEL')
prop.value = "(False, False, True)"
prop.data_path = "tool_settings.mesh_select_mode"
UseSeparator(self, context)
prop = layout.operator("wm.context_set_value",
text="Vertex & Edge Select",
icon='EDITMODE_HLT')
prop.value = "(True, True, False)"
prop.data_path = "tool_settings.mesh_select_mode"
prop = layout.operator("wm.context_set_value",
text="Vertex & Face Select",
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
prop.value = "(True, False, True)"
prop.data_path = "tool_settings.mesh_select_mode"
prop = layout.operator("wm.context_set_value",
text="Edge & Face Select",
icon='SNAP_FACE')
prop.value = "(False, True, True)"
prop.data_path = "tool_settings.mesh_select_mode"
UseSeparator(self, context)
prop = layout.operator("wm.context_set_value",
text="Vertex & Edge & Face Select",
icon='SNAP_VOLUME')
prop.value = "(True, True, True)"
prop.data_path = "tool_settings.mesh_select_mode"
# ********** Edit Mesh Edge **********
class VIEW3D_MT_EditM_Edge2(Menu):
bl_label = "Edges"
def draw(self, context):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("mesh.mark_seam")
layout.operator("mesh.mark_seam", text="Clear Seam").clear = True
UseSeparator(self, context)
layout.operator("mesh.mark_sharp")
layout.operator("mesh.mark_sharp", text="Clear Sharp").clear = True
layout.operator("mesh.extrude_move_along_normals", text="Extrude")
UseSeparator(self, context)
layout.operator("mesh.edge_rotate",
text="Rotate Edge CW").direction = 'CW'
layout.operator("mesh.edge_rotate",
text="Rotate Edge CCW").direction = 'CCW'
UseSeparator(self, context)
layout.operator("TFM_OT_edge_slide", text="Edge Slide")
layout.operator("mesh.loop_multi_select", text="Edge Loop")
layout.operator("mesh.loop_multi_select", text="Edge Ring").ring = True
layout.operator("mesh.loop_to_region")
layout.operator("mesh.region_to_loop")
# ********** Edit Mesh Cursor **********
class VIEW3D_MT_EditCursorMenu2(Menu):
bl_label = "Snap Cursor"
def draw(self, context):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("object.setorigintoselected2",
text="Origin to Selected V/F/E")
UseSeparator(self, context)
layout.menu("VIEW3D_Snap_Origin")
layout.menu("VIEW3D_Snap_Context")
UseSeparator(self, context)
layout.operator("view3d.snap_cursor_to_selected",
text="Cursor to Selected")
layout.operator("view3d.snap_cursor_to_center",
text="Cursor to Center")
layout.operator("view3d.snap_cursor_to_grid",
text="Cursor to Grid")
layout.operator("view3d.snap_cursor_to_active",
text="Cursor to Active")
layout.operator("view3d.snap_cursor_to_edge_intersection2",
text="Cursor to Edge Intersection")
UseSeparator(self, context)
layout.operator("view3d.snap_selected_to_cursor",
text="Selection to Cursor").use_offset = False
layout.operator("view3d.snap_selected_to_cursor",
text="Selection to Cursor (Keep Offset)").use_offset = True
layout.operator("view3d.snap_selected_to_grid",
text="Selection to Grid")
UseSeparator(self, context)
layout.operator("view3d.pivot_cursor2",
text="Set Cursor as Pivot Point")
layout.operator("view3d.revert_pivot2",
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
text="Revert Pivot Point")
# ********** Edit Mesh UV **********
class VIEW3D_MT_UV_Map2(Menu):
bl_label = "UV Mapping"
def draw(self, context):
layout = self.layout
layout.operator("uv.unwrap")
UseSeparator(self, context)
layout.operator_context = 'INVOKE_DEFAULT'
layout.operator("uv.smart_project")
layout.operator("uv.lightmap_pack")
layout.operator("uv.follow_active_quads")
layout.operator_context = 'EXEC_REGION_WIN'
layout.operator("uv.cube_project")
layout.operator("uv.cylinder_project")
layout.operator("uv.sphere_project")
layout.operator_context = 'INVOKE_REGION_WIN'
UseSeparator(self, context)
layout.operator("uv.project_from_view").scale_to_bounds = False
layout.operator("uv.project_from_view", text="Project from View (Bounds)").scale_to_bounds = True
UseSeparator(self, context)
layout.operator("uv.reset")
# ********** Edit Curve **********
class VIEW3D_MT_Edit_Curve2(Menu):
bl_label = "Curve"
def draw(self, context):
layout = self.layout
toolsettings = context.tool_settings
layout.operator("curve.extrude_move")
layout.operator("curve.spin")
layout.operator("curve.duplicate_move")
layout.operator("curve.split")
layout.operator("curve.separate")
layout.operator("curve.make_segment")
layout.operator("curve.cyclic_toggle")
UseSeparator(self, context)
layout.operator("curve.delete", text="Delete...")
UseSeparator(self, context)
layout.menu("VIEW3D_MT_edit_curve_segments")
layout.prop_menu_enum(toolsettings, "proportional_edit",
icon="PROP_CON")
layout.prop_menu_enum(toolsettings, "proportional_edit_falloff",
icon="SMOOTHCURVE")
layout.menu("VIEW3D_MT_edit_curve_showhide")
class VIEW3D_MT_EditCurveCtrlpoints2(Menu):
bl_label = "Control Points"
def draw(self, context):
layout = self.layout
edit_object = context.edit_object
if edit_object.type == 'CURVE':
layout.operator("transform.transform").mode = 'TILT'
layout.operator("curve.tilt_clear")
layout.operator("curve.separate")
layout.operator_menu_enum("curve.handle_type_set", "type")
layout.menu("VIEW3D_MT_hook")
class VIEW3D_MT_EditCurveSegments2(Menu):
bl_label = "Curve Segments"
def draw(self, context):
layout = self.layout
layout.operator("curve.subdivide")
layout.operator("curve.switch_direction")
class VIEW3D_MT_EditCurveSpecials2(Menu):
bl_label = "Specials"
def draw(self, context):
layout = self.layout
layout.operator("curve.subdivide")
UseSeparator(self, context)
layout.operator("curve.switch_direction")
layout.operator("curve.spline_weight_set")
layout.operator("curve.radius_set")
UseSeparator(self, context)
layout.operator("curve.smooth")
layout.operator("curve.smooth_weight")
layout.operator("curve.smooth_radius")
layout.operator("curve.smooth_tilt")
# Brushes Menu's #
# Thanks to CoDEmanX for the code
class VIEW3D_MT_Brush_Selection2(Menu):
bl_label = "Brush Tool"
def draw(self, context):
layout = self.layout
settings = UnifiedPaintPanel.paint_settings(context)
# check if brush exists (for instance, in paint mode before adding a slot)
if hasattr(settings, 'brush'):
brush = settings.brush
else:
brush = None
if not brush:
return
if not context.particle_edit_object:
if UseBrushesLists():
flow = layout.column_flow(columns=3)
for brsh in bpy.data.brushes:
if (context.sculpt_object and brsh.use_paint_sculpt):
props = flow.operator("wm.context_set_id", text=brsh.name,
icon_value=layout.icon(brsh))
props.data_path = "tool_settings.sculpt.brush"
props.value = brsh.name
elif (context.image_paint_object and brsh.use_paint_image):
props = flow.operator("wm.context_set_id", text=brsh.name,
icon_value=layout.icon(brsh))
props.data_path = "tool_settings.image_paint.brush"
props.value = brsh.name
elif (context.vertex_paint_object and brsh.use_paint_vertex):
props = flow.operator("wm.context_set_id", text=brsh.name,
icon_value=layout.icon(brsh))
props.data_path = "tool_settings.vertex_paint.brush"
props.value = brsh.name
elif (context.weight_paint_object and brsh.use_paint_weight):
props = flow.operator("wm.context_set_id", text=brsh.name,
icon_value=layout.icon(brsh))
props.data_path = "tool_settings.weight_paint.brush"
props.value = brsh.name
else:
layout.template_ID_preview(settings, "brush", new="brush.add", rows=3, cols=8)
class VIEW3D_MT_Brush_Settings2(Menu):
bl_label = "Brush Settings"
def draw(self, context):
layout = self.layout
settings = UnifiedPaintPanel.paint_settings(context)
brush = settings.brush
ups = context.tool_settings.unified_paint_settings
layout.prop(ups, "use_unified_size", text="Unified Size")
layout.prop(ups, "use_unified_strength", text="Unified Strength")
if context.image_paint_object or context.vertex_paint_object:
layout.prop(ups, "use_unified_color", text="Unified Color")
UseSeparator(self, context)
layout.menu("VIEW3D_MT_brush_paint_modes")
if not brush:
return
if context.sculpt_object:
sculpt_tool = brush.sculpt_tool
UseSeparator(self, context)
layout.operator_menu_enum("brush.curve_preset", "shape", text="Curve Preset")
UseSeparator(self, context)
if sculpt_tool != 'GRAB':
layout.prop_menu_enum(brush, "stroke_method")
if sculpt_tool in {'DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'}:
layout.prop_menu_enum(brush, "direction")
if sculpt_tool == 'LAYER':
layout.prop(brush, "use_persistent")
layout.operator("sculpt.set_persistent_base")
# Sculpt Menu's #
class VIEW3D_MT_Sculpts2(Menu):
bl_label = "Sculpt"
def draw(self, context):
layout = self.layout
toolsettings = context.tool_settings
sculpt = toolsettings.sculpt
layout.prop(sculpt, "use_symmetry_x")
layout.prop(sculpt, "use_symmetry_y")
layout.prop(sculpt, "use_symmetry_z")
UseSeparator(self, context)
layout.prop(sculpt, "lock_x")
layout.prop(sculpt, "lock_y")
layout.prop(sculpt, "lock_z")
UseSeparator(self, context)
layout.prop(sculpt, "use_threaded", text="Threaded Sculpt")
layout.prop(sculpt, "show_low_resolution")
layout.prop(sculpt, "use_deform_only")
UseSeparator(self, context)
layout.prop(sculpt, "show_brush")
layout.prop(sculpt, "show_diffuse_color")
class VIEW3D_MT_Hide_Masks2(Menu):
bl_label = "Hide/Mask"
def draw(self, context):
layout = self.layout
props = layout.operator("paint.mask_lasso_gesture", text="Lasso Mask")
UseSeparator(self, context)
props = layout.operator("view3d.select_box", text="Box Mask", icon="BORDER_RECT")
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
props = layout.operator("paint.hide_show", text="Box Hide")
props.action = 'HIDE'
props.area = 'INSIDE'
props = layout.operator("paint.hide_show", text="Box Show")
props.action = 'SHOW'
props.area = 'INSIDE'
UseSeparator(self, context)
props = layout.operator("paint.mask_flood_fill", text="Fill Mask", icon="BORDER_RECT")
props.mode = 'VALUE'
props.value = 1
props = layout.operator("paint.mask_flood_fill", text="Clear Mask")
props.mode = 'VALUE'
props.value = 0
layout.operator("paint.mask_flood_fill", text="Invert Mask").mode = 'INVERT'
UseSeparator(self, context)
props = layout.operator("paint.hide_show", text="Show All", icon="RESTRICT_VIEW_OFF")
props.action = 'SHOW'
props.area = 'ALL'
props = layout.operator("paint.hide_show", text="Hide Masked", icon="RESTRICT_VIEW_ON")
props.area = 'MASKED'
props.action = 'HIDE'
# Sculpt Specials Menu (Thanks to marvin.k.breuer) #
class VIEW3D_MT_Sculpt_Specials2(Menu):
bl_label = "Sculpt Specials"
def draw(self, context):
layout = self.layout
settings = context.tool_settings
if context.sculpt_object.use_dynamic_topology_sculpting:
layout.operator("sculpt.dynamic_topology_toggle", icon='X', text="Disable Dyntopo")
UseSeparator(self, context)
if (settings.sculpt.detail_type_method == 'CONSTANT'):
layout.prop(settings.sculpt, "constant_detail", text="Const.")
layout.operator("sculpt.sample_detail_size", text="", icon='EYEDROPPER')
else:
layout.prop(settings.sculpt, "detail_size", text="Detail")
UseSeparator(self, context)
layout.operator("sculpt.symmetrize", icon='ARROW_LEFTRIGHT')
layout.prop(settings.sculpt, "symmetrize_direction", "")
UseSeparator(self, context)
layout.operator("sculpt.optimize")
if (settings.sculpt.detail_type_method == 'CONSTANT'):
layout.operator("sculpt.detail_flood_fill")
UseSeparator(self, context)
layout.prop(settings.sculpt, "detail_refine_method", text="")
layout.prop(settings.sculpt, "detail_type_method", text="")
UseSeparator(self, context)
layout.prop(settings.sculpt, "use_smooth_shading", "Smooth")
else:
layout.operator("sculpt.dynamic_topology_toggle", icon='SCULPT_DYNTOPO', text="Enable Dyntopo")
# Display Wire (Thanks to marvin.k.breuer) #
class VIEW3D_OT_Display_Wire_All2(Operator):
"""Display Wire on All Objects"""
bl_label = "Wire on All Objects"
bl_idname = "view3d.display_wire_all2"
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
@classmethod
def poll(cls, context):
return context.active_object is not None
def execute(self, context):
for obj in bpy.data.objects:
if obj.show_wire:
obj.show_all_edges = False
obj.show_wire = False
else:
obj.show_all_edges = True
obj.show_wire = True
return {'FINISHED'}
# Vertex Color Menu #
class VIEW3D_MT_Vertex_Colors2(Menu):
bl_label = "Vertex Colors"
def draw(self, context):
layout = self.layout
layout.operator("paint.vertex_color_set")
UseSeparator(self, context)
layout.operator("paint.vertex_color_smooth")
layout.operator("paint.vertex_color_dirt")
# Weight Paint Menu #
class VIEW3D_MT_Paint_Weights2(Menu):
bl_label = "Weights"
def draw(self, context):
layout = self.layout
layout.operator("paint.weight_from_bones", text="Assign Automatic From Bones").type = 'AUTOMATIC'
layout.operator("paint.weight_from_bones", text="Assign From Bone Envelopes").type = 'ENVELOPES'
UseSeparator(self, context)
layout.operator("object.vertex_group_normalize_all", text="Normalize All")
layout.operator("object.vertex_group_normalize", text="Normalize")
UseSeparator(self, context)
layout.operator("object.vertex_group_mirror", text="Mirror")
layout.operator("object.vertex_group_invert", text="Invert")
UseSeparator(self, context)
layout.operator("object.vertex_group_clean", text="Clean")
layout.operator("object.vertex_group_quantize", text="Quantize")
UseSeparator(self, context)
layout.operator("object.vertex_group_levels", text="Levels")
layout.operator("object.vertex_group_smooth", text="Smooth")
UseSeparator(self, context)
props = layout.operator("object.data_transfer", text="Transfer Weights")
props.use_reverse_transfer = True
props.data_type = 'VGROUP_WEIGHTS'
UseSeparator(self, context)
layout.operator("object.vertex_group_limit_total", text="Limit Total")
layout.operator("object.vertex_group_fix", text="Fix Deforms")
UseSeparator(self, context)
layout.operator("paint.weight_set")
# Armature Menu's #
class VIEW3D_MT_Edit_Armature2(Menu):
bl_label = "Armature"
def draw(self, context):
layout = self.layout
toolsettings = context.tool_settings
layout.prop_menu_enum(toolsettings, "proportional_edit", icon="PROP_CON")
layout.prop_menu_enum(toolsettings, "proportional_edit_falloff", icon="SMOOTHCURVE")
UseSeparator(self, context)
layout.menu("VIEW3D_MT_bone_options_toggle", text="Bone Settings")
layout.operator("armature.merge")
layout.operator("armature.fill")
layout.operator("armature.split")
layout.operator("armature.separate")
layout.operator("armature.switch_direction", text="Switch Direction")
layout.operator_context = 'EXEC_AREA'
layout.operator("armature.symmetrize")
UseSeparator(self, context)
layout.operator("armature.delete")
UseSeparator(self, context)
layout.operator_context = 'INVOKE_DEFAULT'
layout.operator("armature.armature_layers")
layout.operator("armature.bone_layers")
class VIEW3D_MT_EditArmatureTK2(Menu):
bl_label = "Armature Tools"
def draw(self, context):
layout = self.layout
layout.operator("armature.subdivide", text="Subdivide")
layout.operator("armature.extrude_move")
layout.operator("armature.extrude_forked")
layout.operator("armature.duplicate_move")
UseSeparator(self, context)
layout.menu("VIEW3D_MT_edit_armature_delete")
UseSeparator(self, context)
layout.operator("transform.transform",
text="Scale Envelope Distance").mode = 'BONE_SIZE'
layout.operator("transform.transform",
text="Scale B-Bone Width").mode = 'BONE_SIZE'
# Armature Pose Menu's #
class VIEW3D_MT_Pose2(Menu):
bl_label = "Pose"
def draw(self, context):
layout = self.layout
layout.menu("VIEW3D_MT_object_animation")
layout.menu("VIEW3D_MT_pose_slide")
layout.menu("VIEW3D_MT_pose_propagate")
layout.menu("VIEW3D_MT_pose_library")
layout.menu("VIEW3D_MT_pose_motion")
UseSeparator(self, context)
layout.menu("VIEW3D_MT_pose_group")
layout.menu("VIEW3D_MT_object_parent")
UseSeparator(self, context)
layout.menu("VIEW3D_MT_pose_ik")
layout.menu("VIEW3D_MT_pose_constraints")
layout.operator("pose.quaternions_flip")
layout.operator_context = 'INVOKE_AREA'
UseSeparator(self, context)
layout.operator("armature.armature_layers", text="Change Armature Layers...")
layout.operator("pose.bone_layers", text="Change Bone Layers...")
UseSeparator(self, context)
layout.menu("VIEW3D_MT_pose_showhide")
layout.menu("VIEW3D_MT_bone_options_toggle", text="Bone Settings")
# Transform Menu's #
class VIEW3D_MT_TransformMenu2(Menu):
bl_label = "Transform"
def draw(self, context):
layout = self.layout
layout.menu("VIEW3D_MT_ManipulatorMenu12")
UseSeparator(self, context)
layout.operator("transform.translate", text="Move")
layout.operator("transform.rotate", text="Rotate")
layout.operator("transform.resize", text="Scale")
UseSeparator(self, context)
layout.menu("VIEW3D_MT_object_clear")
layout.menu("VIEW3D_MT_object_apply")
UseSeparator(self, context)
layout.operator("transform.translate", text="Move Texture Space").texture_space = True
layout.operator("transform.resize", text="Scale Texture Space").texture_space = True
UseSeparator(self, context)
layout.operator("object.randomize_transform")
layout.operator("transform.tosphere", text="To Sphere")
layout.operator("transform.shear", text="Shear")
layout.operator("transform.bend", text="Bend")
layout.operator("transform.push_pull", text="Push/Pull")
UseSeparator(self, context)
layout.operator("object.align")
layout.operator_context = 'EXEC_REGION_WIN'
layout.operator("transform.transform",
text="Align to Transform Orientation").mode = 'ALIGN'
Brendon Murphy
committed
# ********** Edit Mesh Transform **********
class VIEW3D_MT_TransformMenuEdit2(Menu):
bl_label = "Transform"
Brendon Murphy
committed
def draw(self, context):
layout = self.layout
layout.menu("VIEW3D_MT_ManipulatorMenu12")
UseSeparator(self, context)
layout.operator("transform.translate", text="Move")
Brendon Murphy
committed
layout.operator("transform.rotate", text="Rotate")
layout.operator("transform.resize", text="Scale")
UseSeparator(self, context)
Brendon Murphy
committed
layout.operator("transform.tosphere", text="To Sphere")
layout.operator("transform.shear", text="Shear")
layout.operator("transform.bend", text="Bend")
layout.operator("transform.push_pull", text="Push/Pull")
layout.operator("transform.vertex_warp", text="Warp")
layout.operator("transform.vertex_random", text="Randomize")
UseSeparator(self, context)
layout.operator("transform.translate", text="Move Texture Space").texture_space = True
layout.operator("transform.resize", text="Scale Texture Space").texture_space = True
UseSeparator(self, context)
layout.operator_context = 'EXEC_REGION_WIN'
layout.operator("transform.transform",
text="Align to Transform Orientation").mode = 'ALIGN'
Brendon Murphy
committed
layout.operator_context = 'EXEC_AREA'
layout.operator("object.origin_set",
text="Geometry to Origin").type = 'GEOMETRY_ORIGIN'
# ********** Transform Lite/Short **********
class VIEW3D_MT_TransformMenuLite2(Menu):
bl_label = "Transform"
def draw(self, context):
layout = self.layout
layout.menu("VIEW3D_MT_ManipulatorMenu12")
UseSeparator(self, context)
layout.operator("transform.translate", text="Move")
layout.operator("transform.rotate", text="Rotate")
layout.operator("transform.resize", text="Scale")
UseSeparator(self, context)
layout.menu("VIEW3D_MT_object_clear")
layout.menu("VIEW3D_MT_object_apply")
UseSeparator(self, context)
layout.operator("transform.transform",
text="Align to Transform Orientation").mode = 'ALIGN'
# ********** Transform Camera **********
class VIEW3D_MT_TransformMenuCamera2(Menu):
bl_label = "Transform"
def draw(self, context):
layout = self.layout
layout.menu("VIEW3D_MT_ManipulatorMenu12")
layout.menu("VIEW3D_MT_object_clear")
layout.menu("VIEW3D_MT_object_apply")
layout.operator("transform.translate", text="Move")
layout.operator("transform.rotate", text="Rotate")
layout.operator("transform.resize", text="Scale")
layout.operator("object.align")
layout.operator_context = 'EXEC_REGION_WIN'
UseSeparator(self, context)
layout.operator("transform.transform",
text="Align to Transform Orientation").mode = 'ALIGN'
# ********** Transform Armature **********
class VIEW3D_MT_TransformMenuArmature2(Menu):
bl_label = "Transform"
def draw(self, context):
layout = self.layout
Brendon Murphy
committed
layout.menu("VIEW3D_MT_ManipulatorMenu12")
UseSeparator(self, context)
layout.operator("transform.translate", text="Move")
layout.operator("transform.rotate", text="Rotate")
layout.operator("transform.resize", text="Scale")
UseSeparator(self, context)
layout.operator("armature.align")
layout.operator("object.align")
layout.operator_context = 'EXEC_AREA'
UseSeparator(self, context)
Brendon Murphy
committed
layout.operator("object.origin_set",
text="Geometry to Origin").type = 'GEOMETRY_ORIGIN'
layout.operator("object.origin_set",
text="Origin to Geometry").type = 'ORIGIN_GEOMETRY'
layout.operator("object.origin_set",
text="Origin to 3D Cursor").type = 'ORIGIN_CURSOR'
layout.operator("object.origin_set",
text="Origin to Center of Mass").type = 'ORIGIN_CENTER_OF_MASS'
Brendon Murphy
committed
# ********** Transform Armature Edit **********
class VIEW3D_MT_TransformMenuArmatureEdit2(Menu):
bl_label = "Transform"
Brendon Murphy
committed
def draw(self, context):
layout = self.layout
layout.menu("VIEW3D_MT_ManipulatorMenu12")
UseSeparator(self, context)
layout.operator("transform.translate", text="Move")
layout.operator("transform.rotate", text="Rotate")
layout.operator("transform.resize", text="Scale")
UseSeparator(self, context)
layout.operator("transform.tosphere", text="To Sphere")
layout.operator("transform.shear", text="Shear")
layout.operator("transform.bend", text="Bend")
layout.operator("transform.push_pull", text="Push/Pull")
layout.operator("transform.vertex_warp", text="Warp")
UseSeparator(self, context)
layout.operator("transform.vertex_random", text="Randomize")
layout.operator("armature.align")
layout.operator_context = 'EXEC_AREA'
Brendon Murphy
committed
# ********** Transform Armature Pose **********
class VIEW3D_MT_TransformMenuArmaturePose2(Menu):