-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path__init__.py
More file actions
73 lines (62 loc) · 2.2 KB
/
__init__.py
File metadata and controls
73 lines (62 loc) · 2.2 KB
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
65
66
67
68
69
70
71
72
73
bl_info = {
"name": "Bizarre Morrowind Anim Utils",
"description": "Animation retargeting and export utilities for Morrowind",
"author": "Maksim Eremenko",
"version": (1, 5, 0),
"blender": (5, 1, 0),
"location": "View3D > UI > Bizarre Anim",
"category": "Animation",
}
import bpy
from . import operators, panels, utils, keymaps, exporter
class BizarreAnimUtils(bpy.types.AddonPreferences):
bl_idname = __package__
export_folder: bpy.props.StringProperty(
name="Export Folder",
description="Folder where exported animations will be saved",
default="~/Morrowind Animations/",
subtype='DIR_PATH'
)
retained_extra_bones: bpy.props.StringProperty(
name="Retained Extra Bones",
description="Comma-separated list of extra bones to retain during export",
default=""
)
enable_root_motion_arp: bpy.props.BoolProperty(
name="Root Motion (ARP)",
description=(
"Bake root motion from the c_traj bone into the exported animation. "
"Only works with AutoRig Pro rigs. "
"If you have not animated c_traj manually, use AutoRig Pro's built-in "
"'Extract Root Motion' button first to transfer hip translation onto c_traj, "
"then export with this option enabled."
),
default=False
)
export_as: bpy.props.EnumProperty(
name="Export as",
description="Select the export type",
items=[
('1ST_PERSON', "1st-person", ""),
('3RD_PERSON', "3rd-person", "")
],
default='1ST_PERSON'
)
def draw(self, context):
layout = self.layout
layout.prop(self, "export_folder")
layout.prop(self, "retained_extra_bones")
layout.prop(self, "export_as") # Add the dropdown to the preferences UI
def register():
operators.register()
panels.register()
keymaps.register()
bpy.utils.register_class(BizarreAnimUtils)
def unregister():
# Unregister panels, operators, and keymaps first
keymaps.unregister()
panels.unregister()
operators.unregister()
bpy.utils.unregister_class(BizarreAnimUtils)
if __name__ == "__main__":
register()