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-01-16 16:57:35 +0400
committerAntony Riakiotakis <kalast@gmail.com>2013-01-16 16:57:35 +0400
commitcb8158cce6a35adb06c6e003a43c686aa88ebc4d (patch)
treeb9294a00b7a785e8b0c0deaa9bbefe27b6556b8d /release
parent2095b2cddba2bdad057ceef54a1046c522389ff5 (diff)
Unification of brush code
* rename sculpt_brush_texture_settings to brush_texture_settings * Expose texture scale and offset in texture paint mode * Introduce still inactive mapping mode for texture paint, tiled and view aligned only. Projective paint uses only tiled, while 2d paint can use both. Commit will come that will use both appropriately for both modes, omitting fixed brush flag (which is tiled with another name)
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_ui/properties_paint_common.py44
-rw-r--r--release/scripts/startup/bl_ui/properties_texture.py6
-rw-r--r--release/scripts/startup/bl_ui/space_view3d_toolbar.py6
3 files changed, 31 insertions, 25 deletions
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py
index 53cf640beb9..022f2500940 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -70,34 +70,40 @@ class UnifiedPaintPanel():
# Used in both the View3D toolbar and texture properties
-def sculpt_brush_texture_settings(layout, brush):
+def brush_texture_settings(layout, brush, sculpt):
tex_slot = brush.texture_slot
layout.label(text="Brush Mapping:")
# map_mode
- layout.row().prop(tex_slot, "map_mode", text="")
- layout.separator()
-
- # angle and texture_angle_source
- col = layout.column()
- col.active = brush.sculpt_capabilities.has_texture_angle_source
- col.label(text="Angle:")
- if brush.sculpt_capabilities.has_random_texture_angle:
- col.prop(brush, "texture_angle_source_random", text="")
+ if sculpt:
+ layout.row().prop(tex_slot, "map_mode", text="")
+ layout.separator()
else:
- col.prop(brush, "texture_angle_source_no_random", text="")
-
+ layout.row().prop(tex_slot, "tex_paint_map_mode", text="")
+ layout.separator()
+
+ # angle and texture_angle_source
col = layout.column()
- col.active = brush.sculpt_capabilities.has_texture_angle
- col.prop(tex_slot, "angle", text="")
+ if sculpt:
+ col.active = brush.sculpt_capabilities.has_texture_angle_source
+ col.label(text="Angle:")
+ if brush.sculpt_capabilities.has_random_texture_angle:
+ col.prop(brush, "texture_angle_source_random", text="")
+ else:
+ col.prop(brush, "texture_angle_source_no_random", text="")
+
+ col = layout.column()
+ col.active = brush.sculpt_capabilities.has_texture_angle
+ col.prop(tex_slot, "angle", text="")
# scale and offset
split = layout.split()
split.prop(tex_slot, "offset")
split.prop(tex_slot, "scale")
-
- # texture_sample_bias
- col = layout.column(align=True)
- col.label(text="Sample Bias:")
- col.prop(brush, "texture_sample_bias", slider=True, text="")
+
+ if sculpt:
+ # texture_sample_bias
+ col = layout.column(align=True)
+ col.label(text="Sample Bias:")
+ col.prop(brush, "texture_sample_bias", slider=True, text="")
diff --git a/release/scripts/startup/bl_ui/properties_texture.py b/release/scripts/startup/bl_ui/properties_texture.py
index 6842b324b0e..6397ed4378e 100644
--- a/release/scripts/startup/bl_ui/properties_texture.py
+++ b/release/scripts/startup/bl_ui/properties_texture.py
@@ -30,7 +30,7 @@ from bpy.types import (Brush,
from rna_prop_ui import PropertyPanel
-from bl_ui.properties_paint_common import sculpt_brush_texture_settings
+from bl_ui.properties_paint_common import brush_texture_settings
class TEXTURE_MT_specials(Menu):
@@ -884,8 +884,8 @@ class TEXTURE_PT_mapping(TextureSlotPanel, Panel):
split.prop(tex, "object", text="")
if isinstance(idblock, Brush):
- if context.sculpt_object:
- sculpt_brush_texture_settings(layout, idblock)
+ if context.sculpt_object or context.image_paint_object:
+ brush_texture_settings(layout, idblock, context.sculpt_object)
else:
if isinstance(idblock, Material):
split = layout.split(percentage=0.3)
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 3c56ff82a77..579171970fa 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -20,7 +20,7 @@
import bpy
from bpy.types import Menu, Panel
from bl_ui.properties_paint_common import UnifiedPaintPanel
-from bl_ui.properties_paint_common import sculpt_brush_texture_settings
+from bl_ui.properties_paint_common import brush_texture_settings
class View3DPanel():
@@ -723,9 +723,9 @@ class VIEW3D_PT_tools_brush_texture(Panel, View3DPaintPanel):
if brush.use_paint_image:
col.prop(brush, "use_fixed_texture")
- if context.sculpt_object:
- sculpt_brush_texture_settings(col, brush)
+ brush_texture_settings(col, brush, context.sculpt_object)
+ if context.sculpt_object:
# use_texture_overlay and texture_overlay_alpha
col = layout.column(align=True)
col.active = brush.sculpt_capabilities.has_overlay