reseting or closing script when file is reset or closed
Hi all
I've create a batch render script that is max file dependent (stores perminent varibles). So it stores information inputted by the user for example the project name and render location etc.
What I'm currently having difficulty with is that I would like the script to know when the user resets max or closes the file or opens a new file so that the script can be closed so that the information from the previous file isn't transferred to the new save.
Any help would be appreciated.
Phil
Comments
I'll give it another go at
I'll give it another go at describing what I'm after.
I've cut my script down just to illustrate what I am hoping to achieve.
So in this example I've put the on command and --(whatever the user.... to illustrate what I want it to do.
In the full script what I would want is that when someone loaded another file it would close the dialogue so when it is opened again it contains the persistent globals that are saved in the loaded file. without it being closed it just continues to show the old persistant globals. Additionally when someone resets or goes for a new scene the dialouge is closed and the persistant globals are wiped.
Hope I've explained it a bit better
you can use callbacks fn
you can use callbacks
my recent MAXScripts RSS (archive here)
I've tried implementing the
I've tried implementing the script but I seem to be getting an error message.
I've tried putting the script in different places but I still get the same message. Sometimes once the script has failed it then starts working the next time until I reload max.
Example of cutdown script. (note that the added script is probably in the wrong place but I seem to get the same message where ever I put it.
Any ideas?
Seems you made some syntax
Seems you made some syntax mistake after editing the function. The brackets are important when you add more than one command to the same scope. Adding a new command "print rolloutclass" without brackets for the IF/DO cause the next command "DestroyDialog MultiSubmitter" to be runned out of the IF/DO scope (and without class checking), i.e.:
my recent MAXScripts RSS (archive here)
Thanks for the reply. I had
Thanks for the reply. I had forgotten that I had put that in. It was my attempt to work out what was going on while I was getting the error and I had forgot to remove it.
However I have done as you suggested Code below and I don't get the error but it doesn't close the dialog box. however once I have run the script once I can remove the line if classOf closeMultiSubmitter == RolloutClass and it does close the box without error.
I feel like I'm almost there.
But not quite :)
Ah, yes, something
Ah, yes, something important... the rollouts inside MacroScripts are local. Declare it as global (
global closeMultiSubmitter
) at the beginning of the macros ;)my recent MAXScripts RSS (archive here)
Thank you for your advice. It
Thank you for your advice. It is now working as I want, or at least I think so. Just to post my conclusions for anyone else having problems or wanting to do something similar here is the process implemented into a simplified version of my script.
It seems to work now :)
Thanks again
Phil
Thank you, I'll give that a
Thank you, I'll give that a go :)
more info or the code pls
more info or the code pls
Raphael Steves