[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [35929] trunk/blender: while looking into adding back brush tool keys found mixed texture/ image paint rna vars, using 'image paint' internally.

Campbell Barton ideasman42 at gmail.com
Fri Apr 1 06:22:31 CEST 2011


Revision: 35929
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=35929
Author:   campbellbarton
Date:     2011-04-01 04:22:30 +0000 (Fri, 01 Apr 2011)
Log Message:
-----------
while looking into adding back brush tool keys found mixed texture/image paint rna vars, using 'image paint' internally.

Modified Paths:
--------------
    trunk/blender/doc/python_api/sphinx_doc_gen.py
    trunk/blender/release/scripts/startup/bl_operators/wm.py
    trunk/blender/release/scripts/startup/bl_ui/space_image.py
    trunk/blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py
    trunk/blender/source/blender/blenkernel/intern/context.c
    trunk/blender/source/blender/editors/interface/interface_icons.c
    trunk/blender/source/blender/editors/screen/screen_context.c
    trunk/blender/source/blender/editors/sculpt_paint/paint_ops.c
    trunk/blender/source/blender/makesrna/RNA_enum_types.h
    trunk/blender/source/blender/makesrna/intern/rna_brush.c

Modified: trunk/blender/doc/python_api/sphinx_doc_gen.py
===================================================================
--- trunk/blender/doc/python_api/sphinx_doc_gen.py	2011-04-01 02:41:15 UTC (rev 35928)
+++ trunk/blender/doc/python_api/sphinx_doc_gen.py	2011-04-01 04:22:30 UTC (rev 35929)
@@ -461,6 +461,7 @@
         "edit_text": ("Text", False),
         "editable_bones": ("EditBone", True),
         "fluid": ("FluidSimulationModifier", False),
+        "image_paint_object": ("Object", False),
         "lamp": ("Lamp", False),
         "lattice": ("Lattice", False),
         "material": ("Material", False),
@@ -490,7 +491,6 @@
         "smoke": ("SmokeModifier", False),
         "soft_body": ("SoftBodyModifier", False),
         "texture": ("Texture", False),
-        "texture_paint_object": ("Object", False),
         "texture_slot": ("MaterialTextureSlot", False),
         "vertex_paint_object": ("Object", False),
         "visible_bases": ("ObjectBase", True),

Modified: trunk/blender/release/scripts/startup/bl_operators/wm.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_operators/wm.py	2011-04-01 02:41:15 UTC (rev 35928)
+++ trunk/blender/release/scripts/startup/bl_operators/wm.py	2011-04-01 04:22:30 UTC (rev 35929)
@@ -74,20 +74,20 @@
     return {'FINISHED'}
 
 
-class BRUSH_OT_set_active_number(bpy.types.Operator):
+class BRUSH_OT_active_index_set(bpy.types.Operator):
     '''Set active sculpt/paint brush from it's number'''
-    bl_idname = "brush.set_active_number"
+    bl_idname = "brush.active_index_set"
     bl_label = "Set Brush Number"
 
     mode = StringProperty(name="mode",
             description="Paint mode to set brush for", maxlen=1024)
-    number = IntProperty(name="number",
+    index = IntProperty(name="number",
             description="Brush number")
 
     _attr_dict = {"sculpt": "use_paint_sculpt",
                   "vertex_paint": "use_paint_vertex",
                   "weight_paint": "use_paint_weight",
-                  "image_paint": "use_paint_texture"}
+                  "image_paint": "use_paint_image"}
 
     def execute(self, context):
         attr = self._attr_dict.get(self.mode)

Modified: trunk/blender/release/scripts/startup/bl_ui/space_image.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_image.py	2011-04-01 02:41:15 UTC (rev 35928)
+++ trunk/blender/release/scripts/startup/bl_ui/space_image.py	2011-04-01 04:22:30 UTC (rev 35929)
@@ -667,7 +667,7 @@
 
             col.prop(brush, "blend", text="Blend")
 
-            if brush.imagepaint_tool == 'CLONE':
+            if brush.image_tool == 'CLONE':
                 col.separator()
                 col.prop(brush, "clone_image", text="Image")
                 col.prop(brush, "clone_alpha", text="Alpha")
@@ -699,13 +699,13 @@
 
         col = layout.column(align=True)
 
-        col.prop(brush, "imagepaint_tool", expand=False, text="")
+        col.prop(brush, "image_tool", expand=False, text="")
 
         row = layout.row(align=True)
         row.prop(brush, "use_paint_sculpt", text="", icon='SCULPTMODE_HLT')
         row.prop(brush, "use_paint_vertex", text="", icon='VPAINT_HLT')
         row.prop(brush, "use_paint_weight", text="", icon='WPAINT_HLT')
-        row.prop(brush, "use_paint_texture", text="", icon='TPAINT_HLT')
+        row.prop(brush, "use_paint_image", text="", icon='TPAINT_HLT')
 
 
 class IMAGE_PT_paint_stroke(BrushButtonsPanel, bpy.types.Panel):

Modified: trunk/blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py	2011-04-01 02:41:15 UTC (rev 35928)
+++ trunk/blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py	2011-04-01 04:22:30 UTC (rev 35929)
@@ -455,7 +455,7 @@
             return ts.vertex_paint
         elif context.weight_paint_object:
             return ts.weight_paint
-        elif context.texture_paint_object:
+        elif context.image_paint_object:
             return ts.image_paint
         elif context.particle_edit_object:
             return ts.particle_edit
@@ -619,7 +619,7 @@
 
         # Texture Paint Mode #
 
-        elif context.texture_paint_object and brush:
+        elif context.image_paint_object and brush:
             col = layout.column()
             col.template_color_wheel(brush, "color", value_slider=True)
             col.prop(brush, "color", text="")
@@ -689,7 +689,7 @@
     def poll(cls, context):
         settings = cls.paint_settings(context)
         return (settings and settings.brush and (context.sculpt_object or
-                             context.texture_paint_object))
+                             context.image_paint_object))
 
     def draw(self, context):
         layout = self.layout
@@ -701,7 +701,7 @@
         col = layout.column()
 
         col.template_ID_preview(brush, "texture", new="texture.new", rows=3, cols=8)
-        if brush.use_paint_texture:
+        if brush.use_paint_image:
             col.prop(brush, "use_fixed_texture")
 
         if context.sculpt_object:
@@ -787,7 +787,7 @@
     def poll(cls, context):
         settings = cls.paint_settings(context)
         return (settings and settings.brush and
-            (context.sculpt_object or context.texture_paint_object or
+            (context.sculpt_object or context.image_paint_object or
             context.vertex_paint_object or context.weight_paint_object))
 
     def draw(self, context):
@@ -796,7 +796,7 @@
         settings = __class__.paint_settings(context)
         brush = settings.brush
         ## Unused
-        # texture_paint = context.texture_paint_object
+        # image_paint = context.image_paint_object
         # sculpt = context.sculpt_object
 
         col = layout.column(align=True)
@@ -804,16 +804,16 @@
         if context.sculpt_object:
             col.prop(brush, "sculpt_tool", expand=False, text="")
             col.operator("brush.reset")
-        elif context.texture_paint_object:
-            col.prop(brush, "imagepaint_tool", expand=False, text="")
+        elif context.image_paint_object:
+            col.prop(brush, "image_tool", expand=False, text="")
         elif context.vertex_paint_object or context.weight_paint_object:
-            col.prop(brush, "vertexpaint_tool", expand=False, text="")
+            col.prop(brush, "vertex_tool", expand=False, text="")
 
         row = layout.row(align=True)
         row.prop(brush, "use_paint_sculpt", text="", icon='SCULPTMODE_HLT')
         row.prop(brush, "use_paint_vertex", text="", icon='VPAINT_HLT')
         row.prop(brush, "use_paint_weight", text="", icon='WPAINT_HLT')
-        row.prop(brush, "use_paint_texture", text="", icon='TPAINT_HLT')
+        row.prop(brush, "use_paint_image", text="", icon='TPAINT_HLT')
 
 
 class VIEW3D_PT_tools_brush_stroke(PaintPanel, bpy.types.Panel):
@@ -826,14 +826,14 @@
         return (settings and settings.brush and (context.sculpt_object or
                              context.vertex_paint_object or
                              context.weight_paint_object or
-                             context.texture_paint_object))
+                             context.image_paint_object))
 
     def draw(self, context):
         layout = self.layout
 
         settings = __class__.paint_settings(context)
         brush = settings.brush
-        texture_paint = context.texture_paint_object
+        image_paint = context.image_paint_object
 
         col = layout.column()
 
@@ -884,7 +884,7 @@
 
             col.separator()
 
-            if not texture_paint:
+            if not image_paint:
                 row = col.row()
                 row.prop(brush, "use_smooth_stroke")
 
@@ -910,7 +910,7 @@
 
             #col.separator()
 
-            #if texture_paint:
+            #if image_paint:
             #    row.prop(brush, "use_pressure_spacing", toggle=True, text="")
 
 
@@ -1018,7 +1018,7 @@
 
     @classmethod
     def poll(cls, context):
-        return (context.sculpt_object and context.tool_settings.sculpt) or (context.vertex_paint_object and context.tool_settings.vertex_paint) or (context.weight_paint_object and context.tool_settings.weight_paint) or (context.texture_paint_object and context.tool_settings.image_paint)
+        return (context.sculpt_object and context.tool_settings.sculpt) or (context.vertex_paint_object and context.tool_settings.vertex_paint) or (context.weight_paint_object and context.tool_settings.weight_paint) or (context.image_paint_object and context.tool_settings.image_paint)
 
     def draw(self, context):
         layout = self.layout
@@ -1135,13 +1135,13 @@
 
 
 class VIEW3D_PT_tools_projectpaint(View3DPanel, bpy.types.Panel):
-    bl_context = "texturepaint"
+    bl_context = "imagepaint"
     bl_label = "Project Paint"
 
     @classmethod
     def poll(cls, context):
         brush = context.tool_settings.image_paint.brush
-        return (brush and brush.imagepaint_tool != 'SOFTEN')
+        return (brush and brush.image_tool != 'SOFTEN')
 
     def draw_header(self, context):
         ipaint = context.tool_settings.image_paint
@@ -1184,7 +1184,7 @@
         col = layout.column()
         sub = col.column()
         row = sub.row()
-        row.active = (settings.brush.imagepaint_tool == 'CLONE')
+        row.active = (settings.brush.image_tool == 'CLONE')
 
         row.prop(ipaint, "use_clone_layer", text="Layer")
         row.menu("VIEW3D_MT_tools_projectpaint_clone", text=context.active_object.data.uv_texture_clone.name)
@@ -1211,7 +1211,7 @@
 
     @classmethod
     def poll(cls, context):
-        return (context.texture_paint_object and context.tool_settings.image_paint)
+        return (context.image_paint_object and context.tool_settings.image_paint)
 
     def draw(self, context):
         layout = self.layout

Modified: trunk/blender/source/blender/blenkernel/intern/context.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/context.c	2011-04-01 02:41:15 UTC (rev 35928)
+++ trunk/blender/source/blender/blenkernel/intern/context.c	2011-04-01 04:22:30 UTC (rev 35929)
@@ -790,7 +790,7 @@
 	"sculpt_mode",
 	"weightpaint",
 	"vertexpaint",
-	"texturepaint",
+	"imagepaint",
 	"particlemode",
 	"objectmode",
 	NULL


@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list