-- Will It Finish? ... Render Time Estimator -- version 1.00 --Christopher Grant, www.christophergrant.com | www.scriptspot.com -- -- DESCRIPTION: -- Allows you to easily estimate how many frames your computer and your backburner network will be able to render in a certain number of hours. -- For example - it's Friday afternoon and you want to leave but you're not quite sure whether all your frames will finish by Monday. This script uses -- the performance index on each node to estimate how many frames can be rendered. -- -- LIMITATIONS: -- It's not magic. -- All scenes vary. It's only as accurate as the "average" frame time that you give it. Thus if you tell it your average frame time is 1 minute but it's actually 1 hour -- don't expect it to give you accurate results. It's up to you to know your scene - the script isn't going to analyze your scene file and magically compute something. -- It's all based on backburner's performance index which if your computers have been rendering for a while then the performance index should be reasonably close -- --INSTALLATION: -- 1. Click Maxscript / Run Script and choose wherever you downloaded this file to... It will seem like nothing happened but that's exactly what it should do, -- you now need to assign a shortcut to it -- 2. Click Customize / Customize User Interface / Keyboard (tab) -- 3. Change the Category to "CG_Tools" -- 5. Click "Will It Finish?" and assign it to a menu, hotkey or toolbar -- 6. Click Save and save your custom UI settings to a file, do yourself a favor and don't use the default. -- 7. Done. -- --HISTORY: -- 2010 11 02: Dev start. Thought it'd be nice to have this run as a script instead of using Excel which is how I've been tracking this... -- -- macroScript cg_WillItFinish Category:"CG_Tools" toolTip:"Will It Finish?" buttontext:"Will It Finish?" ( global wif_roll global wif_allservers = #() global wif_idleservers = #() fn connectBB = ( manager = NetRender.GetManager() manager.connect #automatic "255.255.255.0" --manager.connect #automatic "255.255.0.0" manager.GetControl() --get queue control manager.SetUpdates false --the queue is now frozen servers = manager.GetServers() --get list of servers manager.SetUpdates true --the queue is unfrozen manager.Disconnect() --disconnect return servers ) fn initListView lv = ( lv.gridLines = true --same as in ActiveX --The following controls the display of details. We use defaults: lv.View = (dotNetClass "System.Windows.Forms.View").Details lv.fullRowSelect = true --same as in ActiveX layout_def = #("Server Name", "Performance %") for i in layout_def do lv.Columns.add i 96 --add column with name and optional width ) fn fillInSpreadSheet lv servers = ( theRange = #() --array to collect the list items for s in servers do ( --First we create a ListViewItem object with the object's name: li = dotNetObject "System.Windows.Forms.ListViewItem" s.name --Then we add all the sub-items with the desired string values: sub_li = li.SubItems.add ((floor (s.performance*100)) as string) append theRange li --we add the list item to the array ) lv.Items.AddRange theRange --when done, we populate the ListView ) --Returns BB server instance if the current workstation is in the BB list fn WhoAmI_BB servers netname = ( for s in servers where (matchpattern s.name pattern:netname) do return s return undefined ) fn est_performance allservers idleservers = ( --Sum up all server performance perfall = 0.0 for s in idleservers do perfall = perfall + s.performance --Find this server in backburner list this_server = WhoAmI_BB allservers sysInfo.computername --est_performance values if this_server != undefined then ( this_numframes = (wif_roll.spin_numhours.value*60.0/wif_roll.spin_rendtime.value) as integer bb_numframes = ((perfall/this_server.performance) * this_numframes) as integer wif_roll.est_thisframes.text = this_numframes as string wif_roll.est_bbframes.text = bb_numframes as string wif_roll.lbl_multiplier.caption = idleservers.count as string + " backburner nodes are " + ((floor ((perfall/this_server.performance)*100)/100) as string) + "X times faster than your single node" true ) else ( print "There was an error I didn't account for... Maybe I should have put more effort in this huh?" false ) ) rollout wif_roll "Will It Finish? ... Render Time Estimator" ( dotNetControl lv_objects "System.Windows.Forms.ListView" width:340 height:190 align:#center group "Render Settings" ( spinner spin_rendtime "Single Frame Render Time (ie 4.5 minutes):" range:[0,100,10] type:#float fieldwidth:100 align:#right spinner spin_numhours "Hours Available:" range:[0,10000,12] type:#integer fieldwidth:100 align:#right button btn_presetnight "Preset 12 hours (one night)" offset:[0,0] across:2 button btn_presetweekend "Preset 60 hours (weekend)" offset:[0,0] ) group "Estimate" ( label lbl_multiplier "" edittext est_thisframes "Total frames using this node" fieldwidth:100 text:"" enabled:true align:#right edittext est_bbframes "Total frames using backburner" fieldwidth:100 text:"" enabled:true align:#right label est_warning "* ESTIMATE ONLY. YOU ARE RESPONSIBLE FOR YOUR DEADLINES *" offset:[0,10] ) --connect to BB on startup. populate fields on wif_roll open do ( wif_allservers = connectBB() wif_idleservers = for s in wif_allservers where s.state==#idle collect s initListView lv_objects fillInSpreadSheet lv_objects wif_idleservers est_performance wif_allservers wif_idleservers ) --Preset number of hours. Refresh calculations on btn_presetweekend pressed do ( wif_roll.spin_numhours.value=60 est_performance wif_allservers wif_idleservers ) --Preset number of hours. Refresh calculations on btn_presetnight pressed do ( wif_roll.spin_numhours.value=12 est_performance wif_allservers wif_idleservers ) --Refresh every time spinner changed on spin_rendtime changed arg do (est_performance wif_allservers wif_idleservers) on spin_numhours changed arg do (est_performance wif_allservers wif_idleservers) ) try(destroyDialog wif_roll)catch() createDialog wif_roll 350 400 )