From 36b3690e0cd509cff4c67c6f8befa0341cfe45b4 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Tue, 28 Apr 2020 17:18:05 +0200 Subject: OBJ: Cleeanup: keep sane logical organization of code. Since panels of importer are defined after the operator, do the same for the exporter... --- io_scene_obj/__init__.py | 194 +++++++++++++++++++++++------------------------ 1 file changed, 97 insertions(+), 97 deletions(-) (limited to 'io_scene_obj') diff --git a/io_scene_obj/__init__.py b/io_scene_obj/__init__.py index cfe66283..e9fc8259 100644 --- a/io_scene_obj/__init__.py +++ b/io_scene_obj/__init__.py @@ -234,103 +234,6 @@ class OBJ_PT_import_geometry(bpy.types.Panel): col.prop(operator, "use_groups_as_vgroups") -class OBJ_PT_export_include(bpy.types.Panel): - bl_space_type = 'FILE_BROWSER' - bl_region_type = 'TOOL_PROPS' - bl_label = "Include" - bl_parent_id = "FILE_PT_operator" - - @classmethod - def poll(cls, context): - sfile = context.space_data - operator = sfile.active_operator - - return operator.bl_idname == "EXPORT_SCENE_OT_obj" - - def draw(self, context): - layout = self.layout - layout.use_property_split = True - layout.use_property_decorate = False # No animation. - - sfile = context.space_data - operator = sfile.active_operator - - col = layout.column(heading="Limit to") - col.prop(operator, 'use_selection') - - col = layout.column(heading="Objects as", align=True) - col.prop(operator, 'use_blen_objects') - col.prop(operator, 'group_by_object') - col.prop(operator, 'group_by_material') - - layout.separator() - - layout.prop(operator, 'use_animation') - - -class OBJ_PT_export_transform(bpy.types.Panel): - bl_space_type = 'FILE_BROWSER' - bl_region_type = 'TOOL_PROPS' - bl_label = "Transform" - bl_parent_id = "FILE_PT_operator" - - @classmethod - def poll(cls, context): - sfile = context.space_data - operator = sfile.active_operator - - return operator.bl_idname == "EXPORT_SCENE_OT_obj" - - def draw(self, context): - layout = self.layout - layout.use_property_split = True - layout.use_property_decorate = False # No animation. - - sfile = context.space_data - operator = sfile.active_operator - - layout.prop(operator, 'global_scale') - layout.prop(operator, 'path_mode') - layout.prop(operator, 'axis_forward') - layout.prop(operator, 'axis_up') - - -class OBJ_PT_export_geometry(bpy.types.Panel): - bl_space_type = 'FILE_BROWSER' - bl_region_type = 'TOOL_PROPS' - bl_label = "Geometry" - bl_parent_id = "FILE_PT_operator" - bl_options = {'DEFAULT_CLOSED'} - - @classmethod - def poll(cls, context): - sfile = context.space_data - operator = sfile.active_operator - - return operator.bl_idname == "EXPORT_SCENE_OT_obj" - - def draw(self, context): - layout = self.layout - layout.use_property_split = True - layout.use_property_decorate = False # No animation. - - sfile = context.space_data - operator = sfile.active_operator - - layout.prop(operator, 'use_mesh_modifiers') - # Property definition disabled, not working in 2.8 currently. - # layout.prop(operator, 'use_mesh_modifiers_render') - layout.prop(operator, 'use_smooth_groups') - layout.prop(operator, 'use_smooth_groups_bitflags') - layout.prop(operator, 'use_normals') - layout.prop(operator, 'use_uvs') - layout.prop(operator, 'use_materials') - layout.prop(operator, 'use_triangles') - layout.prop(operator, 'use_nurbs', text="Curves as NURBS") - layout.prop(operator, 'use_vertex_groups') - layout.prop(operator, 'keep_vertex_order') - - @orientation_helper(axis_forward='-Z', axis_up='Y') class ExportOBJ(bpy.types.Operator, ExportHelper): """Save a Wavefront OBJ File""" @@ -474,6 +377,103 @@ class ExportOBJ(bpy.types.Operator, ExportHelper): pass +class OBJ_PT_export_include(bpy.types.Panel): + bl_space_type = 'FILE_BROWSER' + bl_region_type = 'TOOL_PROPS' + bl_label = "Include" + bl_parent_id = "FILE_PT_operator" + + @classmethod + def poll(cls, context): + sfile = context.space_data + operator = sfile.active_operator + + return operator.bl_idname == "EXPORT_SCENE_OT_obj" + + def draw(self, context): + layout = self.layout + layout.use_property_split = True + layout.use_property_decorate = False # No animation. + + sfile = context.space_data + operator = sfile.active_operator + + col = layout.column(heading="Limit to") + col.prop(operator, 'use_selection') + + col = layout.column(heading="Objects as", align=True) + col.prop(operator, 'use_blen_objects') + col.prop(operator, 'group_by_object') + col.prop(operator, 'group_by_material') + + layout.separator() + + layout.prop(operator, 'use_animation') + + +class OBJ_PT_export_transform(bpy.types.Panel): + bl_space_type = 'FILE_BROWSER' + bl_region_type = 'TOOL_PROPS' + bl_label = "Transform" + bl_parent_id = "FILE_PT_operator" + + @classmethod + def poll(cls, context): + sfile = context.space_data + operator = sfile.active_operator + + return operator.bl_idname == "EXPORT_SCENE_OT_obj" + + def draw(self, context): + layout = self.layout + layout.use_property_split = True + layout.use_property_decorate = False # No animation. + + sfile = context.space_data + operator = sfile.active_operator + + layout.prop(operator, 'global_scale') + layout.prop(operator, 'path_mode') + layout.prop(operator, 'axis_forward') + layout.prop(operator, 'axis_up') + + +class OBJ_PT_export_geometry(bpy.types.Panel): + bl_space_type = 'FILE_BROWSER' + bl_region_type = 'TOOL_PROPS' + bl_label = "Geometry" + bl_parent_id = "FILE_PT_operator" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + sfile = context.space_data + operator = sfile.active_operator + + return operator.bl_idname == "EXPORT_SCENE_OT_obj" + + def draw(self, context): + layout = self.layout + layout.use_property_split = True + layout.use_property_decorate = False # No animation. + + sfile = context.space_data + operator = sfile.active_operator + + layout.prop(operator, 'use_mesh_modifiers') + # Property definition disabled, not working in 2.8 currently. + # layout.prop(operator, 'use_mesh_modifiers_render') + layout.prop(operator, 'use_smooth_groups') + layout.prop(operator, 'use_smooth_groups_bitflags') + layout.prop(operator, 'use_normals') + layout.prop(operator, 'use_uvs') + layout.prop(operator, 'use_materials') + layout.prop(operator, 'use_triangles') + layout.prop(operator, 'use_nurbs', text="Curves as NURBS") + layout.prop(operator, 'use_vertex_groups') + layout.prop(operator, 'keep_vertex_order') + + def menu_func_import(self, context): self.layout.operator(ImportOBJ.bl_idname, text="Wavefront (.obj)") -- cgit v1.2.3