-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path__init__.py
64 lines (46 loc) · 1.42 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# <pep8 compliant>
bl_info = {
"name": "Mo' Bends Exporter",
"author": "Iwo Plaza",
"version": (1, 1, 0),
"blender": (2, 81, 0),
"location": "File > Import-Export",
"description":
"Exports all animations in a binary format.",
"warning": "",
"wiki_url": "",
"tracker_url": "",
"category": "Import-Export"}
import bpy
from bpy.props import (
BoolProperty
)
from bpy_extras.io_utils import (
ExportHelper
)
from .export_mobends import save_scene
class ExportMoBends(bpy.types.Operator, ExportHelper):
"""Export a Mo' Bends animation JSON file"""
bl_idname = "export_anim.mobends"
bl_label = "Export Mo' Bends"
bl_options = {'PRESET'}
filename_ext = ".bendsanim"
use_selection = BoolProperty(
name="Selection Only",
description="Export selected objects only",
default=False,
)
def execute(self, context):
return save_scene(context, self.filepath, self.use_selection)
# end execute
# end ExportMoBends
def menu_func_export(self, context):
self.layout.operator(ExportMoBends.bl_idname, text="Mo' Bends (.bendsanim)")
def register():
bpy.utils.register_class(ExportMoBends)
bpy.types.TOPBAR_MT_file_export.append(menu_func_export)
def unregister():
bpy.types.TOPBAR_MT_file_export.remove(menu_func_export)
bpy.utils.unregister_class(ExportMoBends)
if __name__ == "__main__":
register()