mirror of
https://github.com/jorgevasquezp/AFX_yTools.git
synced 2026-08-16 15:30:59 +00:00
Fixed an error on a string declaration that broke the yToolMenu when addig said tool.
This commit is contained in:
@@ -84,7 +84,7 @@ YTB =
|
|||||||
//alert( aTool.info.name );
|
//alert( aTool.info.name );
|
||||||
|
|
||||||
this.tools.push( aTool );
|
this.tools.push( aTool );
|
||||||
|
//alert( aTool.btnLauyout );
|
||||||
var btn = this.window.grp.main.add( aTool.btnLauyout );
|
var btn = this.window.grp.main.add( aTool.btnLauyout );
|
||||||
|
|
||||||
btn.onClick = aTool.activate;
|
btn.onClick = aTool.activate;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
+243
-1
File diff suppressed because one or more lines are too long
@@ -0,0 +1,115 @@
|
|||||||
|
#include "../yScripts/y_JSExtensions.jsx";
|
||||||
|
|
||||||
|
function CompHerder()
|
||||||
|
{
|
||||||
|
this.info =
|
||||||
|
{
|
||||||
|
name : "CompHerder",
|
||||||
|
version : 0.1,
|
||||||
|
stage : "development",
|
||||||
|
description : "Generic script to use as a base for new tools.",
|
||||||
|
url : "yorchnet.com"
|
||||||
|
};
|
||||||
|
this.appearence =
|
||||||
|
{
|
||||||
|
buttonHeight : 30,
|
||||||
|
buttonWidth : 126
|
||||||
|
};
|
||||||
|
this.resources =
|
||||||
|
{
|
||||||
|
icon : new File('yNet.png'),
|
||||||
|
};
|
||||||
|
this.init = function init()
|
||||||
|
{
|
||||||
|
|
||||||
|
this.btnLauyout =
|
||||||
|
"button\
|
||||||
|
{\
|
||||||
|
preferredSize: ['" + this.appearence.buttonWidth + "','" + this.appearence.buttonHeight + "'],\
|
||||||
|
text:'" + this.info.name + "',\
|
||||||
|
helpTip:'" + this.info.description + "'\
|
||||||
|
}";
|
||||||
|
|
||||||
|
this. res =
|
||||||
|
"window\
|
||||||
|
{\
|
||||||
|
type:'palette',\
|
||||||
|
text:'" + this.info.name + ' ' + this.info.ver + ' ' + this.info.stage + "',\
|
||||||
|
info: Group \
|
||||||
|
{\
|
||||||
|
alignment:['center','bottom'],\
|
||||||
|
icon: Image \
|
||||||
|
{\
|
||||||
|
icon:'" + this.resources.icon.path + '/' + this.resources.icon.name + "',\
|
||||||
|
preferredSize: [15, 18]\
|
||||||
|
},\
|
||||||
|
website: StaticText\
|
||||||
|
{\
|
||||||
|
text:'" + this.info.url + "',\
|
||||||
|
alignment:['fill','center']\
|
||||||
|
},\
|
||||||
|
}\
|
||||||
|
}";
|
||||||
|
}
|
||||||
|
this.createUI = function createUI()
|
||||||
|
{
|
||||||
|
var res =
|
||||||
|
"window { \
|
||||||
|
text: 'CompHerder',\
|
||||||
|
alignment: ['fill','fill'], \
|
||||||
|
alignChildren: ['left','top'], \
|
||||||
|
orientation: 'column', \
|
||||||
|
resizeable: 'true',\
|
||||||
|
tabs: Panel {\
|
||||||
|
type: 'tabbedpanel',\
|
||||||
|
alignment: ['fill','fill'], \
|
||||||
|
alignChildren: ['left','top'], \
|
||||||
|
orientation: 'column', \
|
||||||
|
tab1: Panel {\
|
||||||
|
type: 'tab',\
|
||||||
|
text: 'search & replace'\
|
||||||
|
},\
|
||||||
|
tab2: Panel {\
|
||||||
|
type: 'tab',\
|
||||||
|
text: 'suffix/prefix'\
|
||||||
|
},\
|
||||||
|
tab3: Panel {\
|
||||||
|
type: 'tab',\
|
||||||
|
text: 'rename'\
|
||||||
|
}\
|
||||||
|
}\
|
||||||
|
}";
|
||||||
|
|
||||||
|
this.window = new Window( res );
|
||||||
|
this.window.layout.layout(true);
|
||||||
|
/*
|
||||||
|
this.window.resize();
|
||||||
|
this.window.center();
|
||||||
|
*/
|
||||||
|
this.window.show();
|
||||||
|
|
||||||
|
this.window.layout.onResizing = this.window.layout.onResize = function () {this.layout.resize();}
|
||||||
|
}
|
||||||
|
this.yMainFunction = function yMainFunction()
|
||||||
|
{
|
||||||
|
this.createUI();
|
||||||
|
}
|
||||||
|
this.activate = function activate()
|
||||||
|
{
|
||||||
|
this.yTool.yMainFunction();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.init();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
//CHECKS that the toolbox exists, and if it doesn´t it runs the script on its own.
|
||||||
|
if (typeof(YTB)=='undefined')
|
||||||
|
{
|
||||||
|
CompHerder = new CompHerder();
|
||||||
|
CompHerder.activate();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
YTB.addTool(new CompHerder());
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
+127
-1
@@ -1 +1,127 @@
|
|||||||
#include "../yScripts/y_JSExtensions.jsx";␍function YSetProjectTool()␍{␍ this.info =␍ {␍ name : "YSetStructure",␍ version : 0.11,␍ stage : "alpha",␍ description : "Set the Folder Structure for a new Project",␍ url : "yorchnet.com"␍ };␍ this.appearence =␍ {␍ buttonHeight : 30,␍ buttonWidth : 126␍ };␍ this.resources = ␍ {␍ icon : new File('yNet.png'),␍ };␍ this.init = function init()␍ {␍ //alert("my name is:" + this.info.name);␍ this.btnLauyout = ␍ "button\␍ {\␍ preferredSize: ['" + this.appearence.buttonWidth + "','" + this.appearence.buttonHeight + "'],\␍ text:'" + this.info.name + "',\␍ helpTip:'" + this.info.description + "'\␍ }";␍ ␍ this. res = ␍ "window\␍ {\␍ type:'palette',\␍ text:'" + this.info.name + ' ' + this.info.ver + ' ' + this.info.stage + "',\␍ info: Group \␍ {\␍ alignment:['center','bottom'],\␍ icon: Image \␍ {\␍ icon:'" + this.resources.icon.path + '/' + this.resources.icon.name + "',\␍ preferredSize: [15, 18]\␍ },\␍ website: StaticText\␍ {\␍ text:'" + this.info.url + "',\␍ alignment:['fill','center']\␍ },\␍ }\␍ }";␍ }␍ this.createUI = function createUI()␍ {␍ this.window = new Window ( this.res );␍ this.window.show() ;␍ }␍ this.ySetProject = function ySetProject()␍ {␍ //alert("is this working");␍ app.beginUndoGroup('ySetProject');␍ var preStruct = ["01 MAIN","02 PComp","03 Source Layers" ,"04 Movies","05 Other Projects","06 Audio" , "07 Reference"];␍ var newStruct = [];␍ var projectItems = [];␍␍ for(i=1;i<=app.project.items.length;i++)␍ {␍ if(app.project.items[i].parentFolder.name=='Root')␍ {␍ projectItems.push(app.project.items[i].name);␍ }␍ }␍␍ //to start a new organized project since the beginning␍␍ if (projectItems.length == 0)␍ {␍ newStruct = preStruct;␍ }␍ else␍ {␍ for(a=0;a<preStruct.length;a++)␍ {␍ if ((projectItems.getOne(preStruct[a]))==-1)␍ {␍ newStruct.push(preStruct[a]);␍ }␍ }␍ }␍␍ for(i = 1;i<=newStruct.length;i++)␍ {␍ app.project.items.addFolder(newStruct[i-1]);␍ if ( app.project.items[i].name == "01 MAIN" )␍ {␍ //alert("yes");␍ app.project.items[i].items.addComp("JOBCODE_TYPE_[Scene_name]_vA_r000",1920,1080,1,30,23.976);␍ } ␍ ␍ }␍ ␍ saveNow = confirm("Project Succesfully Set, Save Project?",true,"ySetProject");␍ ␍ if(saveNow==true){␍ app.project.save()␍ }else{␍ ␍ }␍ app.endUndoGroup();␍ }␍ ␍ this.activate = this.ySetProject;␍ ␍ this.init();␍ return this;␍}␍␍//CHECKS that the toolbox exists, and if it doesn´t it runs the script on its own.␍if (typeof(YTB)=='undefined')␍{␍ ySetProjectTool = new YSetProjectTool();␍ ySetProjectTool.activate();␍}␍else␍{␍ ySetProjectTool = YTB.addTool(new YSetProjectTool());␍}
|
#include "../yScripts/y_JSExtensions.jsx";
|
||||||
|
function YSetProjectTool()
|
||||||
|
{
|
||||||
|
this.info =
|
||||||
|
{
|
||||||
|
name : "YSetStructure",
|
||||||
|
version : 0.11,
|
||||||
|
stage : "alpha",
|
||||||
|
description : "Set the Folder Structure for a new Project",
|
||||||
|
url : "yorchnet.com"
|
||||||
|
};
|
||||||
|
this.appearence =
|
||||||
|
{
|
||||||
|
buttonHeight : 30,
|
||||||
|
buttonWidth : 126
|
||||||
|
};
|
||||||
|
this.resources =
|
||||||
|
{
|
||||||
|
icon : new File('yNet.png'),
|
||||||
|
};
|
||||||
|
this.init = function init()
|
||||||
|
{
|
||||||
|
//alert("my name is:" + this.info.name);
|
||||||
|
this.btnLauyout =
|
||||||
|
"button\
|
||||||
|
{\
|
||||||
|
preferredSize: ['" + this.appearence.buttonWidth + "','" + this.appearence.buttonHeight + "'],\
|
||||||
|
text:'" + this.info.name + "',\
|
||||||
|
helpTip:'" + this.info.description + "'\
|
||||||
|
}";
|
||||||
|
|
||||||
|
this. res =
|
||||||
|
"window\
|
||||||
|
{\
|
||||||
|
type:'palette',\
|
||||||
|
text:'" + this.info.name + ' ' + this.info.ver + ' ' + this.info.stage + "',\
|
||||||
|
info: Group \
|
||||||
|
{\
|
||||||
|
alignment:['center','bottom'],\
|
||||||
|
icon: Image \
|
||||||
|
{\
|
||||||
|
icon:'" + this.resources.icon.path + '/' + this.resources.icon.name + "',\
|
||||||
|
preferredSize: [15, 18]\
|
||||||
|
},\
|
||||||
|
website: StaticText\
|
||||||
|
{\
|
||||||
|
text:'" + this.info.url + "',\
|
||||||
|
alignment:['fill','center']\
|
||||||
|
},\
|
||||||
|
}\
|
||||||
|
}";
|
||||||
|
}
|
||||||
|
this.createUI = function createUI()
|
||||||
|
{
|
||||||
|
this.window = new Window ( this.res );
|
||||||
|
this.window.show() ;
|
||||||
|
}
|
||||||
|
this.ySetProject = function ySetProject()
|
||||||
|
{
|
||||||
|
//alert("is this working");
|
||||||
|
app.beginUndoGroup('ySetProject');
|
||||||
|
var preStruct = ["01 MAIN","02 PComp","03 Source Layers" ,"04 Movies","05 Other Projects","06 Audio" , "07 Reference"];
|
||||||
|
var newStruct = [];
|
||||||
|
var projectItems = [];
|
||||||
|
|
||||||
|
for(i=1;i<=app.project.items.length;i++)
|
||||||
|
{
|
||||||
|
if(app.project.items[i].parentFolder.name=='Root')
|
||||||
|
{
|
||||||
|
projectItems.push(app.project.items[i].name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//to start a new organized project since the beginning
|
||||||
|
|
||||||
|
if (projectItems.length == 0)
|
||||||
|
{
|
||||||
|
newStruct = preStruct;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for(a=0;a<preStruct.length;a++)
|
||||||
|
{
|
||||||
|
if ((projectItems.getOne(preStruct[a]))==-1)
|
||||||
|
{
|
||||||
|
newStruct.push(preStruct[a]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(i = 1;i<=newStruct.length;i++)
|
||||||
|
{
|
||||||
|
app.project.items.addFolder(newStruct[i-1]);
|
||||||
|
if ( app.project.items[i].name == "01 MAIN" )
|
||||||
|
{
|
||||||
|
//alert("yes");
|
||||||
|
app.project.items[i].items.addComp("JOBCODE_TYPE_[Scene_name]_vA_r000",1920,1080,1,30,23.976);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
saveNow = confirm("Project Succesfully Set, Save Project?",true,"ySetProject");
|
||||||
|
|
||||||
|
if(saveNow==true){
|
||||||
|
app.project.save()
|
||||||
|
}else{
|
||||||
|
|
||||||
|
}
|
||||||
|
app.endUndoGroup();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.activate = this.ySetProject;
|
||||||
|
|
||||||
|
this.init();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
//CHECKS that the toolbox exists, and if it doesn´t it runs the script on its own.
|
||||||
|
if (typeof(YTB)=='undefined')
|
||||||
|
{
|
||||||
|
ySetProjectTool = new YSetProjectTool();
|
||||||
|
ySetProjectTool.activate();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ySetProjectTool = YTB.addTool(new YSetProjectTool());
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user