UI: use property split for UV mask panel
[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         layout.use_property_split = True
614
615         toolsettings = context.tool_settings
616         ipaint = toolsettings.image_paint
617         ob = context.active_object
618         mesh = ob.data
619
620         col = layout.column()
621         col.active = ipaint.use_stencil_layer
622
623         stencil_text = mesh.uv_layer_stencil.name if mesh.uv_layer_stencil else ""
624         split = col.split(0.5)
625         colsub = split.column()
626         colsub.alignment = 'RIGHT'
627         colsub.label("UV Layer")
628         split.column().menu("VIEW3D_MT_tools_projectpaint_stencil", text=stencil_text, translate=False)
629
630         # todo this should be combinded into a single row
631         split = col.split(0.5)
632         colsub = split.column()
633         colsub.alignment = 'RIGHT'
634         colsub.label("Stencil Image")
635         colsub = split.column()
636         colsub.template_ID(ipaint, "stencil_image", open="image.open")
637         colsub.operator("image.new", text="New").gen_context = 'PAINT_STENCIL'
638
639         row = col.row(align=True)
640         row.prop(ipaint, "stencil_color", text="Display Color")
641         row.prop(ipaint, "invert_stencil", text="", icon='IMAGE_ALPHA')
642
643
644 # TODO, move to space_view3d.py
645 class VIEW3D_PT_tools_brush_overlay(Panel, View3DPaintPanel):
646     bl_context = ".paint_common"  # dot on purpose (access from topbar)
647     bl_label = "Overlay"
648
649     @classmethod
650     def poll(cls, context):
651         settings = cls.paint_settings(context)
652         return (settings and
653                 settings.brush and
654                 (context.sculpt_object or
655                  context.vertex_paint_object or
656                  context.weight_paint_object or
657                  context.image_paint_object))
658
659     def draw(self, context):
660         layout = self.layout
661
662         settings = self.paint_settings(context)
663         brush = settings.brush
664         tex_slot = brush.texture_slot
665         tex_slot_mask = brush.mask_texture_slot
666
667         col = layout.column()
668
669         col.label(text="Curve:")
670
671         row = col.row(align=True)
672         if brush.use_cursor_overlay:
673             row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
674         else:
675             row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
676
677         sub = row.row(align=True)
678         sub.prop(brush, "cursor_overlay_alpha", text="Alpha")
679         sub.prop(brush, "use_cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
680
681         col.active = brush.brush_capabilities.has_overlay
682
683         if context.image_paint_object or context.sculpt_object or context.vertex_paint_object:
684             col.label(text="Texture:")
685             row = col.row(align=True)
686             if tex_slot.map_mode != 'STENCIL':
687                 if brush.use_primary_overlay:
688                     row.prop(brush, "use_primary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
689                 else:
690                     row.prop(brush, "use_primary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
691
692             sub = row.row(align=True)
693             sub.prop(brush, "texture_overlay_alpha", text="Alpha")
694             sub.prop(brush, "use_primary_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
695
696         if context.image_paint_object:
697             col.label(text="Mask Texture:")
698
699             row = col.row(align=True)
700             if tex_slot_mask.map_mode != 'STENCIL':
701                 if brush.use_secondary_overlay:
702                     row.prop(brush, "use_secondary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
703                 else:
704                     row.prop(brush, "use_secondary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
705
706             sub = row.row(align=True)
707             sub.prop(brush, "mask_overlay_alpha", text="Alpha")
708             sub.prop(brush, "use_secondary_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
709
710
711 # TODO, move to space_view3d.py
712 class VIEW3D_PT_tools_brush_texture(Panel, View3DPaintPanel):
713     bl_context = ".paint_common"  # dot on purpose (access from topbar)
714     bl_label = "Texture"
715     bl_options = {'DEFAULT_CLOSED'}
716
717     @classmethod
718     def poll(cls, context):
719         settings = cls.paint_settings(context)
720         return (settings and settings.brush and
721                 (context.sculpt_object or context.image_paint_object or context.vertex_paint_object))
722
723     def draw(self, context):
724         layout = self.layout
725
726         settings = self.paint_settings(context)
727         brush = settings.brush
728
729         col = layout.column()
730
731         col.template_ID_preview(brush, "texture", new="texture.new", rows=3, cols=8)
732
733         brush_texture_settings(col, brush, context.sculpt_object)
734
735
736 # TODO, move to space_view3d.py
737 class VIEW3D_PT_tools_mask_texture(Panel, View3DPaintPanel):
738     bl_context = ".imagepaint"  # dot on purpose (access from topbar)
739     bl_label = "Texture Mask"
740     bl_options = {'DEFAULT_CLOSED'}
741
742     @classmethod
743     def poll(cls, context):
744         settings = cls.paint_settings(context)
745         return (settings and settings.brush and context.image_paint_object)
746
747     def draw(self, context):
748         layout = self.layout
749
750         brush = context.tool_settings.image_paint.brush
751
752         col = layout.column()
753
754         col.template_ID_preview(brush, "mask_texture", new="texture.new", rows=3, cols=8)
755
756         brush_mask_texture_settings(col, brush)
757
758
759 # TODO, move to space_view3d.py
760 class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel):
761     bl_context = ".paint_common"  # dot on purpose (access from topbar)
762     bl_label = "Stroke"
763     bl_options = {'DEFAULT_CLOSED'}
764
765     @classmethod
766     def poll(cls, context):
767         settings = cls.paint_settings(context)
768         return (settings and
769                 settings.brush and
770                 (context.sculpt_object or
771                  context.vertex_paint_object or
772                  context.weight_paint_object or
773                  context.image_paint_object))
774
775     def draw(self, context):
776         layout = self.layout
777
778         settings = self.paint_settings(context)
779         brush = settings.brush
780         layout.use_property_split = True
781
782         col = layout.column()
783
784         col.prop(brush, "stroke_method")
785
786         if brush.use_anchor:
787             col.separator()
788             col.prop(brush, "use_edge_to_edge", "Edge To Edge")
789
790         if brush.use_airbrush:
791             col.separator()
792             col.prop(brush, "rate", text="Rate", slider=True)
793
794         if brush.use_space:
795             col.separator()
796             row = col.row(align=True)
797             row.prop(brush, "spacing", text="Spacing")
798             row.prop(brush, "use_pressure_spacing", toggle=True, text="")
799
800         if brush.use_line or brush.use_curve:
801             col.separator()
802             row = col.row(align=True)
803             row.prop(brush, "spacing", text="Spacing")
804
805         if brush.use_curve:
806             col.separator()
807             col.template_ID(brush, "paint_curve", new="paintcurve.new")
808             col.operator("paintcurve.draw")
809
810         if context.sculpt_object:
811             if brush.sculpt_capabilities.has_jitter:
812                 col.separator()
813
814                 colsub = col.split(0.5)
815                 row = colsub.row(align=True)
816                 row.alignment = 'RIGHT'
817                 row.label("Jitter")
818                 row = colsub.row(align=True)
819                 row.prop(brush, "use_relative_jitter", icon_only=True)
820                 if brush.use_relative_jitter:
821                     row.prop(brush, "jitter", slider=True, text="")
822                 else:
823                     row.prop(brush, "jitter_absolute", text="")
824                 row.prop(brush, "use_pressure_jitter", toggle=True, text="")
825
826             if brush.sculpt_capabilities.has_smooth_stroke:
827                 col = layout.column()
828                 col.separator()
829
830                 col.prop(brush, "use_smooth_stroke")
831
832                 sub = col.column()
833                 sub.active = brush.use_smooth_stroke
834                 sub.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
835                 sub.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
836         else:
837             col.separator()
838
839             row = col.row(align=True)
840             row.prop(brush, "use_relative_jitter", icon_only=True)
841             if brush.use_relative_jitter:
842                 row.prop(brush, "jitter", slider=True)
843             else:
844                 row.prop(brush, "jitter_absolute")
845             row.prop(brush, "use_pressure_jitter", toggle=True, text="")
846
847             col = layout.column()
848             col.separator()
849
850             if brush.brush_capabilities.has_smooth_stroke:
851                 col.prop(brush, "use_smooth_stroke")
852
853                 sub = col.column()
854                 sub.active = brush.use_smooth_stroke
855                 sub.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
856                 sub.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
857
858         layout.prop(settings, "input_samples")
859
860
861 # TODO, move to space_view3d.py
862 class VIEW3D_PT_tools_brush_curve(Panel, View3DPaintPanel):
863     bl_context = ".paint_common"  # dot on purpose (access from topbar)
864     bl_label = "Curve"
865     bl_options = {'DEFAULT_CLOSED'}
866
867     @classmethod
868     def poll(cls, context):
869         settings = cls.paint_settings(context)
870         return (settings and settings.brush and settings.brush.curve)
871
872     def draw(self, context):
873         layout = self.layout
874
875         settings = self.paint_settings(context)
876
877         brush = settings.brush
878
879         layout.template_curve_mapping(brush, "curve", brush=True)
880
881         col = layout.column(align=True)
882         row = col.row(align=True)
883         row.operator("brush.curve_preset", icon='SMOOTHCURVE', text="").shape = 'SMOOTH'
884         row.operator("brush.curve_preset", icon='SPHERECURVE', text="").shape = 'ROUND'
885         row.operator("brush.curve_preset", icon='ROOTCURVE', text="").shape = 'ROOT'
886         row.operator("brush.curve_preset", icon='SHARPCURVE', text="").shape = 'SHARP'
887         row.operator("brush.curve_preset", icon='LINCURVE', text="").shape = 'LINE'
888         row.operator("brush.curve_preset", icon='NOCURVE', text="").shape = 'MAX'
889
890
891 # TODO, move to space_view3d.py
892 class VIEW3D_PT_sculpt_dyntopo(Panel, View3DPaintPanel):
893     bl_context = ".sculpt_mode"  # dot on purpose (access from topbar)
894     bl_label = "Dyntopo"
895     bl_options = {'DEFAULT_CLOSED'}
896
897     @classmethod
898     def poll(cls, context):
899         return (context.sculpt_object and context.tool_settings.sculpt)
900
901     def draw_header(self, context):
902         is_popover = self.is_popover
903         layout = self.layout
904         layout.operator(
905             "sculpt.dynamic_topology_toggle",
906             icon='CHECKBOX_HLT' if context.sculpt_object.use_dynamic_topology_sculpting else 'CHECKBOX_DEHLT',
907             text="",
908             emboss=is_popover,
909         )
910
911     def draw(self, context):
912         layout = self.layout
913         layout.use_property_split = True
914
915         toolsettings = context.tool_settings
916         sculpt = toolsettings.sculpt
917         settings = self.paint_settings(context)
918         brush = settings.brush
919
920         col = layout.column()
921         col.active = context.sculpt_object.use_dynamic_topology_sculpting
922
923         sub = col.column()
924         sub.active = (brush and brush.sculpt_tool != 'MASK')
925         if (sculpt.detail_type_method == 'CONSTANT'):
926             row = sub.row(align=True)
927             row.prop(sculpt, "constant_detail_resolution")
928             row.operator("sculpt.sample_detail_size", text="", icon='EYEDROPPER')
929         elif (sculpt.detail_type_method == 'BRUSH'):
930             sub.prop(sculpt, "detail_percent")
931         else:
932             sub.prop(sculpt, "detail_size")
933         sub.prop(sculpt, "detail_refine_method", text="Refine Method")
934         sub.prop(sculpt, "detail_type_method", text="Detailing")
935
936         col.prop(sculpt, "use_smooth_shading")
937
938         col.separator()
939
940         col.prop(sculpt, "symmetrize_direction")
941         col.operator("sculpt.symmetrize")
942         col.operator("sculpt.optimize")
943         if (sculpt.detail_type_method == 'CONSTANT'):
944             col.operator("sculpt.detail_flood_fill")
945
946
947 # TODO, move to space_view3d.py
948 class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel):
949     bl_context = ".sculpt_mode"  # dot on purpose (access from topbar)
950     bl_label = "Options"
951     bl_options = {'DEFAULT_CLOSED'}
952
953     @classmethod
954     def poll(cls, context):
955         return (context.sculpt_object and context.tool_settings.sculpt)
956
957     def draw(self, context):
958         layout = self.layout
959         # scene = context.scene
960
961         toolsettings = context.tool_settings
962         sculpt = toolsettings.sculpt
963         capabilities = sculpt.brush.sculpt_capabilities
964
965         col = layout.column(align=True)
966         col.active = capabilities.has_gravity
967         col.label(text="Gravity:")
968         col.prop(sculpt, "gravity", slider=True, text="Factor")
969         col.prop(sculpt, "gravity_object")
970         col.separator()
971
972         layout.prop(sculpt, "use_threaded", text="Threaded Sculpt")
973         layout.prop(sculpt, "show_low_resolution")
974         layout.prop(sculpt, "use_deform_only")
975         layout.prop(sculpt, "show_diffuse_color")
976         layout.prop(sculpt, "show_mask")
977
978         self.unified_paint_settings(layout, context)
979
980
981 # TODO, move to space_view3d.py
982 class VIEW3D_PT_sculpt_symmetry(Panel, View3DPaintPanel):
983     bl_context = ".sculpt_mode"  # dot on purpose (access from topbar)
984     bl_label = "Symmetry/Lock"
985     bl_options = {'DEFAULT_CLOSED'}
986
987     @classmethod
988     def poll(cls, context):
989         return (context.sculpt_object and context.tool_settings.sculpt)
990
991     def draw(self, context):
992         layout = self.layout
993
994         sculpt = context.tool_settings.sculpt
995
996         split = layout.split()
997
998         col = split.column()
999         col.alignment = 'RIGHT'
1000         col.label(text="Mirror")
1001
1002         col = split.column()
1003
1004         row = col.row(align=True)
1005         row.prop(sculpt, "use_symmetry_x", text="X", toggle=True)
1006         row.prop(sculpt, "use_symmetry_y", text="Y", toggle=True)
1007         row.prop(sculpt, "use_symmetry_z", text="Z", toggle=True)
1008
1009         split = layout.split()
1010
1011         col = split.column()
1012         col.alignment = 'RIGHT'
1013         col.label(text="Lock")
1014
1015         col = split.column()
1016
1017         row = col.row(align=True)
1018         row.prop(sculpt, "lock_x", text="X", toggle=True)
1019         row.prop(sculpt, "lock_y", text="Y", toggle=True)
1020         row.prop(sculpt, "lock_z", text="Z", toggle=True)
1021
1022
1023         split = layout.split()
1024
1025         col = split.column()
1026         col.alignment = 'RIGHT'
1027         col.label(text="Tiling")
1028
1029         col = split.column()
1030
1031         row = col.row(align=True)
1032         row.prop(sculpt, "tile_x", text="X", toggle=True)
1033         row.prop(sculpt, "tile_y", text="Y", toggle=True)
1034         row.prop(sculpt, "tile_z", text="Z", toggle=True)
1035
1036         layout.use_property_split = True
1037
1038         layout.prop(sculpt, "use_symmetry_feather", text="Feather")
1039         layout.column().prop(sculpt, "radial_symmetry", text="Radial")
1040         layout.column().prop(sculpt, "tile_offset", text="Tile Offset")
1041
1042
1043 # TODO, move to space_view3d.py
1044 class VIEW3D_PT_tools_brush_appearance(Panel, View3DPaintPanel):
1045     bl_context = ".paint_common"  # dot on purpose (access from topbar)
1046     bl_label = "Appearance"
1047
1048     @classmethod
1049     def poll(cls, context):
1050         settings = cls.paint_settings(context)
1051         return (settings is not None) and (not isinstance(settings, bpy.types.ParticleEdit))
1052
1053     def draw(self, context):
1054         layout = self.layout
1055
1056         settings = self.paint_settings(context)
1057         brush = settings.brush
1058
1059         if brush is None:  # unlikely but can happen
1060             layout.label(text="Brush Unset")
1061             return
1062
1063         col = layout.column()
1064         col.prop(settings, "show_brush")
1065
1066         sub = col.column()
1067         sub.active = settings.show_brush
1068
1069         if context.sculpt_object and context.tool_settings.sculpt:
1070             if brush.sculpt_capabilities.has_secondary_color:
1071                 sub.row().prop(brush, "cursor_color_add", text="Add")
1072                 sub.row().prop(brush, "cursor_color_subtract", text="Subtract")
1073             else:
1074                 sub.prop(brush, "cursor_color_add", text="")
1075         else:
1076             sub.prop(brush, "cursor_color_add", text="")
1077
1078         col.separator()
1079
1080         col = col.column(align=True)
1081         col.prop(brush, "use_custom_icon")
1082         sub = col.column()
1083         sub.active = brush.use_custom_icon
1084         sub.prop(brush, "icon_filepath", text="")
1085
1086 # ********** default tools for weight-paint ****************
1087
1088
1089 # TODO, move to space_view3d.py
1090 class VIEW3D_PT_tools_weightpaint_symmetry(Panel, View3DPaintPanel):
1091     bl_context = ".weightpaint"
1092     bl_options = {'DEFAULT_CLOSED'}
1093     bl_label = "Symmetry"
1094
1095     def draw(self, context):
1096         layout = self.layout
1097         toolsettings = context.tool_settings
1098         wpaint = toolsettings.weight_paint
1099         draw_vpaint_symmetry(layout, wpaint)
1100
1101
1102 # TODO, move to space_view3d.py
1103 class VIEW3D_PT_tools_weightpaint_options(Panel, View3DPaintPanel):
1104     bl_context = ".weightpaint"
1105     bl_label = "Options"
1106
1107     def draw(self, context):
1108         layout = self.layout
1109
1110         tool_settings = context.tool_settings
1111         wpaint = tool_settings.weight_paint
1112
1113         col = layout.column()
1114         col.prop(wpaint, "use_group_restrict")
1115
1116         obj = context.weight_paint_object
1117         if obj.type == 'MESH':
1118             mesh = obj.data
1119             col.prop(mesh, "use_mirror_x")
1120             row = col.row()
1121             row.active = mesh.use_mirror_x
1122             row.prop(mesh, "use_mirror_topology")
1123
1124         col.label("Show Zero Weights:")
1125         sub = col.row()
1126         sub.prop(tool_settings, "vertex_group_user", expand=True)
1127
1128         self.unified_paint_settings(col, context)
1129
1130 # ********** default tools for vertex-paint ****************
1131
1132
1133 # TODO, move to space_view3d.py
1134 class VIEW3D_PT_tools_vertexpaint(Panel, View3DPaintPanel):
1135     bl_context = ".vertexpaint"  # dot on purpose (access from topbar)
1136     bl_label = "Options"
1137
1138     def draw(self, context):
1139         layout = self.layout
1140
1141         toolsettings = context.tool_settings
1142         vpaint = toolsettings.vertex_paint
1143
1144         col = layout.column()
1145
1146         self.unified_paint_settings(col, context)
1147
1148
1149 # TODO, move to space_view3d.py
1150 class VIEW3D_PT_tools_vertexpaint_symmetry(Panel, View3DPaintPanel):
1151     bl_context = ".vertexpaint"  # dot on purpose (access from topbar)
1152     bl_options = {'DEFAULT_CLOSED'}
1153     bl_label = "Symmetry"
1154
1155     def draw(self, context):
1156         layout = self.layout
1157         toolsettings = context.tool_settings
1158         vpaint = toolsettings.vertex_paint
1159         draw_vpaint_symmetry(layout, vpaint)
1160
1161
1162 # ********** default tools for texture-paint ****************
1163
1164
1165 # TODO, move to space_view3d.py
1166 class VIEW3D_PT_tools_imagepaint_external(Panel, View3DPaintPanel):
1167     bl_context = ".imagepaint"  # dot on purpose (access from topbar)
1168     bl_label = "External"
1169     bl_options = {'DEFAULT_CLOSED'}
1170
1171     def draw(self, context):
1172         layout = self.layout
1173
1174         toolsettings = context.tool_settings
1175         ipaint = toolsettings.image_paint
1176
1177         col = layout.column()
1178         row = col.split(align=True, percentage=0.55)
1179         row.operator("image.project_edit", text="Quick Edit")
1180         row.operator("image.project_apply", text="Apply")
1181
1182         col.row().prop(ipaint, "screen_grab_size", text="")
1183
1184         col.operator("paint.project_image", text="Apply Camera Image")
1185
1186
1187 # TODO, move to space_view3d.py
1188 class VIEW3D_PT_tools_imagepaint_symmetry(Panel, View3DPaintPanel):
1189     bl_context = ".imagepaint"  # dot on purpose (access from topbar)
1190     bl_label = "Symmetry"
1191     bl_options = {'DEFAULT_CLOSED'}
1192
1193     def draw(self, context):
1194         layout = self.layout
1195
1196         toolsettings = context.tool_settings
1197         ipaint = toolsettings.image_paint
1198
1199         split = layout.split()
1200
1201         col = split.column()
1202         col.alignment = 'RIGHT'
1203         col.label(text="Mirror")
1204
1205         col = split.column()
1206
1207         row = col.row(align=True)
1208         row.prop(ipaint, "use_symmetry_x", text="X", toggle=True)
1209         row.prop(ipaint, "use_symmetry_y", text="Y", toggle=True)
1210         row.prop(ipaint, "use_symmetry_z", text="Z", toggle=True)
1211
1212
1213 # TODO, move to space_view3d.py
1214 class VIEW3D_PT_tools_projectpaint(View3DPaintPanel, Panel):
1215     bl_context = ".imagepaint"  # dot on purpose (access from topbar)
1216     bl_label = "Project Paint"
1217
1218     @classmethod
1219     def poll(cls, context):
1220         brush = context.tool_settings.image_paint.brush
1221         return (brush is not None)
1222
1223     def draw(self, context):
1224         layout = self.layout
1225
1226         toolsettings = context.tool_settings
1227         ipaint = toolsettings.image_paint
1228
1229         col = layout.column()
1230
1231         col.prop(ipaint, "use_occlude")
1232         col.prop(ipaint, "use_backface_culling")
1233
1234         row = layout.row()
1235         row.prop(ipaint, "use_normal_falloff")
1236
1237         sub = row.row()
1238         sub.active = (ipaint.use_normal_falloff)
1239         sub.prop(ipaint, "normal_angle", text="")
1240
1241         layout.prop(ipaint, "use_cavity")
1242         if ipaint.use_cavity:
1243             layout.template_curve_mapping(ipaint, "cavity_curve", brush=True)
1244
1245         layout.prop(ipaint, "seam_bleed")
1246         layout.prop(ipaint, "dither")
1247         self.unified_paint_settings(layout, context)
1248
1249
1250 # TODO, move to space_view3d.py
1251 class VIEW3D_PT_imagepaint_options(View3DPaintPanel):
1252     bl_label = "Options"
1253
1254     @classmethod
1255     def poll(cls, context):
1256         return (context.image_paint_object and context.tool_settings.image_paint)
1257
1258     def draw(self, context):
1259         layout = self.layout
1260
1261         col = layout.column()
1262         self.unified_paint_settings(col, context)
1263
1264
1265 class VIEW3D_MT_tools_projectpaint_stencil(Menu):
1266     bl_label = "Mask Layer"
1267
1268     def draw(self, context):
1269         layout = self.layout
1270         for i, uv_layer in enumerate(context.active_object.data.uv_layers):
1271             props = layout.operator("wm.context_set_int", text=uv_layer.name, translate=False)
1272             props.data_path = "active_object.data.uv_layer_stencil_index"
1273             props.value = i
1274
1275
1276 # TODO, move to space_view3d.py
1277 class VIEW3D_PT_tools_particlemode(View3DPanel, Panel):
1278     """Default tools for particle mode"""
1279     bl_context = ".particlemode"
1280     bl_label = "Options"
1281
1282     def draw(self, context):
1283         layout = self.layout
1284
1285         pe = context.tool_settings.particle_edit
1286         ob = pe.object
1287
1288         layout.prop(pe, "type", text="")
1289
1290         ptcache = None
1291
1292         if pe.type == 'PARTICLES':
1293             if ob.particle_systems:
1294                 if len(ob.particle_systems) > 1:
1295                     layout.template_list("UI_UL_list", "particle_systems", ob, "particle_systems",
1296                                          ob.particle_systems, "active_index", rows=2, maxrows=3)
1297
1298                 ptcache = ob.particle_systems.active.point_cache
1299         else:
1300             for md in ob.modifiers:
1301                 if md.type == pe.type:
1302                     ptcache = md.point_cache
1303
1304         if ptcache and len(ptcache.point_caches) > 1:
1305             layout.template_list("UI_UL_list", "particles_point_caches", ptcache, "point_caches",
1306                                  ptcache.point_caches, "active_index", rows=2, maxrows=3)
1307
1308         if not pe.is_editable:
1309             layout.label(text="Point cache must be baked")
1310             layout.label(text="in memory to enable editing!")
1311
1312         col = layout.column(align=True)
1313         if pe.is_hair:
1314             col.active = pe.is_editable
1315             col.prop(pe, "use_emitter_deflect", text="Deflect Emitter")
1316             sub = col.row(align=True)
1317             sub.active = pe.use_emitter_deflect
1318             sub.prop(pe, "emitter_distance", text="Distance")
1319
1320         col = layout.column(align=True)
1321         col.active = pe.is_editable
1322         col.label(text="Keep:")
1323         col.prop(pe, "use_preserve_length", text="Lengths")
1324         col.prop(pe, "use_preserve_root", text="Root")
1325         if not pe.is_hair:
1326             col.label(text="Correct:")
1327             col.prop(pe, "use_auto_velocity", text="Velocity")
1328         col.prop(ob.data, "use_mirror_x")
1329
1330         col.prop(pe, "shape_object")
1331         col.operator("particle.shape_cut")
1332
1333         col = layout.column(align=True)
1334         col.active = pe.is_editable
1335         col.label(text="Draw:")
1336         col.prop(pe, "draw_step", text="Path Steps")
1337         if pe.is_hair:
1338             col.prop(pe, "show_particles", text="Children")
1339         else:
1340             if pe.type == 'PARTICLES':
1341                 col.prop(pe, "show_particles", text="Particles")
1342             col.prop(pe, "use_fade_time")
1343             sub = col.row(align=True)
1344             sub.active = pe.use_fade_time
1345             sub.prop(pe, "fade_frames", slider=True)
1346
1347
1348 # Grease Pencil drawing tools
1349 class VIEW3D_PT_tools_grease_pencil_draw(GreasePencilDrawingToolsPanel, Panel):
1350     bl_space_type = 'VIEW_3D'
1351
1352
1353 # Grease Pencil stroke editing tools
1354 class VIEW3D_PT_tools_grease_pencil_edit(GreasePencilStrokeEditPanel, Panel):
1355     bl_space_type = 'VIEW_3D'
1356
1357
1358 # Grease Pencil stroke interpolation tools
1359 class VIEW3D_PT_tools_grease_pencil_interpolate(GreasePencilInterpolatePanel, Panel):
1360     bl_space_type = 'VIEW_3D'
1361
1362
1363 # Grease Pencil stroke sculpting tools
1364 class VIEW3D_PT_tools_grease_pencil_sculpt(GreasePencilStrokeSculptPanel, Panel):
1365     bl_space_type = 'VIEW_3D'
1366
1367
1368 # Grease Pencil drawing brushes
1369 class VIEW3D_PT_tools_grease_pencil_brush(GreasePencilBrushPanel, Panel):
1370     bl_space_type = 'VIEW_3D'
1371
1372 # Grease Pencil drawingcurves
1373
1374
1375 class VIEW3D_PT_tools_grease_pencil_brushcurves(GreasePencilBrushCurvesPanel, Panel):
1376     bl_space_type = 'VIEW_3D'
1377
1378
1379 classes = (
1380     VIEW3D_PT_tools_meshedit_options,
1381     VIEW3D_PT_tools_curveedit_options_stroke,
1382     VIEW3D_PT_tools_armatureedit_options,
1383     VIEW3D_PT_tools_posemode_options,
1384     VIEW3D_PT_imapaint_tools_missing,
1385     VIEW3D_PT_tools_brush,
1386     TEXTURE_UL_texpaintslots,
1387     VIEW3D_MT_tools_projectpaint_uvlayer,
1388     VIEW3D_PT_slots_projectpaint,
1389     VIEW3D_PT_stencil_projectpaint,
1390     VIEW3D_PT_tools_brush_overlay,
1391     VIEW3D_PT_tools_brush_texture,
1392     VIEW3D_PT_tools_mask_texture,
1393     VIEW3D_PT_tools_brush_stroke,
1394     VIEW3D_PT_tools_brush_curve,
1395     VIEW3D_PT_sculpt_dyntopo,
1396     VIEW3D_PT_sculpt_options,
1397     VIEW3D_PT_sculpt_symmetry,
1398     VIEW3D_PT_tools_brush_appearance,
1399     VIEW3D_PT_tools_weightpaint_symmetry,
1400     VIEW3D_PT_tools_weightpaint_options,
1401     VIEW3D_PT_tools_vertexpaint,
1402     VIEW3D_PT_tools_vertexpaint_symmetry,
1403     VIEW3D_PT_tools_imagepaint_external,
1404     VIEW3D_PT_tools_imagepaint_symmetry,
1405     VIEW3D_PT_tools_projectpaint,
1406     VIEW3D_MT_tools_projectpaint_stencil,
1407     VIEW3D_PT_tools_particlemode,
1408     VIEW3D_PT_tools_grease_pencil_draw,
1409     VIEW3D_PT_tools_grease_pencil_edit,
1410     VIEW3D_PT_tools_grease_pencil_interpolate,
1411     VIEW3D_PT_tools_grease_pencil_sculpt,
1412     VIEW3D_PT_tools_grease_pencil_brush,
1413     VIEW3D_PT_tools_grease_pencil_brushcurves,
1414 )
1415
1416 if __name__ == "__main__":  # only for live edit.
1417     from bpy.utils import register_class
1418     for cls in classes:
1419         register_class(cls)