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
Nice! I've been looking for something like this
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?
Weird, it works for me. No idea why that happens :(
Hmm, perhaps you have some advertising blocker on your browser? I have adblock and sometimes it block elements that are not advertisements.
Hmmmmm, not working for me on Mac OS. After looking at the console, it looks like it can't find the sound file...
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?
I'll just leave this here...
http://blender3d.com.ua/avtomatizatsiya-renderinga/
Good job, Sergey!
Yes! I've been looking for a way to overpass sudo request at shutting down Linux system! Thanks a lot!
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...
see the small edit i wrote on your comment and tell me if it works
Been thinking for some time that blender should have the option to shut down the computer when a render completes. Thanks loads for this!!!
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.
thanx for this plugin ;)
can it execute an exteral command (like ms-dos commands and bash scripts)?
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.
Hi, I solved this using Dbus earlier and now systemd in my addon (http://blenderartists.org/forum/showthread.php?316215-Addon-WIP-RenderPlus&p=2505105). PM me if you need help
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
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?
Wow. I actually didn't thought about it since I always do animation render :)) I will surely fix it in no time!
Hello Sergey,
there is already a addon for autoSave Images, but ist doesn't have a shutdown function: http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Render/Auto_Save
Maybe it will save you a lot of work if you combine your addon with the mentioned above. If so, the new addon will be a perfect tool for both lovers of Still Images and energy savers like me ;-)
I already implemented some basic auto-save feature. Grab an improved version
If you change the default render from tmp to a folder of your choice , it will save the render properly.
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.
Slightly improved version available!
Volume control
Basic auto-save for still renders
Few bugs fixed
Shutdown and Alarm for Unix systems should work now
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!
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.
Благодарю!
int's not working to install... Windows 7, blender 2.74
I will use this from now on! THANK YOU SO MUCH!!
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.
Sorry for reviving such thread. Any luck with porting this script to blender 2.79?
Or any live link?
Thanks.