[Bf-extensions-cvs] [53aec1cc] master: UI: New options layout for IO Add-ons

Julian Eisel noreply at git.blender.org
Tue Sep 3 16:11:46 CEST 2019


Commit: 53aec1ccff1b7e6356836a29b36115b475f0c3d2
Author: Julian Eisel
Date:   Tue Sep 3 16:04:55 2019 +0200
Branches: master
https://developer.blender.org/rBA53aec1ccff1b7e6356836a29b36115b475f0c3d2

UI: New options layout for IO Add-ons

Updates importers/exporters for the new file-browser design. They are
now reorganized into sub-panels.

Updated the Blender version requirement (won't be compatible with older
Blender versions). Left the Add-on versions untouched, will leave that
up to Authors to change.

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

M	io_anim_bvh/__init__.py
M	io_mesh_ply/__init__.py
M	io_mesh_stl/__init__.py
M	io_scene_fbx/__init__.py
M	io_scene_gltf2/__init__.py
M	io_scene_obj/__init__.py
M	io_scene_x3d/__init__.py

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

diff --git a/io_anim_bvh/__init__.py b/io_anim_bvh/__init__.py
index b22811fa..53314758 100644
--- a/io_anim_bvh/__init__.py
+++ b/io_anim_bvh/__init__.py
@@ -22,7 +22,7 @@ bl_info = {
     "name": "BioVision Motion Capture (BVH) format",
     "author": "Campbell Barton",
     "version": (1, 0, 0),
-    "blender": (2, 80, 0),
+    "blender": (2, 81, 6),
     "location": "File > Import-Export",
     "description": "Import-Export BVH from armature objects",
     "warning": "",
@@ -147,6 +147,91 @@ class ImportBVH(bpy.types.Operator, ImportHelper):
         from . import import_bvh
         return import_bvh.load(context, report=self.report, **keywords)
 
+    def draw(self, context):
+        pass
+
+
+class BVH_PT_import_main(bpy.types.Panel):
+    bl_space_type = 'FILE_BROWSER'
+    bl_region_type = 'TOOL_PROPS'
+    bl_label = ""
+    bl_parent_id = "FILE_PT_operator"
+    bl_options = {'HIDE_HEADER'}
+
+
+    @classmethod
+    def poll(cls, context):
+        sfile = context.space_data
+        operator = sfile.active_operator
+
+        return operator.bl_idname == "IMPORT_ANIM_OT_bvh"
+
+    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, "target")
+
+
+class BVH_PT_import_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 == "IMPORT_ANIM_OT_bvh"
+
+    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, "rotate_mode")
+        layout.prop(operator, "axis_forward")
+        layout.prop(operator, "axis_up")
+
+
+class BVH_PT_import_animation(bpy.types.Panel):
+    bl_space_type = 'FILE_BROWSER'
+    bl_region_type = 'TOOL_PROPS'
+    bl_label = "Animation"
+    bl_parent_id = "FILE_PT_operator"
+
+    @classmethod
+    def poll(cls, context):
+        sfile = context.space_data
+        operator = sfile.active_operator
+
+        return operator.bl_idname == "IMPORT_ANIM_OT_bvh"
+
+    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, "frame_start")
+        layout.prop(operator, "use_fps_scale")
+        layout.prop(operator, "use_cyclic")
+
+        layout.prop(operator, "update_scene_fps")
+        layout.prop(operator, "update_scene_duration")
+
 
 class ExportBVH(bpy.types.Operator, ExportHelper):
     """Save a BVH motion capture file from an armature"""
@@ -225,6 +310,61 @@ class ExportBVH(bpy.types.Operator, ExportHelper):
         from . import export_bvh
         return export_bvh.save(context, **keywords)
 
+    def draw(self, context):
+        pass
+
+
+class BVH_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_ANIM_OT_bvh"
+
+    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, "rotate_mode")
+        layout.prop(operator, "root_transform_only")
+
+
+class BVH_PT_export_animation(bpy.types.Panel):
+    bl_space_type = 'FILE_BROWSER'
+    bl_region_type = 'TOOL_PROPS'
+    bl_label = "Animation"
+    bl_parent_id = "FILE_PT_operator"
+
+    @classmethod
+    def poll(cls, context):
+        sfile = context.space_data
+        operator = sfile.active_operator
+
+        return operator.bl_idname == "EXPORT_ANIM_OT_bvh"
+
+    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(align=True)
+        col.prop(operator, "frame_start", text="Frame Start")
+        col.prop(operator, "frame_end", text="End")
+
 
 def menu_func_import(self, context):
     self.layout.operator(ImportBVH.bl_idname, text="Motion Capture (.bvh)")
@@ -236,7 +376,12 @@ def menu_func_export(self, context):
 
 classes = (
     ImportBVH,
-    ExportBVH
+    BVH_PT_import_main,
+    BVH_PT_import_transform,
+    BVH_PT_import_animation,
+    ExportBVH,
+    BVH_PT_export_transform,
+    BVH_PT_export_animation,
 )
 
 def register():
diff --git a/io_mesh_ply/__init__.py b/io_mesh_ply/__init__.py
index d0713b21..b89732fd 100644
--- a/io_mesh_ply/__init__.py
+++ b/io_mesh_ply/__init__.py
@@ -22,7 +22,7 @@ bl_info = {
     "name": "Stanford PLY format",
     "author": "Bruce Merry, Campbell Barton",
     "version": (1, 0, 0),
-    "blender": (2, 80, 0),
+    "blender": (2, 81, 6),
     "location": "File > Import-Export",
     "description": "Import-Export PLY mesh data with UV's and vertex colors",
     "warning": "",
@@ -165,19 +165,61 @@ class ExportPLY(bpy.types.Operator, ExportHelper):
 
         return export_ply.save(self, context, **keywords)
 
+    def draw(self, context):
+        pass
+
+
+class PLY_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_MESH_OT_ply"
+
+    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, "axis_forward")
+        layout.prop(operator, "axis_up")
+        layout.prop(operator, "global_scale")
+
+
+class PLY_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"
+
+    @classmethod
+    def poll(cls, context):
+        sfile = context.space_data
+        operator = sfile.active_operator
+
+        return operator.bl_idname == "EXPORT_MESH_OT_ply"
+
     def draw(self, context):
         layout = self.layout
+        layout.use_property_split = True
+        layout.use_property_decorate = False  # No animation.
 
-        row = layout.row()
-        row.prop(self, "use_mesh_modifiers")
-        row.prop(self, "use_normals")
-        row = layout.row()
-        row.prop(self, "use_uv_coords")
-        row.prop(self, "use_colors")
+        sfile = context.space_data
+        operator = sfile.active_operator
 
-        layout.prop(self, "axis_forward")
-        layout.prop(self, "axis_up")
-        layout.prop(self, "global_scale")
+        layout.prop(operator, "use_mesh_modifiers")
+        layout.prop(operator, "use_normals")
+        layout.prop(operator, "use_uv_coords")
+        layout.prop(operator, "use_colors")
 
 
 def menu_func_import(self, context):
@@ -191,6 +233,8 @@ def menu_func_export(self, context):
 classes = (
     ImportPLY,
     ExportPLY,
+    PLY_PT_export_transform,
+    PLY_PT_export_geometry,
 )
 
 
diff --git a/io_mesh_stl/__init__.py b/io_mesh_stl/__init__.py
index a5c61d9f..cd81b228 100644
--- a/io_mesh_stl/__init__.py
+++ b/io_mesh_stl/__init__.py
@@ -22,7 +22,7 @@ bl_info = {
     "name": "STL format",
     "author": "Guillaume Bouchard (Guillaum)",
     "version": (1, 1, 3),
-    "blender": (2, 80, 0),
+    "blender": (2, 81, 6),
     "location": "File > Import-Export > Stl",
     "description": "Import-Export STL files",
     "warning": "",
@@ -151,6 +151,61 @@ class ImportSTL(Operator, ImportHelper):
 
         return {'FINISHED'}
 
+    def draw(self, context):
+        pass
+
+
+class STL_PT_import_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 == "IMPORT_MESH_OT_stl"
+
+    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, "use_scene_unit")
+
+        layout.prop(operator, "axis_forward")
+        layout.prop(operator, "axis_up")
+
+
+class STL_PT_import_geometry(bpy.types.Panel):
+    bl_space_type = 'FILE_BROWSER'
+    bl_region_type = 'TOOL_PROPS'
+    bl_label = "Geometry"
+    bl_parent_id = "FILE_PT_operator"
+
+    @classmethod
+    def poll(cls, context):
+        sfile = context.space_data
+        operator = sfile.active_operator
+
+        return operator.bl_idname == "IMPORT_MESH_OT_stl"
+
+    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(operato

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list