[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [29341] branches/soc-2010-jwilkins: * Stencil buffer pixel format request for Mac OSX (Cocoa)

Nicholas Bishop nicholasbishop at gmail.com
Tue Jun 8 19:15:28 CEST 2010


Hi Jason,

Nice work, some very clever changes here :) I hope you won't mind if I
take a moment to nitpick on a few things:

> * Added "Restore Mesh" feature to strokes that allows you to drag a shape around on the surface to place it carefully
Perhaps this could be named "Dot"?

> * Unchecking "Original Normal" now hides the "Normal Direction" list box
> * The airbrush rate, smoothstroke, and spacing modifiers are hidden now when their respective strokes are not selected
This is I think inconsistent with other things in Blender; perhaps
this could be solved similar to, for example, Anti-Aliasing in the
Render settings. It's a collapsible section with a checkbox, and
things inside the section are greyed out until the box is checked.

> * Added controls to select the color of each individual brush in both add and subtract mode.
Small bug, the color doesn't change when pressing shift to flip brush direction.

> * Layer does not use direction so removed the add/subtract button for it.
> - Possible bug?  The layer tool does not behave correctly in subtract mod if it is allowed
That's a bug in your branch, layer brush has direction support in trunk.

> * The 'on surface' brush requires that the depth buffer be saved so I modified the "triple" update path to save depth values as well.
I don't know the defaults of what's being done here, but be careful
that the stroke can still be executed without OpenGL information (e.g.
when doing Repeat Last.)
In general we've tried really hard to remove all the OpenGL stuff from
sculpt in 2.5 :)

> * Made outline of brush on surface thinner
I'm finding this a little hard to see.

Thanks,
-Nicholas

>
> Modified Paths:
> --------------
>    branches/soc-2010-jwilkins/intern/ghost/intern/GHOST_WindowCocoa.mm
>    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/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/sculpt.c
>    branches/soc-2010-jwilkins/source/blender/makesdna/DNA_brush_types.h
>    branches/soc-2010-jwilkins/source/blender/makesrna/intern/rna_brush.c
>    branches/soc-2010-jwilkins/source/blender/windowmanager/intern/wm_draw.c
>
> Modified: branches/soc-2010-jwilkins/intern/ghost/intern/GHOST_WindowCocoa.mm
> ===================================================================
> --- branches/soc-2010-jwilkins/intern/ghost/intern/GHOST_WindowCocoa.mm 2010-06-08 13:03:49 UTC (rev 29340)
> +++ branches/soc-2010-jwilkins/intern/ghost/intern/GHOST_WindowCocoa.mm 2010-06-08 13:54:36 UTC (rev 29341)
> @@ -349,15 +349,22 @@
>        pixelFormatAttrsWindow[i++] = NSOpenGLPFAAccelerated;
>        //pixelFormatAttrsWindow[i++] = NSOpenGLPFAAllowOfflineRenderers,;   // Removed to allow 10.4 builds, and 2 GPUs rendering is not used anyway
>
> +       pixelFormatAttrsWindow[i++] = NSOpenGLPFAStencilSize;
> +       pixelFormatAttrsWindow[i++] = (NSOpenGLPixelFormatAttribute) 8;
> +
>        pixelFormatAttrsWindow[i++] = NSOpenGLPFADepthSize;
>        pixelFormatAttrsWindow[i++] = (NSOpenGLPixelFormatAttribute) 32;
>
> +
>        if (stereoVisual) pixelFormatAttrsWindow[i++] = NSOpenGLPFAStereo;
>
>        if (numOfAASamples>0) {
>                // Multisample anti-aliasing
>                pixelFormatAttrsWindow[i++] = NSOpenGLPFAMultisample;
>
> +               pixelFormatAttrsWindow[i++] = NSOpenGLPFAStencilSize;
> +               pixelFormatAttrsWindow[i++] = (NSOpenGLPixelFormatAttribute) 8;
> +
>                pixelFormatAttrsWindow[i++] = NSOpenGLPFASampleBuffers;
>                pixelFormatAttrsWindow[i++] = (NSOpenGLPixelFormatAttribute) 1;
>
>
> Modified: branches/soc-2010-jwilkins/release/scripts/ui/space_view3d_toolbar.py
> ===================================================================
> --- branches/soc-2010-jwilkins/release/scripts/ui/space_view3d_toolbar.py       2010-06-08 13:03:49 UTC (rev 29340)
> +++ branches/soc-2010-jwilkins/release/scripts/ui/space_view3d_toolbar.py       2010-06-08 13:54:36 UTC (rev 29341)
> @@ -547,19 +547,14 @@
>             col.separator()
>
>             row = col.row(align=True)
> -            row.prop(brush, "lock_brush_size", text="Use Surface Size")
> +            row.prop(brush, "lock_brush_size", text="Use Blender Units")
>
>             row = col.row(align=True)
> -            row.prop(brush, "unprojected_radius", text="Surface Size", slider=True)
> -            row.active = brush.lock_brush_size
> +            if brush.lock_brush_size:
> +                row.prop(brush, "unprojected_radius", text="Units", slider=True)
> +            else:
> +                row.prop(brush, "size", slider=True, text="Pixels")
>
> -            if brush.sculpt_tool != 'GRAB' and brush.lock_brush_size:
> -                row.prop(brush, "use_size_pressure", toggle=True, text="")
> -
> -            row = col.row(align=True)
> -            row.prop(brush, "size", slider=True, text="Pixel Size")
> -            row.active = not brush.lock_brush_size
> -
>             if brush.sculpt_tool != 'GRAB' and not brush.lock_brush_size:
>                 row.prop(brush, "use_size_pressure", toggle=True, text="")
>
> @@ -579,7 +574,7 @@
>                     row.prop(brush, "plane_offset", slider=True)
>                     row.prop(brush, "use_offset_pressure", text="")
>
> -                if brush.sculpt_tool in ('DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'):
> +                if brush.sculpt_tool in ('DRAW', 'PINCH', 'INFLATE', 'CLAY'):
>                     col.row().prop(brush, "direction", expand=True)
>
>                 if brush.sculpt_tool in ('DRAW', 'INFLATE', 'LAYER', 'CLAY'):
> @@ -693,11 +688,29 @@
>             row = col.row(align=True)
>             row.prop(tex_slot, "map_mode", expand=True)
>             row = col.row(align=True)
> -            row.prop(brush, "texture_offset", slider=True)
> +            row.prop(brush, "texture_offset", slider=True, text="Depth Offset")
>
> -        row = col.row(align=True)
> -        row.prop(tex_slot, "angle", slider=True)
> +            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="Width")
> +                sub.prop(brush, "texture_scale_y", slider=True, text="Height")
> +                sub.prop(brush, "texture_scale_percentage", slider=True, text="")
> +                sub.label(text="Center:")
> +                sub.prop(brush, "texture_center_x", slider=True, text="Center X")
> +                sub.prop(brush, "texture_center_y", slider=True, text="Center Y")
>
> +                row = col.row(align=True)
> +                row.prop(tex_slot, "angle", slider=True)
> +
> +                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")
> +
>  class VIEW3D_PT_tools_brush_tool(PaintPanel):
>     bl_label = "Tool"
>     bl_default_closed = True
> @@ -750,35 +763,35 @@
>
>         if context.sculpt_object:
>             if brush.sculpt_tool != 'LAYER':
> +                layout.prop(brush, "restore_mesh")
>                 layout.prop(brush, "use_anchor")
> +                if brush.use_anchor:
> +                    layout.prop(brush, "edge_to_edge")
>             layout.prop(brush, "use_rake")
>             if brush.sculpt_tool in ('DRAW', 'LAYER', 'FLATTEN', 'CLAY', 'FILL', 'SCRAPE', 'CONTRAST'):
>                 layout.prop(brush, "use_original_normal")
> -                col = layout.column()
> -                col.label(text="Direction:")
> -                col.prop(brush, "sculpt_direction", text="")
> +                if brush.use_original_normal:
> +                    col = layout.column()
> +                    col.label(text="Direction:")
> +                    col.prop(brush, "sculpt_direction", text="")
>         layout.prop(brush, "use_airbrush")
> -        col = layout.column()
> -        col.active = brush.use_airbrush
> -        col.prop(brush, "rate", slider=True)
> +        if brush.use_airbrush:
> +            col = layout.column()
> +            col.prop(brush, "rate", slider=True)
>
>         if not texture_paint:
>             layout.prop(brush, "use_smooth_stroke")
> -            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 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)
>
>         layout.prop(brush, "use_space")
> -        row = layout.row(align=True)
> -        row.active = brush.use_space
> -        row.prop(brush, "spacing", text="Spacing", slider=True)
> -        row = layout.row(align=True)
> -        row.active = brush.use_space
> -        row.prop(brush, "use_space_atten", text="Adaptive Strength")
> -        #row = layout.row(align=True)
> -        #row.active = brush.use_space
> -        #row.prop(brush, "use_adaptive_space", text="Adaptive Spacing")
> +        if brush.use_space:
> +            col = layout.col(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")
>
>         if texture_paint:
>             row.prop(brush, "use_spacing_pressure", toggle=True, text="")
> @@ -816,12 +829,25 @@
>         layout = self.layout
>
>         sculpt = context.tool_settings.sculpt
> +        settings = self.paint_settings(context)
> +        brush = settings.brush
>
>         col = layout.column()
>         col.prop(sculpt, "show_brush")
> -        col.prop(sculpt, "show_brush_on_surface")
> +        if sculpt.show_brush:
> +            col.prop(sculpt, "show_brush_on_surface")
>         col.prop(sculpt, "fast_navigate")
>
> +        if brush.sculpt_tool in ('DRAW', 'INFLATE', 'CLAY', 'PINCH'):
> +            sub = col.column()
> +            sub.label(text="Color:")
> +            sub.prop(brush, "add_col", text="Add")
> +            sub.prop(brush, "sub_col", text="Substract")
> +        else:
> +            sub = col.column()
> +            sub.prop(brush, "add_col", text="Color")
> +
> +
>         split = self.layout.split()
>
>         col = split.column()
>
> Modified: branches/soc-2010-jwilkins/source/blender/blenkernel/intern/brush.c
> ===================================================================
> --- branches/soc-2010-jwilkins/source/blender/blenkernel/intern/brush.c 2010-06-08 13:03:49 UTC (rev 29340)
> +++ branches/soc-2010-jwilkins/source/blender/blenkernel/intern/brush.c 2010-06-08 13:54:36 UTC (rev 29341)
> @@ -88,7 +88,22 @@
>        brush->flag |= BRUSH_SPACE;
>        brush->detail = 0.25f;
>        brush->smoothness = 0.25f;
> +       brush->plane_offset = 0;
> +       brush->texture_center_x = 0;
> +       brush->texture_center_y = 0;
> +       brush->texture_scale_x = 1;
> +       brush->texture_scale_y = 1;
> +       brush->texture_offset = 0;
> +       brush->overlay_texture = 0;
>
> +       brush->add_col[0] = 1.00;
> +       brush->add_col[1] = 0.39;
> +       brush->add_col[2] = 0.39;
> +
> +       brush->sub_col[0] = 0.39;
> +       brush->sub_col[1] = 0.39;
> +       brush->sub_col[2] = 1.00;
> +
>        brush_curve_preset(brush, CURVE_PRESET_SMOOTH);
>
>        default_mtex(&brush->mtex);
> @@ -1021,7 +1036,12 @@
>        const float conv = 0.017453293;
>
>        if(mode == WM_RADIALCONTROL_SIZE)
> -               br->size = new_value * size_weight;
> +               if (br->flag & BRUSH_LOCK_SIZE) {
> +                       float initial_value = RNA_float_get(op->ptr, "initial_value");
> +                       br->unprojected_radius *= new_value/initial_value * size_weight;
> +               }
> +               else
> +                       br->size = new_value * size_weight;
>        else if(mode == WM_RADIALCONTROL_STRENGTH)
>                br->alpha = new_value;
>        else if(mode == WM_RADIALCONTROL_ANGLE) {
>
> Modified: branches/soc-2010-jwilkins/source/blender/blenloader/intern/readfile.c
> ===================================================================
> --- branches/soc-2010-jwilkins/source/blender/blenloader/intern/readfile.c      2010-06-08 13:03:49 UTC (rev 29340)
> +++ branches/soc-2010-jwilkins/source/blender/blenloader/intern/readfile.c      2010-06-08 13:54:36 UTC (rev 29341)
> @@ -10925,10 +10925,31 @@
>        {
>                Brush *brush;
>                for (brush= main->brush.first; brush; brush= brush->id.next) {
> -                       if(brush->detail == 0.0f)
> -                               brush->detail = 0.25f;
> -                       if (brush->smoothness == 0.0f)
> -                               brush->smoothness = 0.25f;
> +                       if (brush->detail == 0.0f)                brush->detail = 0.25f;
> +                       if (brush->smoothness == 0.0f)            brush->smoothness = 0.25f;
>
> @@ Diff output truncated at 10240 characters. @@
>
> _______________________________________________
> Bf-blender-cvs mailing list
> Bf-blender-cvs at blender.org
> http://lists.blender.org/mailman/listinfo/bf-blender-cvs
>


More information about the Bf-committers mailing list