disable xref scenes + save an incremental copy and enable the disabled xref scenes script :) by anubis and miauu thanks alot

Hey All,

I am trying to form an "xref scene based architectural workflow" but there s one faulty design that spoils it and the only way to solve it goes through two simple commands but i can not find it, and i am 0 at scripting either, incase someone decides to help with it.

i need to have the script disable all xref scenes , d some commands and enable them back.

(
--this line should disable every xref scene loaded into to the current scene

if maxFileName != "" then ( -- if the scene saved
max saveplus -- incremental file save
TheFile = maxFilePath + (trimRight (getFilenameFile maxFileName) "1234567890") + ".max" --remove trailing numbers
if doesFileExist TheFile do deleteFile TheFile
copyFile (maxFilePath + maxFileName) TheFile
) else checkForSave()
--this line should enable every xref scene loaded into to the current scene
)
so this saves a file but it will be removing all xref scenes before saving, and re-enable them forr the artist to go on.
btw, the middle code is written by Anubis ;) thanks to him.
thanks for any input.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
crystal3d's picture

yes i was surprised this time...

but now i believe it s done and very helpful already :)

miauu's picture
crystal3d's picture

and absolutely

anubis:)

miauu's picture

do some actions= ( if

do some actions=
(
	if maxFileName != "" then 
	( -- if the scene saved
		max saveplus -- incremental file save
		TheFile = maxFilePath + (trimRight (getFilenameFile maxFileName) "1234567890") + ".max" --remove trailing numbers
		if doesFileExist TheFile do deleteFile TheFile
		--	disable xref
		for i = 1 to xrefs.getXRefFileCount() do (xrefs.getXRefFile i).disabled = true
		--
		copyFile (maxFilePath + maxFileName) TheFile
		--	enable xref
		for i = 1 to xrefs.getXRefFileCount() do (xrefs.getXRefFile i).disabled = false
	) else checkForSave()
)
crystal3d's picture

testing right now.....

thanks already :)

crystal3d's picture

okay great!

you made it seem like a piece of cake! but reality is different yes? i am still amazed at how simple, thing can be solved by scripting...

I have one more question, was there a way that i could possibly find the solution in some book or cd? like some book?

thanks again miauu, you are priceless too :)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.