diff options
Diffstat (limited to 'release/scripts/ui/properties_data_lattice.py')
-rw-r--r-- | release/scripts/ui/properties_data_lattice.py | 68 |
1 files changed, 23 insertions, 45 deletions
diff --git a/release/scripts/ui/properties_data_lattice.py b/release/scripts/ui/properties_data_lattice.py index 2aa719437a7..9abdb23ea23 100644 --- a/release/scripts/ui/properties_data_lattice.py +++ b/release/scripts/ui/properties_data_lattice.py @@ -20,19 +20,18 @@ import bpy from rna_prop_ui import PropertyPanel -narrowui = bpy.context.user_preferences.view.properties_width_check - -class DataButtonsPanel(bpy.types.Panel): +class DataButtonsPanel(): bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' bl_context = "data" - def poll(self, context): + @classmethod + def poll(cls, context): return context.lattice -class DATA_PT_context_lattice(DataButtonsPanel): +class DATA_PT_context_lattice(DataButtonsPanel, bpy.types.Panel): bl_label = "" bl_show_header = False @@ -42,79 +41,58 @@ class DATA_PT_context_lattice(DataButtonsPanel): ob = context.object lat = context.lattice 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 lat: - split.template_ID(space, "pin_id") - split.separator() - else: - if ob: - layout.template_ID(ob, "data") - elif lat: - layout.template_ID(space, "pin_id") - - -class DATA_PT_custom_props_lattice(DataButtonsPanel, PropertyPanel): - _context_path = "object.data" + + split = layout.split(percentage=0.65) + if ob: + split.template_ID(ob, "data") + split.separator() + elif lat: + split.template_ID(space, "pin_id") + split.separator() -class DATA_PT_lattice(DataButtonsPanel): +class DATA_PT_lattice(DataButtonsPanel, bpy.types.Panel): bl_label = "Lattice" def draw(self, context): layout = self.layout lat = context.lattice - wide_ui = context.region.width > narrowui split = layout.split() col = split.column() col.prop(lat, "points_u") - if wide_ui: - col = split.column() + col = split.column() col.prop(lat, "interpolation_type_u", text="") split = layout.split() col = split.column() col.prop(lat, "points_v") - if wide_ui: - col = split.column() + col = split.column() col.prop(lat, "interpolation_type_v", text="") split = layout.split() col = split.column() col.prop(lat, "points_w") - if wide_ui: - col = split.column() + col = split.column() col.prop(lat, "interpolation_type_w", text="") row = layout.row() - row.prop(lat, "outside") + row.prop(lat, "use_outside") row.prop_object(lat, "vertex_group", context.object, "vertex_groups", text="") + - -classes = [ - DATA_PT_context_lattice, - DATA_PT_lattice, - - DATA_PT_custom_props_lattice] +class DATA_PT_custom_props_lattice(DataButtonsPanel, PropertyPanel, bpy.types.Panel): + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + _context_path = "object.data" def register(): - register = bpy.types.register - for cls in classes: - register(cls) + pass def unregister(): - unregister = bpy.types.unregister - for cls in classes: - unregister(cls) + pass if __name__ == "__main__": register() |