|
|
|
|
@ -12,6 +12,8 @@
|
|
|
|
|
TODO:
|
|
|
|
|
- Get artist initials in Windows too.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// Define the Panel
|
|
|
|
|
(function wcHelperPanel (thisObj) {
|
|
|
|
|
/* Build UI */
|
|
|
|
|
function buildUI(thisObj) {
|
|
|
|
|
@ -21,31 +23,22 @@
|
|
|
|
|
var secondButton = "own";
|
|
|
|
|
var thirdButton = "render";
|
|
|
|
|
var fourthButton = "rename";
|
|
|
|
|
|
|
|
|
|
var win = (thisObj instanceof Panel)? thisObj : new Window('palette', windowTitle);
|
|
|
|
|
win.spacing = 0;
|
|
|
|
|
win.margins = 1;
|
|
|
|
|
|
|
|
|
|
var myProjectGroup = win.add ("group");
|
|
|
|
|
win.projectPathLabel = myProjectGroup.add("statictext");
|
|
|
|
|
|
|
|
|
|
var myArtistGroup = win.add ("group");
|
|
|
|
|
var artistNameLabel= myArtistGroup.add("statictext");
|
|
|
|
|
win.artistName= myArtistGroup.add("statictext");
|
|
|
|
|
var artistRoleLabel= myArtistGroup.add("statictext");
|
|
|
|
|
win.artistRole= myArtistGroup.add("dropdownlist",undefined,["Offline","Finishing"])
|
|
|
|
|
win.artistRole.selection = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
win.projectPathLabel.text = "asdADSASDASDASDASDASDASDASDASDASDASDASDASDASDASDASDASDASDASDASDASDASASDasdADSASDASDASDASDASDASDASDASDASDASDASDASDASDASDASDASDASDASDASDASDASASDasdADSASDASDASDASDASDASDASDASDASDASDASDASDASDASDASDASDASDASDASDASDASASD";
|
|
|
|
|
|
|
|
|
|
win.projectPathLabel.text = "000000000000000000000000000000000000000000000000000";
|
|
|
|
|
artistNameLabel.text = "Artist:";
|
|
|
|
|
artistRoleLabel.text = "Role:";
|
|
|
|
|
//****//
|
|
|
|
|
|
|
|
|
|
win.artistName.text = system.callSystem("whoami");
|
|
|
|
|
|
|
|
|
|
var myButtonGroup = win.add ("group");
|
|
|
|
|
myButtonGroup.spacing = 4;
|
|
|
|
|
myButtonGroup.margins = 4;
|
|
|
|
|
myButtonGroup.orientation = "row";
|
|
|
|
|
win.checkbox1 = myButtonGroup.add( "checkbox", undefined, "Dupli:")
|
|
|
|
|
win.checkbox1.value = true;
|
|
|
|
|
@ -57,6 +50,11 @@
|
|
|
|
|
myButtonGroup2.alignment = "center";
|
|
|
|
|
myButtonGroup2.alignChildren = "center";
|
|
|
|
|
|
|
|
|
|
win.spacing = 0;
|
|
|
|
|
win.margins = 1;
|
|
|
|
|
myButtonGroup.spacing = 4;
|
|
|
|
|
myButtonGroup.margins = 4;
|
|
|
|
|
|
|
|
|
|
win.button1.onClick = function(){
|
|
|
|
|
btnPlus1();
|
|
|
|
|
//versionUpSelectedComps(1);
|
|
|
|
|
@ -67,10 +65,8 @@
|
|
|
|
|
win.button3.onClick = function(){
|
|
|
|
|
btnRender();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
win.button4.onClick = function(){
|
|
|
|
|
btnTest();
|
|
|
|
|
//alert( getItemByName( getTodayString() ));
|
|
|
|
|
}
|
|
|
|
|
win.onResizing = function(){
|
|
|
|
|
updateProjectPath();
|
|
|
|
|
@ -81,18 +77,16 @@
|
|
|
|
|
return win
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Show the Panel
|
|
|
|
|
var w = buildUI(thisObj);
|
|
|
|
|
if (w.toString() == "[object Panel]") {
|
|
|
|
|
// Show the Panel
|
|
|
|
|
var w = buildUI(thisObj);
|
|
|
|
|
if (w.toString() == "[object Panel]") {
|
|
|
|
|
w;
|
|
|
|
|
} else {
|
|
|
|
|
} else {
|
|
|
|
|
w.show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* General functions */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
w.pad = function ( n, i ){ //pad n with zeroes up to i places.
|
|
|
|
|
/* General functions */
|
|
|
|
|
w.pad = function ( n, i ){ //pad n with zeroes up to i places.
|
|
|
|
|
if (String(n).length>=i){
|
|
|
|
|
return String(n)
|
|
|
|
|
}else{
|
|
|
|
|
@ -103,13 +97,11 @@
|
|
|
|
|
}
|
|
|
|
|
return padding+String(n)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function updateProjectPath(){
|
|
|
|
|
}
|
|
|
|
|
function updateProjectPath(){
|
|
|
|
|
w.projectPathLabel.text = getOutputBasePath();
|
|
|
|
|
//alert(w.projectPathLabel.text);
|
|
|
|
|
}
|
|
|
|
|
function getSelectedProjectItems(){
|
|
|
|
|
}
|
|
|
|
|
function getSelectedProjectItems(){
|
|
|
|
|
|
|
|
|
|
var items = [];
|
|
|
|
|
var p = app.project;
|
|
|
|
|
@ -121,12 +113,12 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return items;
|
|
|
|
|
}
|
|
|
|
|
function getRegex( myComp , regex ){
|
|
|
|
|
}
|
|
|
|
|
function getRegex( myComp , regex ){
|
|
|
|
|
var offlineRevCode = myComp.name;
|
|
|
|
|
return offlineRevCode.match(regex)[0];
|
|
|
|
|
}
|
|
|
|
|
function getTodayString(){
|
|
|
|
|
}
|
|
|
|
|
function getTodayString(){
|
|
|
|
|
|
|
|
|
|
dt = new Date();
|
|
|
|
|
|
|
|
|
|
@ -137,8 +129,8 @@
|
|
|
|
|
todayString = String(month)+"_"+String(day)+"_"+String(year);
|
|
|
|
|
|
|
|
|
|
return todayString
|
|
|
|
|
}
|
|
|
|
|
function getItemTrunk( projectItem ){
|
|
|
|
|
}
|
|
|
|
|
function getItemTrunk( projectItem ){
|
|
|
|
|
|
|
|
|
|
var walkBranch =[]
|
|
|
|
|
currentItem = projectItem;
|
|
|
|
|
@ -150,8 +142,8 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return walkBranch
|
|
|
|
|
}
|
|
|
|
|
function getItemByName( name ){
|
|
|
|
|
}
|
|
|
|
|
function getItemByName( name ){
|
|
|
|
|
|
|
|
|
|
var items = app.project.items;
|
|
|
|
|
var myItem = null;
|
|
|
|
|
@ -164,22 +156,23 @@
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
return myItem;
|
|
|
|
|
}
|
|
|
|
|
/* Project Specific functions */
|
|
|
|
|
function getOfflineRevCode( myComp ){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Project Specific functions */
|
|
|
|
|
function getOfflineRevCode( myComp ){
|
|
|
|
|
|
|
|
|
|
//var regex = /[0-9]{2}[a-z]{2}/g; //Maixmum rev number 99
|
|
|
|
|
var regex = /[0-9]{2}[a-z]{2}/g; //Maixmum rev number 99
|
|
|
|
|
var offlineRevCode = myComp.name.match(regex)[0];
|
|
|
|
|
return offlineRevCode;
|
|
|
|
|
}
|
|
|
|
|
function getFinishingRevCode( myComp ){
|
|
|
|
|
}
|
|
|
|
|
function getFinishingRevCode( myComp ){
|
|
|
|
|
|
|
|
|
|
var regex = /[0-9]{2}[a-z]{2}[FINCHK]{3}/g; //Maixmum rev number 99
|
|
|
|
|
var offlineRevCode = myComp.name.match(regex)[0];
|
|
|
|
|
return offlineRevCode;
|
|
|
|
|
}
|
|
|
|
|
function getItemPath( projectItem ){
|
|
|
|
|
}
|
|
|
|
|
function getItemPath( projectItem ){
|
|
|
|
|
//not too useful right now as AE's paths aren't unique./
|
|
|
|
|
var walkPath =""
|
|
|
|
|
currentItem = projectItem;
|
|
|
|
|
@ -192,8 +185,8 @@
|
|
|
|
|
walkPath = "/"+ walkPath;
|
|
|
|
|
|
|
|
|
|
return walkPath
|
|
|
|
|
}
|
|
|
|
|
function getArtistInitials(){
|
|
|
|
|
}
|
|
|
|
|
function getArtistInitials(){
|
|
|
|
|
|
|
|
|
|
//mac only for now ?
|
|
|
|
|
var userName = w.artistName.text;
|
|
|
|
|
@ -206,8 +199,8 @@
|
|
|
|
|
artistInitials = userName.substring(0,2);
|
|
|
|
|
|
|
|
|
|
return artistInitials;
|
|
|
|
|
}
|
|
|
|
|
function versionUpSelectedComps( inc ){
|
|
|
|
|
}
|
|
|
|
|
function versionUpSelectedComps( inc ){
|
|
|
|
|
//really selected items, might be worth to restrict to just comps ?
|
|
|
|
|
var selectedComps = getSelectedProjectItems();
|
|
|
|
|
for ( var i = 0 ; i < selectedComps.length ; i ++ )
|
|
|
|
|
@ -216,8 +209,8 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
function versionUpComp( myComp, inc ){
|
|
|
|
|
}
|
|
|
|
|
function versionUpComp( myComp, inc ){
|
|
|
|
|
role = w.artistRole;
|
|
|
|
|
|
|
|
|
|
if ( role.selection.index == 0 ){
|
|
|
|
|
@ -241,8 +234,8 @@
|
|
|
|
|
newArtistInitials = newArtistInitials+"FIN"
|
|
|
|
|
}
|
|
|
|
|
myComp.name = splitName[0]+w.pad(ver+inc,2)+newArtistInitials+splitName[1] ;
|
|
|
|
|
}
|
|
|
|
|
function getOutputBasePath(){
|
|
|
|
|
}
|
|
|
|
|
function getOutputBasePath(){
|
|
|
|
|
|
|
|
|
|
var file = app.project.file;
|
|
|
|
|
var file_path = String(app.project.file);
|
|
|
|
|
@ -271,21 +264,17 @@
|
|
|
|
|
|
|
|
|
|
// alert(base_path + "/" + getTodayString());
|
|
|
|
|
return base_path + "/" + getTodayString();
|
|
|
|
|
}
|
|
|
|
|
function setRenderToProjectPath( rqItem , extra_path ){
|
|
|
|
|
}
|
|
|
|
|
function setRenderToProjectPath( rqItem , extra_path ){
|
|
|
|
|
updateProjectPath()
|
|
|
|
|
var uiPath = w.projectPathLabel.text;
|
|
|
|
|
alert(uiPath);
|
|
|
|
|
|
|
|
|
|
//alert(uiPath);
|
|
|
|
|
//updateProjectPath();
|
|
|
|
|
|
|
|
|
|
//alert(rqItem);
|
|
|
|
|
|
|
|
|
|
// alert( rqItem );
|
|
|
|
|
if ( (rqItem.status == 3015) || (rqItem.status == 3013) ){
|
|
|
|
|
for ( var j = 1 ; j <= rqItem.numOutputModules ; j ++ ){
|
|
|
|
|
o_module = rqItem.outputModule(j);
|
|
|
|
|
|
|
|
|
|
var old_name = rqItem.comp.name.replace(".","_");
|
|
|
|
|
//alert(old_name);
|
|
|
|
|
if ( o_module.file != null ){
|
|
|
|
|
@ -309,21 +298,17 @@
|
|
|
|
|
//o_module.file= new_file;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var p = String( o_module.file.path ).split("/");
|
|
|
|
|
|
|
|
|
|
p.splice(0,3);
|
|
|
|
|
|
|
|
|
|
var s = "";
|
|
|
|
|
|
|
|
|
|
for ( var i = 0 ; i < p.length ; i ++ ){
|
|
|
|
|
s += "\n"+p[i];
|
|
|
|
|
}
|
|
|
|
|
//alert( "Rendering to :" + "\n" + s + "\n\n" + o_module.file.name );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function setRendersToProjectPath(){
|
|
|
|
|
}
|
|
|
|
|
function setRendersToProjectPath(){
|
|
|
|
|
var q = app.project.renderQueue;
|
|
|
|
|
//check the render queue item is not already rendered.
|
|
|
|
|
for ( var i = 1 ; i <= q.numItems ; i ++ ){
|
|
|
|
|
@ -335,8 +320,8 @@
|
|
|
|
|
setRenderToProjectPath( item );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function renderSelectedToProjectPath(){;
|
|
|
|
|
}
|
|
|
|
|
function renderSelectedToProjectPath(){;
|
|
|
|
|
var q = app.project.renderQueue;
|
|
|
|
|
var items = getSelectedProjectItems();
|
|
|
|
|
// alert( items );
|
|
|
|
|
@ -359,15 +344,15 @@
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function versiounUpTodaySelectedComps( inc ){
|
|
|
|
|
}
|
|
|
|
|
function versiounUpTodaySelectedComps( inc ){
|
|
|
|
|
var myComps = getSelectedProjectItems();
|
|
|
|
|
for ( var i = 0 ; i < myComps.length ; i ++ ){
|
|
|
|
|
var myComp = myComps[i];
|
|
|
|
|
versiounUpTodaySelectedComp( myComp,inc );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function itemIndexInCollection( itemCollection , itemName ){
|
|
|
|
|
}
|
|
|
|
|
function itemIndexInCollection( itemCollection , itemName ){
|
|
|
|
|
var indexInCollection = -1;
|
|
|
|
|
for ( var i = 1; i <= itemCollection.length ; i ++){
|
|
|
|
|
if ( itemCollection[i].name == itemName ){
|
|
|
|
|
@ -375,9 +360,8 @@
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return indexInCollection;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function versiounUpTodaySelectedComp( myComp, inc ){
|
|
|
|
|
}
|
|
|
|
|
function versiounUpTodaySelectedComp( myComp, inc ){
|
|
|
|
|
//var my_item = getSelectedProjectItems()[0];
|
|
|
|
|
|
|
|
|
|
var t = getItemTrunk(myComp);
|
|
|
|
|
@ -428,10 +412,10 @@
|
|
|
|
|
//app.project.activeItem = new_comp;
|
|
|
|
|
myComp.selected = false;
|
|
|
|
|
new_comp.selected = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* UI Buttons */
|
|
|
|
|
function btnPlus1(){
|
|
|
|
|
/* UI Buttons */
|
|
|
|
|
function btnPlus1(){
|
|
|
|
|
var dupli = w.checkbox1.value == true;
|
|
|
|
|
if ( dupli ){
|
|
|
|
|
app.beginUndoGroup("Create copies of selected Comps for today and increment.")
|
|
|
|
|
@ -441,8 +425,8 @@
|
|
|
|
|
versionUpSelectedComps( 1 );
|
|
|
|
|
}
|
|
|
|
|
app.endUndoGroup()
|
|
|
|
|
}
|
|
|
|
|
function btnOwn(){
|
|
|
|
|
}
|
|
|
|
|
function btnOwn(){
|
|
|
|
|
var dupli = w.checkbox1.value == true;
|
|
|
|
|
if ( dupli ){
|
|
|
|
|
app.beginUndoGroup("Own duplicates of selected Comps.")
|
|
|
|
|
@ -451,22 +435,15 @@
|
|
|
|
|
app.beginUndoGroup("Own selected Comps.")
|
|
|
|
|
versionUpSelectedComps( 0 );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function btnRender(){
|
|
|
|
|
}
|
|
|
|
|
function btnRender(){
|
|
|
|
|
renderSelectedToProjectPath();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function btnTest(){
|
|
|
|
|
}
|
|
|
|
|
function btnTest(){
|
|
|
|
|
compHerder = new CompHerder();
|
|
|
|
|
compHerder.activate();
|
|
|
|
|
//alert("Nothing to test right now.")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
////
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function CompHerder(){
|
|
|
|
|
this.methods ={
|
|
|
|
|
@ -554,7 +531,6 @@ function CompHerder(){
|
|
|
|
|
}
|
|
|
|
|
this.init = function init()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// this.btnLauyout =
|
|
|
|
|
// "button\
|
|
|
|
|
// {\
|
|
|
|
|
@ -696,23 +672,21 @@ function CompHerder(){
|
|
|
|
|
myUI.window.tabs.search_tab.replaceGrp.replaceString.onActivate = function(){
|
|
|
|
|
myUI.window.tabs.search_tab.replaceGrp.replaceString.text = "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//EVENT HANDLERS
|
|
|
|
|
myUI.window.tabs.search_tab.doItBtn.onClick = function(){
|
|
|
|
|
var search_str = myUI.window.tabs.search_tab.searchGrp.searchString.text;
|
|
|
|
|
var replace_str = myUI.window.tabs.search_tab.replaceGrp.replaceString.text;
|
|
|
|
|
myUI.methods.replace( myUI.methods.getSelectedProjectItems() , search_str , replace_str );
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
myUI.window.tabs.suprefix.suprefixGrp.pre.prefixBtn.onClick = function(){
|
|
|
|
|
var pre = myUI.window.tabs.suprefix.suprefixGrp.pre.prefixString.text;
|
|
|
|
|
myUI.methods.prefix( myUI.methods.getSelectedProjectItems() , pre );
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
myUI.window.tabs.suprefix.suprefixGrp.su.sufixBtn.onClick = function(){
|
|
|
|
|
var su = myUI.window.tabs.suprefix.suprefixGrp.su.sufixString.text;
|
|
|
|
|
myUI.methods.suffix( myUI.methods.getSelectedProjectItems() , su );
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
myUI.window.tabs.rename_tab.renameGrp.renameBtn.onClick = function(){
|
|
|
|
|
var new_name = myUI.window.tabs.rename_tab.renameGrp.renameString.text;
|
|
|
|
|
myUI.methods.rename( myUI.methods.getSelectedProjectItems() , new_name );
|
|
|
|
|
|