-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPG.Lib.ms
More file actions
55 lines (45 loc) · 1.65 KB
/
Copy pathPG.Lib.ms
File metadata and controls
55 lines (45 loc) · 1.65 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
struct PGLib (
fn askForStringWithDefault txt = (
-- instantiate the object
theObj = dotNetObject "MaxCustomControls.RenameInstanceDialog" txt
theobj.text ="New prefix will be"
DialogResult = theObj.Showmodal()
insetedtext = theobj.InstanceName
--test if the ok button was pressed, if not, return default
okclicked = dotnet.compareenums TheObj.DialogResult ((dotnetclass "System.Windows.Forms.DialogResult").OK)
if not okclicked do insetedtext = txt
insetedtext
),
--RETURN path or undefined
fn saveFileDialog title:undefined = (
dno = dotNetObject "System.Windows.Forms.SaveFileDialog"
if title != undefined do dno.title = title
r = dno.showdialog()
if (r != r.OK) then val = undefined
else val = dno.filename
val
),
fn setData id data = (
setAppData rootnode id data
),
fn getData id = (
getAppData rootnode id
),
cons = (
struct cons (
ini = ((pathConfig.GetDir #userMacros) + "\\PG.ini"),
pgscripts = (getINIsetting ini "PG" "pgscripts"),
last_script = (getINIsetting ini "PG" "lastscript"),
PyMsExe = this.pgscripts + "PyMs.exe",
vray_depth_exr = (pathConfig.GetDir #temp) + "\\vray_depth.exr",
vray_depth_results = (pathConfig.GetDir #temp) + "\\vray_depth.ini",
vray_depth_renderpreset = (pathConfig.GetDir #temp) + "\\vray_depth.rps"
)
)(),
fn vrayDepthMin = ((getINISetting this.cons.vray_depth_results "vray_depth" "min") as number ),
fn vrayDepthMax = ((getINISetting this.cons.vray_depth_results "vray_depth" "max") as number),
fn setLastScript scriptPath = (setINISetting this.cons.ini "PG" "lastscript" scriptPath)
)
global PGLib = PGLib()
PGLib
-- clearlistener()