- 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
This commit is contained in:
Campbell Barton 2009-11-23 13:06:26 +00:00
parent 78b76cc39f
commit e9db9f2a91
3 changed files with 20 additions and 9 deletions

@ -1132,7 +1132,6 @@ class Export3DS(bpy.types.Operator):
return ('RUNNING_MODAL',)
def poll(self, context): # Poll isnt working yet
print("Poll")
return context.active_object != None
bpy.ops.add(Export3DS)

@ -44,7 +44,6 @@ def load_scripts(reload_scripts=False):
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)

@ -1770,21 +1770,34 @@ class VIEW3D_PT_context_properties(bpy.types.Panel):
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