Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2013-03-25 05:00:16 +0400
committerAntony Riakiotakis <kalast@gmail.com>2013-03-25 05:00:16 +0400
commitceb3225db77c5a86b8cb8cce555251c1dffdd033 (patch)
tree8f709801c59f683c2cb50ea67841c5f15861b075 /release/scripts
parent48a256c910e85405747ad47a62bcb70159aee638 (diff)
Alpha mask textures porting part 1: Support for projective texturing.
Also add random mapping to brushes.
Diffstat (limited to 'release/scripts')
-rw-r--r--release/scripts/startup/bl_ui/properties_paint_common.py15
-rw-r--r--release/scripts/startup/bl_ui/space_image.py24
-rw-r--r--release/scripts/startup/bl_ui/space_view3d_toolbar.py29
3 files changed, 67 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py
index a3275bea4ee..17dcf267c3b 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -112,3 +112,18 @@ def brush_texture_settings(layout, brush, sculpt):
col = layout.column(align=True)
col.label(text="Sample Bias:")
col.prop(brush, "texture_sample_bias", slider=True, text="")
+
+
+def brush_mask_texture_settings(layout, brush):
+ mask_tex_slot = brush.mask_texture_slot
+
+ if(brush.mask_texture):
+ layout.label(text="Mask Mapping:")
+ col = layout.column()
+ col.active = brush.brush_capabilities.has_texture_angle
+ col.prop(mask_tex_slot, "angle", text="")
+
+ # scale and offset
+ split = layout.split()
+ split.prop(mask_tex_slot, "offset")
+ split.prop(mask_tex_slot, "scale")
diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py
index 4368d362882..d2bbca358aa 100644
--- a/release/scripts/startup/bl_ui/space_image.py
+++ b/release/scripts/startup/bl_ui/space_image.py
@@ -19,7 +19,7 @@
# <pep8 compliant>
import bpy
from bpy.types import Header, Menu, Panel
-from bl_ui.properties_paint_common import UnifiedPaintPanel, brush_texture_settings
+from bl_ui.properties_paint_common import UnifiedPaintPanel, brush_texture_settings, brush_mask_texture_settings
from bpy.app.translations import pgettext_iface as iface_
@@ -729,6 +729,28 @@ class IMAGE_PT_tools_brush_texture(BrushButtonsPanel, Panel):
brush_texture_settings(col, brush, 0)
+class IMAGE_PT_tools_mask_texture(BrushButtonsPanel, Panel):
+ bl_label = "Texture Mask"
+ bl_options = {'DEFAULT_CLOSED'}
+
+ def draw_header(self, context):
+ brush = context.tool_settings.image_paint.brush
+ tex_slot_alpha = brush.mask_texture_slot
+ self.layout.prop(brush, 'use_mask', text="")
+
+ def draw(self, context):
+ layout = self.layout
+
+ brush = context.tool_settings.image_paint.brush
+ tex_slot_alpha = brush.mask_texture_slot
+
+ col = layout.column()
+
+ col.template_ID_preview(brush, "mask_texture", new="texture.new", rows=3, cols=8)
+
+ brush_mask_texture_settings(col, brush)
+
+
class IMAGE_PT_tools_brush_tool(BrushButtonsPanel, Panel):
bl_label = "Tool"
bl_options = {'DEFAULT_CLOSED'}
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 24e4dac4ded..54d3b61c665 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -21,6 +21,7 @@ import bpy
from bpy.types import Menu, Panel
from bl_ui.properties_paint_common import UnifiedPaintPanel
from bl_ui.properties_paint_common import brush_texture_settings
+from bl_ui.properties_paint_common import brush_mask_texture_settings
class View3DPanel():
@@ -782,6 +783,34 @@ class VIEW3D_PT_tools_brush_texture(Panel, View3DPaintPanel):
sub.prop(brush, "texture_overlay_alpha", text="Alpha")
+class VIEW3D_PT_tools_mask_texture(View3DPanel, Panel):
+ bl_context = "imagepaint"
+ bl_label = "Texture Mask"
+ bl_options = {'DEFAULT_CLOSED'}
+
+ @classmethod
+ def poll(cls, context):
+ brush = context.tool_settings.image_paint.brush
+ return (context.image_paint_object and brush and brush.image_tool != 'SOFTEN')
+
+ def draw_header(self, context):
+ brush = context.tool_settings.image_paint.brush
+ tex_slot_alpha = brush.mask_texture_slot
+ self.layout.prop(brush, 'use_mask', text="")
+
+ def draw(self, context):
+ layout = self.layout
+
+ brush = context.tool_settings.image_paint.brush
+ tex_slot_alpha = brush.mask_texture_slot
+
+ col = layout.column()
+
+ col.template_ID_preview(brush, "mask_texture", new="texture.new", rows=3, cols=8)
+
+ brush_mask_texture_settings(col, brush)
+
+
class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel):
bl_label = "Stroke"
bl_options = {'DEFAULT_CLOSED'}