-
Notifications
You must be signed in to change notification settings - Fork 48
/
main.py
66 lines (50 loc) · 1.8 KB
/
main.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
65
66
import bpy
from . import savefile
from . import mapping
from . import alignment
from . import corrections
from . import drivers
from . import baking
class MainPanel(bpy.types.Panel):
bl_idname = 'RT_PT_Main'
bl_label = 'Animation Retargeting'
bl_category = 'Retargeting'
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
def draw(self, context):
layout = self.layout
if context.object != None and context.object.type == 'ARMATURE':
ctx = context.object.retargeting_context
split = layout.row().split(factor=0.244)
split.column().label(text='Target:')
split.column().label(text=context.object.name, icon='ARMATURE_DATA')
row = layout.row()
row.enabled = not ctx.ui_editing_mappings and not ctx.ui_editing_alignment
row.prop(ctx, 'selected_source', text='Source', icon='ARMATURE_DATA')
layout.separator()
if ctx.source == None:
layout.label(text='Choose a source armature to continue', icon='INFO')
else:
savefile.draw_panel(ctx, layout.box())
layout.separator()
layout.label(text='Bone Mappings')
mapping.draw_panel(ctx, layout.box())
if not ctx.ui_editing_mappings and len(ctx.mappings) > 0:
layout.separator()
layout.label(text='Rest Alignment')
alignment.draw_panel(ctx, layout.box())
if ctx.get_bone_alignments_count() > 0 or ctx.did_setup_empty_alignment:
layout.separator()
layout.label(text='Corrections')
corrections.draw_panel(ctx, layout.box())
layout.separator()
layout.label(text='Drivers')
drivers.draw_panel(ctx, layout.box())
layout.separator()
layout.label(text='Baking')
baking.draw_panel(ctx, layout.box())
else:
layout.label(text='Select target armature', icon='ERROR')
classes = (
MainPanel,
)