OBJ: Cleeanup: keep sane logical organization of code.

Since panels of importer are defined after the operator, do the same for
the exporter...
This commit is contained in:
Bastien Montagne 2020-04-28 17:18:05 +02:00
parent 693a834eb5
commit 36b3690e0c
1 changed files with 97 additions and 97 deletions

View File

@ -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)")