[Closed] Throw an error on missing Start up Script
I have a startup script that performs some operations using the prerender callbacks. My problem is that through backburner if that startup script is missing on a particular machine it will still render the frames, however, inaccurately. Is there a way to check for the script and cancel the job if it doesn’t exist. Much like a missing plugin would do.
Thanks,
Rod
From Maxscript Help:
[left]
getFileSize <filename_string> [/left]
[left]Returns the size of the specified file in bytes. Returns 0 if the file could not be found.[/left]
[left]
[/left]
Another approach, also from the maxScript help:
[b][b]
doesFileExist[/b][/b] <filename_string>
[left]Returns true if the file exists, false otherwise.
[/left]
Ok so where would I put this. Remember this is for render machines on backburner. How would I get the machine to execute this command. I’m guessing it would have to be saved with the file as a persistent global callback (if possible) or something, that runs when the file is opened on the render machine. Then it would have to tell backburner that the frame couldn’t render and to take the machine off the job.
Hope this makes sense.
Thanks,
Rod
I would recommend against the filesize method. I used it extensively in a script and it failed on occasion to identify that a file didn’t exist.
hi rod,
are you using mental ray? you can use the scripts section of the renderer to specify a script containing your operations to be performed before (or after if you like) the render starts.
If you put this script on a network location that all machines can see then it will be immaterial whether it is a startup script, or on the machine in question – backburner will look for the prerender script in the network location, perform the tweaks and render.
no need to specify the prerender callback, or looking if a file exists. just put the script commands in the file.
You could put the #preRender Callback into the scene file prior to submital using the persistent function…
Callbacks.AddScript #preRender (“< your Script >”) id:MyScript Persistent:true
or
Callbacks.AddScript #preRender (“filein “MyScript.ms””) id:MyScript Persistent:true
Where MyScript.ms is in a shared location…
The persistent true allows you to have unique scripts per submital…