SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.

Home / forum / Lounges / Maya Basics & Newbie Lounge / automating shutdowns after renders
Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 06-02-2007, 12:06 AM   #1
danotronXX
Subscriber
 
danotronXX's Avatar
 
Join Date: Jun 2005
Location: cleveland ohio
Posts: 313
Thanks: 0
Thanked 3 Times in 3 Posts
Default automating shutdowns after renders

Ive been doing a lot of overnight renders but most of my shots only take about 3 hours to finish. does anyone know how to set maya to shut down your computer right after the renders are done.

oh and one other thing, do any of you guys happen to have a lamborghini murcielago model or know a link where i can get one? I thought it wouldnt hurt to ask saving myself a couple days on modeling one.

thanks for your replies

cheers,

Last edited by danotronXX : 06-02-2007 at 12:22 AM.
danotronXX is offline   Reply With Quote
Old 06-02-2007, 09:03 AM   #2
enhzflep
Subscriber
 
enhzflep's Avatar
 
Join Date: Oct 2006
Location: Melbourne
Posts: 313
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Can't help with the Lambo, I'm affraid. Nor can I tell you how to get maya itself to initiate the shutdown.

When I've got a render going overnight, I usually just go into the poweroptions in the controll panel and set my computer to go into standby mode after X number of hours, X obviously being larger than the time I reckon is needed. The advantage of stand-by as opposed to shut down is that if you cock-up the timing, Maya is still open and running when you turn your pc back on, and will continue from where it was.

The other way you can do it is to schedule a task to be run some time after you think the render would finish. I'd use the method myself, but have been spectacularly unsuccesful at getting a task to run at the scheduled time, always getting back a message that says the task could not be completed.

For the second option, you just need to schedule a task that is capable of shutting down a windowsXP pc. I've attached a file I use for just this purpose(turning the pc off, that is). I'd much prefer to double-click an icon on the desktop, than go through the whole rigmarole of Start->TurnOffComputer->Shutdown & all the mouse movement inbetween.

I've attached the file I use. Recompiled today to add an icon to it.

EDIT: No reason to increase traffic in case anybody wants the source, here it is, with the exception of the icon - just take a snapshop of the windows Shudown image and save as a 32x32 icon. Code created & compiled with OpenWatcom IDE v1.5.

Main.cpp
Code:
/* Simple code to turn off a WindowsXP based computer.

 Wednesday 7 Feb, 2007 - Simon (enhzflep)

 Based on code by Greg Van Loon - author of StartupManager
*/

#include <windows.h>


void EnableShutdownPrivileges()
{
        HANDLE token;
        TOKEN_PRIVILEGES privileges;

        if(!::OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &token))
                ::MessageBox(NULL, "ERROR: Unable to open process token.", "Error", MB_OK | MB_ICONERROR);

        ::LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME, &privileges.Privileges[0].Luid);

        privileges.PrivilegeCount = 1;
        privileges.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;

        ::AdjustTokenPrivileges(token, FALSE, &privileges, 0, (PTOKEN_PRIVILEGES)NULL, 0);
        if(::GetLastError() != ERROR_SUCCESS)
                ::MessageBox(NULL, "ERROR: Uanble to adjust token privileges.", "Error", MB_OK | MB_ICONERROR);
}

int APIENTRY WinMain(HINSTANCE _1,HINSTANCE _2,LPSTR _3,int _4)
{
 EnableShutdownPrivileges();
 ExitWindowsEx(EWX_SHUTDOWN, 0);
 return 1;
}
PowerOff.rc
Code:
ICON1 ICON "G:\\PowerOff.ico"

1 VERSIONINFO
FILEVERSION 2,0,0,1
PRODUCTVERSION 2,0,0,1
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904E4"
        BEGIN
            VALUE "Comments", "This is a program designed to shut down Windows.\0"
            VALUE "Description", "Enhzflep 2007\0"
            VALUE "FileVersion", "1.0.0.1"
            VALUE "FileDescription", "Shuts down Windows\0"
            VALUE "InternalName", "PowerOff\0"
            VALUE "LegalCopyright", "Copyright \xA9 2007, Enhzflep\0"
            VALUE "OriginalFilename", "PowerOff.EXE\0"
            VALUE "ProductName", "PowerOff 1.1\0"
            VALUE "ProductVersion", "1.0.0.1\0"
            VALUE "License", "None Needed\0"
        END
    END
    
    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x0409, 1252
    END
END
Attached Files
File Type: zip poweroff.zip (13.6 KB, 51 views)

Last edited by enhzflep : 06-02-2007 at 11:07 AM.
enhzflep is offline   Reply With Quote
Old 07-02-2007, 12:37 AM   #3
danotronXX
Subscriber
 
danotronXX's Avatar
 
Join Date: Jun 2005
Location: cleveland ohio
Posts: 313
Thanks: 0
Thanked 3 Times in 3 Posts
Default

oh great! thanks for ur reply
danotronXX is offline   Reply With Quote
New Thread

« Previous Thread | Next Thread »

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing Renders to AE Ozgalis Dynamics & Special Effects 1 08-12-2010 08:56 PM

1 Month

$34

Month-to-month billing
$34/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
 
 

3 months

$87

Billing every 3 months
$29/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $5 per month or $15 in total compared to monthly billing with this package.

12 months

$288

Billing every 12 months
$24/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $10 per month or $120 in total compared to monthly billing with this package.

Your plan will automatically renew. You can cancel at any time via your PayPal account to avoid being charged again.

You can view the FAQ on our video plans here. You can contact us directly here. By clicking one of the buttons above, you agree to our Terms and Privacy Policy.