Skip to content

Instantly share code, notes, and snippets.

@jocafa
Created March 28, 2021 21:26
Show Gist options
  • Save jocafa/2d5c4def804afb7faba078fa7c9fd210 to your computer and use it in GitHub Desktop.
Save jocafa/2d5c4def804afb7faba078fa7c9fd210 to your computer and use it in GitHub Desktop.
bl_info = {
"name": "Blender Toast",
"description": "Toast Notifications",
"author": "Josh Faul",
"blender": (2, 90, 1),
"category": "Render"
}
import subprocess
import os
import bpy
from bpy.app.handlers import persistent
@persistent
def notify(dummy):
scr = r'& "{}\{}"'.format(os.path.dirname(__file__), "rendertoast.ps1")
subprocess.run(['powershell.exe', scr])
def register():
bpy.app.handlers.render_complete.append(notify)
def unregister():
bpy.app.handlers.render_complete.remove(notify)
if __name__ == "__main__":
register()
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
$objNotifyIcon = New-Object System.Windows.Forms.NotifyIcon
$objNotifyIcon.Icon = [System.Drawing.SystemIcons]::Information
$objNotifyIcon.BalloonTipIcon = "Info"
$objNotifyIcon.BalloonTipTitle = "Render Done"
$objNotifyIcon.BalloonTipText = "The render. It is finished."
$objNotifyIcon.Visible = $True
$objNotifyIcon.ShowBalloonTip(10000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment