[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [41551] trunk/blender/release/scripts/ startup/bl_ui/space_view3d_toolbar.py: VIEW3D_PT_tools_meshedit_options panel:

Thomas Dinges blender at dingto.org
Sat Nov 5 11:34:31 CET 2011


Revision: 41551
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41551
Author:   dingto
Date:     2011-11-05 10:34:29 +0000 (Sat, 05 Nov 2011)
Log Message:
-----------
VIEW3D_PT_tools_meshedit_options panel:
* Removed ob check and add a proper poll function. 

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py

Modified: trunk/blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py	2011-11-05 10:19:36 UTC (rev 41550)
+++ trunk/blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py	2011-11-05 10:34:29 UTC (rev 41551)
@@ -172,28 +172,31 @@
 class VIEW3D_PT_tools_meshedit_options(View3DPanel, Panel):
     bl_context = "mesh_edit"
     bl_label = "Mesh Options"
+    
+    @classmethod
+    def poll(cls, context):
+        return context.active_object
 
     def draw(self, context):
         layout = self.layout
 
         ob = context.active_object
 
-        if ob:
-            tool_settings = context.tool_settings
-            mesh = ob.data
+        tool_settings = context.tool_settings
+        mesh = ob.data
 
-            col = layout.column(align=True)
-            col.active = tool_settings.proportional_edit == 'DISABLED'
-            col.prop(mesh, "use_mirror_x")
+        col = layout.column(align=True)
+        col.active = tool_settings.proportional_edit == 'DISABLED'
+        col.prop(mesh, "use_mirror_x")
 
-            row = col.row()
-            row.active = ob.data.use_mirror_x
-            row.prop(mesh, "use_mirror_topology")
+        row = col.row()
+        row.active = ob.data.use_mirror_x
+        row.prop(mesh, "use_mirror_topology")
 
-            col = layout.column(align=True)
-            col.label("Edge Select Mode:")
-            col.prop(tool_settings, "edge_path_mode", text="")
-            col.prop(tool_settings, "edge_path_live_unwrap")
+        col = layout.column(align=True)
+        col.label("Edge Select Mode:")
+        col.prop(tool_settings, "edge_path_mode", text="")
+        col.prop(tool_settings, "edge_path_live_unwrap")
 
 # ********** default tools for editmode_curve ****************
 




More information about the Bf-blender-cvs mailing list