-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathzLayerManagerDev.txt
83 lines (75 loc) · 3.22 KB
/
zLayerManagerDev.txt
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
[RoutineDef, zlmGetLayerPath,
// Check if we are on pc
[If, [ZBrushInfo, 6] == 0,
[VarSet, outputVar, [FileNameResolvePath, "layers.TXT"]]
, /* Else */
[VarSet, outputVar, [FileNameResolvePath, "layers.TXT"]]
]
, outputVar]
<zscriptinsert, "dist\ZlmData\zlmOps.txt">
[RoutineDef, CheckSystem,
//check ZBrush version
[VarSet, Zvers, [ZBrushInfo,0]]
[If, [Val, Zvers] >= 4.8,,
[Note,"\Cff9923This zscript\Cffffff is not designed for this version of \Cff9923ZBrush\Cffffff.",, 3, 4737096,, 300]
[Exit]
]
//check Mac or PC
[VarSet, isMac, [ZBrushInfo, 6]]
// Make sure we have the dll and set its path
[If, [ZBrushInfo, 16] == 64,//64 bit
[If, isMac,
[VarSet,dllPath,[FileNameResolvePath, "dist/ZlmData/ZFileUtils/ZFileUtils.lib"]]
,
[VarSet,dllPath,[FileNameResolvePath, "dist\ZlmData\ZFileUtils\ZFileUtils64.dll"]]
]
, //else 32 bit - no longer supported
[Note, "\Cff9923This zscript\Cffffff is not designed for this version of \Cff9923ZBrush\Cffffff.",, 3, 4737096,, 300]
[Exit]
]
[If, [FileExists, [Var, dllPath]],
//check that correct version
[VarSet, dllVersion, [FileExecute, [Var, dllPath], Version]]
[If, [Val,dllVersion] >= 3.0,//dll version
//OK
,//else earlier version
[Note,"\Cff9923Note :\Cc0c0c0 The \Cff9923 ZFileUtils plugin \CffffffDLL\Cc0c0c0 is an earlier version which does not support this plugin. Please install correct version."]
[Exit]
]
, // else no DLL.
[Note,"\Cff9923Note :\Cc0c0c0 The \Cff9923 ZFileUtils plugin \CffffffDLL\Cc0c0c0 could
not be found at the correct location. Please re-install the plugin, making sure the
relevant files and folders are in the \CffffffZStartup/ZPlugs\Cc0c0c0 folder."]
[Exit]
]
// set dll path in memory block
[If, [MemGetSize, zlmMFileUtilPath],
[MemResize, zlmMFileUtilPath, [StrLength, dllPath]]
,
[MemCreate, zlmMFileUtilPath, [StrLength, dllPath]]
]
[VarSet, size, [MemWriteString, zlmMFileUtilPath, #dllPath,0,0]]
[MemResize, zlmMFileUtilPath, size]
]//end routine
[RoutineCall, CheckSystem]
[IButton, "Open Zlayer", "Open Layer Manager UI or update it if already opened",
// check if there is a subtool loaded
[If, [IExists, "Tool:Layers:Layers Scrollbar"],
[VarSet, filePath, ""]
[VarSet, exec, [FileNameResolvePath, "venv\Scripts\python.exe"]]
[VarSet, scriptPath, [FileNameResolvePath, "src"]]
[VarSet, ui, [FileNameResolvePath, "src\zlm_sender"]]
[RoutineCall, zlmGetLayerPath, filePath]
[RoutineCall, zlmSaveLayerInfo, filePath]
[VarSet, quote, [StrFromAsc, 34]]
[VarSet, layerId, 0]
[RoutineCall, zlmGetIdFirstLayerID, layerId]
[VarSet, cmd, [StrMerge, "SET PYTHONPATH=", #scriptPath, " & "]]
[VarSet, cmd, [StrMerge, cmd, "start ", #quote, #quote, " ", #quote, #exec, #quote, " ", #quote, #ui, #quote]]
[VarSet, cmd, [StrMerge, cmd, " ", #layerId, " -o -f", #quote, #filePath, #quote]]
// [Note, cmd]
[ShellExecute, cmd]
,
[Note, "Zlm: Invalid Subtool"]
]
]