[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [29856] branches/soc-2010-jwilkins: * removed duplicate UI and code for texture scaling and center, instead should have used what was already there

Jason Wilkins Jason.A.Wilkins at gmail.com
Thu Jul 1 21:57:40 CEST 2010


Revision: 29856
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29856
Author:   jwilkins
Date:     2010-07-01 21:57:40 +0200 (Thu, 01 Jul 2010)

Log Message:
-----------
* removed duplicate UI and code for texture scaling and center, instead should have used what was already there
* made texture size and offset consistent with how it works in the rest of blender (scaling and offsetting texture coordinates, which is the inverse of intuition)
* renamed 'sculpt direction' to 'sculpt plane' to avoid confusion with another option and make the name more intuitive
* 'rake' is now an icon toggle button next to 'angle', it uses the comb icon used by the particle editor, need a new icon for it
* renamed 'texture offset' to 'texture sample bias' to better reflect its purpose
* controls in the texture panel now go grey instead of disappearing when they aren't relavent
* added several more preset curves, Linear (Maybe conical would be better), Spherical, Root (maybe parabolic is better), and 'Mid9' which is 9 points ready to be customized.
** The icon for Mid9 is a random curve.  I think it fits because it is meant to be a starting point to make custom curves, but it may make some people want a random curve feature
** adjusted smooth and sharp curves so they are more continuous (if you have the old one saved you need to hit the button again to get the new one)
* removed Unlimited Clay options from the UI
* In the texture mapping panel (the main one on the right), made offset and size appear regardless of if the panel is in brush or material mode
* Moved 'fast navigate' 'show brush' and 'show brush on surface' to user preferences
* texture sample bias is now applyed before the curve is multiplied.  this makes the edges when using a bias much smoother (when using a continuous curve that is)
* made the sculpt stroke mode a proper enum so that the names of the modes appear as strings in the keymap editor instead of as opaque numbers
* decreased crease brush pinch factors hard limit from 2 to 1 to prevent strange behavior
* changed 'show overlay' into an eye icon next to the overlay alpha slider
* smooth, thumb, rotate, and snake hook now ignore the spacing stroke setting
* smooth brush now iterates up to 4 times per dab depending on the strength, so lower levels of strength = more performance
* straighten up the stroke panel, now all controls are show inactive if they are not relavent
* all tools except smooth now use proxies so that they can be combined symmetrically with fewer artifacts, this fixes the bug with the anchor stroke and symmetry
** known bug: for large sized anchor strokes the mesh jitters between two states, this has something to do with proxies and symmetry

Modified Paths:
--------------
    branches/soc-2010-jwilkins/release/scripts/ui/properties_texture.py
    branches/soc-2010-jwilkins/release/scripts/ui/space_userpref.py
    branches/soc-2010-jwilkins/release/scripts/ui/space_view3d_toolbar.py
    branches/soc-2010-jwilkins/source/blender/blenkernel/intern/brush.c
    branches/soc-2010-jwilkins/source/blender/blenkernel/intern/colortools.c
    branches/soc-2010-jwilkins/source/blender/blenlib/intern/pbvh.c
    branches/soc-2010-jwilkins/source/blender/blenloader/intern/readfile.c
    branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/paint_stroke.c
    branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/paint_utils.c
    branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/sculpt.c
    branches/soc-2010-jwilkins/source/blender/makesdna/DNA_brush_types.h
    branches/soc-2010-jwilkins/source/blender/makesdna/DNA_color_types.h
    branches/soc-2010-jwilkins/source/blender/makesdna/DNA_windowmanager_types.h
    branches/soc-2010-jwilkins/source/blender/makesrna/intern/rna_brush.c

Modified: branches/soc-2010-jwilkins/release/scripts/ui/properties_texture.py
===================================================================
--- branches/soc-2010-jwilkins/release/scripts/ui/properties_texture.py	2010-07-01 19:29:27 UTC (rev 29855)
+++ branches/soc-2010-jwilkins/release/scripts/ui/properties_texture.py	2010-07-01 19:57:40 UTC (rev 29856)
@@ -279,10 +279,6 @@
                 row = layout.row()
                 row.active = tex.map_mode in ('FIXED', 'TILED')
                 row.prop(tex, "angle")
-
-                row = layout.row()
-                row.active = tex.map_mode in ('TILED', '3D')
-                row.column().prop(tex, "size")
         else:
             if type(idblock) == bpy.types.Material:
                 split = layout.split(percentage=0.3)
@@ -306,17 +302,16 @@
                 row.prop(tex, "y_mapping", text="")
                 row.prop(tex, "z_mapping", text="")
 
-            # any non brush
-            split = layout.split()
+        split = layout.split()
 
+        col = split.column()
+        col.prop(tex, "offset")
+
+        if wide_ui:
             col = split.column()
-            col.prop(tex, "offset")
+        col.prop(tex, "size")
 
-            if wide_ui:
-                col = split.column()
-            col.prop(tex, "size")
 
-
 class TEXTURE_PT_influence(TextureSlotPanel):
     bl_label = "Influence"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}

Modified: branches/soc-2010-jwilkins/release/scripts/ui/space_userpref.py
===================================================================
--- branches/soc-2010-jwilkins/release/scripts/ui/space_userpref.py	2010-07-01 19:29:27 UTC (rev 29855)
+++ branches/soc-2010-jwilkins/release/scripts/ui/space_userpref.py	2010-07-01 19:57:40 UTC (rev 29856)
@@ -333,7 +333,12 @@
         col.prop(edit, "sculpt_paint_pixel_radius", text="Unified Pixel Radius")
         col.prop(edit, "sculpt_paint_strength", text="Unified Strength")
         col.prop(sculpt, "use_openmp", text="Threaded Sculpt")
-	
+        col.prop(sculpt, "fast_navigate")
+        col.prop(sculpt, "show_brush")
+        row = col.row()
+        row.active = sculpt.show_brush
+        row.prop(sculpt, "show_brush_on_surface")
+
         col.separator()
         col.separator()
         col.separator()

Modified: branches/soc-2010-jwilkins/release/scripts/ui/space_view3d_toolbar.py
===================================================================
--- branches/soc-2010-jwilkins/release/scripts/ui/space_view3d_toolbar.py	2010-07-01 19:29:27 UTC (rev 29855)
+++ branches/soc-2010-jwilkins/release/scripts/ui/space_view3d_toolbar.py	2010-07-01 19:57:40 UTC (rev 29856)
@@ -19,6 +19,7 @@
 # <pep8 compliant>
 import bpy
 
+narrowui = bpy.context.user_preferences.view.properties_width_check
 
 class View3DPanel(bpy.types.Panel):
     bl_space_type = 'VIEW_3D'
@@ -580,7 +581,7 @@
 
                 row = col.row(align=True)
 
-                if brush.use_space:
+                if brush.use_space and brush.sculpt_tool not in ('SMOOTH'):
                     if brush.use_space_atten:
                         row.prop(brush, "use_space_atten", toggle=True, text="", icon='LOCKED')
                     else:
@@ -646,7 +647,7 @@
             else:
                 row.prop(brush, "use_original_normal", toggle=True, text="", icon='UNLOCKED')
 
-            row.prop(brush, "sculpt_direction", text="")
+            row.prop(brush, "sculpt_plane", text="")
 
             if brush.sculpt_tool in ('CLAY', 'WAX', 'FLATTEN', 'FILL', 'SCRAPE'):
                 row = col.row(align=True)
@@ -788,33 +789,54 @@
         col.template_ID_preview(brush, "texture", new="texture.new", rows=2, cols=4)
 
         if context.sculpt_object:
+            #XXX duplicated from properties_texture.py
+
+            wide_ui = context.region.width > narrowui
+
+            col.separator()
+
             row = col.row(align=True)
             row.prop(tex_slot, "map_mode", expand=True)
+
+            col.separator()
+
             row = col.row(align=True)
-            row.prop(brush, "texture_offset", slider=True, text="Depth Offset")
+            row.active = tex_slot.map_mode in ('FIXED')
+            row.prop(brush, "use_rake", toggle=True, icon='PARTICLEMODE', text="")
+            row.prop(tex_slot, "angle")
 
-            if tex_slot.map_mode in ('FIXED', 'TILED'):
-                sub = col.column(align=True)
-                sub.label(text="Scale:")
-                sub.prop(brush, "texture_scale_x", slider=True, text="X")
-                sub.prop(brush, "texture_scale_y", slider=True, text="Y")
-                sub.label(text="Offset:")
-                sub.prop(brush, "texture_center_x", slider=True, text="X")
-                sub.prop(brush, "texture_center_y", slider=True, text="Y")
+            split = layout.split()
 
-                row = col.row(align=True)
-                row.prop(tex_slot, "angle", slider=True)
+            col = split.column()
+            col.prop(tex_slot, "offset")
 
-                if tex_slot.map_mode in ('TILED'):
-                    row = col.row(align=True)
-                    row.prop(brush, "use_texture_overlay", text="Show Overlay")
-                    
-                    if brush.use_texture_overlay:
-                        row = col.row(align=True)
-                        row.prop(brush, "texture_overlay_alpha", slider=True, text="Overlay Alpha")
+            if wide_ui:
+                col = split.column()
+            col.prop(tex_slot, "size")
+
+            col = layout.column()
+
+            col.separator()
+
             row = col.row(align=True)
-            row.prop(brush, "use_rake")
+            row.prop(brush, "texture_sample_bias", slider=True, text="Sample Bias")
 
+            col.separator()
+
+            row = col.row(align=True)
+            row.active = tex_slot.map_mode in ('TILED')
+            
+            row = col.row(align=True)
+
+            if brush.use_texture_overlay:
+                row.prop(brush, "use_texture_overlay", toggle=True, text="", icon='MUTE_IPO_OFF')
+            else:
+                row.prop(brush, "use_texture_overlay", toggle=True, text="", icon='MUTE_IPO_ON')
+
+            row.active = tex_slot.map_mode in ('TILED') and brush.use_texture_overlay
+            row.prop(brush, "texture_overlay_alpha", slider=True, text="Alpha")
+
+
 class VIEW3D_PT_tools_brush_tool(PaintPanel):
     bl_label = "Tool"
     bl_default_closed = True
@@ -865,35 +887,63 @@
         brush = settings.brush
         texture_paint = context.texture_paint_object
 
+        col = layout.column()
+
         if context.sculpt_object:
-            if brush.sculpt_tool != 'LAYER':
-                layout.prop(brush, "restore_mesh", "Drag Dot")
-                layout.prop(brush, "use_anchor")
-                if brush.use_anchor:
-                    layout.prop(brush, "edge_to_edge", "Edge To Edge")
-        layout.prop(brush, "use_airbrush")
-        if brush.use_airbrush:
-            col = layout.column()
-            col.prop(brush, "rate", slider=True)
 
+           row = col.row()
+           row.prop(brush, "restore_mesh", "Drag Dot")
+
+           col.separator()
+
+           row = col.row()
+           row.prop(brush, "use_anchor")
+
+           row = col.row()
+           row.active = brush.use_anchor
+           row.prop(brush, "edge_to_edge", "Edge To Edge")
+
+           col.separator()
+
+        row = col.row()
+        row.prop(brush, "use_airbrush")
+
+        row = col.row()
+        row.active = brush.use_airbrush and (not brush.use_space) and (not brush.use_anchor)
+        row.prop(brush, "rate", slider=True)
+
+        col.separator()
+
         if not texture_paint:
-            layout.prop(brush, "use_smooth_stroke")
-            if brush.use_smooth_stroke:
-                col = layout.column()
-                col.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
-                col.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
+            row = col.row()
+            row.prop(brush, "use_smooth_stroke")
 
-        layout.prop(brush, "use_space")
-        if brush.use_space:
-            col = layout.column(align=True)
-            col.prop(brush, "use_space_atten", text="Adaptive Strength")
-            col.prop(brush, "spacing", text="Spacing", slider=True)
-            #col.prop(brush, "use_adaptive_space", text="Adaptive Spacing")
+            col = layout.column()
+            col.active = brush.use_smooth_stroke
+            col.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
+            col.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
 
-        if texture_paint:
-            row.prop(brush, "use_spacing_pressure", toggle=True, text="")
+        col.separator()
 
+        col = layout.column()
+        col.active = (not brush.use_anchor) and (brush.sculpt_tool not in ('GRAB', 'THUMB', 'ROTATE', 'SNAKE_HOOK', 'SMOOTH'))
 
+        row = col.row()
+        row.prop(brush, "use_space")
+
+        row = col.row()
+        row.active = brush.use_space
+        row.prop(brush, "spacing", text="Spacing", slider=True)
+
+        #col.prop(brush, "use_space_atten", text="Adaptive Strength")
+        #col.prop(brush, "use_adaptive_space", text="Adaptive Spacing")
+
+        #col.separator()
+
+        #if texture_paint:
+        #    row.prop(brush, "use_spacing_pressure", toggle=True, text="")
+
+
 class VIEW3D_PT_tools_brush_curve(PaintPanel):
     bl_label = "Curve"
     bl_default_closed = True
@@ -911,11 +961,14 @@
         layout.template_curve_mapping(brush, "curve", brush=True)
 
         row = layout.row(align=True)
-        row.operator("brush.curve_preset", text="Sharp").shape = 'SHARP'
-        row.operator("brush.curve_preset", text="Smooth").shape = 'SMOOTH'
-        row.operator("brush.curve_preset", text="Max").shape = 'MAX'
+        row.operator("brush.curve_preset", icon="SMOOTHCURVE", text="").shape = 'SMOOTH'
+        row.operator("brush.curve_preset", icon="SPHERECURVE", text="").shape = 'ROUND'
+        row.operator("brush.curve_preset", icon="ROOTCURVE", text="").shape = 'ROOT'
+        row.operator("brush.curve_preset", icon="SHARPCURVE", text="").shape = 'SHARP'
+        row.operator("brush.curve_preset", icon="LINCURVE", text="").shape = 'LINE'
+        row.operator("brush.curve_preset", icon="NOCURVE", text="").shape = 'MAX'

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list