[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48131] branches/soc-2012-bratwurst: Separate Alpha Masks
Antony Riakiotakis
kalast at gmail.com
Wed Jun 20 19:32:31 CEST 2012
Revision: 48131
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48131
Author: psy-fi
Date: 2012-06-20 17:32:25 +0000 (Wed, 20 Jun 2012)
Log Message:
-----------
Separate Alpha Masks
=====================
Add GUI that exposes an extra slot for alpha mtex slot in brushes. Only
shown for texture painting.
Modified Paths:
--------------
branches/soc-2012-bratwurst/release/scripts/startup/bl_ui/space_image.py
branches/soc-2012-bratwurst/release/scripts/startup/bl_ui/space_view3d_toolbar.py
branches/soc-2012-bratwurst/source/blender/makesdna/DNA_brush_types.h
branches/soc-2012-bratwurst/source/blender/makesrna/intern/rna_brush.c
Modified: branches/soc-2012-bratwurst/release/scripts/startup/bl_ui/space_image.py
===================================================================
--- branches/soc-2012-bratwurst/release/scripts/startup/bl_ui/space_image.py 2012-06-20 17:12:20 UTC (rev 48130)
+++ branches/soc-2012-bratwurst/release/scripts/startup/bl_ui/space_image.py 2012-06-20 17:32:25 UTC (rev 48131)
@@ -709,6 +709,7 @@
col = layout.column()
col.template_ID_preview(brush, "texture", new="texture.new", rows=3, cols=8)
+ col.template_ID_preview(brush, "alpha_texture", new="texture.new", rows=3, cols=8)
col.prop(brush, "use_fixed_texture")
Modified: branches/soc-2012-bratwurst/release/scripts/startup/bl_ui/space_view3d_toolbar.py
===================================================================
--- branches/soc-2012-bratwurst/release/scripts/startup/bl_ui/space_view3d_toolbar.py 2012-06-20 17:12:20 UTC (rev 48130)
+++ branches/soc-2012-bratwurst/release/scripts/startup/bl_ui/space_view3d_toolbar.py 2012-06-20 17:32:25 UTC (rev 48131)
@@ -730,10 +730,14 @@
settings = self.paint_settings(context)
brush = settings.brush
tex_slot = brush.texture_slot
+ tex_slot_alpha = brush.alpha_texture_slot
col = layout.column()
col.template_ID_preview(brush, "texture", new="texture.new", rows=3, cols=8)
+ if context.image_paint_object:
+ col.label(text='Mask Texture')
+ col.template_ID_preview(brush, "alpha_texture", new="texture.new", rows=3, cols=8)
if brush.use_paint_image:
col.prop(brush, "use_fixed_texture")
Modified: branches/soc-2012-bratwurst/source/blender/makesdna/DNA_brush_types.h
===================================================================
--- branches/soc-2012-bratwurst/source/blender/makesdna/DNA_brush_types.h 2012-06-20 17:12:20 UTC (rev 48130)
+++ branches/soc-2012-bratwurst/source/blender/makesdna/DNA_brush_types.h 2012-06-20 17:32:25 UTC (rev 48131)
@@ -56,6 +56,7 @@
struct BrushClone clone;
struct CurveMapping *curve; /* falloff curve */
struct MTex mtex;
+ struct MTex alphamtex;
struct Brush *toggle_brush;
Modified: branches/soc-2012-bratwurst/source/blender/makesrna/intern/rna_brush.c
===================================================================
--- branches/soc-2012-bratwurst/source/blender/makesrna/intern/rna_brush.c 2012-06-20 17:12:20 UTC (rev 48130)
+++ branches/soc-2012-bratwurst/source/blender/makesrna/intern/rna_brush.c 2012-06-20 17:32:25 UTC (rev 48131)
@@ -912,6 +912,18 @@
RNA_def_property_ui_text(prop, "Texture", "");
RNA_def_property_update(prop, NC_TEXTURE, "rna_Brush_update");
+ prop = RNA_def_property(srna, "alpha_texture_slot", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "BrushTextureSlot");
+ RNA_def_property_pointer_sdna(prop, NULL, "alphamtex");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Alpha Texture Slot", "");
+
+ prop = RNA_def_property(srna, "alpha_texture", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "alphamtex.tex");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Alpha Texture", "");
+ RNA_def_property_update(prop, NC_TEXTURE, "rna_Brush_update");
+
prop = RNA_def_property(srna, "texture_overlay_alpha", PROP_INT, PROP_PERCENTAGE);
RNA_def_property_int_sdna(prop, NULL, "texture_overlay_alpha");
RNA_def_property_range(prop, 1, 100);
More information about the Bf-blender-cvs
mailing list