Advertisement

You're blocking ads, which pay for BlenderNation. Read about other ways to support us.

Add-on: Alarm and Shutdown at render completion

47

This clever little add-on can make your life a little easier when you're running a big render job.

Sergey Metelskiy writes:

Hello, BlenderHeads!

Here you have a nice handy add-on, which adds in blender an ability to play sound and shutdown a computer at render completion.

I hope you find it useful.

47 Comments

  1. Brian Lockett on

    The download link isn't acting properly for me. It takes me to a blank page with just an image icon on it. No download link. Is anyone else experiencing the same?

    • you might want to edit this line in the file "__init_.py" in the zip file
      sound_path = os.getcwd()+'/2.70/scripts/addons/alarm_and_shutdown/sounds/'
      to something like this

      sound_path ='your_path/sounds/'
      where "your_path" is the location of the files in mac os
      hope it will fix your problem
      note: backup your work, i'm a noob and don't know much on mac

      • oh and also delete the folder py_cache since it's the compiled version of the script on windows (it will be re-created for your operating system again when you execute it)

      • Thanks for the suggestion, that's the change that I made to get the sound button working, but unfortunately the sound still doesn't work when the render completes.

        Also, on mac, the add ons are placed into a folder that are user account specific, e.g:
        /Users/username/Library/Application Support/Blender

        Would be good if the path wasn't hard-coded to my specific add-on folder location so it could be used on other computers...

        • maybe there's a variable to the username path (like for example %userprofile% or similar in windows?

    • Yes! I've been looking for a way to overpass sudo request at shutting down Linux system! Thanks a lot!

  2. does it run on linux?
    can it put computer in hibernate mode? otherwise can i execute a custom command (eg: pm-hibernate)?

    • a quick look into the script code shows that it tests only if OS='win' or not, not sure if i will have to modify it myself to work on linux andmaybe i will add hibernation or it will work directly

      • Well, the test is, if it isn't windows, it assumes it's linux, meaning that if you're on mac, the location of the sound files is incorrect, as it just uses locations for Linux and Windows... So should work for Linux...

        Have managed to get the play button working on mac, but it doesn't play the sound after completing a render... My Python knowledge isn't great, so would take a lot of time for me to update this script to work on mac...

  3. David Allen Kolb on

    Been thinking for some time that blender should have the option to shut down the computer when a render completes. Thanks loads for this!!!

  4. Sorry for late response - problems with comment section :)
    So, unfortunately right now Add-on only works properly on windows systems, but I'm doing my best to add full support for Linux, and then OS X systems.
    I've also got few requests to add support for notifying via e-mail. Tell me guys if you think that it will be a handy feature.

      • btw the commands for shutdown in linux is "shutdown -h now" and restart is "shutdown -r now" in case you don't use linux ,but i guess there's a function directly in python for all OS (like for example "poweroff()" or similar),right?

        • No, it's directly calling for subprocess. Exactly "shutdown -h now". But the problem with Linux is that blender have to be launched by superuser in order to shutdown a computer. But I think I found a solution. Testing it right now.

          • does shutdown need root privileges on most linux distros or only ubuntu and similar?

          • As far as I know every more or less standard unix system sticks to superuser paradigm. So yes - by default such important task as shutting down a machine require root privileges

          • then why you can shutdown the computer from the taskbar without asking for the root password when no other user is logged?

          • Because when you shutting down computer using GUI, the system assumes that you know what you doing. While shutting down from command line can be invoked by some malicious software.

          • so is there a way to use the exact procedures that gui shutdown does? or it just disallows it when it's not a subprocess of the desktop environment program?

          • Yeah, I already fixed this with just one line, with help of this article.
            http://blender3d.com.ua/avtomatizatsiya-renderinga/
            It's written in Russian, so i'll just copy these lines in here.

            sudo chmod u+s /sbin/shutdown
            shutdown -r now

            First line gives current user access to shutdown utility. And you already familiar with the second line

          • sorry for asking a lot of questions
            but you will have to input the sudo password the first time, what about users who don't have it ? and how to input it the first time when there's to terminal to give the input?(gksudo shows a gui prompt of the password instead)
            also giving access to the user to the shutdown program has some security issues,right?

          • It's kind of odd but launched from blender this command do not request a password.
            Then again - I'm really far from being expert with Unix systems, and I'm not familiar with all this nuances. :)

          • not askin for a password!!!! what if a script has sudo rm -f / ?!!!
            and also if it's not asking for a password, why you don't just put sudo shutdown -h now instead of adding permissions to a single non-root user?

          • These are eternal questions of universe...
            That's why developers themselves do not recommend users to use untrusted scripts and addons.

          • so "sudo shutdown -h now" works for non-root users without askin password? if yes that's better than changing the system settings and that's what you should put in you script, otherwise make a note to the users about changing /sbin/shutdown permissions

  5. Very Nice. But what about Saving the Render File? If Render is complete and your Work will NOT be saved before shutting down your Computer, your Render Job will be lost. Is there something i didn't get?

  6. chromemonkey on

    Is it on the user not to share a saved file in an "auto-shutdown" state? I hope this doesn't create any situations on a shared network, don't want to take down a cluster of workstations from rendering a downloaded file after all!

    Though I guess the admin would simply not enable the addon in the first place... making it an irrelevant question.

    • Good point. But as you mentioned - addon has to be enabled in a first place. But i'll make sure that checkbox that enables auto shutdown simply wont save with file and stay unchecked at file open.

  7. Slightly improved version available!
    Volume control
    Basic auto-save for still renders
    Few bugs fixed
    Shutdown and Alarm for Unix systems should work now

  8. A godsend! I often let rendering to be done while I'm away and use Team Viewer to shutdown computer. Now it will be much easier! Also alarm is a great feature - I won't be needing to check if the job''s done while watching a movie or reading a book! Thanks a million!

  9. Good job Sergey but I cannot hear the proper sounds if I install the Addon through the "Install from file..." button on the User Preferences window. It works perfectly by copying the Addon directly in Blender's Program Files directory though.

    • It's not installing on Blender 2.78.

      Looks like Just what I need, let me know if there's anything else I can try to get it working. Thank you.

Leave A Reply

To add a profile picture to your message, register your email address with Gravatar.com. To protect your email address, create an account on BlenderNation and log in when posting a message.

Advertisement

×