.
 
.

ÜberwareTM

View Forum Thread

Anyone can view the forums, but you need to log in in order to post messages.

> Forum Home > Feature Requests > AFX -reuse in smedge_render_queue.jsx ?

  Wed, 13/May/2009 3:24 PM
marc
5 Posts
Im a lazy admin and like automatized processes :) so i copied the smedge_render_queue.jsx
into the After Effecs CS3 Script folder and submit my Jobs on this way. That works fine.
To start rendering mutch faster i found the -reuse flag in AErender.
Fine, this works if i manually hit the Box "Reuse Running Programm" while Submitting a Job
from the "Render Overrides" Tab inside the Smedge Gui.


In the smedge_render_queue.jsx it is possible to add some extra parameters like cmd += " -Paused";
i read administrator pdf, saved .sj files to found the rihgt syntax and do a lot of tests. i cant
solve that. how i can add this -reuse flag correct?

here is my smedge_render_queue.jsx



// smedge_render_queue.jsx
//
// Submits all queued renders as Smedge Jobs
//
// Smedge 3
// Copyright (c) 2004 - 2008 Uberware. All Rights Reserved

{
// Adjust this to the path to the Submit program on your system
// NOTE: If the path has spaces, it must be surrounded in quotes.
// Because quotes and backslashes are special characters to JavaScript
// they must each be preceeded by a backslash inside of the string.
// \ becomes \\ and " becomes \"
var PathToSubmit = "\"C:\\Program Files\\Smedge 3\\2.4.2\\Submit\"";

var safeToRunScript = true;

// check for a project and file
safeToRunScript = app.project != null;
if( !safeToRunScript )
{
alert( "A project must be open to run this script." );
}
else
{
safeToRunScript = app.project.file != null;
if( !safeToRunScript )
{
alert( "Please save your Project before submitting the project to Smedge" );
}
}

if( safeToRunScript )
{
// check the render queue and make certain at least one item is queued
safeToRunScript = false;
for( i = 1; i <= app.project.renderQueue.numItems; ++i )
{
if( app.project.renderQueue.item( i ).status == RQItemStatus.QUEUED )
{
safeToRunScript = true;
break;
}
}
if( !safeToRunScript )
{
alert ( "You do not have any items set to render." );
}
}
if( safeToRunScript )
{
// check that scripts have permission to run
var ScriptPrefsSetting = app.preferences.getPrefAsLong( "Main Pref Section", "Pref_SCRIPTING_FILE_NETWORK_SECURITY" );
safeToRunScript = ScriptPrefsSetting == 1;

// if no access alert and exit
if( !safeToRunScript )
{
alert( "smedge_render_queue requires the scripting security preference to be set.\n" +
"Go to the \"General\" panel of your application preferences,\n" +
"and make sure that \"Allow Scripts to Write Files and Access Network\" is checked." );
}
}

if( safeToRunScript )
{
// Submit To Smedge on button click
function SubmitJob( render )
{
// get the Project File Name
var file = app.project.file;
var ProjectFileName = file.fsName;

// get selected project item
var JobName = file.name.replace( /%20/gi, " " ) + ": " + render.comp.name;

// get the comp name
var CompName = render.comp.name;

// get the frame range
var FPS = render.comp.frameRate;
var StartFrame = Math.round( render.timeSpanStart * FPS )+1;
var EndFrame = Math.round( (render.timeSpanStart + render.timeSpanDuration) * FPS );

// assemble the command string
var cmd = PathToSubmit + " Script -Type AfterEffects";
cmd += " -Scene " + ProjectFileName;
cmd += " -Comp " + CompName;
cmd += " -Range " + StartFrame + "-" + EndFrame;
cmd += " -Name " + JobName;

// NOTE: you can add any other Smedge parameters you want
// You can also devise some clever system that uses the
// AE preferences and/or a nice window or panel in the
// interface. Some examples that you may find useful:
//
// cmd += " -CPUs 0"; // <-- Tells Smedge to launch the Jobs one per Engine (default)
// cmd += " -CPUs 1"; // <-- Tells Smedge to launch the Jobs one per CPU
// cmd += " -CPUs 4"; // <-- Tells Smedge to launch the Jobs to use 4 CPUs for each worker
cmd += " -Pool Render_01-10"; // <-- Set the Smedge Pool for the Jobs (you can use the Pool name or ID)
// cmd += " -WaitForJobID "; // <-- The Jobs will wait for the specified Job to be finished before starting
// cmd += " -Note Note Text"; // <-- Add a note to the Jobs
cmd += " -PacketSize 1"; // <-- Sets the number of frames that will be rendered at once for each Job to 5
cmd += " -Priority 50"; // <-- Sets the Jobs' priority to 75
cmd += " -Paused"; // <-- Submits the Jobs to Smedge in the "paused" state, so no work will start until you resume them
//
// For more information, see the Submit help, and the
// Administrator Manual for a list of all of the parameters
// available for After Effects.

return cmd;
}

// Create a log file with all of the commands and their results
var log = new File( app.project.file.fsName + "__SmedgeSubmit.log" );
log.open( "w" );
log.writeln( "Submitting all queued renders to Smedge" );
var time = new Date();
log.writeln( time.toString() );
log.writeln( "" );

// send each queued render
var count = app.project.renderQueue.numItems;
for( i = 1; i <= count; i++ )
{
var render = app.project.renderQueue.item( i );
if( render.status == RQItemStatus.QUEUED )
{
// Get the command line
var cmd = SubmitJob( render );
log.writeln( cmd );
log.writeln( "" );

// execute the command line and log the result
log.writeln( system.callSystem( cmd ) );

// unqueue this redner
render.render = false;
}
}

// finish the log file
log.writeln( "" );
log.writeln( "All Finished" );
log.close();
}
}



best regards,
marc


EDIT:
i also found this parameters helpfully to bypass plugin problems when each server starts at the same time.

cmd += " -StaggerCount 1";
cmd += " -StaggerStart 3";

Edited by author on Thu, 14/May/2009 6:37 AM
   
  Sun, 17/May/2009 12:03 AM
Robin
1138 Posts
Add this to the SubmitJob function get the -reuse flag added to the commandline:

cmd += " -extra \" -reuse\"";


Note that the whitespace characters are important. There is a space before each - character before -extra and -reuse. The space before -reuse must be inside of the escaped quote marks (the quote marks with the \ in front of them).

-robin
   
Page 1 of 1

.
.
.
.
©2000 - 2013 Überware. All rights reserved