[Bf-extensions-cvs] [e1e8e3fa] filebrowser_redesign: New layouts for FBX and GLTF for the new filebrowser sidebar

William Reynish noreply at git.blender.org
Wed Aug 21 10:17:05 CEST 2019


Commit: e1e8e3fa0d85c1ce51a4b2a84e7518a245174002
Author: William Reynish
Date:   Wed Aug 21 09:42:33 2019 +0200
Branches: filebrowser_redesign
https://developer.blender.org/rBAe1e8e3fa0d85c1ce51a4b2a84e7518a245174002

New layouts for FBX and GLTF for the new filebrowser sidebar

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

M	io_scene_fbx/__init__.py
M	io_scene_gltf2/__init__.py

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

diff --git a/io_scene_fbx/__init__.py b/io_scene_fbx/__init__.py
index 327210cf..b7caf3d3 100644
--- a/io_scene_fbx/__init__.py
+++ b/io_scene_fbx/__init__.py
@@ -89,7 +89,7 @@ class ImportFBX(bpy.types.Operator, ImportHelper):
             default=1.0,
             )
     bake_space_transform: BoolProperty(
-            name="!EXPERIMENTAL! Apply Transform",
+            name="Apply Transform",
             description="Bake space transform into object data, avoids getting unwanted rotations to objects when "
                         "target space is not aligned with Blender's space "
                         "(WARNING! experimental option, use at own risks, known broken with armatures/animations)",
@@ -188,42 +188,8 @@ class ImportFBX(bpy.types.Operator, ImportHelper):
             )
 
     def draw(self, context):
-        layout = self.layout
-
-        layout.prop(self, "ui_tab", expand=True)
-        if self.ui_tab == 'MAIN':
-            layout.prop(self, "use_manual_orientation"),
-            sub = layout.column()
-            sub.enabled = self.use_manual_orientation
-            sub.prop(self, "axis_forward")
-            sub.prop(self, "axis_up")
-            layout.prop(self, "global_scale")
-            layout.prop(self, "bake_space_transform")
-
-            layout.prop(self, "use_custom_normals")
-
-            layout.prop(self, "use_anim")
-            layout.prop(self, "anim_offset")
-
-            layout.prop(self, "use_custom_props")
-            sub = layout.row()
-            sub.enabled = self.use_custom_props
-            sub.prop(self, "use_custom_props_enum_as_string")
-
-            layout.prop(self, "use_image_search")
-            # layout.prop(self, "use_alpha_decals")
-            layout.prop(self, "decal_offset")
-
-            layout.prop(self, "use_prepost_rot")
-        elif self.ui_tab == 'ARMATURE':
-            layout.prop(self, "ignore_leaf_bones")
-            layout.prop(self, "force_connect_children"),
-            layout.prop(self, "automatic_bone_orientation"),
-            sub = layout.column()
-            sub.enabled = not self.automatic_bone_orientation
-            sub.prop(self, "primary_bone_axis")
-            sub.prop(self, "secondary_bone_axis")
-
+        pass
+            
     def execute(self, context):
         keywords = self.as_keywords(ignore=("filter_glob", "directory", "ui_tab"))
 
@@ -231,6 +197,159 @@ class ImportFBX(bpy.types.Operator, ImportHelper):
         return import_fbx.load(self, context, **keywords)
 
 
+class FBX_PT_import_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 == "IMPORT_SCENE_OT_fbx"
+
+    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_custom_normals")
+        layout.prop(operator, "use_custom_props")
+        sub = layout.row()
+        sub.enabled = operator.use_custom_props
+        sub.prop(operator, "use_custom_props_enum_as_string")
+        layout.prop(operator, "use_image_search")
+
+
+class FBX_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_SCENE_OT_fbx"
+
+    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, "decal_offset")
+        layout.prop(operator, "bake_space_transform")
+        layout.prop(operator, "use_prepost_rot")
+
+
+class FBX_PT_import_transform_manual_orientation(bpy.types.Panel):
+    bl_space_type = 'FILE_BROWSER'
+    bl_region_type = 'TOOL_PROPS'
+    bl_label = "Manual Orientation"
+    bl_parent_id = "FBX_PT_import_transform"
+
+    @classmethod
+    def poll(cls, context):
+        sfile = context.space_data
+        operator = sfile.active_operator
+
+        return operator.bl_idname == "IMPORT_SCENE_OT_fbx"
+
+    def draw_header(self, context):
+        sfile = context.space_data
+        operator = sfile.active_operator
+
+        self.layout.prop(operator, "use_manual_orientation", text="")
+
+    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.enabled = operator.use_manual_orientation
+
+        layout.prop(operator, "axis_forward")
+        layout.prop(operator, "axis_up")
+
+
+class FBX_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"
+    bl_options = {'DEFAULT_CLOSED'}
+
+    @classmethod
+    def poll(cls, context):
+        sfile = context.space_data
+        operator = sfile.active_operator
+
+        return operator.bl_idname == "IMPORT_SCENE_OT_fbx"
+
+    def draw_header(self, context):
+        sfile = context.space_data
+        operator = sfile.active_operator
+
+        self.layout.prop(operator, "use_anim", text="")
+
+    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.enabled = operator.use_anim
+
+        layout.prop(operator, "anim_offset")
+
+
+class FBX_PT_import_armature(bpy.types.Panel):
+    bl_space_type = 'FILE_BROWSER'
+    bl_region_type = 'TOOL_PROPS'
+    bl_label = "Armature"
+    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 == "IMPORT_SCENE_OT_fbx"
+
+    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, "ignore_leaf_bones")
+        layout.prop(operator, "force_connect_children"),
+        layout.prop(operator, "automatic_bone_orientation"),
+        sub = layout.column()
+        sub.enabled = not operator.automatic_bone_orientation
+        sub.prop(operator, "primary_bone_axis")
+        sub.prop(operator, "secondary_bone_axis")
+
+
 @orientation_helper(axis_forward='-Z', axis_up='Y')
 class ExportFBX(bpy.types.Operator, ExportHelper):
     """Write a FBX file"""
@@ -244,16 +363,6 @@ class ExportFBX(bpy.types.Operator, ExportHelper):
     # List of operator properties, the attributes will be assigned
     # to the class instance from the operator settings before calling.
 
-    ui_tab: EnumProperty(
-            items=(('MAIN', "Main", "Main basic settings"),
-                   ('GEOMETRY', "Geometries", "Geometry-related settings"),
-                   ('ARMATURE', "Armatures", "Armature-related settings"),
-                   ('ANIMATION', "Animation", "Animation-related settings"),
-                   ),
-            name="ui_tab",
-            description="Export options categories",
-            )
-
     use_selection: BoolProperty(
             name="Selected Objects",
             description="Export selected and visible objects only",
@@ -292,7 +401,7 @@ class ExportFBX(bpy.types.Operator, ExportHelper):
                         "but many other applications do not handle the same way)",
             )
     bake_space_transform: BoolProperty(
-            name="!EXPERIMENTAL! Apply Transform",
+            name="Apply Transform",
             description="Bake space transform into object data, avoids getting unwanted rotations to objects when "
                         "target space is not aligned with Blender's space "
                         "(WARNING! experimental option, use at own risks, known broken with armatures/animations)",
@@ -468,65 +577,199 @@ class ExportFBX(bpy.types.Operator, ExportHelper):
             options={'HIDDEN'},
             )
 
+    def draw(self, context):
+        pass
+
+
+class FBX_PT_export_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 == "EXPORT_SCENE_OT_fbx"
+
+    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
+
+        row = layout.row(align=True)
+        row.prop(operator, "path_mode")
+        sub = row.row(align=True)
+        sub.enabled = (operator.path_mode == 'COPY')
+        sub.prop(operator, "embed_textures", text="", icon='PACKAGE' if operator.embed_textures else 'UGLYPACKAGE')
+        row = layout.row(align=True)
+        row.prop(operator, "batch_mode")
+        sub = row.row(align=True)
+        sub.prop(operator, "use_batch_own_dir", text="", icon='NEWFOLDER')
+
+
+class FBX_PT_export_include(bpy.types.Panel):
+    bl_space_type = 'FILE_BROWSER'
+    bl_region_type = 'TOOL_PROPS'
+    bl_label = "Include"
+    bl_parent_id = "

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list