-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathOpenWithoutXrefs.ms
More file actions
51 lines (45 loc) · 1.39 KB
/
OpenWithoutXrefs.ms
File metadata and controls
51 lines (45 loc) · 1.39 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
-------------------------------------------------------------------------------
-- OpenWithoutXrefs.mcr
-- By Ilya Floussov (ilya@conceptfarm.ca)
-- June 24 2022
-- Open max files faster by disabling all xrefs
-------------------------------------------------------------------------------
macroScript OpenWithoutXrefs
category:"ilya_s Scripts"
tooltip:"OpenWithoutXrefs"
buttontext:"OpenWithoutXrefs"
(
local maxFile = getMAXOpenFileName dir:"X:\\"
if (maxFile != undefined) then
(
local f = ((getDir #temp) + "\\" + (getFilenameFile maxFile) + "_OpenNoXrefs.max")
if doesFileExist f then
(
deleteFile f
print ("Removing Existing File: " + f)
)
local makeCopy = copyFile maxFile f
if makeCopy == true then
(
local fileAssets = getMAXFileAssetMetadata f
print ("---- Accessing file " + f)
for i=1 to fileAssets.count do
(
if (doesfileexist fileAssets[i].filename == true) then
(
if (getFilenameType fileAssets[i].filename == ".max") then
(
print ("Removing Xref Path: " + fileAssets[i].filename)
fileAssets[i].filename = fileAssets[i].filename + "-missing"
)
)
)
setMAXFileAssetMetadata f fileAssets
loadMaxFile f
)
else
(
messageBox ("Failed to make a copy of the file\n" + f as string +"\n\nEither the file is already existing or is open somewhere.")
)
)
)