[Bf-extensions-cvs] [677e5ea2] filebrowser_redesign: BVH IO layout
William Reynish
noreply at git.blender.org
Wed Aug 21 22:16:26 CEST 2019
Commit: 677e5ea2ea223e1a5c85e8d0203c7c9f66f037a1
Author: William Reynish
Date: Wed Aug 21 22:16:24 2019 +0200
Branches: filebrowser_redesign
https://developer.blender.org/rBA677e5ea2ea223e1a5c85e8d0203c7c9f66f037a1
BVH IO layout
===================================================================
M io_anim_bvh/__init__.py
===================================================================
diff --git a/io_anim_bvh/__init__.py b/io_anim_bvh/__init__.py
index b22811fa..4c27a480 100644
--- a/io_anim_bvh/__init__.py
+++ b/io_anim_bvh/__init__.py
@@ -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, "rotation_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"""
@@ -224,6 +309,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):
@@ -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():
More information about the Bf-extensions-cvs
mailing list