Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Reynish <billrey@me.com>2019-08-21 23:16:24 +0300
committerWilliam Reynish <billrey@me.com>2019-08-21 23:16:24 +0300
commit677e5ea2ea223e1a5c85e8d0203c7c9f66f037a1 (patch)
tree36a990e7d0dd0048d5a92df726de48b0a62a91fb
parent3d322e57d420591bc636c82fd59c8d9178ba91ef (diff)
BVH IO layout
-rw-r--r--io_anim_bvh/__init__.py147
1 files changed, 146 insertions, 1 deletions
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():