forked from bartvdbraak/blender
- 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:
parent
78b76cc39f
commit
e9db9f2a91
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user