Merge branch 'blender2.8' into soc-2018-bevel
authorBastien Montagne <montagne29@wanadoo.fr>
Wed, 1 Aug 2018 12:16:41 +0000 (14:16 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Wed, 1 Aug 2018 12:16:41 +0000 (14:16 +0200)
Conflicts:
release/scripts/addons
release/scripts/startup/bl_ui/space_view3d_toolbar.py
source/blender/editors/space_outliner/outliner_draw.c

13 files changed:
1  2 
release/scripts/modules/bpy_extras/keyconfig_utils.py
release/scripts/startup/bl_ui/properties_data_modifier.py
release/scripts/startup/bl_ui/space_view3d.py
release/scripts/startup/bl_ui/space_view3d_toolbar.py
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/mesh/mesh_ops.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/space_outliner/outliner_draw.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_ops.c
source/blender/makesdna/DNA_scene_types.h
source/blender/makesrna/RNA_access.h
source/blender/makesrna/intern/rna_scene.c

@@@ -1570,25 -1567,445 +1575,461 @@@ class DATA_PT_modifiers(ModifierButtons
          if md.rest_source == 'BIND':
              layout.operator("object.correctivesmooth_bind", text="Unbind" if is_bind else "Bind")
  
 +    def WEIGHTED_NORMAL(self, layout, ob, md):
 +        layout.label("Weighting Mode:")
 +        split = layout.split(align=True)
 +        col = split.column(align=True)
 +        col.prop(md, "mode", text="")
 +        col.prop(md, "weight", text="Weight")
 +        col.prop(md, "keep_sharp")
 +
 +        col = split.column(align=True)
 +        row = col.row(align=True)
 +        row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
 +        row.active = bool(md.vertex_group)
 +        row.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
 +        col.prop(md, "thresh", text="Threshold")
 +        col.prop(md, "face_influence")
 +
  
+ class DATA_PT_gpencil_modifiers(ModifierButtonsPanel, Panel):
+     bl_label = "Modifiers"
+     @classmethod
+     def poll(cls, context):
+         ob = context.object
+         return ob and ob.type == 'GPENCIL'
+     def draw(self, context):
+         layout = self.layout
+         ob = context.object
+         layout.operator_menu_enum("object.gpencil_modifier_add", "type")
+         for md in ob.grease_pencil_modifiers:
+             box = layout.template_greasepencil_modifier(md)
+             if box:
+                 # match enum type to our functions, avoids a lookup table.
+                 getattr(self, md.type)(box, ob, md)
+     # the mt.type enum is (ab)used for a lookup on function names
+     # ...to avoid lengthy if statements
+     # so each type must have a function here.
+     def GP_NOISE(self, layout, ob, md):
+         gpd = ob.data
+         split = layout.split()
+         col = split.column()
+         row = col.row(align=True)
+         row.prop(md, "factor")
+         row.prop(md, "random", text="", icon="TIME", toggle=True)
+         row = col.row()
+         row.enabled = md.random
+         row.prop(md, "step")
+         col.prop(md, "full_stroke")
+         col.prop(md, "move_extreme")
+         col = split.column()
+         col.label("Layer:")
+         row = col.row(align=True)
+         row.prop_search(md, "layer", gpd, "layers", text="", icon='GREASEPENCIL')
+         row.prop(md, "invert_layers", text="", icon="ARROW_LEFTRIGHT")
+         col.label("Vertex Group:")
+         row = col.row(align=True)
+         row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
+         row.prop(md, "invert_vertex", text="", icon="ARROW_LEFTRIGHT")
+         row = col.row(align=True)
+         row.prop(md, "pass_index", text="Pass")
+         row.prop(md, "invert_pass", text="", icon="ARROW_LEFTRIGHT")
+         row = layout.row(align=True)
+         row.label("Affect:")
+         row = layout.row(align=True)
+         row.prop(md, "affect_position", text="Position", icon='MESH_DATA', toggle=True)
+         row.prop(md, "affect_strength", text="Strength", icon='COLOR', toggle=True)
+         row.prop(md, "affect_thickness", text="Thickness", icon='LINE_DATA', toggle=True)
+         row.prop(md, "affect_uv", text="UV", icon='MOD_UVPROJECT', toggle=True)
+     def GP_SMOOTH(self, layout, ob, md):
+         gpd = ob.data
+         row = layout.row(align=False)
+         row.prop(md, "factor")
+         row.prop(md, "step")
+         split = layout.split()
+         col = split.column()
+         col.label("Layer:")
+         row = col.row(align=True)
+         row.prop_search(md, "layer", gpd, "layers", text="", icon='GREASEPENCIL')
+         row.prop(md, "invert_layers", text="", icon="ARROW_LEFTRIGHT")
+         col = split.column()
+         col.label("Vertex Group:")
+         row = col.row(align=True)
+         row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
+         row.prop(md, "invert_vertex", text="", icon="ARROW_LEFTRIGHT")
+         row = col.row(align=True)
+         row.prop(md, "pass_index", text="Pass")
+         row.prop(md, "invert_pass", text="", icon="ARROW_LEFTRIGHT")
+         row = layout.row(align=True)
+         row.label("Affect:")
+         row = layout.row(align=True)
+         row.prop(md, "affect_position", text="Position", icon='MESH_DATA', toggle=True)
+         row.prop(md, "affect_strength", text="Strength", icon='COLOR', toggle=True)
+         row.prop(md, "affect_thickness", text="Thickness", icon='LINE_DATA', toggle=True)
+         row.prop(md, "affect_uv", text="UV", icon='MOD_UVPROJECT', toggle=True)
+     def GP_SUBDIV(self, layout, ob, md):
+         gpd = ob.data
+         split = layout.split()
+         col = split.column()
+         row = col.row(align=True)
+         row.prop(md, "level")
+         row.prop(md, "simple", text="", icon="PARTICLE_POINT")
+         row = col.row(align=True)
+         row.prop(md, "pass_index", text="Pass")
+         row.prop(md, "invert_pass", text="", icon="ARROW_LEFTRIGHT")
+         col = split.column()
+         col.label("Layer:")
+         row = col.row(align=True)
+         row.prop_search(md, "layer", gpd, "layers", text="", icon='GREASEPENCIL')
+         row.prop(md, "invert_layers", text="", icon="ARROW_LEFTRIGHT")
+     def GP_SIMPLIFY(self, layout, ob, md):
+         gpd = ob.data
+         row = layout.row()
+         row.prop(md, "mode")
+         split = layout.split()
+         col = split.column()
+         col.label("Settings:")
+         row = col.row(align=True)
+         row.enabled = md.mode == 'FIXED'
+         row.prop(md, "step")
+         row = col.row(align=True)
+         row.enabled = not md.mode == 'FIXED'
+         row.prop(md, "factor")
+         col = split.column()
+         col.label("Layer:")
+         row = col.row(align=True)
+         row.prop_search(md, "layer", gpd, "layers", text="", icon='GREASEPENCIL')
+         row = col.row(align=True)
+         row.prop(md, "pass_index", text="Pass")
+         row.prop(md, "invert_pass", text="", icon="ARROW_LEFTRIGHT")
+     def GP_THICK(self, layout, ob, md):
+         gpd = ob.data
+         split = layout.split()
+         col = split.column()
+         row = col.row(align=True)
+         row.prop(md, "thickness")
+         row = col.row(align=True)
+         row.prop(md, "pass_index", text="Pass")
+         row.prop(md, "invert_pass", text="", icon="ARROW_LEFTRIGHT")
+         col.prop(md, "normalize_thickness")
+         col = split.column()
+         col.label("Layer:")
+         row = col.row(align=True)
+         row.prop_search(md, "layer", gpd, "layers", text="", icon='GREASEPENCIL')
+         row.prop(md, "invert_layers", text="", icon="ARROW_LEFTRIGHT")
+         col.label("Vertex Group:")
+         row = col.row(align=True)
+         row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
+         row.prop(md, "invert_vertex", text="", icon="ARROW_LEFTRIGHT")
+         if not md.normalize_thickness:
+             split = layout.split()
+             col = split.column()
+             col.prop(md, "use_custom_curve")
+             if md.use_custom_curve:
+                 col.template_curve_mapping(md, "curve")
+     def GP_TINT(self, layout, ob, md):
+         gpd = ob.data
+         split = layout.split()
+         col = split.column()
+         col.prop(md, "color")
+         col.prop(md, "factor")
+         col = split.column()
+         col.label("Layer:")
+         row = col.row(align=True)
+         row.prop_search(md, "layer", gpd, "layers", text="", icon='GREASEPENCIL')
+         row.prop(md, "invert_layers", text="", icon="ARROW_LEFTRIGHT")
+         row = col.row(align=True)
+         row.prop(md, "pass_index", text="Pass")
+         row.prop(md, "invert_pass", text="", icon="ARROW_LEFTRIGHT")
+         row = layout.row()
+         row.prop(md, "create_colors")
+     def GP_COLOR(self, layout, ob, md):
+         gpd = ob.data
+         split = layout.split()
+         col = split.column()
+         col.label("Color:")
+         col.prop(md, "hue", text="H")
+         col.prop(md, "saturation", text="S")
+         col.prop(md, "value", text="V")
+         col = split.column()
+         col.label("Layer:")
+         row = col.row(align=True)
+         row.prop_search(md, "layer", gpd, "layers", text="", icon='GREASEPENCIL')
+         row.prop(md, "invert_layers", text="", icon="ARROW_LEFTRIGHT")
+         row = col.row(align=True)
+         row.prop(md, "pass_index", text="Pass")
+         row.prop(md, "invert_pass", text="", icon="ARROW_LEFTRIGHT")
+         row = layout.row()
+         row.prop(md, "create_colors")
+     def GP_OPACITY(self, layout, ob, md):
+         gpd = ob.data
+         split = layout.split()
+         col = split.column()
+         col.label("Opacity:")
+         col.prop(md, "factor")
+         col = split.column()
+         col.label("Layer:")
+         row = col.row(align=True)
+         row.prop_search(md, "layer", gpd, "layers", text="", icon='GREASEPENCIL')
+         row.prop(md, "invert_layers", text="", icon="ARROW_LEFTRIGHT")
+         col.label("Vertex Group:")
+         row = col.row(align=True)
+         row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
+         row.prop(md, "invert_vertex", text="", icon="ARROW_LEFTRIGHT")
+         row = col.row(align=True)
+         row.prop(md, "pass_index", text="Pass")
+         row.prop(md, "invert_pass", text="", icon="ARROW_LEFTRIGHT")
+     def GP_INSTANCE(self, layout, ob, md):
+         gpd = ob.data
+         col = layout.column()
+         col.prop(md, "count")
+         col.prop(md, "use_make_objects")
+         split = layout.split()
+         col = split.column()
+         col.label("Offset:")
+         col.prop(md, "offset", text="")
+         col = split.column()
+         col.label("Shift:")
+         col.prop(md, "shift", text="")
+         row = col.row(align=True)
+         row.prop(md, "lock_axis", expand=True)
+         split = layout.split()
+         col = split.column()
+         col.label("Rotation:")
+         col.prop(md, "rotation", text="")
+         col.separator()
+         row = col.row(align=True)
+         row.prop(md, "random_rot", text="", icon="TIME", toggle=True)
+         row.prop(md, "rot_factor", text="")
+         col = split.column()
+         col.label("Scale:")
+         col.prop(md, "scale", text="")
+         col.separator()
+         row = col.row(align=True)
+         row.prop(md, "random_scale", text="", icon="TIME", toggle=True)
+         row.prop(md, "scale_factor", text="")
+         split = layout.split()
+         col = split.column()
+         col.label("Layer:")
+         row = col.row(align=True)
+         row.prop_search(md, "layer", gpd, "layers", text="", icon='GREASEPENCIL')
+         row.prop(md, "invert_layers", text="", icon="ARROW_LEFTRIGHT")
+         row = col.row(align=True)
+         row.prop(md, "pass_index", text="Pass")
+         row.prop(md, "invert_pass", text="", icon="ARROW_LEFTRIGHT")
+     def GP_BUILD(self, layout, ob, md):
+         gpd = ob.data
+         split = layout.split()
+         col = split.column()
+         col.prop(md, "mode")
+         if md.mode == 'CONCURRENT':
+             col.prop(md, "concurrent_time_alignment")
+         else:
+             col.separator()  # For spacing
+             col.separator()
+         col.separator()
+         col.prop(md, "transition")
+         sub = col.column(align=True)
+         sub.prop(md, "start_delay")
+         sub.prop(md, "length")
+         col = split.column(align=True)
+         col.prop(md, "use_restrict_frame_range")
+         sub = col.column(align=True)
+         sub.active = md.use_restrict_frame_range
+         sub.prop(md, "frame_start", text="Start")
+         sub.prop(md, "frame_end", text="End")
+         col.separator()
+         col.label("Layer:")
+         row = col.row(align=True)
+         row.prop_search(md, "layer", gpd, "layers", text="", icon='GREASEPENCIL')
+         row.prop(md, "invert_layers", text="", icon="ARROW_LEFTRIGHT")
+     def GP_LATTICE(self, layout, ob, md):
+         gpd = ob.data
+         split = layout.split()
+         col = split.column()
+         col.label(text="Object:")
+         col.prop(md, "object", text="")
+         col = split.column()
+         col.label("Layer:")
+         row = col.row(align=True)
+         row.prop_search(md, "layer", gpd, "layers", text="", icon='GREASEPENCIL')
+         row.prop(md, "invert_layers", text="", icon="ARROW_LEFTRIGHT")
+         col.label("Vertex Group:")
+         row = col.row(align=True)
+         row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
+         row.prop(md, "invert_vertex", text="", icon="ARROW_LEFTRIGHT")
+         row = col.row(align=True)
+         row.prop(md, "pass_index", text="Pass")
+         row.prop(md, "invert_pass", text="", icon="ARROW_LEFTRIGHT")
+         layout.separator()
+         layout.prop(md, "strength", slider=True)
+     def GP_MIRROR(self, layout, ob, md):
+         gpd = ob.data
+         row = layout.row(align=True)
+         row.prop(md, "x_axis")
+         row.prop(md, "y_axis")
+         row.prop(md, "z_axis")
+         # GPXX: Not implemented yet
+         # layout.separator()
+         # layout.prop(md, "clip")
+         layout.label("Layer:")
+         row = layout.row(align=True)
+         row.prop_search(md, "layer", gpd, "layers", text="", icon='GREASEPENCIL')
+         row.prop(md, "invert_layers", text="", icon="ARROW_LEFTRIGHT")
+         row = layout.row(align=True)
+         row.prop(md, "pass_index", text="Pass")
+         row.prop(md, "invert_pass", text="", icon="ARROW_LEFTRIGHT")
+         layout.label(text="Object:")
+         layout.prop(md, "object", text="")
+     def GP_HOOK(self, layout, ob, md):
+         gpd = ob.data
+         split = layout.split()
+         col = split.column()
+         col.label(text="Object:")
+         col.prop(md, "object", text="")
+         if md.object and md.object.type == 'ARMATURE':
+             col.label(text="Bone:")
+             col.prop_search(md, "subtarget", md.object.data, "bones", text="")
+         col = split.column()
+         col.label("Layer:")
+         row = col.row(align=True)
+         row.prop_search(md, "layer", gpd, "layers", text="", icon='GREASEPENCIL')
+         row.prop(md, "invert_layers", text="", icon="ARROW_LEFTRIGHT")
+         col.label("Vertex Group:")
+         row = col.row(align=True)
+         row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
+         row.prop(md, "invert_vertex", text="", icon="ARROW_LEFTRIGHT")
+         row = col.row(align=True)
+         row.prop(md, "pass_index", text="Pass")
+         row.prop(md, "invert_pass", text="", icon="ARROW_LEFTRIGHT")
+         use_falloff = (md.falloff_type != 'NONE')
+         split = layout.split()
+         layout.separator()
+         row = layout.row(align=True)
+         if use_falloff:
+             row.prop(md, "falloff_radius")
+         row.prop(md, "strength", slider=True)
+         layout.prop(md, "falloff_type")
+         col = layout.column()
+         if use_falloff:
+             if md.falloff_type == 'CURVE':
+                 col.template_curve_mapping(md, "falloff_curve")
+         split = layout.split()
+         col = split.column()
+         col.prop(md, "use_falloff_uniform")
+     def GP_OFFSET(self, layout, ob, md):
+         gpd = ob.data
+         split = layout.split()
+         col = split.column()
+         col.prop(md, "location")
+         col.prop(md, "scale")
+         col = split.column()
+         col.prop(md, "rotation")
+         col.label("Layer:")
+         row = col.row(align=True)
+         row.prop_search(md, "layer", gpd, "layers", text="", icon='GREASEPENCIL')
+         row.prop(md, "invert_layers", text="", icon="ARROW_LEFTRIGHT")
+         col.label("Vertex Group:")
+         row = col.row(align=True)
+         row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
+         row.prop(md, "invert_vertex", text="", icon="ARROW_LEFTRIGHT")
+         row = col.row(align=True)
+         row.prop(md, "pass_index", text="Pass")
+         row.prop(md, "invert_pass", text="", icon="ARROW_LEFTRIGHT")
  classes = (
      DATA_PT_modifiers,
+     DATA_PT_gpencil_modifiers,
  )
  
  if __name__ == "__main__":  # only for live edit.
@@@ -1341,29 -1349,272 +1349,293 @@@ class VIEW3D_PT_tools_particlemode(View
              sub.prop(pe, "fade_frames", slider=True)
  
  
- # Grease Pencil drawing tools
- class VIEW3D_PT_tools_grease_pencil_draw(GreasePencilDrawingToolsPanel, Panel):
 +class VIEW3D_PT_tools_normal(View3DPanel, Panel):
 +    bl_category = ""
 +    bl_context = ".mesh_edit"
 +    bl_label = "Normal Tools"
 +
 +    def draw(self, context):
 +        layout = self.layout
 +        toolsettings = context.tool_settings
 +
 +        col = layout.column(align=True)
 +        col.label(text="Normal Vector")
 +        col.prop(toolsettings, "normal_vector", text="")
 +
 +        layout.separator()
 +        layout.label(text="Face Strength")
 +        layout.prop(toolsettings, "face_strength", text="")
 +
 +        col = layout.column(align=True)
 +
 +
+ # ********** grease pencil object tool panels ****************
+ # Grease Pencil drawing brushes
+ class VIEW3D_PT_tools_grease_pencil_brush(View3DPanel, Panel):
+     bl_context = ".greasepencil_paint"
+     bl_label = "Brush"
+     @classmethod
+     def poll(cls, context):
+         is_3d_view = context.space_data.type == 'VIEW_3D'
+         if is_3d_view:
+             if context.gpencil_data is None:
+                 return False
+             gpd = context.gpencil_data
+             return bool(gpd.is_stroke_paint_mode)
+         else:
+             return True
+     @staticmethod
+     def draw(self, context):
+         layout = self.layout
+         layout.use_property_split = True
+         layout.use_property_decorate = False
+         ts = context.scene.tool_settings
+         settings = ts.gpencil_paint
+         row = layout.row()
+         col = row.column()
+         col.template_ID_preview(settings, "brush", new="brush.add_gpencil", rows=3, cols=8)
+         col = row.column()
+         brush = context.active_gpencil_brush
+         gp_settings = brush.gpencil_settings
+         sub = col.column(align=True)
+         sub.operator("gpencil.brush_presets_create", icon='HELP', text="")
+         if brush is not None:
+             # XXX: Items in "sub" currently show up beside the brush selector in a separate column
+             if gp_settings.gpencil_brush_type == 'ERASE':
+                 sub.prop(gp_settings, "default_eraser", text="")
+             # Brush details
+             if gp_settings.gpencil_brush_type == 'ERASE':
+                 col = layout.column(align=True)
+                 col.prop(brush, "size", text="Radius")
+                 col.separator()
+                 row = col.row()
+                 row.prop(gp_settings, "eraser_mode", expand=True)
+             elif gp_settings.gpencil_brush_type == 'FILL':
+                 col = layout.column(align=True)
+                 col.prop(gp_settings, "gpencil_fill_leak", text="Leak Size")
+                 col.prop(brush, "size", text="Thickness")
+                 col.prop(gp_settings, "gpencil_fill_simplyfy_level", text="Simplify")
+                 col = layout.row(align=True)
+                 col.template_ID(gp_settings, "material")
+                 row = layout.row(align=True)
+                 row.prop(gp_settings, "gpencil_fill_draw_mode", text="Boundary Draw Mode")
+                 row.prop(gp_settings, "gpencil_fill_show_boundary", text="", icon='GRID')
+                 col = layout.column(align=True)
+                 col.enabled = gp_settings.gpencil_fill_draw_mode != "STROKE"
+                 col.prop(gp_settings, "gpencil_fill_hide", text="Hide Transparent Lines")
+                 sub = col.row(align=True)
+                 sub.enabled = gp_settings.gpencil_fill_hide
+                 sub.prop(gp_settings, "gpencil_fill_threshold", text="Threshold")
+             else:  # bgpsettings.gpencil_brush_type == 'DRAW':
+                 row = layout.row(align=True)
+                 row.prop(brush, "size", text="Radius")
+                 row.prop(gp_settings, "use_pressure", text="", icon='STYLUS_PRESSURE')
+                 row = layout.row(align=True)
+                 row.prop(gp_settings, "pen_strength", slider=True)
+                 row.prop(gp_settings, "use_strength_pressure", text="", icon='STYLUS_PRESSURE')
+                 row = layout.row(align=True)
+                 row.template_ID(gp_settings, "material")
+ # Grease Pencil drawing brushes options
+ class VIEW3D_PT_tools_grease_pencil_brush_option(View3DPanel, Panel):
+     bl_context = ".greasepencil_paint"
+     bl_label = "Options"
+     bl_options = {'DEFAULT_CLOSED'}
+     def draw_header_preset(self, context):
+         VIEW3D_PT_gpencil_brush_presets.draw_panel_header(self.layout)
+     @staticmethod
+     def draw(self, context):
+         layout = self.layout
+         layout.use_property_split = True
+         layout.use_property_decorate = False
+         brush = context.active_gpencil_brush
+         gp_settings = brush.gpencil_settings
+         if brush is not None:
+             col = layout.column(align=True)
+             col.prop(gp_settings, "input_samples")
+             col.separator()
+             col.prop(gp_settings, "active_smooth_factor")
+             col.separator()
+             col.prop(gp_settings, "angle", slider=True)
+             col.prop(gp_settings, "angle_factor", text="Factor", slider=True)
+             col.separator()
+ class VIEW3D_PT_tools_grease_pencil_brush_stabilizer(View3DPanel, Panel):
+     bl_context = ".greasepencil_paint"
+     bl_parent_id = 'VIEW3D_PT_tools_grease_pencil_brush_option'
+     bl_label = "Stabilizer"
+     bl_options = {'DEFAULT_CLOSED'}
+     @classmethod
+     def poll(cls, context):
+         brush = context.active_gpencil_brush
+         gp_settings = brush.gpencil_settings
+         return brush is not None and gp_settings.gpencil_brush_type == 'DRAW'
+     def draw_header(self, context):
+         brush = context.active_gpencil_brush
+         gp_settings = brush.gpencil_settings
+         self.layout.prop(gp_settings, "use_stabilizer", text="")
+     @staticmethod
+     def draw(self, context):
+         layout = self.layout
+         layout.use_property_split = True
+         layout.use_property_decorate = False
+         brush = context.active_gpencil_brush
+         gp_settings = brush.gpencil_settings
+         layout.active = gp_settings.use_stabilizer
+         layout.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
+         layout.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
+ class VIEW3D_PT_tools_grease_pencil_brush_settings(View3DPanel, Panel):
+     bl_context = ".greasepencil_paint"
+     bl_parent_id = 'VIEW3D_PT_tools_grease_pencil_brush_option'
+     bl_label = "Post-processing Settings"
+     bl_options = {'DEFAULT_CLOSED'}
+     @classmethod
+     def poll(cls, context):
+         brush = context.active_gpencil_brush
+         return brush is not None
+     def draw_header(self, context):
+         brush = context.active_gpencil_brush
+         gp_settings = brush.gpencil_settings
+         self.layout.prop(gp_settings, "enable_settings", text="")
+     @staticmethod
+     def draw(self, context):
+         layout = self.layout
+         layout.use_property_split = True
+         layout.use_property_decorate = False
+         brush = context.active_gpencil_brush
+         gp_settings = brush.gpencil_settings
+         layout.active = gp_settings.enable_settings
+         layout.prop(gp_settings, "pen_smooth_factor")
+         layout.prop(gp_settings, "pen_smooth_steps")
+         layout.prop(gp_settings, "pen_thick_smooth_factor")
+         layout.prop(gp_settings, "pen_thick_smooth_steps")
+         layout.prop(gp_settings, "pen_subdivision_steps")
+         layout.prop(gp_settings, "random_subdiv", text="Randomness", slider=True)
+ class VIEW3D_PT_tools_grease_pencil_brush_random(View3DPanel, Panel):
+     bl_context = ".greasepencil_paint"
+     bl_parent_id = 'VIEW3D_PT_tools_grease_pencil_brush_option'
+     bl_label = "Random Settings"
+     bl_options = {'DEFAULT_CLOSED'}
+     @classmethod
+     def poll(cls, context):
+         brush = context.active_gpencil_brush
+         return brush is not None
+     def draw_header(self, context):
+         brush = context.active_gpencil_brush
+         gp_settings = brush.gpencil_settings
+         self.layout.prop(gp_settings, "enable_random", text="")
+     @staticmethod
+     def draw(self, context):
+         layout = self.layout
+         layout.use_property_split = True
+         layout.use_property_decorate = False
+         brush = context.active_gpencil_brush
+         gp_settings = brush.gpencil_settings
+         layout.active = gp_settings.enable_random
+         layout.prop(gp_settings, "random_pressure", text="Pressure", slider=True)
+         layout.prop(gp_settings, "random_strength", text="Strength", slider=True)
+         layout.prop(gp_settings, "uv_random", text="UV", slider=True)
+         row = layout.row(align=True)
+         row.prop(gp_settings, "pen_jitter", slider=True)
+         row.prop(gp_settings, "use_jitter_pressure", text="", icon='STYLUS_PRESSURE')
+ # Grease Pencil drawingcurves
+ class VIEW3D_PT_tools_grease_pencil_brushcurves(View3DPanel, Panel):
+     bl_context = ".greasepencil_paint"
+     bl_label = "Curves"
+     bl_options = {'DEFAULT_CLOSED'}
+     @staticmethod
+     def draw(self, context):
+         layout = self.layout
+         layout.use_property_split = True
+         brush = context.active_gpencil_brush
+         gp_settings = brush.gpencil_settings
+         # Brush
+         layout.label("Sensitivity")
+         layout.template_curve_mapping(gp_settings, "curve_sensitivity", brush=True)
+         layout.label("Strength")
+         layout.template_curve_mapping(gp_settings, "curve_strength", brush=True)
+         layout.label("Jitter")
+         layout.template_curve_mapping(gp_settings, "curve_jitter", brush=True)
+ # Grease Pencil create shapes
+ class VIEW3D_PT_tools_grease_pencil_shapes(View3DPanel, Panel):
++>>>>>>> blender2.8
      bl_space_type = 'VIEW_3D'
+     bl_region_type = 'HEADER'
+     bl_label = "Shapes"
+     @classmethod
+     def poll(cls, context):
+         ob = context.active_object
+         return ob and ob.type == 'GPENCIL'
+     @staticmethod
+     def draw(self, context):
+         layout = self.layout
+         layout.use_property_split = True
+         col = layout.column(align=True)
+         col.operator("gpencil.primitive", text="Line", icon='IPO_CONSTANT').type = 'LINE'
+         col.operator("gpencil.primitive", text="Rectangle", icon='UV_FACESEL').type = 'BOX'
+         col.operator("gpencil.primitive", text="Circle", icon='ANTIALIASED').type = 'CIRCLE'
+         layout.operator("object.gpencil_add", text="Monkey", icon='MONKEY').type = 'MONKEY'
  
  
  # Grease Pencil stroke editing tools
@@@ -1421,13 -1757,21 +1778,22 @@@ classes = 
      VIEW3D_PT_tools_projectpaint,
      VIEW3D_MT_tools_projectpaint_stencil,
      VIEW3D_PT_tools_particlemode,
-     VIEW3D_PT_tools_grease_pencil_draw,
-     VIEW3D_PT_tools_grease_pencil_edit,
-     VIEW3D_PT_tools_grease_pencil_interpolate,
-     VIEW3D_PT_tools_grease_pencil_sculpt,
+     VIEW3D_PT_gpencil_brush_presets,
      VIEW3D_PT_tools_grease_pencil_brush,
+     VIEW3D_PT_tools_grease_pencil_brush_option,
+     VIEW3D_PT_tools_grease_pencil_brush_settings,
+     VIEW3D_PT_tools_grease_pencil_brush_stabilizer,
+     VIEW3D_PT_tools_grease_pencil_brush_random,
      VIEW3D_PT_tools_grease_pencil_brushcurves,
+     VIEW3D_PT_tools_grease_pencil_shapes,
+     VIEW3D_PT_tools_grease_pencil_sculpt,
+     VIEW3D_PT_tools_grease_pencil_weight_paint,
+     VIEW3D_PT_tools_grease_pencil_paint_appearance,
+     VIEW3D_PT_tools_grease_pencil_sculpt_appearance,
+     VIEW3D_PT_tools_grease_pencil_weight_appearance,
+     VIEW3D_PT_tools_grease_pencil_interpolate,
 +    VIEW3D_PT_tools_normal,
  )
  
  if __name__ == "__main__":  # only for live edit.
@@@ -969,157 -942,212 +942,213 @@@ static void tselem_draw_icon
                        case TSE_MODIFIER:
                        {
                                Object *ob = (Object *)tselem->id;
-                               ModifierData *md = BLI_findlink(&ob->modifiers, tselem->nr);
-                               switch ((ModifierType)md->type) {
-                                       case eModifierType_Subsurf:
-                                               ICON_DRAW(ICON_MOD_SUBSURF);
-                                               break;
-                                       case eModifierType_Armature:
-                                               ICON_DRAW(ICON_MOD_ARMATURE);
-                                               break;
-                                       case eModifierType_Lattice:
-                                               ICON_DRAW(ICON_MOD_LATTICE);
-                                               break;
-                                       case eModifierType_Curve:
-                                               ICON_DRAW(ICON_MOD_CURVE);
-                                               break;
-                                       case eModifierType_Build:
-                                               ICON_DRAW(ICON_MOD_BUILD);
-                                               break;
-                                       case eModifierType_Mirror:
-                                               ICON_DRAW(ICON_MOD_MIRROR);
-                                               break;
-                                       case eModifierType_Decimate:
-                                               ICON_DRAW(ICON_MOD_DECIM);
-                                               break;
-                                       case eModifierType_Wave:
-                                               ICON_DRAW(ICON_MOD_WAVE);
-                                               break;
-                                       case eModifierType_Hook:
-                                               ICON_DRAW(ICON_HOOK);
-                                               break;
-                                       case eModifierType_Softbody:
-                                               ICON_DRAW(ICON_MOD_SOFT);
-                                               break;
-                                       case eModifierType_Boolean:
-                                               ICON_DRAW(ICON_MOD_BOOLEAN);
-                                               break;
-                                       case eModifierType_ParticleSystem:
-                                               ICON_DRAW(ICON_MOD_PARTICLES);
-                                               break;
-                                       case eModifierType_ParticleInstance:
-                                               ICON_DRAW(ICON_MOD_PARTICLES);
-                                               break;
-                                       case eModifierType_EdgeSplit:
-                                               ICON_DRAW(ICON_MOD_EDGESPLIT);
-                                               break;
-                                       case eModifierType_Array:
-                                               ICON_DRAW(ICON_MOD_ARRAY);
-                                               break;
-                                       case eModifierType_UVProject:
-                                       case eModifierType_UVWarp:  /* TODO, get own icon */
-                                               ICON_DRAW(ICON_MOD_UVPROJECT);
-                                               break;
-                                       case eModifierType_Displace:
-                                               ICON_DRAW(ICON_MOD_DISPLACE);
-                                               break;
-                                       case eModifierType_Shrinkwrap:
-                                               ICON_DRAW(ICON_MOD_SHRINKWRAP);
-                                               break;
-                                       case eModifierType_Cast:
-                                               ICON_DRAW(ICON_MOD_CAST);
-                                               break;
-                                       case eModifierType_MeshDeform:
-                                       case eModifierType_SurfaceDeform:
-                                               ICON_DRAW(ICON_MOD_MESHDEFORM);
-                                               break;
-                                       case eModifierType_Bevel:
-                                               ICON_DRAW(ICON_MOD_BEVEL);
-                                               break;
-                                       case eModifierType_Smooth:
-                                       case eModifierType_LaplacianSmooth:
-                                       case eModifierType_CorrectiveSmooth:
-                                               ICON_DRAW(ICON_MOD_SMOOTH);
-                                               break;
-                                       case eModifierType_SimpleDeform:
-                                               ICON_DRAW(ICON_MOD_SIMPLEDEFORM);
-                                               break;
-                                       case eModifierType_Mask:
-                                               ICON_DRAW(ICON_MOD_MASK);
-                                               break;
-                                       case eModifierType_Cloth:
-                                               ICON_DRAW(ICON_MOD_CLOTH);
-                                               break;
-                                       case eModifierType_Explode:
-                                               ICON_DRAW(ICON_MOD_EXPLODE);
-                                               break;
-                                       case eModifierType_Collision:
-                                       case eModifierType_Surface:
-                                               ICON_DRAW(ICON_MOD_PHYSICS);
-                                               break;
-                                       case eModifierType_Fluidsim:
-                                               ICON_DRAW(ICON_MOD_FLUIDSIM);
-                                               break;
-                                       case eModifierType_Multires:
-                                               ICON_DRAW(ICON_MOD_MULTIRES);
-                                               break;
-                                       case eModifierType_Smoke:
-                                               ICON_DRAW(ICON_MOD_SMOKE);
-                                               break;
-                                       case eModifierType_Solidify:
-                                               ICON_DRAW(ICON_MOD_SOLIDIFY);
-                                               break;
-                                       case eModifierType_Screw:
-                                               ICON_DRAW(ICON_MOD_SCREW);
-                                               break;
-                                       case eModifierType_Remesh:
-                                               ICON_DRAW(ICON_MOD_REMESH);
-                                               break;
-                                       case eModifierType_WeightVGEdit:
-                                       case eModifierType_WeightVGMix:
-                                       case eModifierType_WeightVGProximity:
-                                               ICON_DRAW(ICON_MOD_VERTEX_WEIGHT);
-                                               break;
-                                       case eModifierType_DynamicPaint:
-                                               ICON_DRAW(ICON_MOD_DYNAMICPAINT);
-                                               break;
-                                       case eModifierType_Ocean:
-                                               ICON_DRAW(ICON_MOD_OCEAN);
-                                               break;
-                                       case eModifierType_Warp:
-                                               ICON_DRAW(ICON_MOD_WARP);
-                                               break;
-                                       case eModifierType_Skin:
-                                               ICON_DRAW(ICON_MOD_SKIN);
-                                               break;
-                                       case eModifierType_Triangulate:
-                                               ICON_DRAW(ICON_MOD_TRIANGULATE);
-                                               break;
-                                       case eModifierType_MeshCache:
-                                               ICON_DRAW(ICON_MOD_MESHDEFORM); /* XXX, needs own icon */
-                                               break;
-                                       case eModifierType_MeshSequenceCache:
-                                               ICON_DRAW(ICON_MOD_MESHDEFORM); /* XXX, needs own icon */
-                                               break;
-                                       case eModifierType_Wireframe:
-                                               ICON_DRAW(ICON_MOD_WIREFRAME);
-                                               break;
-                                       case eModifierType_LaplacianDeform:
-                                               ICON_DRAW(ICON_MOD_MESHDEFORM); /* XXX, needs own icon */
-                                               break;
-                                       case eModifierType_DataTransfer:
-                                               ICON_DRAW(ICON_MOD_DATA_TRANSFER);
-                                               break;
-                                       case eModifierType_NormalEdit:
-                                       case eModifierType_WeightedNormal:
-                                               ICON_DRAW(ICON_MOD_NORMALEDIT);
-                                               break;
-                                       /* Default */
-                                       case eModifierType_None:
-                                       case eModifierType_ShapeKey:
-                                       case NUM_MODIFIER_TYPES:
-                                               ICON_DRAW(ICON_DOT);
-                                               break;
+                               if (ob->type != OB_GPENCIL) {
+                                       ModifierData *md = BLI_findlink(&ob->modifiers, tselem->nr);
+                                       switch ((ModifierType)md->type) {
+                                               case eModifierType_Subsurf:
+                                                       ICON_DRAW(ICON_MOD_SUBSURF);
+                                                       break;
+                                               case eModifierType_Armature:
+                                                       ICON_DRAW(ICON_MOD_ARMATURE);
+                                                       break;
+                                               case eModifierType_Lattice:
+                                                       ICON_DRAW(ICON_MOD_LATTICE);
+                                                       break;
+                                               case eModifierType_Curve:
+                                                       ICON_DRAW(ICON_MOD_CURVE);
+                                                       break;
+                                               case eModifierType_Build:
+                                                       ICON_DRAW(ICON_MOD_BUILD);
+                                                       break;
+                                               case eModifierType_Mirror:
+                                                       ICON_DRAW(ICON_MOD_MIRROR);
+                                                       break;
+                                               case eModifierType_Decimate:
+                                                       ICON_DRAW(ICON_MOD_DECIM);
+                                                       break;
+                                               case eModifierType_Wave:
+                                                       ICON_DRAW(ICON_MOD_WAVE);
+                                                       break;
+                                               case eModifierType_Hook:
+                                                       ICON_DRAW(ICON_HOOK);
+                                                       break;
+                                               case eModifierType_Softbody:
+                                                       ICON_DRAW(ICON_MOD_SOFT);
+                                                       break;
+                                               case eModifierType_Boolean:
+                                                       ICON_DRAW(ICON_MOD_BOOLEAN);
+                                                       break;
+                                               case eModifierType_ParticleSystem:
+                                                       ICON_DRAW(ICON_MOD_PARTICLES);
+                                                       break;
+                                               case eModifierType_ParticleInstance:
+                                                       ICON_DRAW(ICON_MOD_PARTICLES);
+                                                       break;
+                                               case eModifierType_EdgeSplit:
+                                                       ICON_DRAW(ICON_MOD_EDGESPLIT);
+                                                       break;
+                                               case eModifierType_Array:
+                                                       ICON_DRAW(ICON_MOD_ARRAY);
+                                                       break;
+                                               case eModifierType_UVProject:
+                                               case eModifierType_UVWarp:  /* TODO, get own icon */
+                                                       ICON_DRAW(ICON_MOD_UVPROJECT);
+                                                       break;
+                                               case eModifierType_Displace:
+                                                       ICON_DRAW(ICON_MOD_DISPLACE);
+                                                       break;
+                                               case eModifierType_Shrinkwrap:
+                                                       ICON_DRAW(ICON_MOD_SHRINKWRAP);
+                                                       break;
+                                               case eModifierType_Cast:
+                                                       ICON_DRAW(ICON_MOD_CAST);
+                                                       break;
+                                               case eModifierType_MeshDeform:
+                                               case eModifierType_SurfaceDeform:
+                                                       ICON_DRAW(ICON_MOD_MESHDEFORM);
+                                                       break;
+                                               case eModifierType_Bevel:
+                                                       ICON_DRAW(ICON_MOD_BEVEL);
+                                                       break;
+                                               case eModifierType_Smooth:
+                                               case eModifierType_LaplacianSmooth:
+                                               case eModifierType_CorrectiveSmooth:
+                                                       ICON_DRAW(ICON_MOD_SMOOTH);
+                                                       break;
+                                               case eModifierType_SimpleDeform:
+                                                       ICON_DRAW(ICON_MOD_SIMPLEDEFORM);
+                                                       break;
+                                               case eModifierType_Mask:
+                                                       ICON_DRAW(ICON_MOD_MASK);
+                                                       break;
+                                               case eModifierType_Cloth:
+                                                       ICON_DRAW(ICON_MOD_CLOTH);
+                                                       break;
+                                               case eModifierType_Explode:
+                                                       ICON_DRAW(ICON_MOD_EXPLODE);
+                                                       break;
+                                               case eModifierType_Collision:
+                                               case eModifierType_Surface:
+                                                       ICON_DRAW(ICON_MOD_PHYSICS);
+                                                       break;
+                                               case eModifierType_Fluidsim:
+                                                       ICON_DRAW(ICON_MOD_FLUIDSIM);
+                                                       break;
+                                               case eModifierType_Multires:
+                                                       ICON_DRAW(ICON_MOD_MULTIRES);
+                                                       break;
+                                               case eModifierType_Smoke:
+                                                       ICON_DRAW(ICON_MOD_SMOKE);
+                                                       break;
+                                               case eModifierType_Solidify:
+                                                       ICON_DRAW(ICON_MOD_SOLIDIFY);
+                                                       break;
+                                               case eModifierType_Screw:
+                                                       ICON_DRAW(ICON_MOD_SCREW);
+                                                       break;
+                                               case eModifierType_Remesh:
+                                                       ICON_DRAW(ICON_MOD_REMESH);
+                                                       break;
+                                               case eModifierType_WeightVGEdit:
+                                               case eModifierType_WeightVGMix:
+                                               case eModifierType_WeightVGProximity:
+                                                       ICON_DRAW(ICON_MOD_VERTEX_WEIGHT);
+                                                       break;
+                                               case eModifierType_DynamicPaint:
+                                                       ICON_DRAW(ICON_MOD_DYNAMICPAINT);
+                                                       break;
+                                               case eModifierType_Ocean:
+                                                       ICON_DRAW(ICON_MOD_OCEAN);
+                                                       break;
+                                               case eModifierType_Warp:
+                                                       ICON_DRAW(ICON_MOD_WARP);
+                                                       break;
+                                               case eModifierType_Skin:
+                                                       ICON_DRAW(ICON_MOD_SKIN);
+                                                       break;
+                                               case eModifierType_Triangulate:
+                                                       ICON_DRAW(ICON_MOD_TRIANGULATE);
+                                                       break;
+                                               case eModifierType_MeshCache:
+                                                       ICON_DRAW(ICON_MOD_MESHDEFORM); /* XXX, needs own icon */
+                                                       break;
+                                               case eModifierType_MeshSequenceCache:
+                                                       ICON_DRAW(ICON_MOD_MESHDEFORM); /* XXX, needs own icon */
+                                                       break;
+                                               case eModifierType_Wireframe:
+                                                       ICON_DRAW(ICON_MOD_WIREFRAME);
+                                                       break;
+                                               case eModifierType_LaplacianDeform:
+                                                       ICON_DRAW(ICON_MOD_MESHDEFORM); /* XXX, needs own icon */
+                                                       break;
+                                               case eModifierType_DataTransfer:
+                                                       ICON_DRAW(ICON_MOD_DATA_TRANSFER);
+                                                       break;
+                                               case eModifierType_NormalEdit:
++                                              case eModifierType_WeightedNormal:
+                                                       ICON_DRAW(ICON_MOD_NORMALEDIT);
+                                                       break;
+                                                       /* Default */
+                                               case eModifierType_None:
+                                               case eModifierType_ShapeKey:
+                                               case NUM_MODIFIER_TYPES:
+                                                       ICON_DRAW(ICON_DOT);
+                                                       break;
+                                       }
+                               }
+                               else {
+                                       /* grease pencil modifiers */
+                                       GpencilModifierData *md = BLI_findlink(&ob->greasepencil_modifiers, tselem->nr);
+                                       switch ((GpencilModifierType)md->type) {
+                                               case eGpencilModifierType_Noise:
+                                                       ICON_DRAW(ICON_RNDCURVE);
+                                                       break;
+                                               case eGpencilModifierType_Subdiv:
+                                                       ICON_DRAW(ICON_MOD_SUBSURF);
+                                                       break;
+                                               case eGpencilModifierType_Thick:
+                                                       ICON_DRAW(ICON_MAN_ROT);
+                                                       break;
+                                               case eGpencilModifierType_Tint:
+                                                       ICON_DRAW(ICON_COLOR);
+                                                       break;
+                                               case eGpencilModifierType_Instance:
+                                                       ICON_DRAW(ICON_MOD_ARRAY);
+                                                       break;
+                                               case eGpencilModifierType_Build:
+                                                       ICON_DRAW(ICON_MOD_BUILD);
+                                                       break;
+                                               case eGpencilModifierType_Opacity:
+                                                       ICON_DRAW(ICON_MOD_MASK);
+                                                       break;
+                                               case eGpencilModifierType_Color:
+                                                       ICON_DRAW(ICON_GROUP_VCOL);
+                                                       break;
+                                               case eGpencilModifierType_Lattice:
+                                                       ICON_DRAW(ICON_MOD_LATTICE);
+                                                       break;
+                                               case eGpencilModifierType_Mirror:
+                                                       ICON_DRAW(ICON_MOD_MIRROR);
+                                                       break;
+                                               case eGpencilModifierType_Simplify:
+                                                       ICON_DRAW(ICON_MOD_DECIM);
+                                                       break;
+                                               case eGpencilModifierType_Smooth:
+                                                       ICON_DRAW(ICON_MOD_SMOOTH);
+                                                       break;
+                                               case eGpencilModifierType_Hook:
+                                                       ICON_DRAW(ICON_HOOK);
+                                                       break;
+                                               case eGpencilModifierType_Offset:
+                                                       ICON_DRAW(ICON_MOD_DISPLACE);
+                                                       break;
+                                                       /* Default */
+                                               default:
+                                                       ICON_DRAW(ICON_DOT);
+                                                       break;
+                                       }
                                }
                                break;
                        }
Simple merge