menus are now global (like operators), so for eg, the info add menu and the 3D add...
[blender.git] / release / scripts / ui / space_view3d.py
1
2 import bpy
3
4 # ********** Header **********
5
6 class VIEW3D_HT_header(bpy.types.Header):
7         __space_type__ = 'VIEW_3D'
8
9         def draw(self, context):
10                 layout = self.layout
11                 
12                 view = context.space_data
13                 mode_string = context.mode
14                 edit_object = context.edit_object
15                 object = context.active_object
16                 
17                 row = layout.row(align=True)
18                 row.template_header()
19
20                 # Menus
21                 if context.area.show_menus:
22                         sub = row.row(align=True)
23
24                         sub.itemM("VIEW3D_MT_view")
25                         
26                         # Select Menu
27                         if mode_string not in ('EDIT_TEXT', 'SCULPT', 'PAINT_WEIGHT', 'PAINT_VERTEX', 'PAINT_TEXTURE'):
28                                 sub.itemM("VIEW3D_MT_select_%s" % mode_string.lower())
29                         
30                         if edit_object:
31                                 sub.itemM("VIEW3D_MT_edit_%s" % edit_object.type.lower())
32                         elif object:
33                                 ob_mode_string = object.mode
34                                 
35                                 if mode_string not in ['PAINT_WEIGHT', 'PAINT_TEXTURE']:
36                                         sub.itemM("VIEW3D_MT_%s" % mode_string.lower())
37                         else:
38                                 sub.itemM("VIEW3D_MT_object")
39
40                 layout.template_header_3D()
41
42 # ********** Menu **********
43
44 # ********** Utilities **********
45
46 class VIEW3D_MT_showhide(bpy.types.Menu):
47         __label__ = "Show/Hide"
48         _operator_name = ""
49
50         def draw(self, context):
51                 layout = self.layout
52                 
53                 layout.itemO("%s.reveal" % self._operator_name, text="Show Hidden")
54                 layout.itemO("%s.hide" % self._operator_name, text="Hide Selected")
55                 layout.item_booleanO("%s.hide" % self._operator_name, "unselected", True, text="Hide Unselected")
56
57 class VIEW3D_MT_snap(bpy.types.Menu):
58         __label__ = "Snap"
59
60         def draw(self, context):
61                 layout = self.layout
62                 
63                 layout.itemO("view3d.snap_selected_to_grid", text="Selection to Grid")
64                 layout.itemO("view3d.snap_selected_to_cursor", text="Selection to Cursor")
65                 layout.itemO("view3d.snap_selected_to_center", text="Selection to Center")
66                 
67                 layout.itemS()
68                 
69                 layout.itemO("view3d.snap_cursor_to_selected", text="Cursor to Selected")
70                 layout.itemO("view3d.snap_cursor_to_grid", text="Cursor to Grid")
71                 layout.itemO("view3d.snap_cursor_to_active", text="Cursor to Active")
72
73 # ********** View menus **********
74
75 class VIEW3D_MT_view(bpy.types.Menu):
76         __label__ = "View"
77
78         def draw(self, context):
79                 layout = self.layout
80
81                 layout.itemO("view3d.properties", icon='ICON_MENU_PANEL')
82                 layout.itemO("view3d.toolbar", icon='ICON_MENU_PANEL')
83                 
84                 layout.itemS()
85                 
86                 layout.item_enumO("view3d.viewnumpad", "type", 'CAMERA')
87                 layout.item_enumO("view3d.viewnumpad", "type", 'TOP')
88                 layout.item_enumO("view3d.viewnumpad", "type", 'FRONT')
89                 layout.item_enumO("view3d.viewnumpad", "type", 'RIGHT')
90                 
91                 layout.itemM("VIEW3D_MT_view_cameras", text="Cameras")
92                 
93                 layout.itemS()
94                 
95                 layout.itemO("view3d.view_persportho")
96                 
97                 layout.itemS()
98                 
99                 layout.itemM("VIEW3D_MT_view_navigation")
100                 layout.itemM("VIEW3D_MT_view_align")
101                 
102                 layout.itemS()
103
104                 layout.operator_context = "INVOKE_REGION_WIN"
105                 
106                 layout.itemO("view3d.clip_border", text="Clipping Border...")
107                 layout.itemO("view3d.zoom_border", text="Zoom Border...")
108                 
109                 layout.itemS()
110                 
111                 layout.itemO("view3d.view_center")
112                 layout.itemO("view3d.view_all")
113                 
114                 layout.itemS()
115                 
116                 layout.itemO("screen.region_foursplit", text="Toggle Quad View")
117                 layout.itemO("screen.screen_full_area", text="Toggle Full Screen")
118
119 class VIEW3D_MT_view_navigation(bpy.types.Menu):
120         __label__ = "Navigation"
121
122         def draw(self, context):
123                 layout = self.layout
124
125                 layout.items_enumO("view3d.view_orbit", "type")
126                 
127                 layout.itemS()
128                 
129                 layout.items_enumO("view3d.view_pan", "type")
130                 
131                 layout.itemS()
132                 
133                 layout.item_floatO("view3d.zoom", "delta", 1.0, text="Zoom In")
134                 layout.item_floatO("view3d.zoom", "delta", -1.0, text="Zoom Out")
135                 
136                 layout.itemS()
137                 
138                 layout.itemO("view3d.fly")
139
140 class VIEW3D_MT_view_align(bpy.types.Menu):
141         __label__ = "Align View"
142
143         def draw(self, context):
144                 layout = self.layout
145                 
146                 layout.itemO("view3d.view_center")
147                 
148 class VIEW3D_MT_view_cameras(bpy.types.Menu):
149         __label__ = "Cameras"
150
151         def draw(self, context):
152                 layout = self.layout
153                 
154                 layout.itemO("view3d.object_as_camera")
155
156 # ********** Select menus, suffix from context.mode **********
157
158 class VIEW3D_MT_select_object(bpy.types.Menu):
159         __label__ = "Select"
160
161         def draw(self, context):
162                 layout = self.layout
163
164                 layout.itemO("view3d.select_border")
165
166                 layout.itemS()
167
168                 layout.itemO("object.select_all_toggle", text="Select/Deselect All")
169                 layout.itemO("object.select_inverse", text="Inverse")
170                 layout.itemO("object.select_random", text="Random")
171                 layout.itemO("object.select_mirror", text="Mirror")
172                 layout.itemO("object.select_by_layer", text="Select All by Layer")
173                 layout.item_enumO("object.select_by_type", "type", "", text="Select All by Type...")
174                 layout.itemO("object.select_grouped", text="Select Grouped...")
175                 layout.itemO("object.select_pattern", text="Select Pattern...")
176
177 class VIEW3D_MT_select_pose(bpy.types.Menu):
178         __label__ = "Select"
179
180         def draw(self, context):
181                 layout = self.layout
182
183                 layout.itemO("view3d.select_border", text="Border Select...")
184
185                 layout.itemS()
186                 
187                 layout.itemO("pose.select_all_toggle", text="Select/Deselect All")
188                 layout.itemO("pose.select_inverse", text="Inverse")
189                 layout.itemO("pose.select_constraint_target", text="Constraint Target")
190                 layout.itemO("pose.select_linked", text="Linked")
191                 
192                 layout.itemS()
193                 
194                 layout.item_enumO("pose.select_hierarchy", "direction", 'PARENT')
195                 layout.item_enumO("pose.select_hierarchy", "direction", 'CHILD')
196                 
197                 layout.itemS()
198                 
199                 props = layout.itemO("pose.select_hierarchy", properties=True, text="Extend Parent")
200                 props.extend = True
201                 props.direction = 'PARENT'
202
203                 props = layout.itemO("pose.select_hierarchy", properties=True, text="Extend Child")
204                 props.extend = True
205                 props.direction = 'CHILD'
206
207 class VIEW3D_MT_select_particle(bpy.types.Menu):
208         __label__ = "Select"
209
210         def draw(self, context):
211                 layout = self.layout
212
213                 layout.itemO("view3d.select_border")
214
215                 layout.itemS()
216                 
217                 layout.itemO("particle.select_all_toggle", text="Select/Deselect All")
218                 layout.itemO("particle.select_linked")
219                 
220                 layout.itemS()
221                 
222                 layout.itemO("particle.select_more")
223                 layout.itemO("particle.select_less")
224
225 class VIEW3D_MT_select_edit_mesh(bpy.types.Menu):
226         __label__ = "Select"
227
228         def draw(self, context):
229                 layout = self.layout
230
231                 layout.itemO("view3d.select_border", text="Border Select...")
232
233                 layout.itemS()
234
235                 layout.itemO("mesh.select_all_toggle", text="Select/Deselect All")
236                 layout.itemO("mesh.select_inverse", text="Inverse")
237
238                 layout.itemS()
239
240                 layout.itemO("mesh.select_random", text="Random...")
241                 layout.itemO("mesh.edges_select_sharp", text="Sharp Edges")
242                 layout.itemO("mesh.faces_select_linked_flat", text="Linked Flat Faces")
243
244                 layout.itemS()
245
246                 layout.item_enumO("mesh.select_by_number_vertices", "type", 'TRIANGLES', text="Triangles")
247                 layout.item_enumO("mesh.select_by_number_vertices", "type", 'QUADS', text="Quads")
248                 layout.item_enumO("mesh.select_by_number_vertices", "type", 'OTHER', text="Loose Verts/Edges")
249                 layout.itemO("mesh.select_similar", text="Similar...")
250
251                 layout.itemS()
252
253                 layout.itemO("mesh.select_less", text="Less")
254                 layout.itemO("mesh.select_more", text="More")
255
256                 layout.itemS()
257
258                 layout.itemO("mesh.select_linked", text="Linked")
259                 layout.itemO("mesh.select_vertex_path", text="Vertex Path")
260                 layout.itemO("mesh.loop_multi_select", text="Edge Loop")
261                 layout.item_booleanO("mesh.loop_multi_select", "ring", True, text="Edge Ring")
262
263                 layout.itemS()
264
265                 layout.itemO("mesh.loop_to_region")
266                 layout.itemO("mesh.region_to_loop")
267
268 class VIEW3D_MT_select_edit_curve(bpy.types.Menu):
269         __label__ = "Select"
270
271         def draw(self, context):
272                 layout = self.layout
273
274                 layout.itemO("view3d.select_border", text="Border Select...")
275                 layout.itemO("view3d.select_circle", text="Circle Select...")
276
277                 layout.itemS()
278                 
279                 layout.itemO("curve.select_all_toggle", text="Select/Deselect All")
280                 layout.itemO("curve.select_inverse")
281                 layout.itemO("curve.select_random")
282                 layout.itemO("curve.select_every_nth")
283
284                 layout.itemS()
285                 
286                 layout.itemO("curve.de_select_first")
287                 layout.itemO("curve.de_select_last")
288                 layout.itemO("curve.select_next")
289                 layout.itemO("curve.select_previous")
290
291                 layout.itemS()
292                 
293                 layout.itemO("curve.select_more")
294                 layout.itemO("curve.select_less")
295
296 class VIEW3D_MT_select_edit_surface(bpy.types.Menu):
297         __label__ = "Select"
298
299         def draw(self, context):
300                 layout = self.layout
301
302                 layout.itemO("view3d.select_border", text="Border Select...")
303                 layout.itemO("view3d.select_circle", text="Circle Select...")
304
305                 layout.itemS()
306                 
307                 layout.itemO("curve.select_all_toggle", text="Select/Deselect All")
308                 layout.itemO("curve.select_inverse")
309                 layout.itemO("curve.select_random")
310                 layout.itemO("curve.select_every_nth")
311
312                 layout.itemS()
313                 
314                 layout.itemO("curve.select_row")
315
316                 layout.itemS()
317                 
318                 layout.itemO("curve.select_more")
319                 layout.itemO("curve.select_less")
320
321 class VIEW3D_MT_select_edit_metaball(bpy.types.Menu):
322         __label__ = "Select"
323
324         def draw(self, context):
325                 layout = self.layout
326
327                 layout.itemO("view3d.select_border")
328                 
329                 layout.itemS()
330                 
331                 layout.itemO("mball.select_deselect_all_metaelems")
332                 layout.itemO("mball.select_inverse_metaelems")
333                 
334                 layout.itemS()
335                 
336                 layout.itemO("mball.select_random_metaelems")
337
338 class VIEW3D_MT_select_edit_lattice(bpy.types.Menu):
339         __label__ = "Select"
340
341         def draw(self, context):
342                 layout = self.layout
343
344                 layout.itemO("view3d.select_border")
345
346                 layout.itemS()
347                 
348                 layout.itemO("lattice.select_all_toggle", text="Select/Deselect All")
349
350 class VIEW3D_MT_select_edit_armature(bpy.types.Menu):
351         __label__ = "Select"
352
353         def draw(self, context):
354                 layout = self.layout
355
356                 layout.itemO("view3d.select_border", text="Border Select...")
357
358                 layout.itemS()
359                 
360                 layout.itemO("armature.select_all_toggle", text="Select/Deselect All")
361                 layout.itemO("armature.select_inverse", text="Inverse")
362
363                 layout.itemS()
364                 
365                 layout.item_enumO("armature.select_hierarchy", "direction", 'PARENT', text="Parent")
366                 layout.item_enumO("armature.select_hierarchy", "direction", 'CHILD', text="Child")
367                 
368                 layout.itemS()
369                 
370                 props = layout.itemO("armature.select_hierarchy", properties=True, text="Extend Parent")
371                 props.extend = True
372                 props.direction = 'PARENT'
373
374                 props = layout.itemO("armature.select_hierarchy", properties=True, text="Extend Child")
375                 props.extend = True
376                 props.direction = 'CHILD'
377
378 class VIEW3D_MT_select_face(bpy.types.Menu):# XXX no matching enum
379         __label__ = "Select"
380
381         def draw(self, context):
382                 layout = self.layout
383
384                 layout.view3d_select_faceselmenu()
385
386 # ********** Object menu **********
387
388 class VIEW3D_MT_object(bpy.types.Menu):
389         __context__ = "objectmode"
390         __label__ = "Object"
391
392         def draw(self, context):
393                 layout = self.layout
394
395                 layout.itemM("VIEW3D_MT_object_clear")
396                 layout.itemM("VIEW3D_MT_snap")
397                 
398                 layout.itemS()
399                 
400                 layout.itemO("anim.insert_keyframe_menu", text="Insert Keyframe...")
401                 layout.itemO("anim.delete_keyframe_v3d", text="Delete Keyframe...")
402                 
403                 layout.itemS()
404                 
405                 layout.itemO("object.duplicate_move")
406                 layout.item_booleanO("object.duplicate", "linked", True, text="Duplicate Linked")
407                 layout.itemO("object.delete", text="Delete...")
408                 layout.itemO("object.proxy_make", text="Make Proxy...")
409                 
410                 layout.itemS()
411                 
412                 layout.itemM("VIEW3D_MT_object_parent")
413                 layout.itemM("VIEW3D_MT_object_track")
414                 layout.itemM("VIEW3D_MT_object_group")
415                 layout.itemM("VIEW3D_MT_object_constraints")
416                 
417                 layout.itemS()
418                 
419                 layout.itemO("object.join")
420                 
421                 layout.itemS()
422                 
423                 layout.itemM("VIEW3D_MT_object_showhide")
424                 
425 class VIEW3D_MT_object_clear(bpy.types.Menu):
426         __label__ = "Clear"
427
428         def draw(self, context):
429                 layout = self.layout
430                 
431                 layout.itemO("object.location_clear", text="Location")
432                 layout.itemO("object.rotation_clear", text="Rotation")
433                 layout.itemO("object.scale_clear", text="Scale")
434                 layout.itemO("object.origin_clear", text="Origin")
435                 
436 class VIEW3D_MT_object_parent(bpy.types.Menu):
437         __label__ = "Parent"
438
439         def draw(self, context):
440                 layout = self.layout
441                 
442                 layout.itemO("object.parent_set", text="Set")
443                 layout.itemO("object.parent_clear", text="Clear")
444                 
445 class VIEW3D_MT_object_track(bpy.types.Menu):
446         __label__ = "Track"
447
448         def draw(self, context):
449                 layout = self.layout
450                 
451                 layout.itemO("object.track_set", text="Set")
452                 layout.itemO("object.track_clear", text="Clear")
453                 
454 class VIEW3D_MT_object_group(bpy.types.Menu):
455         __label__ = "Group"
456
457         def draw(self, context):
458                 layout = self.layout
459                 
460                 layout.itemO("group.group_create")
461                 layout.itemO("group.objects_remove")
462                 
463                 layout.itemS()
464                 
465                 layout.itemO("group.objects_add_active")
466                 layout.itemO("group.objects_remove_active")
467                 
468 class VIEW3D_MT_object_constraints(bpy.types.Menu):
469         __label__ = "Constraints"
470
471         def draw(self, context):
472                 layout = self.layout
473                 
474                 layout.itemO("object.constraint_add_with_targets")
475                 layout.itemO("object.constraints_clear")
476                 
477 class VIEW3D_MT_object_showhide(bpy.types.Menu):
478         __label__ = "Show/Hide"
479
480         def draw(self, context):
481                 layout = self.layout
482                 
483                 layout.itemO("object.restrictview_clear", text="Show Hidden")
484                 layout.itemO("object.restrictview_set", text="Hide Selected")
485                 layout.item_booleanO("object.restrictview_set", "unselected", True, text="Hide Unselected")
486
487 # ********** Vertex paint menu **********       
488         
489 class VIEW3D_MT_paint_vertex(bpy.types.Menu):
490         __label__ = "Paint"
491
492         def draw(self, context):
493                 layout = self.layout
494                 
495                 sculpt = context.tool_settings.sculpt
496
497                 layout.itemO("paint.vertex_color_set")
498                 props = layout.itemO("paint.vertex_color_set", text="Set Selected Vertex Colors", properties=True)
499                 props.selected = True
500
501 # ********** Sculpt menu **********     
502         
503 class VIEW3D_MT_sculpt(bpy.types.Menu):
504         __label__ = "Sculpt"
505
506         def draw(self, context):
507                 layout = self.layout
508                 
509                 sculpt = context.tool_settings.sculpt
510                 brush = context.tool_settings.sculpt.brush
511                 
512                 layout.itemR(sculpt, "symmetry_x")
513                 layout.itemR(sculpt, "symmetry_y")
514                 layout.itemR(sculpt, "symmetry_z")
515                 layout.itemS()
516                 layout.itemR(sculpt, "lock_x")
517                 layout.itemR(sculpt, "lock_y")
518                 layout.itemR(sculpt, "lock_z")
519                 layout.itemS()
520                 layout.item_menu_enumO("brush.curve_preset", property="shape")
521                 layout.itemS()
522                 
523                 if brush.sculpt_tool != 'GRAB':
524                         layout.itemR(brush, "use_airbrush")
525                         
526                         if brush.sculpt_tool != 'LAYER':
527                                 layout.itemR(brush, "use_anchor")
528                         
529                         if brush.sculpt_tool in ('DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'):
530                                 layout.itemR(brush, "flip_direction")
531
532                         if brush.sculpt_tool == 'LAYER':
533                                 layout.itemR(brush, "use_persistent")
534                                 layout.itemO("sculpt.set_persistent_base")
535
536 # ********** Particle menu **********   
537         
538 class VIEW3D_MT_particle(bpy.types.Menu):
539         __label__ = "Particle"
540
541         def draw(self, context):
542                 layout = self.layout
543                 
544                 particle_edit = context.tool_settings.particle_edit
545                 
546                 layout.itemO("particle.mirror")
547                 
548                 layout.itemS()
549                 
550                 layout.itemO("particle.remove_doubles")
551                 layout.itemO("particle.delete")
552                 
553                 if particle_edit.selection_mode == 'POINT':
554                         layout.itemO("particle.subdivide")
555                 
556                 layout.itemO("particle.rekey")
557                 
558                 layout.itemS()
559                 
560                 layout.itemM("VIEW3D_MT_particle_showhide")
561
562 class VIEW3D_MT_particle_showhide(VIEW3D_MT_showhide):
563         _operator_name = "particle"
564
565 # ********** Pose Menu **********
566
567 class VIEW3D_MT_pose(bpy.types.Menu):
568         __label__ = "Pose"
569
570         def draw(self, context):
571                 layout = self.layout
572                 
573                 arm = context.active_object.data
574                 
575                 if arm.drawtype in ('BBONE', 'ENVELOPE'):
576                         layout.item_enumO("tfm.transform", "mode", 'BONESIZE', text="Scale Envelope Distance")
577                 
578                 layout.itemM("VIEW3D_MT_pose_transform")
579                 
580                 layout.itemS()
581                 
582                 layout.itemO("anim.insert_keyframe_menu", text="Insert Keyframe...")
583                 layout.itemO("anim.delete_keyframe_v3d", text="Delete Keyframe...")
584                 
585                 layout.itemS()
586                 
587                 layout.itemO("pose.apply")
588                 
589                 layout.itemS()
590                 
591                 layout.itemO("pose.copy")
592                 layout.itemO("pose.paste")
593                 layout.item_booleanO("pose.paste", "flipped", True, text="Paste X-Flipped Pose")
594                 
595                 layout.itemS()
596                 
597                 layout.itemM("VIEW3D_MT_pose_pose")
598                 layout.itemM("VIEW3D_MT_pose_motion")
599                 layout.itemM("VIEW3D_MT_pose_group")
600                 
601                 layout.itemS()
602                 
603                 layout.itemM("VIEW3D_MT_pose_ik")
604                 layout.itemM("VIEW3D_MT_pose_constraints")
605                 
606                 layout.itemS()
607                 
608                 layout.operator_context = "EXEC_AREA"
609                 layout.item_enumO("pose.autoside_names", "axis", 'XAXIS', text="AutoName Left/Right")
610                 layout.item_enumO("pose.autoside_names", "axis", 'YAXIS', text="AutoName Front/Back")
611                 layout.item_enumO("pose.autoside_names", "axis", 'ZAXIS', text="AutoName Top/Bottom")
612                 
613                 layout.itemO("pose.flip_names")
614                 
615                 layout.itemS()
616                 
617                 layout.operator_context = "INVOKE_AREA"
618                 layout.itemO("pose.armature_layers", text="Change Armature Layers...")
619                 layout.itemO("pose.bone_layers", text="Change Bone Layers...")
620                 
621                 layout.itemS()
622                 
623                 layout.itemM("VIEW3D_MT_pose_showhide")
624                 layout.item_menu_enumO("pose.flags_set", 'mode', text="Bone Settings")
625
626 class VIEW3D_MT_pose_transform(bpy.types.Menu):
627         __label__ = "Clear Transform"
628
629         def draw(self, context):
630                 layout = self.layout
631                 
632                 layout.itemL(text="User Transform")
633                 
634                 layout.itemO("pose.loc_clear", text="Location")
635                 layout.itemO("pose.rot_clear", text="Rotation")
636                 layout.itemO("pose.scale_clear", text="Scale")
637                 
638                 layout.itemL(text="Origin")
639                 
640 class VIEW3D_MT_pose_pose(bpy.types.Menu):
641         __label__ = "Pose Library"
642
643         def draw(self, context):
644                 layout = self.layout
645                 
646                 layout.itemO("poselib.browse_interactive", text="Browse Poses...")
647                 
648                 layout.itemS()
649                 
650                 layout.itemO("poselib.pose_add", text="Add Pose...")
651                 layout.itemO("poselib.pose_rename", text="Rename Pose...")
652                 layout.itemO("poselib.pose_remove", text="Remove Pose...")
653
654 class VIEW3D_MT_pose_motion(bpy.types.Menu):
655         __label__ = "Motion Paths"
656
657         def draw(self, context):
658                 layout = self.layout
659                 
660                 layout.itemO("pose.paths_calculate", text="Calculate")
661                 layout.itemO("pose.paths_clear", text="Clear")
662                 
663 class VIEW3D_MT_pose_group(bpy.types.Menu):
664         __label__ = "Bone Groups"
665
666         def draw(self, context):
667                 layout = self.layout
668                 layout.itemO("pose.group_add")
669                 layout.itemO("pose.group_remove")
670                 
671                 layout.itemS()
672                 
673                 layout.itemO("pose.group_assign")
674                 layout.itemO("pose.group_unassign")
675                 
676                 
677 class VIEW3D_MT_pose_ik(bpy.types.Menu):
678         __label__ = "Inverse Kinematics"
679
680         def draw(self, context):
681                 layout = self.layout
682                 
683                 layout.itemO("pose.ik_add")
684                 layout.itemO("pose.ik_clear")
685                 
686 class VIEW3D_MT_pose_constraints(bpy.types.Menu):
687         __label__ = "Constraints"
688
689         def draw(self, context):
690                 layout = self.layout
691                 
692                 layout.itemO("pose.constraint_add_with_targets", text="Add (With Targets)...")
693                 layout.itemO("pose.constraints_clear")
694                 
695 class VIEW3D_MT_pose_showhide(VIEW3D_MT_showhide):
696         _operator_name = "pose"
697
698 # ********** Edit Menus, suffix from ob.type **********
699
700 # Edit MESH
701 class VIEW3D_MT_edit_mesh(bpy.types.Menu):
702         __label__ = "Mesh"
703
704         def draw(self, context):
705                 layout = self.layout
706                 
707                 settings = context.tool_settings
708
709                 layout.itemO("ed.undo")
710                 layout.itemO("ed.redo")
711                 
712                 layout.itemS()
713                 
714                 layout.itemM("VIEW3D_MT_snap")
715                 
716                 layout.itemS()
717                 
718                 layout.itemO("uv.mapping_menu", text="UV Unwrap...")
719                 
720                 layout.itemS()
721                 
722                 layout.itemO("mesh.extrude")
723                 layout.itemO("mesh.duplicate")
724                 layout.itemO("mesh.delete", text="Delete...")
725                 
726                 layout.itemS()
727                 
728                 layout.itemM("VIEW3D_MT_edit_mesh_vertices")
729                 layout.itemM("VIEW3D_MT_edit_mesh_edges")
730                 layout.itemM("VIEW3D_MT_edit_mesh_faces")
731                 layout.itemM("VIEW3D_MT_edit_mesh_normals")
732                 
733                 layout.itemS()
734                 
735                 layout.itemR(settings, "automerge_editing")
736                 layout.itemR(settings, "proportional_editing")
737                 layout.item_menu_enumR(settings, "proportional_editing_falloff")
738                 
739                 layout.itemS()
740                 
741                 layout.itemM("VIEW3D_MT_edit_mesh_showhide")
742
743 class VIEW3D_MT_edit_mesh_vertices(bpy.types.Menu):
744         __label__ = "Vertices"
745
746         def draw(self, context):
747                 layout = self.layout
748                 
749                 layout.itemO("mesh.merge")
750                 layout.itemO("mesh.rip")
751                 layout.itemO("mesh.split")
752                 layout.itemO("mesh.separate")
753
754                 layout.itemS()
755                 
756                 layout.itemO("mesh.vertices_smooth")
757                 layout.itemO("mesh.remove_doubles")
758
759 class VIEW3D_MT_edit_mesh_edges(bpy.types.Menu):
760         __label__ = "Edges"
761
762         def draw(self, context):
763                 layout = self.layout
764
765                 layout.itemO("mesh.edge_face_add")
766                 layout.itemO("mesh.subdivide")
767
768                 layout.itemS()
769                 
770                 layout.itemO("mesh.mark_seam")
771                 layout.item_booleanO("mesh.mark_seam", "clear", True, text="Clear Seam")
772                 
773                 layout.itemS()
774                 
775                 layout.itemO("mesh.mark_sharp")
776                 layout.item_booleanO("mesh.mark_sharp", "clear", True, text="Clear Sharp")
777                 
778                 layout.itemS()
779                 
780                 layout.item_enumO("mesh.edge_rotate", "direction", 'CW', text="Rotate Edge CW")
781                 layout.item_enumO("mesh.edge_rotate", "direction", 'CCW', text="Rotate Edge CCW")
782
783 class VIEW3D_MT_edit_mesh_faces(bpy.types.Menu):
784         __label__ = "Faces"
785
786         def draw(self, context):
787                 layout = self.layout
788
789                 layout.itemO("mesh.edge_face_add")
790                 layout.itemO("mesh.fill")
791                 layout.itemO("mesh.beauty_fill")
792
793                 layout.itemS()
794                 
795                 layout.itemO("mesh.quads_convert_to_tris")
796                 layout.itemO("mesh.tris_convert_to_quads")
797                 layout.itemO("mesh.edge_flip")
798                 
799                 layout.itemS()
800                 
801                 layout.itemO("mesh.faces_shade_smooth")
802                 layout.itemO("mesh.faces_shade_flat")
803
804 class VIEW3D_MT_edit_mesh_normals(bpy.types.Menu):
805         __label__ = "Normals"
806
807         def draw(self, context):
808                 layout = self.layout
809
810                 layout.itemO("mesh.normals_make_consistent", text="Recalculate Outside")
811                 layout.item_booleanO("mesh.normals_make_consistent", "inside", True, text="Recalculate Inside")
812
813                 layout.itemS()
814                 
815                 layout.itemO("mesh.flip_normals")
816                 
817 class VIEW3D_MT_edit_mesh_showhide(VIEW3D_MT_showhide):
818         _operator_name = "mesh"
819
820 # Edit Curve
821
822 # draw_curve is used by VIEW3D_MT_edit_curve and VIEW3D_MT_edit_surface
823 def draw_curve(self, context):
824         layout = self.layout
825         
826         settings = context.tool_settings
827         
828         layout.itemM("VIEW3D_MT_snap")
829         
830         layout.itemS()
831         
832         layout.itemO("curve.extrude")
833         layout.itemO("curve.duplicate")
834         layout.itemO("curve.separate")
835         layout.itemO("curve.make_segment")
836         layout.itemO("curve.cyclic_toggle")
837         layout.itemO("curve.delete", text="Delete...")
838         
839         layout.itemS()
840         
841         layout.itemM("VIEW3D_MT_edit_curve_ctrlpoints")
842         layout.itemM("VIEW3D_MT_edit_curve_segments")
843         
844         layout.itemS()
845         
846         layout.itemR(settings, "proportional_editing")
847         layout.item_menu_enumR(settings, "proportional_editing_falloff")
848         
849         layout.itemS()
850         
851         layout.itemM("VIEW3D_MT_edit_curve_showhide")
852
853 class VIEW3D_MT_edit_curve(bpy.types.Menu):
854         __label__ = "Curve"
855
856         draw = draw_curve
857         
858 class VIEW3D_MT_edit_curve_ctrlpoints(bpy.types.Menu):
859         __label__ = "Control Points"
860
861         def draw(self, context):
862                 layout = self.layout
863                 
864                 edit_object = context.edit_object
865                 
866                 if edit_object.type == 'CURVE':
867                         layout.item_enumO("tfm.transform", "mode", 'TILT')
868                         layout.itemO("curve.tilt_clear")
869                         layout.itemO("curve.separate")
870                         
871                         layout.itemS()
872                         
873                         layout.item_menu_enumO("curve.handle_type_set", "type")
874                 
875 class VIEW3D_MT_edit_curve_segments(bpy.types.Menu):
876         __label__ = "Segments"
877
878         def draw(self, context):
879                 layout = self.layout
880                 
881                 layout.itemO("curve.subdivide")
882                 layout.itemO("curve.switch_direction")
883
884 class VIEW3D_MT_edit_curve_showhide(VIEW3D_MT_showhide):
885         _operator_name = "curve"
886
887 # Edit SURFACE
888 class VIEW3D_MT_edit_surface(bpy.types.Menu):
889         __label__ = "Surface"
890
891         draw = draw_curve
892
893 # Edit TEXT
894 class VIEW3D_MT_edit_text(bpy.types.Menu):
895         __label__ = "Text"
896
897         def draw(self, context):
898                 layout = self.layout
899                 
900                 layout.itemO("font.file_paste")
901                 
902                 layout.itemS()
903                 
904                 layout.itemm("view3d_mt_edit_text_chars")
905
906 class VIEW3D_MT_edit_text_chars(bpy.types.Menu):
907         __label__ = "Special Characters"
908
909         def draw(self, context):
910                 layout = self.layout
911                 
912                 layout.item_stringO("font.text_insert", "text", b'\xC2\xA9'.decode(), text="Copyright|Alt C")
913                 layout.item_stringO("font.text_insert", "text", b'\xC2\xAE'.decode(), text="Registered Trademark|Alt R")
914                 
915                 layout.itemS()
916                 
917                 layout.item_stringO("font.text_insert", "text", b'\xC2\xB0'.decode(), text="Degree Sign|Alt G")
918                 layout.item_stringO("font.text_insert", "text", b'\xC3\x97'.decode(), text="Multiplication Sign|Alt x")
919                 layout.item_stringO("font.text_insert", "text", b'\xC2\x8A'.decode(), text="Circle|Alt .")
920                 layout.item_stringO("font.text_insert", "text", b'\xC2\xB9'.decode(), text="Superscript 1|Alt 1")
921                 layout.item_stringO("font.text_insert", "text", b'\xC2\xB2'.decode(), text="Superscript 2|Alt 2")
922                 layout.item_stringO("font.text_insert", "text", b'\xC2\xB3'.decode(), text="Superscript 3|Alt 3")
923                 layout.item_stringO("font.text_insert", "text", b'\xC2\xBB'.decode(), text="Double >>|Alt >")
924                 layout.item_stringO("font.text_insert", "text", b'\xC2\xAB'.decode(), text="Double <<|Alt <")
925                 layout.item_stringO("font.text_insert", "text", b'\xE2\x80\xB0'.decode(), text="Promillage|Alt %")
926                 
927                 layout.itemS()
928                 
929                 layout.item_stringO("font.text_insert", "text", b'\xC2\xA4'.decode(), text="Dutch Florin|Alt F")
930                 layout.item_stringO("font.text_insert", "text", b'\xC2\xA3'.decode(), text="British Pound|Alt L")
931                 layout.item_stringO("font.text_insert", "text", b'\xC2\xA5'.decode(), text="Japanese Yen|Alt Y")
932                 
933                 layout.itemS()
934                 
935                 layout.item_stringO("font.text_insert", "text", b'\xC3\x9F'.decode(), text="German S|Alt S")
936                 layout.item_stringO("font.text_insert", "text", b'\xC2\xBF'.decode(), text="Spanish Question Mark|Alt ?")
937                 layout.item_stringO("font.text_insert", "text", b'\xC2\xA1'.decode(), text="Spanish Exclamation Mark|Alt !")
938
939 # Edit META
940 class VIEW3D_MT_edit_meta(bpy.types.Menu):
941         __label__ = "Metaball"
942
943         def draw(self, context):
944                 layout = self.layout
945                 
946                 settings = context.tool_settings
947
948                 layout.itemO("ed.undo")
949                 layout.itemO("ed.redo")
950                 
951                 layout.itemS()
952                 
953                 layout.itemM("VIEW3D_MT_snap")
954                 
955                 layout.itemS()
956                 
957                 layout.itemO("mball.delete_metaelems", text="Delete...")
958                 layout.itemO("mball.duplicate_metaelems")
959                 
960                 layout.itemS()
961                 
962                 layout.itemR(settings, "proportional_editing")
963                 layout.item_menu_enumR(settings, "proportional_editing_falloff")
964                 
965                 layout.itemS()
966                 
967                 layout.itemM("VIEW3D_MT_edit_meta_showhide")
968
969 class VIEW3D_MT_edit_meta_showhide(bpy.types.Menu):
970         __label__ = "Show/Hide"
971
972         def draw(self, context):
973                 layout = self.layout
974                 
975                 layout.itemO("mball.reveal_metaelems", text="Show Hidden")
976                 layout.itemO("mball.hide_metaelems", text="Hide Selected")
977                 layout.item_booleanO("mball.hide_metaelems", "unselected", True, text="Hide Unselected")
978
979 # Edit LATTICE
980 class VIEW3D_MT_edit_lattice(bpy.types.Menu):
981         __label__ = "Lattice"
982
983         def draw(self, context):
984                 layout = self.layout
985                 
986                 settings = context.tool_settings
987
988                 layout.itemM("VIEW3D_MT_snap")
989                 
990                 layout.itemS()
991                 
992                 layout.itemO("lattice.make_regular")
993                 
994                 layout.itemS()
995                 
996                 layout.itemR(settings, "proportional_editing")
997                 layout.item_menu_enumR(settings, "proportional_editing_falloff")
998
999 # Edit ARMATURE
1000 class VIEW3D_MT_edit_armature(bpy.types.Menu):
1001         __label__ = "Armature"
1002
1003         def draw(self, context):
1004                 layout = self.layout
1005                 
1006                 edit_object = context.edit_object
1007                 arm = edit_object.data
1008                 
1009                 layout.itemM("VIEW3D_MT_snap")
1010                 layout.itemM("VIEW3D_MT_edit_armature_roll")
1011                 
1012                 if arm.drawtype == 'ENVELOPE':
1013                         layout.item_enumO("tfm.transform", "mode", 'BONESIZE', text="Scale Envelope Distance")
1014                 else:
1015                         layout.item_enumO("tfm.transform", "mode", 'BONESIZE', text="Scale B-Bone Width")
1016                                 
1017                 layout.itemS()
1018                 
1019                 layout.itemO("armature.extrude")
1020                 
1021                 if arm.x_axis_mirror:
1022                         layout.item_booleanO("armature.extrude", "forked", True, text="Extrude Forked")
1023                 
1024                 layout.itemO("armature.duplicate")
1025                 layout.itemO("armature.merge")
1026                 layout.itemO("armature.fill")
1027                 layout.itemO("armature.delete")
1028                 layout.itemO("armature.separate")
1029
1030                 layout.itemS()
1031
1032                 layout.itemO("armature.subdivide_multi", text="Subdivide")
1033                 
1034                 layout.itemS()
1035                 
1036                 layout.operator_context = "EXEC_AREA"
1037                 layout.item_enumO("armature.autoside_names", "type", 'XAXIS', text="AutoName Left/Right")
1038                 layout.item_enumO("armature.autoside_names", "type", 'YAXIS', text="AutoName Front/Back")
1039                 layout.item_enumO("armature.autoside_names", "type", 'ZAXIS', text="AutoName Top/Bottom")
1040                 layout.itemO("armature.flip_names")
1041
1042                 layout.itemS()
1043                 
1044                 layout.operator_context = "INVOKE_DEFAULT"
1045                 layout.itemO("armature.armature_layers")
1046                 layout.itemO("armature.bone_layers")
1047
1048                 layout.itemS()
1049
1050                 layout.itemM("VIEW3D_MT_edit_armature_parent")
1051
1052                 layout.itemS()
1053                 
1054                 layout.item_menu_enumO("armature.flags_set", "mode", text="Bone Settings")
1055
1056 class VIEW3D_MT_edit_armature_parent(bpy.types.Menu):
1057         __label__ = "Parent"
1058
1059         def draw(self, context):
1060                 layout = self.layout
1061                 
1062                 layout.itemO("armature.parent_set", text="Make")
1063                 layout.itemO("armature.parent_clear", text="Clear")
1064
1065 class VIEW3D_MT_edit_armature_roll(bpy.types.Menu):
1066         __label__ = "Bone Roll"
1067
1068         def draw(self, context):
1069                 layout = self.layout
1070                 
1071                 layout.item_enumO("armature.calculate_roll", "type", 'GLOBALUP', text="Clear Roll (Z-Axis Up)")
1072                 layout.item_enumO("armature.calculate_roll", "type", 'CURSOR', text="Roll to Cursor")
1073                 
1074                 layout.itemS()
1075                 
1076                 layout.item_enumO("tfm.transform", "mode", 'BONE_ROLL', text="Set Roll")
1077
1078 # ********** Panel **********
1079
1080 class VIEW3D_PT_3dview_properties(bpy.types.Panel):
1081         __space_type__ = 'VIEW_3D'
1082         __region_type__ = 'UI'
1083         __label__ = "View"
1084
1085         def poll(self, context):
1086                 view = context.space_data
1087                 return (view)
1088
1089         def draw(self, context):
1090                 layout = self.layout
1091                 
1092                 view = context.space_data
1093                 scene = context.scene
1094                 
1095                 col = layout.column()
1096                 col.itemL(text="Camera:")
1097                 col.itemR(view, "camera", text="")
1098                 col.itemR(view, "lens")
1099                 
1100                 col = layout.column(align=True)
1101                 col.itemL(text="Clip:")
1102                 col.itemR(view, "clip_start", text="Start")
1103                 col.itemR(view, "clip_end", text="End")
1104                 
1105                 col = layout.column(align=True)
1106                 col.itemL(text="Grid:")
1107                 col.itemR(view, "grid_lines", text="Lines")
1108                 col.itemR(view, "grid_spacing", text="Spacing")
1109                 col.itemR(view, "grid_subdivisions", text="Subdivisions")
1110                 
1111                 layout.column().itemR(scene, "cursor_location", text="3D Cursor:")
1112                 
1113 class VIEW3D_PT_3dview_display(bpy.types.Panel):
1114         __space_type__ = 'VIEW_3D'
1115         __region_type__ = 'UI'
1116         __label__ = "Display"
1117         __default_closed__ = True
1118         
1119         def poll(self, context):
1120                 view = context.space_data
1121                 return (view)
1122
1123         def draw(self, context):
1124                 layout = self.layout
1125                 view = context.space_data
1126                 
1127                 col = layout.column()
1128                 col.itemR(view, "display_floor", text="Grid Floor")
1129                 col.itemR(view, "display_x_axis", text="X Axis")
1130                 col.itemR(view, "display_y_axis", text="Y Axis")
1131                 col.itemR(view, "display_z_axis", text="Z Axis")
1132                 col.itemR(view, "outline_selected")
1133                 col.itemR(view, "all_object_centers")
1134                 col.itemR(view, "relationship_lines")
1135                 col.itemR(view, "textured_solid")
1136                 
1137                 layout.itemS()
1138                 
1139                 layout.itemO("screen.region_foursplit", text="Toggle Quad View")
1140                 
1141                 col = layout.column()
1142                 col.itemR(view, "lock_rotation")
1143                 col.itemR(view, "box_preview")
1144                 col.itemR(view, "box_clip")
1145
1146 class VIEW3D_PT_3dview_meshdisplay(bpy.types.Panel):
1147         __space_type__ = 'VIEW_3D'
1148         __region_type__ = 'UI'
1149         __label__ = "Mesh Display"
1150
1151         def poll(self, context):
1152                 editmesh = context.mode == 'EDIT_MESH'
1153                 return (editmesh)
1154
1155         def draw(self, context):
1156                 layout = self.layout
1157
1158                 mesh = context.active_object.data
1159                 
1160                 col = layout.column()
1161                 col.itemL(text="Overlays:")
1162                 col.itemR(mesh, "draw_edges", text="Edges")
1163                 col.itemR(mesh, "draw_faces", text="Faces")
1164                 col.itemR(mesh, "draw_creases", text="Creases")
1165                 col.itemR(mesh, "draw_bevel_weights", text="Bevel Weights")
1166                 col.itemR(mesh, "draw_seams", text="Seams")
1167                 col.itemR(mesh, "draw_sharp", text="Sharp")
1168                 
1169                 col.itemS()
1170                 col.itemL(text="Normals:")
1171                 col.itemR(mesh, "draw_normals", text="Face")
1172                 col.itemR(mesh, "draw_vertex_normals", text="Vertex")
1173                 col.itemR(context.scene.tool_settings, "normal_size", text="Normal Size")
1174                 
1175                 col.itemS()
1176                 col.itemL(text="Numerics:")
1177                 col.itemR(mesh, "draw_edge_lenght")
1178                 col.itemR(mesh, "draw_edge_angle")
1179                 col.itemR(mesh, "draw_face_area")
1180
1181
1182 class VIEW3D_PT_3dview_curvedisplay(bpy.types.Panel):
1183         __space_type__ = 'VIEW_3D'
1184         __region_type__ = 'UI'
1185         __label__ = "Curve Display"
1186
1187         def poll(self, context):
1188                 editmesh = context.mode == 'EDIT_CURVE'
1189                 return (editmesh)
1190
1191         def draw(self, context):
1192                 layout = self.layout
1193
1194                 curve = context.active_object.data
1195                 
1196                 col = layout.column()
1197                 col.itemL(text="Overlays:")
1198                 col.itemR(curve, "draw_handles", text="Handles")
1199                 col.itemR(curve, "draw_normals", text="Normals")
1200                 col.itemR(context.scene.tool_settings, "normal_size", text="Normal Size")
1201                 
1202         
1203 class VIEW3D_PT_background_image(bpy.types.Panel):
1204         __space_type__ = 'VIEW_3D'
1205         __region_type__ = 'UI'
1206         __label__ = "Background Image"
1207         __default_closed__ = True
1208
1209         def poll(self, context):
1210                 view = context.space_data
1211                 bg = context.space_data.background_image
1212                 return (view)
1213
1214         def draw_header(self, context):
1215                 layout = self.layout
1216                 view = context.space_data
1217
1218                 layout.itemR(view, "display_background_image", text="")
1219
1220         def draw(self, context):
1221                 layout = self.layout
1222                 
1223                 view = context.space_data
1224                 bg = view.background_image
1225
1226                 if bg:
1227                         layout.active = view.display_background_image
1228
1229                         col = layout.column()
1230                         col.itemR(bg, "image", text="")
1231                         #col.itemR(bg, "image_user")
1232                         col.itemR(bg, "size")
1233                         col.itemR(bg, "transparency", slider=True)
1234                         
1235                         
1236                         col = layout.column(align=True)
1237                         col.itemL(text="Offset:")
1238                         col.itemR(bg, "offset_x", text="X")
1239                         col.itemR(bg, "offset_y", text="Y")
1240
1241 class VIEW3D_PT_transform_orientations(bpy.types.Panel):
1242         __space_type__ = 'VIEW_3D'
1243         __region_type__ = 'UI'
1244         __label__ = "Transform Orientations"
1245         __default_closed__ = True
1246
1247         def poll(self, context):
1248                 view = context.space_data
1249                 return (view)
1250
1251         def draw(self, context):
1252                 layout = self.layout
1253                 
1254                 view = context.space_data
1255
1256                 col = layout.column()
1257                 col.itemO("TFM_OT_select_orientation", text="Select")
1258                 col.itemO("TFM_OT_create_orientation", text="Create")
1259                 col.itemO("TFM_OT_delete_orientation", text="Delete")
1260
1261 # Operators 
1262
1263 class OBJECT_OT_select_pattern(bpy.types.Operator):
1264         '''Select object matching a naming pattern.'''
1265         __idname__ = "object.select_pattern"
1266         __label__ = "Select Pattern"
1267         __register__ = True
1268         __undo__ = True
1269         __props__ = [
1270                 bpy.props.StringProperty(attr="pattern", name="Pattern", description="Name filter using '*' and '?' wildcard chars", maxlen= 32, default= "*"),
1271                 bpy.props.BoolProperty(attr="case_sensitive", name="Case Sensitive", description="Do a case sensitive compare", default= False),
1272                 bpy.props.BoolProperty(attr="extend", name="Extend", description="Extend the existing selection", default= True),
1273         ]
1274         
1275         def execute(self, context):
1276         
1277                 import fnmatch
1278                 if self.case_sensitive: pattern_match = fnmatch.fnmatchcase
1279                 else:                                   pattern_match = lambda a, b: fnmatch.fnmatchcase(a.upper(), b.upper())
1280
1281                 for ob in context.visible_objects:
1282                         if pattern_match(ob.name, self.pattern):
1283                                 ob.selected = True
1284                         elif not self.extend:
1285                                 ob.selected = False
1286
1287                 return ('FINISHED',)
1288                 
1289                 # TODO - python cant do popups yet
1290         '''
1291         def invoke(self, context, event):       
1292                 wm = context.manager
1293                 wm.add_fileselect(self.__operator__)
1294                 return ('RUNNING_MODAL',)
1295         '''
1296
1297
1298
1299 bpy.types.register(VIEW3D_HT_header) # Header
1300
1301 bpy.types.register(VIEW3D_MT_view) #View Menus
1302 bpy.types.register(VIEW3D_MT_view_navigation)
1303 bpy.types.register(VIEW3D_MT_view_align)
1304 bpy.types.register(VIEW3D_MT_view_cameras)
1305
1306 bpy.types.register(VIEW3D_MT_select_object) # Select Menus
1307 bpy.types.register(VIEW3D_MT_select_pose)
1308 bpy.types.register(VIEW3D_MT_select_particle)
1309 bpy.types.register(VIEW3D_MT_select_edit_mesh)
1310 bpy.types.register(VIEW3D_MT_select_edit_curve)
1311 bpy.types.register(VIEW3D_MT_select_edit_surface)
1312 bpy.types.register(VIEW3D_MT_select_edit_metaball)
1313 bpy.types.register(VIEW3D_MT_select_edit_lattice)
1314 bpy.types.register(VIEW3D_MT_select_edit_armature)
1315 bpy.types.register(VIEW3D_MT_select_face) # XXX todo
1316
1317 bpy.types.register(VIEW3D_MT_object) # Object Menu
1318 bpy.types.register(VIEW3D_MT_object_clear)
1319 bpy.types.register(VIEW3D_MT_object_parent)
1320 bpy.types.register(VIEW3D_MT_object_track)
1321 bpy.types.register(VIEW3D_MT_object_group)
1322 bpy.types.register(VIEW3D_MT_object_constraints)
1323 bpy.types.register(VIEW3D_MT_object_showhide)
1324
1325 bpy.types.register(VIEW3D_MT_sculpt) # Sculpt Menu
1326
1327 bpy.types.register(VIEW3D_MT_paint_vertex)
1328
1329 bpy.types.register(VIEW3D_MT_particle) # Particle Menu
1330 bpy.types.register(VIEW3D_MT_particle_showhide)
1331
1332 bpy.types.register(VIEW3D_MT_pose) # POSE Menu
1333 bpy.types.register(VIEW3D_MT_pose_transform)
1334 bpy.types.register(VIEW3D_MT_pose_pose)
1335 bpy.types.register(VIEW3D_MT_pose_motion)
1336 bpy.types.register(VIEW3D_MT_pose_group)
1337 bpy.types.register(VIEW3D_MT_pose_ik)
1338 bpy.types.register(VIEW3D_MT_pose_constraints)
1339 bpy.types.register(VIEW3D_MT_pose_showhide)
1340
1341 bpy.types.register(VIEW3D_MT_snap) # Edit Menus
1342
1343 bpy.types.register(VIEW3D_MT_edit_mesh)
1344 bpy.types.register(VIEW3D_MT_edit_mesh_vertices)
1345 bpy.types.register(VIEW3D_MT_edit_mesh_edges)
1346 bpy.types.register(VIEW3D_MT_edit_mesh_faces)
1347 bpy.types.register(VIEW3D_MT_edit_mesh_normals)
1348 bpy.types.register(VIEW3D_MT_edit_mesh_showhide)
1349
1350 bpy.types.register(VIEW3D_MT_edit_curve)
1351 bpy.types.register(VIEW3D_MT_edit_curve_ctrlpoints)
1352 bpy.types.register(VIEW3D_MT_edit_curve_segments)
1353 bpy.types.register(VIEW3D_MT_edit_curve_showhide)
1354
1355 bpy.types.register(VIEW3D_MT_edit_surface)
1356
1357 bpy.types.register(VIEW3D_MT_edit_text)
1358 bpy.types.register(VIEW3D_MT_edit_text_chars)
1359
1360 bpy.types.register(VIEW3D_MT_edit_meta)
1361 bpy.types.register(VIEW3D_MT_edit_meta_showhide)
1362
1363 bpy.types.register(VIEW3D_MT_edit_lattice)
1364
1365 bpy.types.register(VIEW3D_MT_edit_armature)
1366 bpy.types.register(VIEW3D_MT_edit_armature_parent)
1367 bpy.types.register(VIEW3D_MT_edit_armature_roll)
1368
1369 bpy.types.register(VIEW3D_PT_3dview_properties) # Panels
1370 bpy.types.register(VIEW3D_PT_3dview_display)
1371 bpy.types.register(VIEW3D_PT_3dview_meshdisplay)
1372 bpy.types.register(VIEW3D_PT_3dview_curvedisplay)
1373 bpy.types.register(VIEW3D_PT_background_image)
1374 bpy.types.register(VIEW3D_PT_transform_orientations)
1375
1376 bpy.ops.add(OBJECT_OT_select_pattern)
1377