-
Notifications
You must be signed in to change notification settings - Fork 32
/
preferences.py
71 lines (51 loc) · 1.97 KB
/
preferences.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
67
68
69
70
71
import os
import bpy
from bpy.props import StringProperty
from . import preset_handler
from .version_compatibility import make_annotations, layout_split
@make_annotations
class ExpyToClipboard(bpy.types.Operator):
"""Copy Expy Kit Preferences to the clipboard"""
bl_idname = "wm.expy_to_clipboard"
bl_label = "Copy Stuff to the clipboard"
clip_text = StringProperty(description="Text to Copy", default="")
@classmethod
def poll(cls, context):
return True
def execute(self, context):
context.window_manager.clipboard = self.clip_text
return {'FINISHED'}
class ExpyPrefs(bpy.types.AddonPreferences):
bl_idname = __package__
def draw(self, context):
layout = self.layout
column = layout.column()
box = column.box()
col = box.column()
row = col.row()
row.label(text="Useful Paths:")
row = col.row()
split = layout_split(row, factor=0.15, align=False)
sp_col = split.column()
sp_col = split.column()
row = col.row()
split = layout_split(row, factor=0.15, align=False)
sp_col = split.column()
sp_col = split.column()
script_path = os.path.dirname(__file__)
script_path = os.path.join(script_path, 'rig_mapping', 'unreal_mapping.py')
op = sp_col.operator(ExpyToClipboard.bl_idname, text='Path of "Unreal Mapping" to Clipboard')
op.clip_text = script_path
col.separator()
row = col.row()
split = layout_split(row, factor=0.15, align=False)
sp_col = split.column()
sp_col = split.column()
op = sp_col.operator(ExpyToClipboard.bl_idname, text='Path of stored rig presets')
op.clip_text = preset_handler.get_retarget_dir()
def register_classes():
bpy.utils.register_class(ExpyPrefs)
bpy.utils.register_class(ExpyToClipboard)
def unregister_classes():
bpy.utils.unregister_class(ExpyPrefs)
bpy.utils.unregister_class(ExpyToClipboard)