-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexport
97 lines (85 loc) · 2.79 KB
/
export
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
try
(
cui.UnRegisterDialogBar TKT
destroyDialog TKT
) catch ()
rollout TKT "Just Exporter" width:320 height:32
(
local theDockState
local DialogDock
local scriptpath = @"D:\"
local INIfile = scriptpath + "Settings.ini"
local The_INI_Path = ((GetDir #userScripts) + "/N00BY_Scripts/Export_Settings_2_1.ini")
local TheExportPath
dropdownList 'ExportPaths' width:192 height:40 toolTip:"Right click to open selected folder ;)" align:#left --enabled:false
button 'Browse' "..." pos:[210,5] width:25 height:21 toolTip:"Browse for export folder.Right click to purge list" align:#left
button 'Export_Button' "Export" pos:[240,5] width:68 height:22 toolTip:"Export selected objects." align:#left
on Export_Button pressed do
(
mySelection = #()
for i in selection do
(
myObj = copy i pos:[0,0,0] name:i.name
append mySelection myObj
)
for i in mySelection do
(
print i
select i
converttopoly i
resetxform i
exportfile (ExportPath + "\\" + i.name) #noPrompt selectedOnly:true
delete i
)
print ExportPath
)
on ExportPaths rightClick do -- Open the selected path in windows explorer
(
if ExportPaths.selected != undefined do shellLaunch "explorer.exe" ExportPaths.selected
)
on Browse pressed do
(
if ExportPaths.selected != undefined then Global ExportPath = getSavepath initialDir:ExportPaths.selected
else Global ExportPath = getSavepath initialDir:(GetDir #export)
if ExportPath != undefined do
(
insertItem ExportPath ExportPaths.items 1
ExportPaths.items = makeUniqueArray ExportPaths.items
setINISetting (The_INI_Path) "Paths" "Export_Paths" (ExportPaths.items as string)
)
)
on Browse rightClick do
(
if QueryBox "Are you sure you want to remove the selected path from the list ?" then
(
ExportPaths.items = deleteItem ExportPaths.items 1
setINISetting (The_INI_Path) "Paths" "Export_Paths" (ExportPaths.items as string)
)
)
function dockstatus =
(
DialogDock = getINISetting INIfile "Dialog" "Dock"
TestDock = case DialogDock of
(
("cui_dock_left"): #cui_dock_left
("cui_dock_right"): #cui_dock_right
("cui_dock_bottom"): #cui_dock_bottom
("cui_dock_top"): #cui_dock_top
("cui_floatable"): #cui_floatable
)
format "TestDock: % \n" TestDock
TestDock
)
on TKT open do
(
format "Open %\n" (dockstatus())
--cui.DockDialogBar rol_dockTest #cui_dock_top
cui.RegisterDialogBar TKT maxsize:[-1,-1] style:#(#cui_dock_all, #cui_floatable, #cui_handles )
--cui.DockDialogBar TKT #cui_dock_top
)
on TKT close do
(
try(setINISetting INIfile "Dialog" "Dock" theDockState forceUTF16:false)catch()
)
)
CreateDialog TKT style:#(#style_titlebar, #style_sysmenu, #style_toolwindow)#cui_max_sized