[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [24805] trunk/blender/release/scripts: - made properties in the view3d panel only show when there are some properties available since this the option to add props isnt in this panel

Campbell Barton ideasman42 at gmail.com
Mon Nov 23 14:06:26 CET 2009


Revision: 24805
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=24805
Author:   campbellbarton
Date:     2009-11-23 14:06:26 +0100 (Mon, 23 Nov 2009)

Log Message:
-----------
- made properties in the view3d panel only show when there are some properties available since this the option to add props isnt in this panel
- remove print on startup

Modified Paths:
--------------
    trunk/blender/release/scripts/io/export_3ds.py
    trunk/blender/release/scripts/modules/bpy/__init__.py
    trunk/blender/release/scripts/ui/space_view3d.py

Modified: trunk/blender/release/scripts/io/export_3ds.py
===================================================================
--- trunk/blender/release/scripts/io/export_3ds.py	2009-11-23 11:58:30 UTC (rev 24804)
+++ trunk/blender/release/scripts/io/export_3ds.py	2009-11-23 13:06:26 UTC (rev 24805)
@@ -1132,7 +1132,6 @@
 		return ('RUNNING_MODAL',)
 	
 	def poll(self, context): # Poll isnt working yet
-		print("Poll")
 		return context.active_object != None
 
 bpy.ops.add(Export3DS)

Modified: trunk/blender/release/scripts/modules/bpy/__init__.py
===================================================================
--- trunk/blender/release/scripts/modules/bpy/__init__.py	2009-11-23 11:58:30 UTC (rev 24804)
+++ trunk/blender/release/scripts/modules/bpy/__init__.py	2009-11-23 13:06:26 UTC (rev 24805)
@@ -44,7 +44,6 @@
             return None
 
     for base_path in utils.script_paths():
-        print(base_path)
         for path_subdir in ("ui", "op", "io"):
             path = os.path.join(base_path, path_subdir)
             sys.path.insert(0, path)

Modified: trunk/blender/release/scripts/ui/space_view3d.py
===================================================================
--- trunk/blender/release/scripts/ui/space_view3d.py	2009-11-23 11:58:30 UTC (rev 24804)
+++ trunk/blender/release/scripts/ui/space_view3d.py	2009-11-23 13:06:26 UTC (rev 24805)
@@ -1770,21 +1770,34 @@
     bl_label = "Properties"
     bl_default_closed = True
 
-    def draw(self, context):
-        import rna_prop_ui
-        # reload(rna_prop_ui)
+    def _active_context_member(self, context):
         obj = context.object
         if obj:
             mode = obj.mode
             if mode == 'POSE':
-                item = "active_pchan"
+                return "active_pchan"
             elif mode == 'EDIT' and obj.type == 'ARMATURE':
-                item = "active_bone"
+                return "active_bone"
             else:
-                item = "object"
+                return "object"
 
+        return ""
+    
+    def poll(self, context):
+        member = self._active_context_member(context)
+        if member:
+            return getattr(context, member).keys()
+
+        return False
+
+    def draw(self, context):
+        import rna_prop_ui
+        # reload(rna_prop_ui)
+        member = self._active_context_member(context)
+
+        if member:
             # Draw with no edit button
-            rna_prop_ui.draw(self.layout, context, item, False)
+            rna_prop_ui.draw(self.layout, context, member, False)
 
 
 # Operators





More information about the Bf-blender-cvs mailing list