@ -5,6 +5,8 @@ function RenderToProject()
this . info =
this . info =
{
{
name : "RenderToProject" ,
name : "RenderToProject" ,
btn1 : "RenderToProject" ,
btn2 : "SetAllToProject" ,
version : 0.1 ,
version : 0.1 ,
stage : "development" ,
stage : "development" ,
description : "Set Renders to project appropriate folders according to the studio folder structure." ,
description : "Set Renders to project appropriate folders according to the studio folder structure." ,
@ -21,6 +23,17 @@ function RenderToProject()
} ;
} ;
this . methods =
this . methods =
{
{
getSelectedProjectItems : function ( ) {
var items = [ ] ;
var p = app . project ;
for ( var i = 1 ; i <= p . numItems ; i ++ ) {
var item = p . item ( i ) ;
if ( item . selected ) {
items . push ( item ) ;
}
}
return items ;
} ,
pad : function ( n , pad ) {
pad : function ( n , pad ) {
zeros = "" ;
zeros = "" ;
for ( i = 0 ; i < pad ; i ++ )
for ( i = 0 ; i < pad ; i ++ )
@ -71,19 +84,11 @@ function RenderToProject()
return base _path ;
return base _path ;
} ,
} ,
setRendersToProjectPath : function ( ) {
setRenderToProjectPath : function ( rqItem ) {
var q = app . project . renderQueue ;
if ( ( rqItem . status == 3015 ) || ( rqItem . status == 3013 ) ) {
/ / c h e c k t h e r e n d e r q u e u e i t e m i s n o t a l r e a d y r e n d e r e d .
for ( var j = 1 ; j <= rqItem . numOutputModules ; j ++ ) {
o _module = rqItem . outputModule ( j ) ;
for ( var i = 1 ; i <= q . numItems ; i ++ ) {
var old _name = rqItem . comp . name . replace ( "." , "_" ) ;
item = q . item ( i ) ;
/ / 3 0 1 5 i s Q U E U E D
/ / 3 0 1 3 i s N E E D S _ O U T P U T
if ( ( item . status == 3015 ) || ( item . status == 3013 ) ) {
for ( var j = 1 ; j <= item . numOutputModules ; j ++ ) {
o _module = item . outputModule ( j ) ;
var old _name = item . comp . name . replace ( "." , "_" ) ;
/ / a l e r t ( o l d _ n a m e ) ;
/ / a l e r t ( o l d _ n a m e ) ;
if ( o _module . file != null ) {
if ( o _module . file != null ) {
@ -110,23 +115,63 @@ function RenderToProject()
for ( var i = 0 ; i < p . length ; i ++ ) {
for ( var i = 0 ; i < p . length ; i ++ ) {
s += "\n" + p [ i ] ;
s += "\n" + p [ i ] ;
}
}
alert ( "Rendering to :" + "\n" + s + "\n\n" + o _module . file . name ) ;
/ / a l e r t ( " R e n d e r i n g t o : " + " \ n " + s + " \ n \ n " + o _ m o d u l e . f i l e . n a m e ) ;
}
}
}
}
} ,
setRendersToProjectPath : function ( ) {
var q = app . project . renderQueue ;
/ / c h e c k t h e r e n d e r q u e u e i t e m i s n o t a l r e a d y r e n d e r e d .
for ( var i = 1 ; i <= q . numItems ; i ++ ) {
item = q . item ( i ) ;
/ / 3 0 1 5 i s Q U E U E D
/ / 3 0 1 3 i s N E E D S _ O U T P U T
if ( ( item . status == 3015 ) || ( item . status == 3013 ) ) {
this . setRenderToProjectPath ( item ) ;
}
}
}
} ,
} ,
renderSelectedToProjectPath : function ( ) {
var q = app . project . renderQueue ;
var items = this . getSelectedProjectItems ( ) ;
for ( var i = 0 ; i < items . length ; i ++ ) {
rqItem = q . items . add ( items [ i ] ) ;
this . setRenderToProjectPath ( rqItem ) ;
}
q . showWindow ( true ) ;
}
}
}
this . init = function init ( )
this . init = function init ( )
{
{
/ *
* Sketching a possible multi button approach .
this . btnLauyout =
this . btnLauyout =
" button \
" group \
{ \
{ \
btn1 : Button { \
preferredSize : [ '" + this.appearence.buttonWidth + "' , '" + this.appearence.buttonHeight + "' ] , \
text : '" + this.info.btn1 + "' , \
onClick : "+ this.methods.setRendersToProjectPath;+" , \
helpTip : '" + this.info.description + "' \
} , \
btn2 : Button { \
preferredSize : [ '" + this.appearence.buttonWidth + "' , '" + this.appearence.buttonHeight + "' ] , \
text : '" + this.info.btn2 + "' , \
helpTip : '" + this.info.description + "' \
} \
} " ;
* /
this . btnLauyout =
" button { \
preferredSize : [ '" + this.appearence.buttonWidth + "' , '" + this.appearence.buttonHeight + "' ] , \
preferredSize : [ '" + this.appearence.buttonWidth + "' , '" + this.appearence.buttonHeight + "' ] , \
text : '" + this.info.name + "' , \
text : '" + this.info. btn1 + "', \
helpTip : '" + this.info.description + "' \
helpTip : '" + this.info.description + "' \
} " ;
} " ;
this . res =
this . res =
" window \
" window \
@ -200,7 +245,8 @@ function RenderToProject()
this . yMainFunction = function yMainFunction ( )
this . yMainFunction = function yMainFunction ( )
{
{
w = this . methods . setRendersToProjectPath ( ) ;
/ / H a v e t o S e p a r a t e t h i s i n t o " O p e r a t o r s " s o I c a n h a v e m u t i p l e b u t t o n s i n a s i n g l e T o o l .
w = this . methods . renderSelectedToProjectPath ( ) ;
}
}
this . activate = function activate ( )
this . activate = function activate ( )
{
{