diff options
Diffstat (limited to 'release/scripts/ui/properties_data_metaball.py')
-rw-r--r-- | release/scripts/ui/properties_data_metaball.py | 68 |
1 files changed, 26 insertions, 42 deletions
diff --git a/release/scripts/ui/properties_data_metaball.py b/release/scripts/ui/properties_data_metaball.py index 1cce0cea66f..b4bf8dc5d70 100644 --- a/release/scripts/ui/properties_data_metaball.py +++ b/release/scripts/ui/properties_data_metaball.py @@ -20,21 +20,20 @@ import bpy from rna_prop_ui import PropertyPanel -narrowui = bpy.context.user_preferences.view.properties_width_check - class DataButtonsPanel(): bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' bl_context = "data" - def poll(self, context): + @classmethod + def poll(cls, context): return context.meta_ball class DATA_PT_context_metaball(DataButtonsPanel, bpy.types.Panel): bl_label = "" - bl_show_header = False + bl_options = {'HIDE_HEADER'} def draw(self, context): layout = self.layout @@ -42,25 +41,14 @@ class DATA_PT_context_metaball(DataButtonsPanel, bpy.types.Panel): ob = context.object mball = context.meta_ball space = context.space_data - wide_ui = context.region.width > narrowui - - if wide_ui: - split = layout.split(percentage=0.65) - if ob: - split.template_ID(ob, "data") - split.separator() - elif mball: - split.template_ID(space, "pin_id") - split.separator() - else: - if ob: - layout.template_ID(ob, "data") - elif mball: - layout.template_ID(space, "pin_id") - -class DATA_PT_custom_props_metaball(DataButtonsPanel, PropertyPanel, bpy.types.Panel): - _context_path = "object.data" + split = layout.split(percentage=0.65) + if ob: + split.template_ID(ob, "data") + split.separator() + elif mball: + split.template_ID(space, "pin_id") + split.separator() class DATA_PT_metaball(DataButtonsPanel, bpy.types.Panel): @@ -70,55 +58,46 @@ class DATA_PT_metaball(DataButtonsPanel, bpy.types.Panel): layout = self.layout mball = context.meta_ball - wide_ui = context.region.width > narrowui split = layout.split() col = split.column() col.label(text="Resolution:") sub = col.column(align=True) - sub.prop(mball, "wire_size", text="View") - sub.prop(mball, "render_size", text="Render") + sub.prop(mball, "resolution", text="View") + sub.prop(mball, "render_resolution", text="Render") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Settings:") col.prop(mball, "threshold", text="Threshold") layout.label(text="Update:") - if wide_ui: - layout.prop(mball, "flag", expand=True) - else: - layout.prop(mball, "flag", text="") + layout.prop(mball, "update_method", expand=True) class DATA_PT_metaball_element(DataButtonsPanel, bpy.types.Panel): bl_label = "Active Element" - def poll(self, context): - return (context.meta_ball and context.meta_ball.active_element) + @classmethod + def poll(cls, context): + return (context.meta_ball and context.meta_ball.elements.active) def draw(self, context): layout = self.layout - metaelem = context.meta_ball.active_element - wide_ui = context.region.width > narrowui + metaelem = context.meta_ball.elements.active - if wide_ui: - layout.prop(metaelem, "type") - else: - layout.prop(metaelem, "type", text="") + layout.prop(metaelem, "type") split = layout.split() col = split.column(align=True) col.label(text="Settings:") col.prop(metaelem, "stiffness", text="Stiffness") - col.prop(metaelem, "negative", text="Negative") + col.prop(metaelem, "use_negative", text="Negative") col.prop(metaelem, "hide", text="Hide") - if wide_ui: - col = split.column(align=True) + col = split.column(align=True) if metaelem.type in ('CUBE', 'ELLIPSOID'): col.label(text="Size:") @@ -136,6 +115,11 @@ class DATA_PT_metaball_element(DataButtonsPanel, bpy.types.Panel): col.prop(metaelem, "size_y", text="Y") +class DATA_PT_custom_props_metaball(DataButtonsPanel, PropertyPanel, bpy.types.Panel): + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + _context_path = "object.data" + + def register(): pass |