[Bf-blender-cvs] [f745564] master: GSOC 2013 paint

Antony Riakiotakis noreply at git.blender.org
Mon Jul 21 12:02:52 CEST 2014


Commit: f745564e4ee791e4faf804b09ce975b882f4f8d9
Author: Antony Riakiotakis
Date:   Mon Jul 21 12:02:05 2014 +0200
Branches: master
https://developer.blender.org/rBf745564e4ee791e4faf804b09ce975b882f4f8d9

GSOC 2013 paint

Yep, at last it's here!

There are a few minor issues remaining but development can go on in
master after discussion at blender institute.

For full list of features see:

http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.72/Painting

Thanks to Sergey and Campbell for the extensive review and to the
countless artists that have given their input and reported issues during
development.

===================================================================

M	SConstruct
M	release/scripts/startup/bl_ui/properties_paint_common.py
M	release/scripts/startup/bl_ui/space_image.py
M	release/scripts/startup/bl_ui/space_view3d.py
M	release/scripts/startup/bl_ui/space_view3d_toolbar.py
M	source/blender/blenkernel/BKE_DerivedMesh.h
M	source/blender/blenkernel/BKE_blender.h
M	source/blender/blenkernel/BKE_brush.h
M	source/blender/blenkernel/BKE_library.h
M	source/blender/blenkernel/BKE_main.h
M	source/blender/blenkernel/BKE_material.h
M	source/blender/blenkernel/BKE_paint.h
M	source/blender/blenkernel/intern/DerivedMesh.c
M	source/blender/blenkernel/intern/brush.c
M	source/blender/blenkernel/intern/cdderivedmesh.c
M	source/blender/blenkernel/intern/depsgraph.c
M	source/blender/blenkernel/intern/editderivedmesh.c
M	source/blender/blenkernel/intern/idcode.c
M	source/blender/blenkernel/intern/library.c
M	source/blender/blenkernel/intern/material.c
M	source/blender/blenkernel/intern/paint.c
M	source/blender/blenkernel/intern/subsurf_ccg.c
M	source/blender/blenkernel/intern/texture.c
M	source/blender/blenlib/BLI_math_color_blend.h
M	source/blender/blenlib/BLI_math_vector.h
M	source/blender/blenlib/intern/math_color_blend_inline.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/blenloader/intern/versioning_270.c
M	source/blender/blenloader/intern/writefile.c
M	source/blender/editors/datafiles/CMakeLists.txt
M	source/blender/editors/datafiles/SConscript
M	source/blender/editors/include/ED_datafiles.h
M	source/blender/editors/include/ED_image.h
M	source/blender/editors/include/ED_paint.h
M	source/blender/editors/include/ED_transform.h
M	source/blender/editors/include/ED_view3d.h
M	source/blender/editors/include/UI_icons.h
M	source/blender/editors/include/UI_interface.h
M	source/blender/editors/include/UI_resources.h
M	source/blender/editors/interface/interface_handlers.c
M	source/blender/editors/interface/interface_icons.c
M	source/blender/editors/interface/interface_intern.h
M	source/blender/editors/interface/interface_ops.c
M	source/blender/editors/interface/interface_templates.c
M	source/blender/editors/interface/interface_widgets.c
M	source/blender/editors/interface/resources.c
M	source/blender/editors/render/render_update.c
M	source/blender/editors/screen/screen_ops.c
M	source/blender/editors/sculpt_paint/CMakeLists.txt
M	source/blender/editors/sculpt_paint/paint_cursor.c
A	source/blender/editors/sculpt_paint/paint_curve.c
M	source/blender/editors/sculpt_paint/paint_image.c
M	source/blender/editors/sculpt_paint/paint_image_2d.c
M	source/blender/editors/sculpt_paint/paint_image_proj.c
M	source/blender/editors/sculpt_paint/paint_intern.h
M	source/blender/editors/sculpt_paint/paint_ops.c
M	source/blender/editors/sculpt_paint/paint_stroke.c
M	source/blender/editors/sculpt_paint/paint_undo.c
M	source/blender/editors/sculpt_paint/paint_utils.c
M	source/blender/editors/sculpt_paint/paint_vertex.c
M	source/blender/editors/sculpt_paint/sculpt.c
M	source/blender/editors/sculpt_paint/sculpt_undo.c
M	source/blender/editors/space_api/spacetypes.c
M	source/blender/editors/space_image/image_edit.c
M	source/blender/editors/space_image/image_ops.c
M	source/blender/editors/space_image/space_image.c
M	source/blender/editors/space_view3d/drawmesh.c
M	source/blender/editors/space_view3d/drawobject.c
M	source/blender/editors/space_view3d/space_view3d.c
M	source/blender/editors/space_view3d/view3d_draw.c
M	source/blender/editors/space_view3d/view3d_edit.c
M	source/blender/editors/space_view3d/view3d_header.c
M	source/blender/editors/transform/transform.c
M	source/blender/editors/transform/transform.h
M	source/blender/editors/transform/transform_constraints.c
M	source/blender/editors/transform/transform_conversions.c
M	source/blender/editors/transform/transform_generics.c
M	source/blender/editors/transform/transform_snap.c
M	source/blender/editors/uvedit/uvedit_draw.c
M	source/blender/editors/uvedit/uvedit_ops.c
M	source/blender/gpu/GPU_buffers.h
M	source/blender/gpu/GPU_draw.h
M	source/blender/gpu/intern/gpu_buffers.c
M	source/blender/gpu/intern/gpu_draw.c
M	source/blender/imbuf/IMB_imbuf.h
M	source/blender/imbuf/intern/rectop.c
M	source/blender/makesdna/DNA_ID.h
M	source/blender/makesdna/DNA_brush_types.h
M	source/blender/makesdna/DNA_material_types.h
M	source/blender/makesdna/DNA_scene_types.h
M	source/blender/makesdna/DNA_space_types.h
M	source/blender/makesdna/DNA_userdef_types.h
M	source/blender/makesrna/RNA_access.h
M	source/blender/makesrna/intern/rna_ID.c
M	source/blender/makesrna/intern/rna_brush.c
M	source/blender/makesrna/intern/rna_internal.h
M	source/blender/makesrna/intern/rna_material.c
M	source/blender/makesrna/intern/rna_mesh.c
M	source/blender/makesrna/intern/rna_scene.c
M	source/blender/makesrna/intern/rna_sculpt_paint.c
M	source/blender/makesrna/intern/rna_space.c
M	source/blender/makesrna/intern/rna_ui_api.c
M	source/blender/makesrna/intern/rna_userdef.c
M	source/blender/windowmanager/WM_api.h
M	source/blender/windowmanager/WM_types.h
M	source/blender/windowmanager/intern/wm.c
M	source/blender/windowmanager/intern/wm_dragdrop.c
M	source/blender/windowmanager/intern/wm_event_system.c
M	source/blender/windowmanager/intern/wm_window.c
M	source/blender/windowmanager/wm_event_types.h
M	source/blenderplayer/bad_level_call_stubs/stubs.c
M	source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageIM.cpp
M	source/gameengine/VideoTexture/ImageBuff.cpp

===================================================================

diff --git a/SConstruct b/SConstruct
index 6abf91c..331158e 100644
--- a/SConstruct
+++ b/SConstruct
@@ -730,6 +730,8 @@ if B.targets != ['cudakernels']:
     data_to_c_simple("release/datafiles/brushicons/soften.png")
     data_to_c_simple("release/datafiles/brushicons/subtract.png")
     data_to_c_simple("release/datafiles/brushicons/texdraw.png")
+    data_to_c_simple("release/datafiles/brushicons/texfill.png")
+    data_to_c_simple("release/datafiles/brushicons/texmask.png")
     data_to_c_simple("release/datafiles/brushicons/thumb.png")
     data_to_c_simple("release/datafiles/brushicons/twist.png")
     data_to_c_simple("release/datafiles/brushicons/vertexdraw.png")
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py
index 462ca2e..8359ae6 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -50,6 +50,10 @@ class UnifiedPaintPanel():
         row.prop(ups, "use_unified_strength", text="Strength")
         if context.weight_paint_object:
             parent.prop(ups, "use_unified_weight", text="Weight")
+        elif context.vertex_paint_object or context.image_paint_object:
+            parent.prop(ups, "use_unified_color", text="Color")
+        else:
+            parent.prop(ups, "use_unified_color", text="Color")
 
     @staticmethod
     def prop_unified_size(parent, context, brush, prop_name, icon='NONE', text="", slider=False):
@@ -69,6 +73,105 @@ class UnifiedPaintPanel():
         ptr = ups if ups.use_unified_weight else brush
         parent.prop(ptr, prop_name, icon=icon, text=text, slider=slider)
 
+    @staticmethod
+    def prop_unified_color(parent, context, brush, prop_name, text=""):
+        ups = context.tool_settings.unified_paint_settings
+        ptr = ups if ups.use_unified_color else brush
+        parent.prop(ptr, prop_name, text=text)
+
+    @staticmethod
+    def prop_unified_color_picker(parent, context, brush, prop_name, value_slider=True):
+        ups = context.tool_settings.unified_paint_settings
+        ptr = ups if ups.use_unified_color else brush
+        parent.template_color_picker(ptr, prop_name, value_slider=value_slider)
+
+
+def brush_texpaint_common(panel, context, layout, brush, settings):
+    capabilities = brush.image_paint_capabilities
+
+    col = layout.column()
+
+    if brush.image_tool in {'DRAW', 'FILL'}:
+        if brush.blend not in {'ERASE_ALPHA', 'ADD_ALPHA'}:
+            if not brush.use_gradient:
+                panel.prop_unified_color_picker(col, context, brush, "color", value_slider=True)
+
+            if settings.palette:
+                col.template_palette(settings, "palette", color=True)
+
+            if brush.use_gradient:
+                col.label("Gradient Colors")
+                col.template_color_ramp(brush, "gradient", expand=True)
+
+                if brush.image_tool != 'FILL':
+                    col.label("Background Color")
+                    row = col.row(align=True)
+                    panel.prop_unified_color(row, context, brush, "secondary_color", text="")
+
+                if brush.image_tool == 'DRAW':
+                    col.prop(brush, "gradient_stroke_mode", text="Mode")
+                    if brush.gradient_stroke_mode in {'SPACING_REPEAT', 'SPACING_CLAMP'}:
+                        col.prop(brush, "grad_spacing")
+                elif brush.image_tool == 'FILL':
+                    col.prop(brush, "gradient_fill_mode")
+            else:
+                row = col.row(align=True)
+                panel.prop_unified_color(row, context, brush, "color", text="")
+                if brush.image_tool == 'FILL':
+                    col.prop(brush, "fill_threshold")
+                else:
+                    panel.prop_unified_color(row, context, brush, "secondary_color", text="")
+                    row.separator()
+                    row.operator("paint.brush_colors_flip", icon='FILE_REFRESH', text="")
+
+    elif brush.image_tool == 'SOFTEN':
+        col = layout.column(align=True)
+        col.row().prop(brush, "direction", expand=True)
+        col.separator()
+        col.prop(brush, "sharp_threshold")
+        col.prop(brush, "blur_kernel_radius")
+        col.separator()
+        col.prop(brush, "blur_mode")
+    elif brush.image_tool == 'MASK':
+        col.prop(brush, "weight", text="Mask Value", slider=True)
+
+    elif brush.image_tool == 'CLONE':
+        col.separator()
+        col.prop(brush, "clone_image", text="Image")
+        col.prop(brush, "clone_alpha", text="Alpha")
+
+    col.separator()
+
+    if capabilities.has_radius:
+        row = col.row(align=True)
+        panel.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
+        panel.prop_unified_size(row, context, brush, "use_pressure_size")
+
+        row = col.row(align=True)
+
+    if capabilities.has_space_attenuation:
+        row.prop(brush, "use_space_attenuation", toggle=True, icon_only=True)
+
+    panel.prop_unified_strength(row, context, brush, "strength", text="Strength")
+    panel.prop_unified_strength(row, context, brush, "use_pressure_strength")
+
+    if brush.image_tool in {'DRAW', 'FILL'}:
+        col.separator()
+        col.prop(brush, "blend", text="Blend")
+
+    col = layout.column()
+
+    # use_accumulate
+    if capabilities.has_accumulate:
+        col = layout.column(align=True)
+        col.prop(brush, "use_accumulate")
+
+    col.prop(brush, "use_alpha")
+    col.prop(brush, "use_gradient")
+
+    col.separator()
+    col.template_ID(settings, "palette", new="palette.new")
+
 
 # Used in both the View3D toolbar and texture properties
 def brush_texture_settings(layout, brush, sculpt):
@@ -136,6 +239,7 @@ def brush_mask_texture_settings(layout, brush):
         layout.operator("brush.stencil_reset_transform").mask = True
 
     col = layout.column()
+    col.prop(brush, "use_pressure_masking", text="")
     col.label(text="Angle:")
     col.active = brush.brush_capabilities.has_texture_angle
     col.prop(mask_tex_slot, "angle", text="")
diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py
index 97c89df..b3ba3b6 100644
--- a/release/scripts/startup/bl_ui/space_image.py
+++ b/release/scripts/startup/bl_ui/space_image.py
@@ -22,6 +22,7 @@ from bpy.types import Header, Menu, Panel
 from bl_ui.properties_paint_common import (
         UnifiedPaintPanel,
         brush_texture_settings,
+        brush_texpaint_common,
         brush_mask_texture_settings,
         )
 from bl_ui.properties_grease_pencil_common import GreasePencilPanel
@@ -31,13 +32,11 @@ from bpy.app.translations import pgettext_iface as iface_
 class ImagePaintPanel(UnifiedPaintPanel):
     bl_space_type = 'IMAGE_EDITOR'
     bl_region_type = 'TOOLS'
-    bl_category = "Tools"
 
 
-class BrushButtonsPanel:
+class BrushButtonsPanel(UnifiedPaintPanel):
     bl_space_type = 'IMAGE_EDITOR'
     bl_region_type = 'TOOLS'
-    bl_category = "Tools"
 
     @classmethod
     def poll(cls, context):
@@ -66,6 +65,7 @@ class IMAGE_MT_view(Menu):
         sima = context.space_data
         uv = sima.uv_editor
         toolsettings = context.tool_settings
+        paint = toolsettings.image_paint
 
         show_uvedit = sima.show_uvedit
         show_render = sima.show_render
@@ -80,6 +80,8 @@ class IMAGE_MT_view(Menu):
             layout.prop(toolsettings, "show_uv_local_view")
 
         layout.prop(uv, "show_other_objects")
+        if paint.brush and (context.image_paint_object or sima.mode == 'PAINT'):
+            layout.prop(uv, "show_texpaint")
 
         layout.separator()
 
@@ -140,6 +142,24 @@ class IMAGE_MT_select(Menu):
         layout.operator("uv.select_split")
 
 
+class IMAGE_MT_brush(Menu):
+    bl_label = "Brush"
+
+    def draw(self, context):
+        layout = self.layout
+        toolsettings = context.tool_settings
+        settings = toolsettings.image_paint
+        brush = settings.brush
+
+        ups = context.tool_settings.unified_paint_settings
+        layout.prop(ups, "use_unified_size", text="Unified Size")
+        layout.prop(ups, "use_unified_strength", text="Unified Strength")
+        layout.separator()
+
+        # brush tool
+        layout.prop_menu_enum(brush, "image_tool")
+
+
 class IMAGE_MT_image(Menu):
     bl_label = "Image"
 
@@ -382,7 +402,6 @@ class IMAGE_HT_header(Header):
         mode = sima.mode
 
         show_render = sima.show_render
-        # show_paint = sima.show_paint
         show_uvedit = sima.show_uvedit
         show_maskedit = sima.show_maskedit
 
@@ -401,8 +420,7 @@ class IMAGE_HT_header(Header):
             row = layout.row()
             row.template_ID(sima, "mask", new="mask.new")
 
-        if show_uvedit or show_maskedit:
-            layout.prop(sima, "pivot_point", icon_only=True)
+        layout.prop(sima, "pivot_point", icon_only=True)
 
         # uv editing
         if show_uvedit:
@@ -462,6 +480,7 @@ class MASK_MT_editor_menus(Menu):
 
         show_uvedit = sima.show_uvedit
         show_maskedit = sima.show_maskedit
+        show_paint = sima.show_paint
 
         layout.menu("IMAGE_MT_view")
 
@@ -469,6 +488,8 @@ class MASK_MT_editor_menus(Menu):
             layout.menu("IMAGE_MT_select")
         if show_maskedit:
             layout.menu("MASK_MT_select")
+        if show_paint:
+            layout.menu("IMAGE_MT_brush")
 
         if ima and ima.is_dirty:
             layout.menu("IMAGE_MT_image", text="Image*")
@@ -658,49 +679,27 @@ class IMAGE_PT_tools_transform_uvs(Panel, UVToolsPanel):
         col.operator("transform.shear")
 
 
-class IMAGE_PT_paint(Panel, ImagePaintPanel):
+class IMAGE_PT_paint(Panel, BrushButtonsPanel):
     bl_label = "Paint"
-
-    @classmethod
-    def poll(cls, context):
-        sima = context.space_data
-        return sima.show_paint
+    bl_category = "Tools"
 
     def draw(self, context):
         layout = self.layout
 
-        toolsettings = context.tool_settings.image_paint
-        brush = toolsettings.brush
+        settings = context.tool_settings.image_paint
+        brush = settings.brush
 
         col = layout.colum

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list