[Bf-extensions-cvs] [36b3690e] master: OBJ: Cleeanup: keep sane logical organization of code.

Bastien Montagne noreply at git.blender.org
Tue Apr 28 17:30:48 CEST 2020


Commit: 36b3690e0cd509cff4c67c6f8befa0341cfe45b4
Author: Bastien Montagne
Date:   Tue Apr 28 17:18:05 2020 +0200
Branches: master
https://developer.blender.org/rBA36b3690e0cd509cff4c67c6f8befa0341cfe45b4

OBJ: Cleeanup: keep sane logical organization of code.

Since panels of importer are defined after the operator, do the same for
the exporter...

===================================================================

M	io_scene_obj/__init__.py

===================================================================

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



More information about the Bf-extensions-cvs mailing list