UI: correct jitter button
[blender.git] / release / scripts / startup / bl_ui / space_view3d_toolbar.py
1 # ##### BEGIN GPL LICENSE BLOCK #####
2 #
3 #  This program is free software; you can redistribute it and/or
4 #  modify it under the terms of the GNU General Public License
5 #  as published by the Free Software Foundation; either version 2
6 #  of the License, or (at your option) any later version.
7 #
8 #  This program is distributed in the hope that it will be useful,
9 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 #  GNU General Public License for more details.
12 #
13 #  You should have received a copy of the GNU General Public License
14 #  along with this program; if not, write to the Free Software Foundation,
15 #  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 #
17 # ##### END GPL LICENSE BLOCK #####
18
19 # <pep8 compliant>
20 import bpy
21 from bpy.types import Menu, Panel, UIList
22 from .properties_grease_pencil_common import (
23     GreasePencilDrawingToolsPanel,
24     GreasePencilStrokeEditPanel,
25     GreasePencilInterpolatePanel,
26     GreasePencilStrokeSculptPanel,
27     GreasePencilBrushPanel,
28     GreasePencilBrushCurvesPanel
29 )
30 from .properties_paint_common import (
31     UnifiedPaintPanel,
32     brush_texture_settings,
33     brush_texpaint_common,
34     brush_mask_texture_settings,
35 )
36
37
38 class View3DPanel:
39     bl_space_type = 'PROPERTIES'
40     bl_region_type = 'WINDOW'
41
42
43 # **************** standard tool clusters ******************
44
45 # Keyframing tools
46 def draw_keyframing_tools(context, layout):
47     col = layout.column(align=True)
48     col.label(text="Keyframes:")
49     row = col.row(align=True)
50     row.operator("anim.keyframe_insert_menu", text="Insert")
51     row.operator("anim.keyframe_delete_v3d", text="Remove")
52
53
54 # Used by vertex & weight paint
55 def draw_vpaint_symmetry(layout, vpaint):
56
57     split = layout.split()
58
59     col = split.column()
60     col.alignment = 'RIGHT'
61     col.label(text="Mirror")
62
63     col = split.column()
64     row = col.row(align=True)
65     row.prop(vpaint, "use_symmetry_x", text="X", toggle=True)
66     row.prop(vpaint, "use_symmetry_y", text="Y", toggle=True)
67     row.prop(vpaint, "use_symmetry_z", text="Z", toggle=True)
68
69     col = layout.column()
70     col.use_property_split = True
71     col.prop(vpaint, "radial_symmetry", text="Radial")
72
73
74 # ********** default tools for editmode_mesh ****************
75
76
77 class VIEW3D_PT_tools_meshedit_options(View3DPanel, Panel):
78     bl_category = "Options"
79     bl_context = ".mesh_edit"  # dot on purpose (access from topbar)
80     bl_label = "Mesh Options"
81
82     @classmethod
83     def poll(cls, context):
84         return context.active_object
85
86     def draw(self, context):
87         layout = self.layout
88
89         ob = context.active_object
90
91         tool_settings = context.tool_settings
92         mesh = ob.data
93
94         col = layout.column(align=True)
95         col.prop(mesh, "use_mirror_x")
96
97         row = col.row(align=True)
98         row.active = ob.data.use_mirror_x
99         row.prop(mesh, "use_mirror_topology")
100
101         col = layout.column(align=True)
102         col.label("Edge Select Mode:")
103         col.prop(tool_settings, "edge_path_mode", text="")
104         col.prop(tool_settings, "edge_path_live_unwrap")
105         col.label("Double Threshold:")
106         col.prop(tool_settings, "double_threshold", text="")
107
108 # ********** default tools for editmode_curve ****************
109
110
111 class VIEW3D_PT_tools_curveedit_options_stroke(View3DPanel, Panel):
112     bl_category = "Options"
113     bl_context = ".curve_edit"  # dot on purpose (access from topbar)
114     bl_label = "Curve Stroke"
115
116     def draw(self, context):
117         layout = self.layout
118
119         tool_settings = context.tool_settings
120         cps = tool_settings.curve_paint_settings
121
122         col = layout.column()
123
124         col.prop(cps, "curve_type")
125
126         if cps.curve_type == 'BEZIER':
127             col.label("Bezier Options:")
128             col.prop(cps, "error_threshold")
129             col.prop(cps, "fit_method")
130             col.prop(cps, "use_corners_detect")
131
132             col = layout.column()
133             col.active = cps.use_corners_detect
134             col.prop(cps, "corner_angle")
135
136         col.label("Pressure Radius:")
137         row = layout.row(align=True)
138         rowsub = row.row(align=True)
139         rowsub.prop(cps, "radius_min", text="Min")
140         rowsub.prop(cps, "radius_max", text="Max")
141
142         row.prop(cps, "use_pressure_radius", text="", icon_only=True)
143
144         col = layout.column()
145         col.label("Taper Radius:")
146         row = layout.row(align=True)
147         row.prop(cps, "radius_taper_start", text="Start")
148         row.prop(cps, "radius_taper_end", text="End")
149
150         col = layout.column()
151         col.label("Projection Depth:")
152         row = layout.row(align=True)
153         row.prop(cps, "depth_mode", expand=True)
154
155         col = layout.column()
156         if cps.depth_mode == 'SURFACE':
157             col.prop(cps, "surface_offset")
158             col.prop(cps, "use_offset_absolute")
159             col.prop(cps, "use_stroke_endpoints")
160             if cps.use_stroke_endpoints:
161                 colsub = layout.column(align=True)
162                 colsub.prop(cps, "surface_plane", expand=True)
163
164
165 # ********** default tools for editmode_armature ****************
166
167
168 class VIEW3D_PT_tools_armatureedit_options(View3DPanel, Panel):
169     bl_category = "Options"
170     bl_context = ".armature_edit"  # dot on purpose (access from topbar)
171     bl_label = "Armature Options"
172
173     def draw(self, context):
174         arm = context.active_object.data
175
176         self.layout.prop(arm, "use_mirror_x")
177
178
179 # ********** default tools for pose-mode ****************
180
181 class VIEW3D_PT_tools_posemode_options(View3DPanel, Panel):
182     bl_category = "Options"
183     bl_context = ".posemode"  # dot on purpose (access from topbar)
184     bl_label = "Pose Options"
185
186     def draw(self, context):
187         arm = context.active_object.data
188
189         self.layout.prop(arm, "use_auto_ik")
190         self.layout.prop(arm, "use_mirror_x")
191
192 # ********** default tools for paint modes ****************
193
194
195 class View3DPaintPanel(UnifiedPaintPanel):
196     bl_space_type = 'PROPERTIES'
197     bl_region_type = 'WINDOW'
198
199
200 class VIEW3D_PT_imapaint_tools_missing(Panel, View3DPaintPanel):
201     bl_category = "Tools"
202     bl_context = ".imagepaint"  # dot on purpose (access from topbar)
203     bl_label = "Missing Data"
204
205     @classmethod
206     def poll(cls, context):
207         toolsettings = context.tool_settings.image_paint
208         return context.image_paint_object and not toolsettings.detect_data()
209
210     def draw(self, context):
211         layout = self.layout
212         toolsettings = context.tool_settings.image_paint
213
214         col = layout.column()
215         col.label("Missing Data", icon='ERROR')
216         if toolsettings.missing_uvs:
217             col.separator()
218             col.label("Missing UVs", icon='INFO')
219             col.label("Unwrap the mesh in edit mode or generate a simple UV layer")
220             col.operator("paint.add_simple_uvs")
221
222         if toolsettings.mode == 'MATERIAL':
223             if toolsettings.missing_materials:
224                 col.separator()
225                 col.label("Missing Materials", icon='INFO')
226                 col.label("Add a material and paint slot below")
227                 col.operator_menu_enum("paint.add_texture_paint_slot", "type", text="Add Paint Slot")
228             elif toolsettings.missing_texture:
229                 ob = context.active_object
230                 mat = ob.active_material
231
232                 col.separator()
233                 if mat:
234                     col.label("Missing Texture Slots", icon='INFO')
235                     col.label("Add a paint slot below")
236                     col.operator_menu_enum("paint.add_texture_paint_slot", "type", text="Add Paint Slot")
237                 else:
238                     col.label("Missing Materials", icon='INFO')
239                     col.label("Add a material and paint slot below")
240                     col.operator_menu_enum("paint.add_texture_paint_slot", "type", text="Add Paint Slot")
241
242         elif toolsettings.mode == 'IMAGE':
243             if toolsettings.missing_texture:
244                 col.separator()
245                 col.label("Missing Canvas", icon='INFO')
246                 col.label("Add or assign a canvas image below")
247                 col.label("Canvas Image:")
248                 # todo this should be combinded into a single row
249                 col.template_ID(toolsettings, "canvas", open="image.open")
250                 col.operator("image.new", text="New").gen_context = 'PAINT_CANVAS'
251
252         if toolsettings.missing_stencil:
253             col.separator()
254             col.label("Missing Stencil", icon='INFO')
255             col.label("Add or assign a stencil image below")
256             col.label("Stencil Image:")
257             # todo this should be combinded into a single row
258             col.template_ID(toolsettings, "stencil_image", open="image.open")
259             col.operator("image.new", text="New").gen_context = 'PAINT_STENCIL'
260
261
262 # TODO, move to space_view3d.py
263 class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
264     bl_context = ".paint_common"  # dot on purpose (access from topbar)
265     bl_label = "Brush"
266
267     @classmethod
268     def poll(cls, context):
269         return cls.paint_settings(context)
270
271     def draw(self, context):
272         layout = self.layout
273
274         toolsettings = context.tool_settings
275         settings = self.paint_settings(context)
276         brush = settings.brush
277
278         if not context.particle_edit_object:
279             col = layout.split().column()
280             col.template_ID_preview(settings, "brush", new="brush.add", rows=3, cols=8)
281
282         # Particle Mode #
283         if context.particle_edit_object:
284             tool = settings.tool
285
286             layout.column().prop(settings, "tool", expand=True)
287
288             if tool != 'NONE':
289                 col = layout.column()
290                 col.prop(brush, "size", slider=True)
291                 if tool != 'ADD':
292                     col.prop(brush, "strength", slider=True)
293
294             if tool == 'ADD':
295                 col.prop(brush, "count")
296                 col = layout.column()
297                 col.prop(settings, "use_default_interpolate")
298                 col.prop(brush, "steps", slider=True)
299                 col.prop(settings, "default_key_count", slider=True)
300             elif tool == 'LENGTH':
301                 layout.row().prop(brush, "length_mode", expand=True)
302             elif tool == 'PUFF':
303                 layout.row().prop(brush, "puff_mode", expand=True)
304                 layout.prop(brush, "use_puff_volume")
305
306         # Sculpt Mode #
307
308         elif context.sculpt_object and brush:
309             capabilities = brush.sculpt_capabilities
310
311             col = layout.column()
312
313             col.separator()
314
315             row = col.row(align=True)
316
317             ups = toolsettings.unified_paint_settings
318             if ((ups.use_unified_size and ups.use_locked_size) or
319                     ((not ups.use_unified_size) and brush.use_locked_size)):
320                 self.prop_unified_size(row, context, brush, "use_locked_size", icon='LOCKED')
321                 self.prop_unified_size(row, context, brush, "unprojected_radius", slider=True, text="Radius")
322             else:
323                 self.prop_unified_size(row, context, brush, "use_locked_size", icon='UNLOCKED')
324                 self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
325
326             self.prop_unified_size(row, context, brush, "use_pressure_size")
327
328             # strength, use_strength_pressure, and use_strength_attenuation
329             col.separator()
330             row = col.row(align=True)
331
332             if capabilities.has_space_attenuation:
333                 row.prop(brush, "use_space_attenuation", toggle=True, icon_only=True)
334
335             self.prop_unified_strength(row, context, brush, "strength", text="Strength")
336
337             if capabilities.has_strength_pressure:
338                 self.prop_unified_strength(row, context, brush, "use_pressure_strength")
339
340             # auto_smooth_factor and use_inverse_smooth_pressure
341             if capabilities.has_auto_smooth:
342                 col.separator()
343
344                 row = col.row(align=True)
345                 row.prop(brush, "auto_smooth_factor", slider=True)
346                 row.prop(brush, "use_inverse_smooth_pressure", toggle=True, text="")
347
348             # normal_weight
349             if capabilities.has_normal_weight:
350                 col.separator()
351                 row = col.row(align=True)
352                 row.prop(brush, "normal_weight", slider=True)
353
354             # crease_pinch_factor
355             if capabilities.has_pinch_factor:
356                 col.separator()
357                 row = col.row(align=True)
358                 row.prop(brush, "crease_pinch_factor", slider=True, text="Pinch")
359
360             # rake_factor
361             if capabilities.has_rake_factor:
362                 col.separator()
363                 row = col.row(align=True)
364                 row.prop(brush, "rake_factor", slider=True)
365
366             # use_original_normal and sculpt_plane
367             if capabilities.has_sculpt_plane:
368                 col.separator()
369                 row = col.row(align=True)
370
371                 row.prop(brush, "use_original_normal", toggle=True, icon_only=True)
372
373                 row.prop(brush, "sculpt_plane", text="")
374
375             if brush.sculpt_tool == 'MASK':
376                 col.prop(brush, "mask_tool", text="")
377
378             # plane_offset, use_offset_pressure, use_plane_trim, plane_trim
379             if capabilities.has_plane_offset:
380                 row = col.row(align=True)
381                 row.prop(brush, "plane_offset", slider=True)
382                 row.prop(brush, "use_offset_pressure", text="")
383
384                 col.separator()
385
386                 row = col.row()
387                 row.prop(brush, "use_plane_trim", text="Trim")
388                 row = col.row()
389                 row.active = brush.use_plane_trim
390                 row.prop(brush, "plane_trim", slider=True, text="Distance")
391
392             # height
393             if capabilities.has_height:
394                 row = col.row()
395                 row.prop(brush, "height", slider=True, text="Height")
396
397             # use_frontface
398             col.separator()
399             col.prop(brush, "use_frontface", text="Front Faces Only")
400             col.prop(brush, "use_projected")
401
402             # direction
403             col.separator()
404             col.row().prop(brush, "direction", expand=True)
405
406             # use_accumulate
407             if capabilities.has_accumulate:
408                 col.separator()
409
410                 col.prop(brush, "use_accumulate")
411
412             # use_persistent, set_persistent_base
413             if capabilities.has_persistence:
414                 col.separator()
415
416                 ob = context.sculpt_object
417                 do_persistent = True
418
419                 # not supported yet for this case
420                 for md in ob.modifiers:
421                     if md.type == 'MULTIRES':
422                         do_persistent = False
423                         break
424
425                 if do_persistent:
426                     col.prop(brush, "use_persistent")
427                     col.operator("sculpt.set_persistent_base")
428
429         # Texture Paint Mode #
430
431         elif context.image_paint_object and brush:
432             brush_texpaint_common(self, context, layout, brush, settings, True)
433
434         # Weight Paint Mode #
435         elif context.weight_paint_object and brush:
436
437             col = layout.column()
438
439             row = col.row(align=True)
440             self.prop_unified_weight(row, context, brush, "weight", slider=True, text="Weight")
441
442             row = col.row(align=True)
443             self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
444             self.prop_unified_size(row, context, brush, "use_pressure_size")
445
446             row = col.row(align=True)
447             self.prop_unified_strength(row, context, brush, "strength", text="Strength")
448             self.prop_unified_strength(row, context, brush, "use_pressure_strength")
449
450             col.separator()
451             col.prop(brush, "vertex_tool", text="Blend")
452
453             if brush.vertex_tool != 'SMEAR':
454                 col.prop(brush, "use_accumulate")
455                 col.separator()
456
457             col.prop(brush, "use_frontface", text="Front Faces Only")
458             row = col.row()
459             row.prop(brush, "use_frontface_falloff", text="Falloff Angle")
460             sub = row.row()
461             sub.active = brush.use_frontface_falloff
462             sub.prop(brush, "falloff_angle", text="")
463
464             col.prop(brush, "use_projected")
465
466             col = layout.column()
467             col.prop(toolsettings, "use_auto_normalize", text="Auto Normalize")
468             col.prop(toolsettings, "use_multipaint", text="Multi-Paint")
469
470         # Vertex Paint Mode #
471         elif context.vertex_paint_object and brush:
472             col = layout.column()
473             self.prop_unified_color_picker(col, context, brush, "color", value_slider=True)
474             if settings.palette:
475                 col.template_palette(settings, "palette", color=True)
476             row = col.row(align=True)
477             self.prop_unified_color(row, context, brush, "color", text="")
478             self.prop_unified_color(row, context, brush, "secondary_color", text="")
479             row.separator()
480             row.operator("paint.brush_colors_flip", icon='FILE_REFRESH', text="")
481
482             col.separator()
483             row = col.row(align=True)
484             self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
485             self.prop_unified_size(row, context, brush, "use_pressure_size")
486
487             row = col.row(align=True)
488             self.prop_unified_strength(row, context, brush, "strength", text="Strength")
489             self.prop_unified_strength(row, context, brush, "use_pressure_strength")
490
491             col.separator()
492             col.prop(brush, "vertex_tool", text="Blend")
493             col.prop(brush, "use_alpha")
494
495             if brush.vertex_tool != 'SMEAR':
496                 col.prop(brush, "use_accumulate")
497                 col.separator()
498
499             col.prop(brush, "use_frontface", text="Front Faces Only")
500             row = col.row()
501             row.prop(brush, "use_frontface_falloff", text="Falloff Angle")
502             sub = row.row()
503             sub.active = brush.use_frontface_falloff
504             sub.prop(brush, "falloff_angle", text="")
505
506             col.prop(brush, "use_projected")
507
508             col.separator()
509             col.template_ID(settings, "palette", new="palette.new")
510
511
512 class TEXTURE_UL_texpaintslots(UIList):
513     def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
514         mat = data
515
516         if self.layout_type in {'DEFAULT', 'COMPACT'}:
517             layout.prop(item, "name", text="", emboss=False, icon_value=icon)
518         elif self.layout_type == 'GRID':
519             layout.alignment = 'CENTER'
520             layout.label(text="")
521
522
523 class VIEW3D_MT_tools_projectpaint_uvlayer(Menu):
524     bl_label = "Clone Layer"
525
526     def draw(self, context):
527         layout = self.layout
528
529         for i, uv_layer in enumerate(context.active_object.data.uv_layers):
530             props = layout.operator("wm.context_set_int", text=uv_layer.name, translate=False)
531             props.data_path = "active_object.data.uv_layers.active_index"
532             props.value = i
533
534
535 # TODO, move to space_view3d.py
536 class VIEW3D_PT_slots_projectpaint(View3DPanel, Panel):
537     bl_context = ".imagepaint"  # dot on purpose (access from topbar)
538     bl_label = "Slots"
539
540     @classmethod
541     def poll(cls, context):
542         brush = context.tool_settings.image_paint.brush
543         ob = context.active_object
544         return (brush is not None and ob is not None)
545
546     def draw(self, context):
547         layout = self.layout
548
549         settings = context.tool_settings.image_paint
550         # brush = settings.brush
551
552         ob = context.active_object
553         col = layout.column()
554
555         col.label("Painting Mode:")
556         col.prop(settings, "mode", text="")
557         col.separator()
558
559         if settings.mode == 'MATERIAL':
560             if len(ob.material_slots) > 1:
561                 col.label("Materials:")
562                 col.template_list("MATERIAL_UL_matslots", "layers",
563                                   ob, "material_slots",
564                                   ob, "active_material_index", rows=2)
565
566             mat = ob.active_material
567             if mat:
568                 col.label("Available Paint Slots:")
569                 col.template_list("TEXTURE_UL_texpaintslots", "",
570                                   mat, "texture_paint_images",
571                                   mat, "paint_active_slot", rows=2)
572
573                 if mat.texture_paint_slots:
574                     slot = mat.texture_paint_slots[mat.paint_active_slot]
575                 else:
576                     slot = None
577
578                 if slot and slot.is_valid:
579                     col.label("UV Map:")
580                     col.prop_search(slot, "uv_layer", ob.data, "uv_layers", text="")
581
582         elif settings.mode == 'IMAGE':
583             mesh = ob.data
584             uv_text = mesh.uv_layers.active.name if mesh.uv_layers.active else ""
585             col.label("Canvas Image:")
586             # todo this should be combinded into a single row
587             col.template_ID(settings, "canvas", open="image.open")
588             col.operator("image.new", text="New").gen_context = 'PAINT_CANVAS'
589             col.label("UV Map:")
590             col.menu("VIEW3D_MT_tools_projectpaint_uvlayer", text=uv_text, translate=False)
591
592         col.separator()
593         col.operator("image.save_dirty", text="Save All Images")
594
595
596 # TODO, move to space_view3d.py
597 class VIEW3D_PT_stencil_projectpaint(View3DPanel, Panel):
598     bl_context = ".imagepaint"  # dot on purpose (access from topbar)
599     bl_label = "Mask"
600
601     @classmethod
602     def poll(cls, context):
603         brush = context.tool_settings.image_paint.brush
604         ob = context.active_object
605         return (brush is not None and ob is not None)
606
607     def draw_header(self, context):
608         ipaint = context.tool_settings.image_paint
609         self.layout.prop(ipaint, "use_stencil_layer", text="")
610
611     def draw(self, context):
612         layout = self.layout
613
614         toolsettings = context.tool_settings
615         ipaint = toolsettings.image_paint
616         ob = context.active_object
617         mesh = ob.data
618
619         col = layout.column()
620         col.active = ipaint.use_stencil_layer
621
622         stencil_text = mesh.uv_layer_stencil.name if mesh.uv_layer_stencil else ""
623         col.label("UV Map")
624         col.menu("VIEW3D_MT_tools_projectpaint_stencil", text=stencil_text, translate=False)
625
626         col.label("Stencil Image:")
627         # todo this should be combinded into a single row
628         col.template_ID(ipaint, "stencil_image", open="image.open")
629         col.operator("image.new", text="New").gen_context = 'PAINT_STENCIL'
630
631         col.label("Visualization:")
632         row = col.row(align=True)
633         row.prop(ipaint, "stencil_color", text="")
634         row.prop(ipaint, "invert_stencil", text="", icon='IMAGE_ALPHA')
635
636
637 # TODO, move to space_view3d.py
638 class VIEW3D_PT_tools_brush_overlay(Panel, View3DPaintPanel):
639     bl_context = ".paint_common"  # dot on purpose (access from topbar)
640     bl_label = "Overlay"
641
642     @classmethod
643     def poll(cls, context):
644         settings = cls.paint_settings(context)
645         return (settings and
646                 settings.brush and
647                 (context.sculpt_object or
648                  context.vertex_paint_object or
649                  context.weight_paint_object or
650                  context.image_paint_object))
651
652     def draw(self, context):
653         layout = self.layout
654
655         settings = self.paint_settings(context)
656         brush = settings.brush
657         tex_slot = brush.texture_slot
658         tex_slot_mask = brush.mask_texture_slot
659
660         col = layout.column()
661
662         col.label(text="Curve:")
663
664         row = col.row(align=True)
665         if brush.use_cursor_overlay:
666             row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
667         else:
668             row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
669
670         sub = row.row(align=True)
671         sub.prop(brush, "cursor_overlay_alpha", text="Alpha")
672         sub.prop(brush, "use_cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
673
674         col.active = brush.brush_capabilities.has_overlay
675
676         if context.image_paint_object or context.sculpt_object or context.vertex_paint_object:
677             col.label(text="Texture:")
678             row = col.row(align=True)
679             if tex_slot.map_mode != 'STENCIL':
680                 if brush.use_primary_overlay:
681                     row.prop(brush, "use_primary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
682                 else:
683                     row.prop(brush, "use_primary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
684
685             sub = row.row(align=True)
686             sub.prop(brush, "texture_overlay_alpha", text="Alpha")
687             sub.prop(brush, "use_primary_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
688
689         if context.image_paint_object:
690             col.label(text="Mask Texture:")
691
692             row = col.row(align=True)
693             if tex_slot_mask.map_mode != 'STENCIL':
694                 if brush.use_secondary_overlay:
695                     row.prop(brush, "use_secondary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
696                 else:
697                     row.prop(brush, "use_secondary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
698
699             sub = row.row(align=True)
700             sub.prop(brush, "mask_overlay_alpha", text="Alpha")
701             sub.prop(brush, "use_secondary_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
702
703
704 # TODO, move to space_view3d.py
705 class VIEW3D_PT_tools_brush_texture(Panel, View3DPaintPanel):
706     bl_context = ".paint_common"  # dot on purpose (access from topbar)
707     bl_label = "Texture"
708     bl_options = {'DEFAULT_CLOSED'}
709
710     @classmethod
711     def poll(cls, context):
712         settings = cls.paint_settings(context)
713         return (settings and settings.brush and
714                 (context.sculpt_object or context.image_paint_object or context.vertex_paint_object))
715
716     def draw(self, context):
717         layout = self.layout
718
719         settings = self.paint_settings(context)
720         brush = settings.brush
721
722         col = layout.column()
723
724         col.template_ID_preview(brush, "texture", new="texture.new", rows=3, cols=8)
725
726         brush_texture_settings(col, brush, context.sculpt_object)
727
728
729 # TODO, move to space_view3d.py
730 class VIEW3D_PT_tools_mask_texture(Panel, View3DPaintPanel):
731     bl_context = ".imagepaint"  # dot on purpose (access from topbar)
732     bl_label = "Texture Mask"
733     bl_options = {'DEFAULT_CLOSED'}
734
735     @classmethod
736     def poll(cls, context):
737         settings = cls.paint_settings(context)
738         return (settings and settings.brush and context.image_paint_object)
739
740     def draw(self, context):
741         layout = self.layout
742
743         brush = context.tool_settings.image_paint.brush
744
745         col = layout.column()
746
747         col.template_ID_preview(brush, "mask_texture", new="texture.new", rows=3, cols=8)
748
749         brush_mask_texture_settings(col, brush)
750
751
752 # TODO, move to space_view3d.py
753 class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel):
754     bl_context = ".paint_common"  # dot on purpose (access from topbar)
755     bl_label = "Stroke"
756     bl_options = {'DEFAULT_CLOSED'}
757
758     @classmethod
759     def poll(cls, context):
760         settings = cls.paint_settings(context)
761         return (settings and
762                 settings.brush and
763                 (context.sculpt_object or
764                  context.vertex_paint_object or
765                  context.weight_paint_object or
766                  context.image_paint_object))
767
768     def draw(self, context):
769         layout = self.layout
770
771         settings = self.paint_settings(context)
772         brush = settings.brush
773         layout.use_property_split = True
774
775         col = layout.column()
776
777         col.prop(brush, "stroke_method")
778
779         if brush.use_anchor:
780             col.separator()
781             col.prop(brush, "use_edge_to_edge", "Edge To Edge")
782
783         if brush.use_airbrush:
784             col.separator()
785             col.prop(brush, "rate", text="Rate", slider=True)
786
787         if brush.use_space:
788             col.separator()
789             row = col.row(align=True)
790             row.prop(brush, "spacing", text="Spacing")
791             row.prop(brush, "use_pressure_spacing", toggle=True, text="")
792
793         if brush.use_line or brush.use_curve:
794             col.separator()
795             row = col.row(align=True)
796             row.prop(brush, "spacing", text="Spacing")
797
798         if brush.use_curve:
799             col.separator()
800             col.template_ID(brush, "paint_curve", new="paintcurve.new")
801             col.operator("paintcurve.draw")
802
803         if context.sculpt_object:
804             if brush.sculpt_capabilities.has_jitter:
805                 col.separator()
806
807                 colsub = col.split(0.5)
808                 row = colsub.row(align=True)
809                 row.alignment = 'RIGHT'
810                 row.label("Jitter")
811                 row = colsub.row(align=True)
812                 row.prop(brush, "use_relative_jitter", icon_only=True)
813                 if brush.use_relative_jitter:
814                     row.prop(brush, "jitter", slider=True, text="")
815                 else:
816                     row.prop(brush, "jitter_absolute", text="")
817                 row.prop(brush, "use_pressure_jitter", toggle=True, text="")
818
819             if brush.sculpt_capabilities.has_smooth_stroke:
820                 col = layout.column()
821                 col.separator()
822
823                 col.prop(brush, "use_smooth_stroke")
824
825                 sub = col.column()
826                 sub.active = brush.use_smooth_stroke
827                 sub.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
828                 sub.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
829         else:
830             col.separator()
831
832             row = col.row(align=True)
833             row.prop(brush, "use_relative_jitter", icon_only=True)
834             if brush.use_relative_jitter:
835                 row.prop(brush, "jitter", slider=True)
836             else:
837                 row.prop(brush, "jitter_absolute")
838             row.prop(brush, "use_pressure_jitter", toggle=True, text="")
839
840             col = layout.column()
841             col.separator()
842
843             if brush.brush_capabilities.has_smooth_stroke:
844                 col.prop(brush, "use_smooth_stroke")
845
846                 sub = col.column()
847                 sub.active = brush.use_smooth_stroke
848                 sub.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
849                 sub.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
850
851         layout.prop(settings, "input_samples")
852
853
854 # TODO, move to space_view3d.py
855 class VIEW3D_PT_tools_brush_curve(Panel, View3DPaintPanel):
856     bl_context = ".paint_common"  # dot on purpose (access from topbar)
857     bl_label = "Curve"
858     bl_options = {'DEFAULT_CLOSED'}
859
860     @classmethod
861     def poll(cls, context):
862         settings = cls.paint_settings(context)
863         return (settings and settings.brush and settings.brush.curve)
864
865     def draw(self, context):
866         layout = self.layout
867
868         settings = self.paint_settings(context)
869
870         brush = settings.brush
871
872         layout.template_curve_mapping(brush, "curve", brush=True)
873
874         col = layout.column(align=True)
875         row = col.row(align=True)
876         row.operator("brush.curve_preset", icon='SMOOTHCURVE', text="").shape = 'SMOOTH'
877         row.operator("brush.curve_preset", icon='SPHERECURVE', text="").shape = 'ROUND'
878         row.operator("brush.curve_preset", icon='ROOTCURVE', text="").shape = 'ROOT'
879         row.operator("brush.curve_preset", icon='SHARPCURVE', text="").shape = 'SHARP'
880         row.operator("brush.curve_preset", icon='LINCURVE', text="").shape = 'LINE'
881         row.operator("brush.curve_preset", icon='NOCURVE', text="").shape = 'MAX'
882
883
884 # TODO, move to space_view3d.py
885 class VIEW3D_PT_sculpt_dyntopo(Panel, View3DPaintPanel):
886     bl_context = ".sculpt_mode"  # dot on purpose (access from topbar)
887     bl_label = "Dyntopo"
888     bl_options = {'DEFAULT_CLOSED'}
889
890     @classmethod
891     def poll(cls, context):
892         return (context.sculpt_object and context.tool_settings.sculpt)
893
894     def draw_header(self, context):
895         is_popover = self.is_popover
896         layout = self.layout
897         layout.operator(
898             "sculpt.dynamic_topology_toggle",
899             icon='CHECKBOX_HLT' if context.sculpt_object.use_dynamic_topology_sculpting else 'CHECKBOX_DEHLT',
900             text="",
901             emboss=is_popover,
902         )
903
904     def draw(self, context):
905         layout = self.layout
906         layout.use_property_split = True
907
908         toolsettings = context.tool_settings
909         sculpt = toolsettings.sculpt
910         settings = self.paint_settings(context)
911         brush = settings.brush
912
913         col = layout.column()
914         col.active = context.sculpt_object.use_dynamic_topology_sculpting
915
916         sub = col.column()
917         sub.active = (brush and brush.sculpt_tool != 'MASK')
918         if (sculpt.detail_type_method == 'CONSTANT'):
919             row = sub.row(align=True)
920             row.prop(sculpt, "constant_detail_resolution")
921             row.operator("sculpt.sample_detail_size", text="", icon='EYEDROPPER')
922         elif (sculpt.detail_type_method == 'BRUSH'):
923             sub.prop(sculpt, "detail_percent")
924         else:
925             sub.prop(sculpt, "detail_size")
926         sub.prop(sculpt, "detail_refine_method", text="Refine Method")
927         sub.prop(sculpt, "detail_type_method", text="Detailing")
928
929         col.prop(sculpt, "use_smooth_shading")
930
931         col.separator()
932
933         col.prop(sculpt, "symmetrize_direction")
934         col.operator("sculpt.symmetrize")
935         col.operator("sculpt.optimize")
936         if (sculpt.detail_type_method == 'CONSTANT'):
937             col.operator("sculpt.detail_flood_fill")
938
939
940 # TODO, move to space_view3d.py
941 class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel):
942     bl_context = ".sculpt_mode"  # dot on purpose (access from topbar)
943     bl_label = "Options"
944     bl_options = {'DEFAULT_CLOSED'}
945
946     @classmethod
947     def poll(cls, context):
948         return (context.sculpt_object and context.tool_settings.sculpt)
949
950     def draw(self, context):
951         layout = self.layout
952         # scene = context.scene
953
954         toolsettings = context.tool_settings
955         sculpt = toolsettings.sculpt
956         capabilities = sculpt.brush.sculpt_capabilities
957
958         col = layout.column(align=True)
959         col.active = capabilities.has_gravity
960         col.label(text="Gravity:")
961         col.prop(sculpt, "gravity", slider=True, text="Factor")
962         col.prop(sculpt, "gravity_object")
963         col.separator()
964
965         layout.prop(sculpt, "use_threaded", text="Threaded Sculpt")
966         layout.prop(sculpt, "show_low_resolution")
967         layout.prop(sculpt, "use_deform_only")
968         layout.prop(sculpt, "show_diffuse_color")
969         layout.prop(sculpt, "show_mask")
970
971         self.unified_paint_settings(layout, context)
972
973
974 # TODO, move to space_view3d.py
975 class VIEW3D_PT_sculpt_symmetry(Panel, View3DPaintPanel):
976     bl_context = ".sculpt_mode"  # dot on purpose (access from topbar)
977     bl_label = "Symmetry/Lock"
978     bl_options = {'DEFAULT_CLOSED'}
979
980     @classmethod
981     def poll(cls, context):
982         return (context.sculpt_object and context.tool_settings.sculpt)
983
984     def draw(self, context):
985         layout = self.layout
986
987         sculpt = context.tool_settings.sculpt
988
989         split = layout.split()
990
991         col = split.column()
992         col.alignment = 'RIGHT'
993         col.label(text="Mirror")
994
995         col = split.column()
996
997         row = col.row(align=True)
998         row.prop(sculpt, "use_symmetry_x", text="X", toggle=True)
999         row.prop(sculpt, "use_symmetry_y", text="Y", toggle=True)
1000         row.prop(sculpt, "use_symmetry_z", text="Z", toggle=True)
1001
1002         split = layout.split()
1003
1004         col = split.column()
1005         col.alignment = 'RIGHT'
1006         col.label(text="Lock")
1007
1008         col = split.column()
1009
1010         row = col.row(align=True)
1011         row.prop(sculpt, "lock_x", text="X", toggle=True)
1012         row.prop(sculpt, "lock_y", text="Y", toggle=True)
1013         row.prop(sculpt, "lock_z", text="Z", toggle=True)
1014
1015
1016         split = layout.split()
1017
1018         col = split.column()
1019         col.alignment = 'RIGHT'
1020         col.label(text="Tiling")
1021
1022         col = split.column()
1023
1024         row = col.row(align=True)
1025         row.prop(sculpt, "tile_x", text="X", toggle=True)
1026         row.prop(sculpt, "tile_y", text="Y", toggle=True)
1027         row.prop(sculpt, "tile_z", text="Z", toggle=True)
1028
1029         layout.use_property_split = True
1030
1031         layout.prop(sculpt, "use_symmetry_feather", text="Feather")
1032         layout.column().prop(sculpt, "radial_symmetry", text="Radial")
1033         layout.column().prop(sculpt, "tile_offset", text="Tile Offset")
1034
1035
1036 # TODO, move to space_view3d.py
1037 class VIEW3D_PT_tools_brush_appearance(Panel, View3DPaintPanel):
1038     bl_context = ".paint_common"  # dot on purpose (access from topbar)
1039     bl_label = "Appearance"
1040
1041     @classmethod
1042     def poll(cls, context):
1043         settings = cls.paint_settings(context)
1044         return (settings is not None) and (not isinstance(settings, bpy.types.ParticleEdit))
1045
1046     def draw(self, context):
1047         layout = self.layout
1048
1049         settings = self.paint_settings(context)
1050         brush = settings.brush
1051
1052         if brush is None:  # unlikely but can happen
1053             layout.label(text="Brush Unset")
1054             return
1055
1056         col = layout.column()
1057         col.prop(settings, "show_brush")
1058
1059         sub = col.column()
1060         sub.active = settings.show_brush
1061
1062         if context.sculpt_object and context.tool_settings.sculpt:
1063             if brush.sculpt_capabilities.has_secondary_color:
1064                 sub.row().prop(brush, "cursor_color_add", text="Add")
1065                 sub.row().prop(brush, "cursor_color_subtract", text="Subtract")
1066             else:
1067                 sub.prop(brush, "cursor_color_add", text="")
1068         else:
1069             sub.prop(brush, "cursor_color_add", text="")
1070
1071         col.separator()
1072
1073         col = col.column(align=True)
1074         col.prop(brush, "use_custom_icon")
1075         sub = col.column()
1076         sub.active = brush.use_custom_icon
1077         sub.prop(brush, "icon_filepath", text="")
1078
1079 # ********** default tools for weight-paint ****************
1080
1081
1082 # TODO, move to space_view3d.py
1083 class VIEW3D_PT_tools_weightpaint_symmetry(Panel, View3DPaintPanel):
1084     bl_context = ".weightpaint"
1085     bl_options = {'DEFAULT_CLOSED'}
1086     bl_label = "Symmetry"
1087
1088     def draw(self, context):
1089         layout = self.layout
1090         toolsettings = context.tool_settings
1091         wpaint = toolsettings.weight_paint
1092         draw_vpaint_symmetry(layout, wpaint)
1093
1094
1095 # TODO, move to space_view3d.py
1096 class VIEW3D_PT_tools_weightpaint_options(Panel, View3DPaintPanel):
1097     bl_context = ".weightpaint"
1098     bl_label = "Options"
1099
1100     def draw(self, context):
1101         layout = self.layout
1102
1103         tool_settings = context.tool_settings
1104         wpaint = tool_settings.weight_paint
1105
1106         col = layout.column()
1107         col.prop(wpaint, "use_group_restrict")
1108
1109         obj = context.weight_paint_object
1110         if obj.type == 'MESH':
1111             mesh = obj.data
1112             col.prop(mesh, "use_mirror_x")
1113             row = col.row()
1114             row.active = mesh.use_mirror_x
1115             row.prop(mesh, "use_mirror_topology")
1116
1117         col.label("Show Zero Weights:")
1118         sub = col.row()
1119         sub.prop(tool_settings, "vertex_group_user", expand=True)
1120
1121         self.unified_paint_settings(col, context)
1122
1123 # ********** default tools for vertex-paint ****************
1124
1125
1126 # TODO, move to space_view3d.py
1127 class VIEW3D_PT_tools_vertexpaint(Panel, View3DPaintPanel):
1128     bl_context = ".vertexpaint"  # dot on purpose (access from topbar)
1129     bl_label = "Options"
1130
1131     def draw(self, context):
1132         layout = self.layout
1133
1134         toolsettings = context.tool_settings
1135         vpaint = toolsettings.vertex_paint
1136
1137         col = layout.column()
1138
1139         self.unified_paint_settings(col, context)
1140
1141
1142 # TODO, move to space_view3d.py
1143 class VIEW3D_PT_tools_vertexpaint_symmetry(Panel, View3DPaintPanel):
1144     bl_context = ".vertexpaint"  # dot on purpose (access from topbar)
1145     bl_options = {'DEFAULT_CLOSED'}
1146     bl_label = "Symmetry"
1147
1148     def draw(self, context):
1149         layout = self.layout
1150         toolsettings = context.tool_settings
1151         vpaint = toolsettings.vertex_paint
1152         draw_vpaint_symmetry(layout, vpaint)
1153
1154
1155 # ********** default tools for texture-paint ****************
1156
1157
1158 # TODO, move to space_view3d.py
1159 class VIEW3D_PT_tools_imagepaint_external(Panel, View3DPaintPanel):
1160     bl_context = ".imagepaint"  # dot on purpose (access from topbar)
1161     bl_label = "External"
1162     bl_options = {'DEFAULT_CLOSED'}
1163
1164     def draw(self, context):
1165         layout = self.layout
1166
1167         toolsettings = context.tool_settings
1168         ipaint = toolsettings.image_paint
1169
1170         col = layout.column()
1171         row = col.split(align=True, percentage=0.55)
1172         row.operator("image.project_edit", text="Quick Edit")
1173         row.operator("image.project_apply", text="Apply")
1174
1175         col.row().prop(ipaint, "screen_grab_size", text="")
1176
1177         col.operator("paint.project_image", text="Apply Camera Image")
1178
1179
1180 # TODO, move to space_view3d.py
1181 class VIEW3D_PT_tools_imagepaint_symmetry(Panel, View3DPaintPanel):
1182     bl_context = ".imagepaint"  # dot on purpose (access from topbar)
1183     bl_label = "Symmetry"
1184     bl_options = {'DEFAULT_CLOSED'}
1185
1186     def draw(self, context):
1187         layout = self.layout
1188
1189         toolsettings = context.tool_settings
1190         ipaint = toolsettings.image_paint
1191
1192         split = layout.split()
1193
1194         col = split.column()
1195         col.alignment = 'RIGHT'
1196         col.label(text="Mirror")
1197
1198         col = split.column()
1199
1200         row = col.row(align=True)
1201         row.prop(ipaint, "use_symmetry_x", text="X", toggle=True)
1202         row.prop(ipaint, "use_symmetry_y", text="Y", toggle=True)
1203         row.prop(ipaint, "use_symmetry_z", text="Z", toggle=True)
1204
1205
1206 # TODO, move to space_view3d.py
1207 class VIEW3D_PT_tools_projectpaint(View3DPaintPanel, Panel):
1208     bl_context = ".imagepaint"  # dot on purpose (access from topbar)
1209     bl_label = "Project Paint"
1210
1211     @classmethod
1212     def poll(cls, context):
1213         brush = context.tool_settings.image_paint.brush
1214         return (brush is not None)
1215
1216     def draw(self, context):
1217         layout = self.layout
1218
1219         toolsettings = context.tool_settings
1220         ipaint = toolsettings.image_paint
1221
1222         col = layout.column()
1223
1224         col.prop(ipaint, "use_occlude")
1225         col.prop(ipaint, "use_backface_culling")
1226
1227         row = layout.row()
1228         row.prop(ipaint, "use_normal_falloff")
1229
1230         sub = row.row()
1231         sub.active = (ipaint.use_normal_falloff)
1232         sub.prop(ipaint, "normal_angle", text="")
1233
1234         layout.prop(ipaint, "use_cavity")
1235         if ipaint.use_cavity:
1236             layout.template_curve_mapping(ipaint, "cavity_curve", brush=True)
1237
1238         layout.prop(ipaint, "seam_bleed")
1239         layout.prop(ipaint, "dither")
1240         self.unified_paint_settings(layout, context)
1241
1242
1243 # TODO, move to space_view3d.py
1244 class VIEW3D_PT_imagepaint_options(View3DPaintPanel):
1245     bl_label = "Options"
1246
1247     @classmethod
1248     def poll(cls, context):
1249         return (context.image_paint_object and context.tool_settings.image_paint)
1250
1251     def draw(self, context):
1252         layout = self.layout
1253
1254         col = layout.column()
1255         self.unified_paint_settings(col, context)
1256
1257
1258 class VIEW3D_MT_tools_projectpaint_stencil(Menu):
1259     bl_label = "Mask Layer"
1260
1261     def draw(self, context):
1262         layout = self.layout
1263         for i, uv_layer in enumerate(context.active_object.data.uv_layers):
1264             props = layout.operator("wm.context_set_int", text=uv_layer.name, translate=False)
1265             props.data_path = "active_object.data.uv_layer_stencil_index"
1266             props.value = i
1267
1268
1269 # TODO, move to space_view3d.py
1270 class VIEW3D_PT_tools_particlemode(View3DPanel, Panel):
1271     """Default tools for particle mode"""
1272     bl_context = ".particlemode"
1273     bl_label = "Options"
1274
1275     def draw(self, context):
1276         layout = self.layout
1277
1278         pe = context.tool_settings.particle_edit
1279         ob = pe.object
1280
1281         layout.prop(pe, "type", text="")
1282
1283         ptcache = None
1284
1285         if pe.type == 'PARTICLES':
1286             if ob.particle_systems:
1287                 if len(ob.particle_systems) > 1:
1288                     layout.template_list("UI_UL_list", "particle_systems", ob, "particle_systems",
1289                                          ob.particle_systems, "active_index", rows=2, maxrows=3)
1290
1291                 ptcache = ob.particle_systems.active.point_cache
1292         else:
1293             for md in ob.modifiers:
1294                 if md.type == pe.type:
1295                     ptcache = md.point_cache
1296
1297         if ptcache and len(ptcache.point_caches) > 1:
1298             layout.template_list("UI_UL_list", "particles_point_caches", ptcache, "point_caches",
1299                                  ptcache.point_caches, "active_index", rows=2, maxrows=3)
1300
1301         if not pe.is_editable:
1302             layout.label(text="Point cache must be baked")
1303             layout.label(text="in memory to enable editing!")
1304
1305         col = layout.column(align=True)
1306         if pe.is_hair:
1307             col.active = pe.is_editable
1308             col.prop(pe, "use_emitter_deflect", text="Deflect Emitter")
1309             sub = col.row(align=True)
1310             sub.active = pe.use_emitter_deflect
1311             sub.prop(pe, "emitter_distance", text="Distance")
1312
1313         col = layout.column(align=True)
1314         col.active = pe.is_editable
1315         col.label(text="Keep:")
1316         col.prop(pe, "use_preserve_length", text="Lengths")
1317         col.prop(pe, "use_preserve_root", text="Root")
1318         if not pe.is_hair:
1319             col.label(text="Correct:")
1320             col.prop(pe, "use_auto_velocity", text="Velocity")
1321         col.prop(ob.data, "use_mirror_x")
1322
1323         col.prop(pe, "shape_object")
1324         col.operator("particle.shape_cut")
1325
1326         col = layout.column(align=True)
1327         col.active = pe.is_editable
1328         col.label(text="Draw:")
1329         col.prop(pe, "draw_step", text="Path Steps")
1330         if pe.is_hair:
1331             col.prop(pe, "show_particles", text="Children")
1332         else:
1333             if pe.type == 'PARTICLES':
1334                 col.prop(pe, "show_particles", text="Particles")
1335             col.prop(pe, "use_fade_time")
1336             sub = col.row(align=True)
1337             sub.active = pe.use_fade_time
1338             sub.prop(pe, "fade_frames", slider=True)
1339
1340
1341 # Grease Pencil drawing tools
1342 class VIEW3D_PT_tools_grease_pencil_draw(GreasePencilDrawingToolsPanel, Panel):
1343     bl_space_type = 'VIEW_3D'
1344
1345
1346 # Grease Pencil stroke editing tools
1347 class VIEW3D_PT_tools_grease_pencil_edit(GreasePencilStrokeEditPanel, Panel):
1348     bl_space_type = 'VIEW_3D'
1349
1350
1351 # Grease Pencil stroke interpolation tools
1352 class VIEW3D_PT_tools_grease_pencil_interpolate(GreasePencilInterpolatePanel, Panel):
1353     bl_space_type = 'VIEW_3D'
1354
1355
1356 # Grease Pencil stroke sculpting tools
1357 class VIEW3D_PT_tools_grease_pencil_sculpt(GreasePencilStrokeSculptPanel, Panel):
1358     bl_space_type = 'VIEW_3D'
1359
1360
1361 # Grease Pencil drawing brushes
1362 class VIEW3D_PT_tools_grease_pencil_brush(GreasePencilBrushPanel, Panel):
1363     bl_space_type = 'VIEW_3D'
1364
1365 # Grease Pencil drawingcurves
1366
1367
1368 class VIEW3D_PT_tools_grease_pencil_brushcurves(GreasePencilBrushCurvesPanel, Panel):
1369     bl_space_type = 'VIEW_3D'
1370
1371
1372 classes = (
1373     VIEW3D_PT_tools_meshedit_options,
1374     VIEW3D_PT_tools_curveedit_options_stroke,
1375     VIEW3D_PT_tools_armatureedit_options,
1376     VIEW3D_PT_tools_posemode_options,
1377     VIEW3D_PT_imapaint_tools_missing,
1378     VIEW3D_PT_tools_brush,
1379     TEXTURE_UL_texpaintslots,
1380     VIEW3D_MT_tools_projectpaint_uvlayer,
1381     VIEW3D_PT_slots_projectpaint,
1382     VIEW3D_PT_stencil_projectpaint,
1383     VIEW3D_PT_tools_brush_overlay,
1384     VIEW3D_PT_tools_brush_texture,
1385     VIEW3D_PT_tools_mask_texture,
1386     VIEW3D_PT_tools_brush_stroke,
1387     VIEW3D_PT_tools_brush_curve,
1388     VIEW3D_PT_sculpt_dyntopo,
1389     VIEW3D_PT_sculpt_options,
1390     VIEW3D_PT_sculpt_symmetry,
1391     VIEW3D_PT_tools_brush_appearance,
1392     VIEW3D_PT_tools_weightpaint_symmetry,
1393     VIEW3D_PT_tools_weightpaint_options,
1394     VIEW3D_PT_tools_vertexpaint,
1395     VIEW3D_PT_tools_vertexpaint_symmetry,
1396     VIEW3D_PT_tools_imagepaint_external,
1397     VIEW3D_PT_tools_imagepaint_symmetry,
1398     VIEW3D_PT_tools_projectpaint,
1399     VIEW3D_MT_tools_projectpaint_stencil,
1400     VIEW3D_PT_tools_particlemode,
1401     VIEW3D_PT_tools_grease_pencil_draw,
1402     VIEW3D_PT_tools_grease_pencil_edit,
1403     VIEW3D_PT_tools_grease_pencil_interpolate,
1404     VIEW3D_PT_tools_grease_pencil_sculpt,
1405     VIEW3D_PT_tools_grease_pencil_brush,
1406     VIEW3D_PT_tools_grease_pencil_brushcurves,
1407 )
1408
1409 if __name__ == "__main__":  # only for live edit.
1410     from bpy.utils import register_class
1411     for cls in classes:
1412         register_class(cls)