* Tweak texture paint view3d settings, make projection paint options dependent on...
authorMatt Ebb <matt@mke3.net>
Fri, 28 Aug 2009 02:24:14 +0000 (02:24 +0000)
committerMatt Ebb <matt@mke3.net>
Fri, 28 Aug 2009 02:24:14 +0000 (02:24 +0000)
release/ui/space_view3d_toolbar.py

index bbca43279a708948a6c1448d11816ce606ebfe00..0e6dc76d49dece1bc296198d99394a8c00810b4b 100644 (file)
@@ -362,10 +362,8 @@ class VIEW3D_PT_tools_brush(PaintPanel):
                        col = layout.column(align=True)
                        col.item_enumR(settings, "tool", 'DRAW')
                        col.item_enumR(settings, "tool", 'SOFTEN')
-                       if settings.use_projection:
-                               col.item_enumR(settings, "tool", 'CLONE')
-                       else:
-                               col.item_enumR(settings, "tool", 'SMEAR')
+                       col.item_enumR(settings, "tool", 'CLONE')
+                       col.item_enumR(settings, "tool", 'SMEAR')
                                
                        col = layout.column()
                        col.itemR(brush, "color", text="")
@@ -540,12 +538,22 @@ class VIEW3D_PT_tools_vertexpaint(View3DPanel):
 #              col.itemR(vpaint, "mul", text="")
 
 
-# ********** default tools for texturepaint ****************
+# ********** options for projection paint ****************
 
-class VIEW3D_PT_tools_texturepaint(View3DPanel):
+class VIEW3D_PT_tools_projectpaint(View3DPanel):
        __context__ = "texturepaint"
-       __label__ = "Options"
+       __label__ = "Project Paint"
+       
+       def poll(self, context):
+               return context.tool_settings.image_paint.tool != 'SMEAR'
+       
+       def draw_header(self, context):
+               layout = self.layout
+               
+               ipaint = context.tool_settings.image_paint
 
+               layout.itemR(ipaint, "use_projection", text="")
+       
        def draw(self, context):
                layout = self.layout
                
@@ -554,7 +562,6 @@ class VIEW3D_PT_tools_texturepaint(View3DPanel):
                use_projection= ipaint.use_projection
                
                col = layout.column()
-               col.itemR(ipaint, "use_projection")
                sub = col.column()
                sub.active = use_projection
                sub.itemR(ipaint, "use_occlude")
@@ -631,5 +638,5 @@ bpy.types.register(VIEW3D_PT_tools_brush_curve)
 bpy.types.register(VIEW3D_PT_sculpt_options)
 bpy.types.register(VIEW3D_PT_tools_vertexpaint)
 bpy.types.register(VIEW3D_PT_tools_weightpaint)
-bpy.types.register(VIEW3D_PT_tools_texturepaint)
+bpy.types.register(VIEW3D_PT_tools_projectpaint)
 bpy.types.register(VIEW3D_PT_tools_particlemode)