24 Commits
Author SHA1 Message Date
Jorge Vássquez Pérez f5c30efe7d Fixed some git blunders. 2016-12-02 16:46:22 -08:00
Jorge Vássquez Pérez 816d566df4 Brought the yStopMotionLayer to the new codebase. 2016-12-02 16:37:09 -08:00
Jorge Vássquez Pérez 1e932c7a2d Cleaned up the code and made the scripts work individually and with thetoolbox 2016-12-02 15:30:12 -08:00
Jorge Vássquez Pérez 84e17ede95 Adapted all scripts to work on their own and with the toolbox. 2016-12-02 15:25:00 -08:00
Jorge Vássquez Pérez 8414847715 Fixed the PuppetRig Script to conform to the new code for the Toolbox, changed all linebreaks to unix, updated all script version numbers 2016-12-02 11:58:07 -08:00
jorge a879c2190d removed a debuging alert() 2015-07-16 13:08:56 -07:00
jorge 550a55e444 Added a new comp on every new project, with our internal new project template name. 2015-07-16 12:58:14 -07:00
jorge df5ea0ac01 Minor changes to adjust CPoffset PuppetRig and StopmotionLayer to the new model. 2015-06-04 15:06:39 -07:00
jorge f4c74abe46 Converted the CornerPinOffset tool to the new model 2015-04-10 17:24:12 -07:00
jorge e4b0a98471 Added BindBetween2, to the tool bar, and cleaned it's name up. 2015-04-10 12:16:28 -07:00
jorge 58fe19cacd Transfered BindBetween2 to the new model 2015-04-10 12:07:32 -07:00
jorge 868c1cb141 Cambiando bind between 2, incomplete 2015-04-09 14:40:04 -07:00
jorge e07df6d9d4 Switched line endings to Unix-like on all scripts 2015-03-19 12:27:58 -07:00
jorge 2d6983e014 Now the button calls to a reference of the tool from this.yTool, to be able to access its methods 2015-03-19 10:51:04 -07:00
jorge 3c12bdfb2d Added a reference to the tool to the buttons added to the toolbox, so I can call them later 2015-03-19 10:49:57 -07:00
jorge bb5336a612 I'm really not sure what I changed.. :S I have to learn to use git better... 2015-03-18 18:39:09 -07:00
jorge 75b0091c1d started cleaning up code, to adapt to new generic script mode 2015-03-18 18:33:20 -07:00
jorge 300d3c98fc Cleaned up a Generic script to base new tools on 2015-03-18 18:32:44 -07:00
jorge cc91c4a6ce When closing the window now it makes the YTB variable a null, to clean up a bit. 2015-03-18 17:49:20 -07:00
jorge 994772be8d Re-enabled the createUI function for tools to be able to create their own independent windows 2015-03-18 17:48:04 -07:00
jorge 2c49d99929 Removed some debgging alert() calls 2015-03-18 17:18:54 -07:00
jorge 992891bf28 Got the toolbox code cleaned up, and the YSetStrcuture tool, already works with this new model. 2015-03-18 16:45:14 -07:00
jorge 6d01d35cd0 Reorganized the ToolBox and encapsulated it into a Signle namespace YTB, the tool bundling doesn't work yet 2015-03-18 12:58:55 -07:00
jorge 1238e7949e added a tabbed_structure test 2015-03-13 15:50:17 -07:00
22 changed files with 2092 additions and 1361 deletions
+127 -1
View File
@@ -1 +1,127 @@
var YToolBox = function YToolBox(thisObj){ var resources = { icon : new File('../yScripts/yNet.png'), header : new File('../yScripts/header.png') } var info = { url : 'yorchnet.com', name :'yToolBox', ver :'0.4.2.1 alpha', description : 'Working tools so far...' } var gui = { buttonWidth : 126, buttonHeight : 30 } var tools = []; #include "../yScripts/y_JSExtensions.jsx"; this.addTool = function addTool(aTool) { alert("AddTool : Adding"); alert("AddTool : there are " + this.tools.length + " tools right now"); this.tools.push(aTool); alert("AddTool : there are " + this.tools.length + " tools right now"); } //alert(thisObj);␍ this.customize = function customize()␍ {␍ /* g = this.window.grp.main.graphics; myFont = ScriptUI.newFont('Cooper Std Black',ScriptUI.FontStyle.REGULAR ,14 ); myBrush = g.newBrush(g.BrushType.SOLID_COLOR, [1, .45, 0, 1]); g.backgroundColor = myBrush; */␍ alert();␍ }␍␍ this.resize = function resize()␍ {␍ this.layout.resize();␍ this.customize; ␍ }␍ ␍ this.createGui = function createGui()␍ {␍ //MAIN WINDOW STRUCTURE. this.gui.header = "group\␍ {\␍ orientation:'column',\␍ alignment:['fill','fill'],\␍ margins:[0,0,0,0]\␍ \␍ header: Group\␍ {\␍ orientation:'column', \␍ alignment:['center','top'],\␍ margins:[0,0,0,0]\␍ \␍ title: Image\␍ {\␍ icon:'"+this.resources.header.path+'/'+this.resources.header.name+"',\␍ preferredSize: [175, 35]},\␍ ver: StaticText { text:'"+this.info.ver+"',\␍ alignment:['center','center']}\␍ desc: StaticText\␍ {\␍ text:'"+this.info.description+"',\␍ alignment:['center','center']\␍ },\␍ },\␍ main: Group {\␍ orientation:'column',\␍ alignment:['fill','fill'],\␍ alignChildren:['center','center']\␍ ," this.gui.main= ""; //To be populated with the included Tools this.gui.footer ="}, \ cmds: Group\ {\ alignment:['center','bottom'],\ icn_app: Image\ {\ icon:'"+ this.resources.icon.path+'/'+ this.resources.icon.name+"',\ preferredSize: [15, 18]\ },\ txt_info: StaticText\ {\ text:'"+ this.info.url+"',\ alignment:['fill','center']\ },\ },\ }"; alert(this.tools); this.window.grp = this.window.add( this.gui.header + this.gui.main + this.gui.footer ); this.window.layout.layout(true); this.window.onResize = this.resize; this.window.onClose = function () {delete yToolBox;}; //ASSIGN buttons to the activate function of each tool; var toolBtns = this.window.grp.main.children; for( var n = 0 ; n < toolBtns.length ; n++ ){ toolBtns[n].onClick = this.tools[n].activate; } } this.init = function init() { this.resources = resources; this.info = info; this.gui = gui; this.tools = tools; this.window = (thisObj instanceof Panel) ? thisObj : new Window("palette", this.info , undefined, {resizeable:true}); this.createGui(); } this.init(); return this}var ytb = new YToolBox(this);#include "../yScripts/y_setStructure.jsx";
var scriptUIPanel = this;YTB ={ info : { name : "yToolBox", ver : 0.5, status : "alpha", url : "yorchnet.com", description : "My mixed bag of tools" }, resources : { icon : new File('../yScripts/yNet.png'), header : new File('../yScripts/header.png') }, appearence : { buttonHeight : 30, buttonWidth : 126 }, tools : [], createUI : function createUI() { var res ="group\␍ {\␍ orientation:'column',\␍ alignment:['fill','fill'],\␍ margins:[0,0,0,0]\␍ header: Group\␍ {\␍ orientation:'column',\␍ alignment:['center','top'],\␍ margins:[0,0,0,0]\␍ title: Image\␍ {\␍ icon:'" + this.resources.header.path + '/' + this.resources.header.name + "',\␍ preferredSize: [175, 35]},\␍ ver: StaticText\␍ {\␍ text:'" + this.info.ver + "',\␍ alignment:['center','center']\␍ }\␍ desc: StaticText\␍ {\␍ text:'" + this.info.description + "',\␍ alignment:['center','center']\␍ },\␍ },\␍ main: Group\␍ {\␍ orientation:'column',\␍ alignment:['fill','fill'],\␍ alignChildren:['center','center'],\␍ },\␍ footer: Group\␍ {\␍ alignment:['center','bottom'], \␍ icn_app: Image {icon:'" + this.resources.icon.path + '/' + this.resources.icon.name + "',preferredSize: [15, 18]},\␍ txt_info: StaticText { text:'"+ this.info.url + "', alignment:['fill','center'] },\␍ }, \␍ }"; this.window.grp = this.window.add( res ); this.window.layout.layout(true); this.customizeUI(); //EventHandlerAssignment␍ this.window.onResize = this.resize;␍ this.window.onClose = this.close;␍ this.window.onDraw = this.autoLayout;␍ },␍ customizeUI : function customizeUI()␍ {␍ var g = this.window.graphics; ␍ var orange = g.newBrush(g.BrushType.SOLID_COLOR, [1, .45, 0, 1]); ␍ this.window.grp.main.graphics.backgroundColor = orange;␍ },␍ addTool : function addTool( aTool )␍ {␍ /**** TO DO ****/␍ // Check that the tool object is unique.␍ // Call for a window resize so it refreshes propperly.␍ ␍ this.tools.push( aTool );␍␍ var btn = this.window.grp.main.add( aTool.btnLauyout );␍ ␍ btn.onClick = aTool.activate;␍ btn.yTool = aTool; // add a reference to the tool so I can access info on it later...␍ ␍ //alert(btn.onClick);␍␍ this.window.layout.layout(true);␍ ␍ },␍ //EVENT HANDLERS␍ resize : function resize()␍ {␍ this.layout.resize();␍ },␍ close : function close()␍ {␍ YTB = null;␍ delete this;␍ },␍ init : function init()␍ {␍ this.window = ( scriptUIPanel instanceof Panel ) ? scriptUIPanel: new Window( "palette" , this.info.name , undefined, { resizeable : true } );␍ this.createUI();␍ }␍ ␍};␍␍YTB.init();␍␍#include "../yScripts/y_setStructure.jsx";␍#include "../yScripts/y_colorProbe.jsx";␍#include "../yScripts/y_BindBetween2.jsx";␍#include "../yScripts/y_CPOffset.jsx";␍#include "../yScripts/y_puppetRig.jsx";␍#include "../yScripts/y_GenericNewScript.jsx";
=======
var scriptUIPanel = this;
YTB =
{
info :
{
name : "yToolBox",
ver : 0.51,
status : "alpha",
url : "yorchnet.com",
description : "My mixed bag of tools"
},
resources :
{
icon : new File('../yScripts/yNet.png'),
header : new File('../yScripts/header.png')
},
appearence :
{
buttonHeight : 30,
buttonWidth : 126
},
tools : [],
createUI : function createUI()
{
var res ="group\
{\
orientation:'column',\
alignment:['fill','fill'],\
margins:[0,0,0,0]\
header: Group\
{\
orientation:'column',\
alignment:['center','top'],\
margins:[0,0,0,0]\
title: Image\
{\
icon:'" + this.resources.header.path + '/' + this.resources.header.name + "',\
preferredSize: [175, 35]},\
ver: StaticText\
{\
text:'" + this.info.ver + "',\
alignment:['center','center']\
}\
desc: StaticText\
{\
text:'" + this.info.description + "',\
alignment:['center','center']\
},\
},\
main: Group\
{\
orientation:'column',\
alignment:['fill','fill'],\
alignChildren:['center','center'],\
},\
footer: Group\
{\
alignment:['center','bottom'], \
icn_app: Image {icon:'" + this.resources.icon.path + '/' + this.resources.icon.name + "',preferredSize: [15, 18]},\
txt_info: StaticText { text:'"+ this.info.url + "', alignment:['fill','center'] },\
}, \
}";
this.window.grp = this.window.add( res );
this.window.layout.layout(true);
this.customizeUI();
//EventHandlerAssignment
this.window.onResize = this.resize;
this.window.onClose = this.close;
this.window.onDraw = this.autoLayout;
},
customizeUI : function customizeUI()
{
var g = this.window.graphics;
var orange = g.newBrush(g.BrushType.SOLID_COLOR, [1, .45, 0, 1]);
this.window.grp.main.graphics.backgroundColor = orange;
},
addTool : function addTool( aTool )
{
/**** TO DO ****/
// Check that the tool object is unique.
// Call for a window resize so it refreshes propperly.
this.tools.push( aTool );
var btn = this.window.grp.main.add( aTool.btnLauyout );
btn.onClick = aTool.activate;
btn.yTool = aTool; // add a reference to the tool so I can access info on it later...
//alert(btn.onClick);
this.window.layout.layout(true);
return aTool;
},
//EVENT HANDLERS
resize : function resize()
{
this.layout.resize();
},
close : function close()
{
YTB = null;
delete this;
},
init : function init()
{
this.window = ( scriptUIPanel instanceof Panel ) ? scriptUIPanel: new Window( "palette" , this.info.name , undefined, { resizeable : true } );
this.createUI();
}
};
YTB.init();
#include "../yScripts/y_setStructure.jsx";
#include "../yScripts/y_colorProbe.jsx";
#include "../yScripts/y_BindBetween2.jsx";
#include "../yScripts/y_CPOffset.jsx";
#include "../yScripts/y_puppetRig.jsx";
#include "../yScripts/y_stopMotionLayer.jsx";
-1
View File
@@ -1 +0,0 @@
scriptUIpanel = this;ytb = { // INFO RESOURCES & PREFERENCES info : { name :'yToolBox', url : 'yorchnet.com', ver :'0.5', status : 'alpha', description : 'My mixed bag of tricks' }, resources : { icon : new File('../yScripts/yNet.png'), header : new File('../yScripts/header.png') }, gui : { buttonWidth : 126, buttonHeight : 30 }, //METHODS syncWindow : function syncWindow() { this.window = ( ( scriptUIpanel instanceof Panel ) ? scriptUIpanel : new Window ( "palette" , this.info , undefined, { resizeable:true , alignment:['fill','fill'] , orientation:'column' } ) ); }, customize : function customize() { //myFont = ScriptUI.newFont('Cooper Std Black',ScriptUI.FontStyle.REGULAR ,14 ); g = this.window.graphics; naranja = g.newBrush(g.BrushType.SOLID_COLOR, [1, .45, 0, 1]); black = g.newBrush(g.BrushType.SOLID_COLOR, [0, 0, 0, 1]); gray1 = g.newBrush(g.BrushType.SOLID_COLOR, [.125, .125, .125, 1]); gray2 = g.newBrush(g.BrushType.SOLID_COLOR, [.25, .25, .25, 1]); gray3 = g.newBrush(g.BrushType.SOLID_COLOR, [.5, .5, .5, 1]); gray4 = g.newBrush(g.BrushType.SOLID_COLOR, [.75, .75, .75, 1]); white = g.newBrush(g.BrushType.SOLID_COLOR, [1, 1, 1, 1]); g.backgroundColor = naranja; this.window.grp.main.graphics.backgroundColor = gray1; this.window.grp.header.graphics.backgroundColor = naranja; this.window.grp.main.graphics.backgroundColor = gray2; this.window.grp.footer.graphics.backgroundColor = gray3; }, createGui : function createGui() { //MAIN WINDOW STRUCTURE. var gui = "group\ {\ orientation:'column',\ alignment:['fill','fill'],\ margins:[0,0,0,0]\ \ header: Group\ {\ orientation:'column', \ alignment:['center','top'],\ margins:[0,0,0,0]\ \ title: Image\ {\ icon:'"+this.resources.header.path+'/'+this.resources.header.name+"',\ preferredSize: [175, 35]},\ ver: StaticText { text:'"+this.info.ver+"',\ alignment:['center','center']}\ desc: StaticText\ {\ text:'"+this.info.description+"',\ alignment:['center','center']\ },\ },\ main: Group {\ orientation:'column',\ alignment:['fill','fill'],\ alignChildren:['center','center']\ ,\ }, \ footer: Group\ {\ alignment:['center','bottom'],\ icn_app: Image\ {\ icon:'"+ this.resources.icon.path+'/'+ this.resources.icon.name+"',\ preferredSize: [15, 18]\ },\ txt_info: StaticText\ {\ text:'"+ this.info.url+"',\ alignment:['fill','center']\ },\ },\ }"; this.window.grp = this.window.add( gui ); this.window.layout.layout(true); this.customize(); //Assignacion de Manejo de Eventos. this.window.onResize = this.resize; this.window.onClose = this.selfDestruct; }, addTool : function addTool( aTool ) { alert(" A darle "); }, //Manejo de Eventos resize : function resize() { this.layout.resize(); }, selfDestruct : function selfDestruct() { delete this; }, init : function init() { this.syncWindow(); this.createGui(); }} ytb.init();
+26
View File
@@ -0,0 +1,26 @@
template_str="\
01 MAIN\
02 PComp\
03 Source Layers\
04 Movies\
05 Other Projects\
06 Audio\
07 References\
";
var FolderStructure = function(){
var template = template_str.split('\n');
template = template.slice(1,template.length-1);
var tab=" ";
for(var i = 0; i < template.length; i++){
alert(template[i].split(tab));
this[template[i]]='';
}
this.print = function(){
for (var i in this){
}
};
};
fs = new FolderStructure()
fs.print();
+52 -1
View File
@@ -1 +1,52 @@
//if (typeof(ytb)!=='undefined'){ yGenericTool ={ info : { name : 'YGenericTool', description : 'YToolBox Generic Script is the base for adding tools.', version : '0.1a', status : "alpha", url : 'yorchnet.com' }, resources : { img : new File('../header.png') }, gui_preferences : { buttonWidth : 76, buttonHeight : 30 }, toolbox : { buttons : "btn_" + this.info.name + ": Button\ {\ preferredSize: ['" + this.gui_preferences.buttonWidth + "','" + this.gui_preferences.buttonHeight + "'],\ text:'" + this.info.name + "',\ helpTip:'" + this.info.description + "'\ }", gui : "window\ {\ type:'palette',\ text:'" + this.info.name + ' ' + this.info.version + " " + this.info.status + "',\ info: Group\ {\ alignment:['center','bottom'],\ icon: Image\ {\ icon:'" + String( this.resources.img.path + "/" + this.resources.img.name ) + "',\ preferredSize: [15, 18]\ },\ website: StaticText\ {\ text:'" + this.info.url + "',\ alignment:['fill','center'] \ }\ }\ }" }, getInfo : function getInfo( info_request ) { var info = null ; switch (info_request) { case "name": info = this.name; break; case "description": info = this.description; break; case "version": info = this.version; break; case "status": info = this.status; break; case "url": info = this.url; break; } return info; }, getInfo : function getInfo( resource_request ) { var resource = null ; switch ( resource_request ) { case "img": resource = this.img; break; } return info; }, getToolBoxButtons : function getToolBoxButtons() { return this.toolbox.buttons; }, getToolBoxGui : function getToolBoxGui() { return this.toolbox.gui; }, buildUI : function buildUI() { this.window = new Window ( this.toolbox.gui , {resizable:true}); this.window.show(); }, addToBox : function addToBox() { ytb.addTool(this); }, init : function init() { if ( typeof ytb !== "undefined" ) { this.addToBox(); } this.buildUI(); }}yGenericTool.init()
yGeneric_data = new Object();
yGeneric_data.scriptName = 'YTBGen';
yGeneric_data.scriptDesc = 'YToolBox Generic Script is the base for adding tools.';
yGeneric_data.scriptVer = '0.1a';
yGeneric_data.webLink = 'yorchnet.com';
yGeneric_data.img = YTB.icon;
//if yToolBox Exists add it to its tool list.
if (typeof(YTB)!=='undefined'){
//it should be called from toolbox.
yGeneric_data.buttonWidth=76;
yGeneric_data.buttonHeight=30;
yGeneric_data.btnLayout = "btn_"+yGeneric_data.scriptName+": Button { preferredSize: ['"+ yGeneric_data.buttonWidth+"','"+ yGeneric_data.buttonHeight+"'], text:'"+yGeneric_data.scriptName+"', helpTip:'"+yGeneric_data.scriptDesc+"' }";
}
yGeneric_data.res = "window { \
type:'palette' , text:'"+yGeneric_data.scriptName+' '+yGeneric_data.scriptVer+"',\
\
\
info: Group { \
alignment:['center','bottom'], \
icon: Image {icon:'"+String(yGeneric_data.img.path+"/"+yGeneric_data.img.name)+"',preferredSize: [15, 18]},\
website: StaticText { text:'"+yGeneric_data.webLink+"', alignment:['fill','center'] }\
}\
\
}";
//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------
// MAIN SCRIPT GOES HERE.
//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------
function build_yGeneric_data_UI(){
yGeneric_data.window = new Window ( yGeneric_data.res);
yGeneric_data.window.show();
}
yGeneric_data.activate = build_yGeneric_data_UI ;
//alert();
//CHECKS that the toolbox exists, and if it doesn´t it runs the script on its own.
//if (typeof(YTB)=='undefined'){
yGeneric_data.activate();
//}else{
//}
+4 -4
View File
@@ -6,15 +6,15 @@ yMultiRenamer_data.scriptVer = '0.1a';
yMultiRenamer_data.webLink = 'yorchnet.com';
//if yToolBox Exists add it to its tool list.
if (typeof(yToolBox_data)!=='undefined'){
yToolBox_data.tools.push(yMultiRenamer_data);
if (typeof(YTB)!=='undefined'){
YTB.tools.push(yMultiRenamer_data);
//it should be called from toolbox.
yMultiRenamer_data.buttonWidth=76;
yMultiRenamer_data.buttonHeight=30;
yMultiRenamer_data.btnLayout = "btn_"+yMultiRenamer_data.scriptName+": Button { preferredSize: ['"+ yToolBox_data.buttonWidth+"','"+ yToolBox_data.buttonHeight+"'], text:'"+yMultiRenamer_data.scriptName+"', helpTip:'"+yMultiRenamer_data.scriptDesc+"' }";
yMultiRenamer_data.btnLayout = "btn_"+yMultiRenamer_data.scriptName+": Button { preferredSize: ['"+ YTB.buttonWidth+"','"+ YTB.buttonHeight+"'], text:'"+yMultiRenamer_data.scriptName+"', helpTip:'"+yMultiRenamer_data.scriptDesc+"' }";
}
@@ -167,7 +167,7 @@ function build_yMultiRenamer_data_UI(){
yMultiRenamer_data.activate = build_yMultiRenamer_data_UI ;
//CHECKS that the toolbox exists, and if it doesn´t it runs the script on its own.
if (typeof(yToolBox_data)=='undefined'){
if (typeof(YTB)=='undefined'){
yMultiRenamer_data.activate();
}else{
}
+4 -4
View File
@@ -6,15 +6,15 @@ yMultiRenamer_data.scriptVer = '0.2a';
yMultiRenamer_data.webLink = 'yorchnet.com';
//if yToolBox Exists add it to its tool list.
if (typeof(yToolBox_data)!=='undefined'){
yToolBox_data.tools.push(yMultiRenamer_data);
if (typeof(YTB)!=='undefined'){
YTB.tools.push(yMultiRenamer_data);
//it should be called from toolbox.
yMultiRenamer_data.buttonWidth=76;
yMultiRenamer_data.buttonHeight=30;
yMultiRenamer_data.btnLayout = "btn_"+yMultiRenamer_data.scriptName+": Button { preferredSize: ['"+ yToolBox_data.buttonWidth+"','"+ yToolBox_data.buttonHeight+"'], text:'"+yMultiRenamer_data.scriptName+"', helpTip:'"+yMultiRenamer_data.scriptDesc+"' }";
yMultiRenamer_data.btnLayout = "btn_"+yMultiRenamer_data.scriptName+": Button { preferredSize: ['"+ YTB.buttonWidth+"','"+ YTB.buttonHeight+"'], text:'"+yMultiRenamer_data.scriptName+"', helpTip:'"+yMultiRenamer_data.scriptDesc+"' }";
}
@@ -141,7 +141,7 @@ yMultiRenamer_data.activate = build_yMultiRenamer_data_UI ;
//CHECKS that the toolbox exists, and if it doesn´t it runs the script on its own.
/*
if (typeof(yToolBox_data)=='undefined'){
if (typeof(YTB)=='undefined'){
*/
yMultiRenamer_data.activate();
/*}else{
+216
View File
@@ -0,0 +1,216 @@
#include "../yScripts/y_JSExtensions.jsx";
function YBindBetween2()
{
this.info =
{
name : "yBindBetween2",
version : 0.13,
stage : "development",
description : "Constraints a layer between two others, position and rotation-wise",
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.version + "',\
margins:[10,10,10,10],\
spacing:[5,5,5,5]\
\
lst_layer: DropDownList\
{\
title:'layer to constrain',\
preferredSize:[150,35],\
textSelection:'Escoge',\
helpTip:'Select the layer you wish to constrain'\
}\
lst_pa: DropDownList\
{\
title:'parent a',\
preferredSize:[150,35],\
textSelection:'Escoge',\
helpTip:'Select the first parent'\
}\
lst_pb: DropDownList\
{\
title:'parent b',\
preferredSize:[150,35],\
textSelection:'Escoge',\
helpTip:'Select the second parent'\
}\
exec_btn: Button\
{\
text:'do It',\
preferredSize:[150,35],\
helpTip:'do it'\
}\
info: Group\
{\
alignment:['center','bottom'], \
icon: Image\
{\
preferredSize: [15, 18]\
},\
website: StaticText\
{\
text:'" + this.info.url + "', alignment:['fill','center']\
},\
}\
}";
}
this.createUI = function createUI()
{
this.window = new Window( this.res );
this.refresh();
this.window.exec_btn.onClick = this.run;
this.window.layout.layout(true);
this.window.center();
this.window.show();
}
this.yMainFunction = function yMainFunction()
{
this.createUI();
}
this.activate = function activate()
{
yBindBetween2.yMainFunction();
}
this.run = function run()
{
app.beginUndoGroup('Bind Between Two');
selectedLayerName=String(this.window.lst_layer.selection);
parentALayerName=String(this.window.lst_pa.selection);
parentBLayerName=String(this.window.lst_pb.selection);
layerN = selectedLayerName.substr(0, selectedLayerName.indexOf('.'));
paN = parentALayerName.substr(0, parentALayerName.indexOf('.'));
pbN = parentBLayerName.substr(0, parentBLayerName.indexOf('.'));
layer = app.project.activeItem.layers[layerN];
pa = app.project.activeItem.layers[paN];
pb = app.project.activeItem.layers[pbN];
layer("Effects").addProperty("Layer Control");
layer("Effects")("Layer Control").name = 'ctrl01';
layer("Effects")("ctrl01")("Layer").setValue(pa.index);
layer("Effects").addProperty("Layer Control");
layer("Effects")("Layer Control").name = 'ctrl02';
layer("Effects")("ctrl02")("Layer").setValue(pb.index);
layer("Effects").addProperty("Angle Control");
layer("Effects")("Angle Control").name = 'offset';
layer("Effects")("offset")("Angle").setValue(0);
layer("Effects").addProperty("Slider Control");
layer("Effects")("Slider Control").name = 'weight';
layer("Effects")("weight")(1).setValue(50);
layer("Effects").addProperty("Checkbox Control");
layer("Effects")("Checkbox Control").name = 'stretch';
posExp ='\
a = effect("ctrl01")("Layer");\
b = effect("ctrl02")("Layer");\
aPos = a.toComp(a.anchorPoint);\
bPos = b.toComp(b.anchorPoint);\
w= effect("weight")(1)/100;\
(aPos*(1-w)+bPos*(w))'
rotExp ='\
a =effect("ctrl01")("Layer");\
b = effect("ctrl02")("Layer");\
aPos = a.toComp(a.anchorPoint);\
bPos = b.toComp(b.anchorPoint);\
rx = lookAt(aPos,bPos)[0];\
ry = lookAt(aPos,bPos)[1];\
offset = effect("offset")("Angle");\
if (aPos[1] > bPos[1]){\
(ry) -90 + offset\
}else{\
90 - (ry) + offset\
}'
scaleExp ='\
a = effect("ctrl01")("Layer");\
b = effect("ctrl02")("Layer");\
aPos = a.toComp(a.anchorPoint);\
bPos = b.toComp(b.anchorPoint);\
d = Math.sqrt(Math.pow((aPos[0]-bPos[0]),2)+Math.pow((aPos[1]-bPos[1]),2));\
x = transform.scale[0];\
y = transform.scale[1];\
sx = ((d*100)/this.width)/100;\
stretch = effect("stretch")("Checkbox");\
if(stretch==true){\
[x*sx,y]\
}else{\
[x,y]\
}'
layer.transform.position.expression = posExp;
layer.transform.rotation.expression= rotExp;
layer.transform.scale.expression= scaleExp;
app.endUndoGroup();
}
this.refresh = function refresh()
{
var lists = [ this.window.lst_pa , this.window.lst_layer , this.window.lst_pb ]//they should be in this order for the assignment of the selection index works right/
for(i=0;i<lists.length;i++)
{
lists[i].removeAll();
}
var sel = app.project.activeItem.selectedLayers;
var compLayers = app.project.activeItem.layers;
var selectableLayers = [];
for ( var i = 1 ; i <= compLayers.length ; i++ )
{
selectableLayers.push(compLayers[i]);
}
var lst_layer = this.window.lst_layer;
var lst_pa = this.window.lst_pa;
var lst_pb = this.window.lst_pb;
for( var i = 0 ; i < lists.length ; i++ )
{
for( j = 0 ; j < selectableLayers.length ; j++ )
{
lists[i].add('item',selectableLayers[j].index+"."+selectableLayers[j].name);
}
}
lst_layer.selection = 0;
lst_pa.selection = 0;
lst_pb.selection = 0;
}
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')
{
yBindBetween2 = new YBindBetween2();
yBindBetween2.activate();
}
else
{
yBindBetween2 = YTB.addTool(new YBindBetween2());
}
+173
View File
@@ -0,0 +1,173 @@
#include "../yScripts/y_JSExtensions.jsx";
function YCPOffset()
{
this.info =
{
name : "YCornerPinOffset",
version : 0.12,
stage : "development",
description : "Offsets each corner of a CornerPin Effect.",
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()
{
res =
"window {\
resizeable : true\
closeButton : true\
text:'wtf'\
}"
this.window = new Window( res );
this.window.layout.layout(true);
this.window.center();
this.window.show();
}
this.yMainFunction = function yMainFunction()
{
//if called from the button as opposed as from the script.
if ( String(this) == "[object Button]" )
{
this.yTool.processCornerPins();
}
else
{
this.processCornerPins();
}
}
this.getSelectedCornerPins = function getSelectedCornerPins()
{
/* Function that returns a list of effect objects
that match any of the names
specified in validCornerPinNames. */
validCornerPinNames = ["ADBE Corner Pin","CC Power Pin"];
selectedLayers = app.project.activeItem.selectedLayers;
cornerPins = [];
for (layer=0;layer<selectedLayers.length;layer++)
{
myLayer = selectedLayers[layer];
myEffects = myLayer.property("ADBE Effect Parade");
for(effect=1;effect<=myEffects.numProperties;effect++)
{
for(validCornerPinName=0;validCornerPinName<validCornerPinNames.length;validCornerPinName++)
{
if ( myEffects.property(effect).matchName == validCornerPinNames[validCornerPinName] )
{
cornerPins.push(myEffects.property(effect));
}
}
}
}
return cornerPins;
}
this.getLayer = function getLayer(effect)
{
/* If given a layer's effect object
this function returns the layer object */
layer = effect.parentProperty.parentProperty;
return layer;
}
this.addEffect = function addEffect(layer,effect_string,effect_name)
{
new_effect = layer.property("ADBE Effect Parade").addProperty(effect_string);
new_effect.name = effect_name;
return new_effect;
}
this.addPointControls = function addPointControls(effect)
{
/*calling the getLayer(effect) is resetting my effect object to null, and not allowing me to do everything in a single sitting. I think it has to do with variable scopes.*/
local = {};
local.effect = effect;
base_name = local.effect.name;
names = ["Upper Left","Upper Right","Lower Left","Lower Right"];
for (i=1;i<=4;i++)
{
expression = '\
try\
{\
effect("'+base_name+'")('+(i)+')+effect("'+base_name+'_'+names[i-1]+'_'+'Offset'+'")("Point")\
}\
catch(err)\
{\
[0,0]\
}'
local.effect.property(i).expression = expression;
}
layer = this.getLayer(effect);
for(i=0;i<=3;i++)
{
new_effect = this.addEffect(layer,"Point Control",base_name+"_"+names[i]+"_"+"Offset");
new_effect.property("Point").setValue([0,0]);
}
}
this.processCornerPins = function processCornerPins(){
app.beginUndoGroup('ySetProject');
pins = this.getSelectedCornerPins();
for(pin=0;pin<pins.length;pin++)
{
this.addPointControls(pins[pin])
}
app.endUndoGroup();
}
this.activate = this.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')
{
yCPOffset = new YCPOffset();
yCPOffset.activate();
}
else
{
yCPOffset = YTB.addTool(new YCPOffset());
}
-108
View File
@@ -1,108 +0,0 @@
#include "../yScripts/y_JSExtensions.jsx";
yOffsetCornerPin_data = new Object();
yOffsetCornerPin_data.scriptName = 'YCornerPinOffset';
yOffsetCornerPin_data.scriptDesc = 'Offsets each corner of a CornerPin Effect';
yOffsetCornerPin_data.scriptVer = '0.1a';
yOffsetCornerPin_data.webLink = 'yorchnet.com';
//if yToolBox Exists add it to its tool list.
if (typeof(yToolBox_data)!=='undefined'){
yToolBox_data.tools.push(yOffsetCornerPin_data);
//it should be called from toolbox.
/*
yOffsetCornerPin_data.buttonWidth=76;
yOffsetCornerPin_data.buttonHeight=30;
*/
yOffsetCornerPin_data.btnLayout = "btn_"+ yOffsetCornerPin_data.scriptName+": Button { preferredSize: ['"+ yToolBox_data.buttonWidth+"','"+ yToolBox_data.buttonHeight+"'], text:'"+yOffsetCornerPin_data.scriptName+"', helpTip:'"+yOffsetCornerPin_data.scriptDesc+"' }";
}
yOffsetCornerPin_data.res = "window { \
type:'palette' , text:'"+yOffsetCornerPin_data.scriptName+' '+yOffsetCornerPin_data.scriptVer+"',\
\
\
info: Group { \
alignment:['center','bottom'], \
icon: Image {preferredSize: [15, 18]},\
website: StaticText { text:'"+yOffsetCornerPin_data.webLink+"', alignment:['fill','center'] },\
}\
\
}";
//------------------------------------------------------------------------------------------------------------------------
function getSelectedCornerPins() {
/* Function that returns a list of effect objects
that match any of the names
specified in validCornerPinNames. */
validCornerPinNames = ["ADBE Corner Pin","CC Power Pin"]
selectedLayers = app.project.activeItem.selectedLayers
cornerPins = []
for (layer=0;layer<selectedLayers.length;layer++){
myLayer = selectedLayers[layer];
myEffects = myLayer.property("ADBE Effect Parade");
for(effect=1;effect<=myEffects.numProperties;effect++){
for(validCornerPinName=0;validCornerPinName<validCornerPinNames.length;validCornerPinName++){
if ( myEffects.property(effect).matchName == validCornerPinNames[validCornerPinName] && myEffects.property(effect).selected == true){
cornerPins.push(myEffects.property(effect))
}
}
}
}
return cornerPins
}
function getLayer(effect){
/* If given a layer's effect object
this function returns the layer object */
layer = effect.parentProperty.parentProperty
return layer
}
function addEffect(layer,effect_string,effect_name){
new_effect = layer.property("ADBE Effect Parade").addProperty(effect_string);
new_effect.name = effect_name;
return new_effect
}
function addPointControls(effect){
/*calling the getLayer(effect) is resetting my effect object to null, and not allowing me to do everything in a single sitting. I think it has to do with variable scopes.*/
local = {};
local.effect = effect;
base_name = local.effect.name;
names = ["Upper Left","Upper Right","Lower Left","Lower Right"];
for (i=1;i<=4;i++){
expression = 'try{\
effect("'+base_name+'")('+(i)+')+effect("'+base_name+'_'+names[i-1]+'_'+'Offset'+'")("Point")\
}catch(err){\
[0,0]\
}'
local.effect.property(i).expression = expression;
}
layer = getLayer(effect);
for(i=0;i<=3;i++){
new_effect = addEffect(layer,"Point Control",base_name+"_"+names[i]+"_"+"Offset");
new_effect.property("Point").setValue([0,0]);
}
}
function processCornerPins(){
app.beginUndoGroup('ySetProject');
pins = getSelectedCornerPins();
for(pin=0;pin<pins.length;pin++){
addPointControls(pins[pin])
}
app.endUndoGroup();
}
//------------------------------------------------------------------------------------------------------------------------
function build_yOffsetCornerPin_data_UI(){
yOffsetCornerPin_data.window = new Window ( yOffsetCornerPin_data.res);
yOffsetCornerPin_data.window.show();
}
yOffsetCornerPin_data.activate =processCornerPins ;
//CHECKS that the toolbox exists, and if it doesn´t it runs the script on its own.
if (typeof(yToolBox_data)=='undefined'){
yOffsetCornerPin_data.activate();
}else{
}
+89
View File
@@ -0,0 +1,89 @@
#include "../yScripts/y_JSExtensions.jsx";
function YGenericTool()
{
this.info =
{
name : "yGenericTool",
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()
{
res =
"window {\
resizeable : true\
closeButton : true\
text:'wtf'\
}"
this.window = new Window( res );
this.window.layout.layout(true);
this.window.center();
this.window.show();
}
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')
{
yGenericTool = new YGenericTool();
yGenericTool.activate();
}
else
{
YTB.addTool(new YGenericTool());
}
+86 -47
View File
@@ -1,43 +1,71 @@
yColorProbe_data = new Object();
yColorProbe_data.scriptName = 'yColorProbe';
yColorProbe_data.scriptDesc = 'Creates a Null that will Sample the selected layer within the specified radius.';
yColorProbe_data.scriptVer = '0.2a';
yColorProbe_data.webLink = 'yorchnet.com';
//if yToolBox Exists add it to its tool list.
if (typeof(yToolBox_data)!=='undefined'){
yToolBox_data.tools.push(yColorProbe_data);
//it should be called from toolbox.
/* yColorProbe_data.buttonWidth=76;
yColorProbe_data.buttonHeight=30;
*/
yColorProbe_data.btnLayout = "btn_"+yColorProbe_data.scriptName+": Button { preferredSize: ['"+ yToolBox_data.buttonWidth+"','"+ yToolBox_data.buttonHeight+"'], text:'"+yColorProbe_data.scriptName+"', helpTip:'"+yColorProbe_data.scriptDesc+"' }";
}
yColorProbe_data.res = "window { \
type:'palette' , text:'"+yColorProbe_data.scriptName+' '+yColorProbe_data.scriptVer+"',\
\
\
info: Group { \
alignment:['center','bottom'], \
icon: Image {preferredSize: [15, 18]},\
website: StaticText { text:'"+yColorProbe_data.webLink+"', alignment:['fill','center'] },\
}\
\
}";
//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------
// MAIN SCRIPT GOES HERE.
#include "../yScripts/y_JSExtensions.jsx";
#include "usefulFunctions.jsx";
function yColorProbe(){
//It works with Sampled layers at a 100% scale only.
app.beginUndoGroup('Create ColorProbe');
function YColorProbe()
{
this.info =
{
name : "yColorProbe",
version : 0.1,
stage : "development",
description : "Creates a Null that will Sample the selected layer within the specified radius.",
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.getInfo = function getInfo( )
{
alert("asdasdasd");
}
this.createUI = function createUI()
{
this.window = new Window ( this.res );
this.window.show() ;
}
this.yMainFunction = function yMainFunction()
{
app.beginUndoGroup( yColorProbe.info.name ); // yTool is a refernece to the Tool object, because THIS in this context returns the ButtonObject....
//It works with Sampled layers at a 100% scale only.
try
{
sel = app.project.activeItem.selectedLayers[0];
@@ -47,6 +75,7 @@ function yColorProbe(){
sel = undefined;
}
if(sel!==undefined){
myNull = app.project.activeItem.layers.addNull();
myNull.transform.anchorPoint.setValue([50,50]);
myNull.name = yUniStr('colorProbe'); //Generates a Unique Name by adding numbers at the end of the main string.
@@ -67,23 +96,33 @@ function yColorProbe(){
myNull.source.width=30;
myNull.anchorPoint=(15,15);
if(sel!==undefined){
myNull("Effects")('sampledLayer')(1).setValue(sel.index);
}
else
{
alert("Error : No layer selected.")
}
app.endUndoGroup();
return 'ok'
}
//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------
this.activate = this.yMainFunction;
function build_yColorProbe_data_UI(){
yColorProbe_data.window = new Window ( yColorProbe_data.res);
yColorProbe_data.window.show();
this.init();
return this;
}
yColorProbe_data.activate =yColorProbe ;
//CHECKS that the toolbox exists, and if it doesn´t it runs the script on its own.
if (typeof(yToolBox_data)=='undefined'){
yColorProbe_data.activate();
}else{
if (typeof(YTB)=='undefined')
{
yColorProbe = new YColorProbe();
yColorProbe.activate();
}
else
{
yColorProbe = YTB.addTool(new YColorProbe());
}
+112 -96
View File
@@ -1,45 +1,59 @@
yPuppetRig_data = new Object();
#include "../yScripts/y_JSExtensions.jsx";
function YPuppetRigTool()
{
this.info =
{
name : "yPuppetRig",
version : 0.34,
stage : "development",
description : "Tools for streamlining puppet-based animation rigs.",
url : "yorchnet.com"
};
this.appearence =
{
buttonHeight : 30,
buttonWidth : 126
};
this.resources =
{
icon : new File('yNet.png'),
scriptName : 'yPuppetRigger',
scriptVer : 'v0.3.3a',
scriptDesc : 'Tools for streamlining puppet-based animation rigs.',
string_info : 'yorchnet.com',
e_000 : 'e_000 : No layers are selected.',
e_001 : 'e_001 : Layer contains no effects.',
e_002 : 'e_002 : Layer contains no Puppet effects.',
string_001 : 'Rig Pins',
string_001x : 'Rigs Selected Pins on Layer',
string_002 : 'Rig Layers',
string_002x : 'Rigs Selected Layers',
string_003 : 'Rig All',
string_003x : 'Rig All Layers in Comp'
};
this.init = function init()
{
this.btnLauyout =
"button\
{\
preferredSize: ['" + this.appearence.buttonWidth + "','" + this.appearence.buttonHeight + "'],\
text:'" + this.info.name + "',\
helpTip:'" + this.info.description + "'\
}";
yPuppetRig_data.scriptName = 'yPuppetRigger';
yPuppetRig_data.scriptVer = 'v0.3.3a';
yPuppetRig_data.scriptDesc = 'Tools for streamlining puppet-based animation rigs.';
yPuppetRig_data.string_info = 'yorchnet.com';
yPuppetRig_data.e_000 = 'e_000 : No layers are selected.';
yPuppetRig_data.e_001 = 'e_001 : Layer contains no effects.';
yPuppetRig_data.e_002 = 'e_002 : Layer contains no Puppet effects.';
yPuppetRig_data.string_001 = 'Rig Pins';
yPuppetRig_data.string_001x = 'Rigs Selected Pins on Layer';
yPuppetRig_data.string_002 = 'Rig Layers';
yPuppetRig_data.string_002x = 'Rigs Selected Layers';
yPuppetRig_data.string_003 = 'Rig All';
yPuppetRig_data.string_003x = 'Rig All Layers in Comp';
//it should be called from toolbox.
yPuppetRig_data.buttonWidth=76;
yPuppetRig_data.buttonHeight=30;
//if yToolBox Exists add it to its tool list.
if (typeof(yToolBox_data)!=='undefined'){
yToolBox_data.tools.push(yPuppetRig_data);
yPuppetRig_data.btnLayout = "btn_"+ yPuppetRig_data.scriptName+": Button { preferredSize: ['"+yToolBox_data.buttonWidth+"','"+ yToolBox_data.buttonHeight+"'], text:'"+yPuppetRig_data.scriptName+"', helpTip:'"+yPuppetRig_data.scriptDesc+"' }";
}
function build_yPuppetRig_data_UI(){
//define custom strings for error messages, names, button names and helpTips. //Defines Layout variables.
yPuppetRig_data.res = "window { \
type:'palette' , text:'"+yPuppetRig_data.scriptName+" "+yPuppetRig_data.scriptVer+"',margins:[10,10,10,10],spacing:[5,5,5,5],\
this. res =
"window { \
type:'palette' , text:'" + this.resources.scriptName + " " + this.resources.scriptVer + "',margins:[10,10,10,10],spacing:[5,5,5,5],\
grp: Group { orientation:'column' , alignment:['fill','fill'] , alignChildren:['fill','fill'] , spacing:'2' , margin:'5', \
btn_01: Button { preferredSize: ['"+yPuppetRig_data.buttonWidth+"','"+yPuppetRig_data.buttonHeight+"'], text:'"+yPuppetRig_data.string_001+"', helpTip:'"+yPuppetRig_data.string_001x+"' }, \
btn_02: Button { preferredSize: ['"+yPuppetRig_data.buttonWidth+"','"+yPuppetRig_data.buttonHeight+"'], text:'"+yPuppetRig_data.string_002+"', helpTip:'"+yPuppetRig_data.string_002x+"' }, \
btn_03: Button { preferredSize: ['"+yPuppetRig_data.buttonWidth+"','"+yPuppetRig_data.buttonHeight+"'], text:'"+yPuppetRig_data.string_003+"', helpTip:'"+yPuppetRig_data.string_003x+"' }, \
btn_01: Button { preferredSize: ['" + this.appearence.buttonWidth + "','" + this.appearence.buttonHeight + "'], text:'" + this.resources.string_001 + "', helpTip:'" + this.resources.string_001x + "' }, \
btn_02: Button { preferredSize: ['" + this.appearence.buttonWidth + "','" + this.appearence.buttonHeight + "'], text:'" + this.resources.string_002 + "', helpTip:'" + this.resources.string_002x + "' }, \
btn_03: Button { preferredSize: ['" + this.appearence.buttonWidth + "','" + this.appearence.buttonHeight + "'], text:'" + this.resources.string_003 + "', helpTip:'" + this.resources.string_003x + "' }, \
chk_optn: Checkbox { text:'Enable Options', alignment:['fill','center'] , helpTip:'Enable Advanced Options' },\
optn: Panel{ text:'Options' , visible:'false', orientation:'row' , alignment:['fill','fill'] , alignChildren:['fill','fill'] , spacing:'2' , margin:'5', \
nullSizeGrp: Group{ \
orientation:'column' , alignment:['fill','fill'] , alignChildren:['fill','fill'] , spacing:'2' , margin:'5', \
sldr_tit: StaticText { text:'Set Null Size in Pixels.', alignment:['fill','center'] },\
sldr: Slider { value:'125' , minvalue:'6' , maxvalue:'250' , text:'alaverga', helpTip:'"+yPuppetRig_data.string_001x+"' }, \
sldr: Slider { value:'125' , minvalue:'6' , maxvalue:'250' , text:'alaverga', helpTip:'" + this.resources.string_001x + "' }, \
sldr_Values_txt: Group{\
orientation:'row' , alignment:['fill','fill'] , alignChildren:['center','fill'] , spacing:'2' , margin:'5', \
mintxt: StaticText { text:'small', alignment:['left','fill'] },\
@@ -55,55 +69,63 @@ yPuppetRig_data.res = "window { \
},\
info: Group { \
alignment:['center','bottom'], \
icn_app: Image {icon:'"+ yToolBox_data.icon.path+'/'+ yToolBox_data.icon.name+"',preferredSize: [15, 18]},\
txt_info: StaticText { text:'"+yPuppetRig_data.string_info+"', alignment:['fill','center'] },\
txt_info: StaticText { text:'" + this.resources.string_info + "', alignment:['fill','center'] },\
}\
}\
}";
//if (typeof(yToolBox_data)!=='undefined'){
yPuppetRigDialog = new Window (yPuppetRig_data.res); // Creates Window
//}
//yPuppetRigDialog.onDraw = customColors(yPuppetRigDialog);
yPuppetRigDialog.grp.optn.enabled = false;
yPuppetRigDialog.show(); //Shows Window.
//yPuppetRigDialog.grp.info.icn_app.image = yToolBox_data.icon.substring(3,yToolBox_data.icon.length);
yPuppetRigDialog.grp.btn_01.onClick = runRigPin; //Defines Button Action
yPuppetRigDialog.grp.btn_02.onClick = runRigLayer; //Defines Button Action
yPuppetRigDialog.grp.btn_03.onClick = runRigAll; //Defines Button Action
yPuppetRigDialog.grp.chk_optn.onClick = toggleOptions;
}
yPuppetRig_data.activate = build_yPuppetRig_data_UI ;
this.createUI = function createUI()
{
this.window = new Window( this.res );
this.window.layout.layout(true);
this.window.center();
this.window.show();
this.window.grp.optn.enabled = false;
function toggleOptions(){
if(yPuppetRigDialog.grp.chk_optn==true){
yPuppetRigDialog.grp.chk_optn=false;
this.window.grp.btn_01.onClick = yPuppetRigTool.runRigPin; //Defines Button Action
this.window.grp.btn_02.onClick = yPuppetRigTool.runRigLayer; //Defines Button Action
this.window.grp.btn_03.onClick = yPuppetRigTool.runRigAll; //Defines Button Action
this.window.grp.chk_optn.onClick = yPuppetRigTool.toggleOptions;
}
this.yMainFunction = function yMainFunction()
{
this.createUI();
}
this.activate = function activate()
{
yPuppetRigTool.yMainFunction();
}
/**/
this.toggleOptions = function toggleOptions(){
if(this.window.grp.chk_optn==true){
this.window.grp.chk_optn=false;
}
else
{
yPuppetRigDialog.grp.chk_optn=true;
this.window.grp.chk_optn=true;
}
yPuppetRigDialog.grp.optn.enabled = yPuppetRigDialog.grp.chk_optn;
this.window.grp.optn.enabled = this.window.grp.chk_optn;
}
function customColors(rsr){
this.customColors = function customColors(rsr){
g = rsr.graphics;
myBrush = g.newBrush(g.BrushType.SOLID_COLOR, [0.25, 0.05, 0.25, 1]);
g.backgroundColor = yToolBoxPalette.graphics.backgroundColor;
}
function getPuppetEffects(aLayer){
this.getPuppetEffects = function getPuppetEffects(aLayer){
puppetEffects = []
for(i=1;i<=aLayer('Effects').numProperties;i++){
puppetEffects.push(aLayer('Effects')(i));
}
return puppetEffects;
}
function getPosPins(aLayer){
puppetEffects = getPuppetEffects(aLayer);
this.getPosPins = function getPosPins(aLayer){
puppetEffects = this.getPuppetEffects(aLayer);
if(puppetEffects.length>0){
posPins = [];
for(i=0;i<puppetEffects.length;i++){
@@ -120,14 +142,14 @@ function getPosPins(aLayer){
return []
}
}
function rigPins(aLayer,selectedOnly){
pins = getPosPins(aLayer);
this.rigPins = function rigPins(aLayer,selectedOnly){
pins = this.getPosPins(aLayer);
selectedPins = [];
createdNulls =[];
for(i=0;i<pins.length;i++){
selectedPins.push(pins[i].selected)
}
setPropsFromUI();
this.setPropsFromUI();
for(i=0;i<pins.length;i++){
if(selectedPins[i]||!selectedOnly){
@@ -167,30 +189,16 @@ aLayerAnchorPoint = null;
txtExpression = null;
}
function runRigPin(){
/* NOT WORKING YET
app.beginUndoGroup(string_001);
allLayers = app.project.activeItem.layers;
workLayers = [];
for(i=1;i<=allLayers.length;i++){
if(allLayers[i].selected){
workLayers.push(allLayers[i]);
}
}
for(x=0;x<workLayers.length;x++){
rigPins(workLayers[x],false);
}
app.endUndoGroup();
*/
app.beginUndoGroup(yPuppetRig_data.string_001);
this.runRigPin = function runRigPin(){
app.beginUndoGroup( yPuppetRigTool.resources.string_001 );
sel =app.project.activeItem.selectedLayers;
setPropsFromUI();
rigPins(sel[0],true);
yPuppetRigTool.setPropsFromUI();
yPuppetRigTool.rigPins(sel[0],true);
app.endUndoGroup();
}
function runRigLayer(){
app.beginUndoGroup(yPuppetRig_data.string_002);
this.runRigLayer = function runRigLayer(){
//alert( yPuppetRigTool.resources.string_002 );
app.beginUndoGroup( yPuppetRigTool.resources.string_002 );
allLayers = app.project.activeItem.layers;
workLayers = [];
for(i=1;i<=allLayers.length;i++){
@@ -199,26 +207,27 @@ function runRigLayer(){
}
}
for(x=0;x<workLayers.length;x++){
rigPins(workLayers[x],false);
//alert( yPuppetRigTool.info );
yPuppetRigTool.rigPins(workLayers[x],false);
}
app.endUndoGroup();
}
function runRigAll(){
app.beginUndoGroup(yPuppetRig_data.string_003);
this.runRigAll = function runRigAll(){
app.beginUndoGroup( yPuppetRigTool.resources.string_003 );
allLayers = app.project.activeItem.layers;
workLayers = [];
for(i=1;i<=allLayers.length;i++){
workLayers.push(allLayers[i]);
}
for(x=0;x<workLayers.length;x++){
rigPins(workLayers[x],false);
yPuppetRigTool.rigPins(workLayers[x],false);
}
app.endUndoGroup();
}
function setPropsFromUI(){
nullSize = yFactor(parseInt(yPuppetRigDialog.grp.optn.nullSizeGrp.sldr.value),5)
if(yPuppetRigDialog.grp.optn.nullSizeGrp.otherOptionsGrp.chk_box_02.value==true){
this.setPropsFromUI = function setPropsFromUI(){
nullSize = yFactor(parseInt(this.window.grp.optn.nullSizeGrp.sldr.value),5)
if(this.window.grp.optn.nullSizeGrp.otherOptionsGrp.chk_box_02.value==true){
layerLock =true // solo si vamos a hacer vainas pixeladas.
}
else
@@ -226,7 +235,7 @@ function setPropsFromUI(){
layerLock =false // solo si vamos a hacer vainas pixeladas.
}
if(yPuppetRigDialog.grp.optn.nullSizeGrp.otherOptionsGrp.chk_box_01.value==true){
if(this.window.grp.optn.nullSizeGrp.otherOptionsGrp.chk_box_01.value==true){
layerQuality =LayerQuality.DRAFT // solo si vamos a hacer vainas pixeladas.
}
else
@@ -234,12 +243,19 @@ function setPropsFromUI(){
layerQuality =LayerQuality.BEST // solo si vamos a hacer vainas pixeladas.
}
}
/**/
//build_yPuppetRig_UI();
this.init();
return this;
}
//CHECKS that the toolbox exists, and if it doesn´t it runs the script on its own.
if (typeof(yToolBox_data)=='undefined'){
yPuppetRig_data.activate();
}else{
if (typeof(YTB)=='undefined')
{
yPuppetRigTool = new YPuppetRigTool();
yPuppetRigTool.activate();
}
else
{
yPuppetRigTool = YTB.addTool(new YPuppetRigTool());
}
+98 -43
View File
@@ -1,76 +1,131 @@
<<<<<<< HEAD
#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";
ySetProject_data = new Object();
ySetProject_data.scriptName = 'YSetStructure';
ySetProject_data.scriptDesc = 'Set the Folder Structure for a new Project';
ySetProject_data.scriptVer = '0.1a';
ySetProject_data.webLink = 'yorchnet.com';
//if yToolBox Exists add it to its tool list.
if (typeof(ytb)!=='undefined'){
ySetProject_data.btnLayout = "btn_"+ ySetProject_data.scriptName+": Button { preferredSize: ['"+ ytb.buttonWidth+"','"+ ytb.buttonHeight+"'], text:'"+ySetProject_data.scriptName+"', helpTip:'"+ySetProject_data.scriptDesc+"' }";
ytb.addTool(ySetProject_data);
}
ySetProject_data.res = "window { \
type:'palette' , text:'"+ySetProject_data.scriptName+' '+ySetProject_data.scriptVer+"',\
\
\
info: Group { \
alignment:['center','bottom'], \
icon: Image {preferredSize: [15, 18]},\
website: StaticText { text:'"+ySetProject_data.webLink+"', alignment:['fill','center'] },\
}\
\
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 + "'\
}";
//------------------------------------------------------------------------------------------------------------------------
function ySetProject(){
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'){
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){
if (projectItems.length == 0)
{
newStruct = preStruct;
}else{
for(a=0;a<preStruct.length;a++){
if ((projectItems.getOne(preStruct[a]))==-1){
}
else
{
for(a=0;a<preStruct.length;a++)
{
if ((projectItems.getOne(preStruct[a]))==-1)
{
newStruct.push(preStruct[a]);
};
}
}
}
for(i = 0;i<newStruct.length;i++){
app.project.items.addFolder(newStruct[i]);
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();
}
//------------------------------------------------------------------------------------------------------------------------
function build_ySetProject_data_UI(){
ySetProject_data.window = new Window ( ySetProject_data.res);
ySetProject_data.window.show();
this.activate = this.ySetProject;
this.init();
return this;
}
ySetProject_data.activate = ySetProject ;
//CHECKS that the toolbox exists, and if it doesn´t it runs the script on its own.
if (typeof(ytb)=='undefined')
if (typeof(YTB)=='undefined')
{
ySetProject_data.activate();
}else{
ySetProjectTool = new YSetProjectTool();
ySetProjectTool.activate();
}
else
{
YTB.addTool(new YSetProjectTool());
}
>>>>>>> 841484771586f75c140288b329d54c96d3cb3925
+93 -43
View File
@@ -1,41 +1,78 @@
yStopMotion_data = new Object();
#include "../yScripts/y_JSExtensions.jsx";
function YStopMotionLayer()
{
this.info =
{
name : "YStopMotionLayer",
version : 0.11,
stage : "development",
description : "Tool to create a sprite-like behaviour with a composition.",
url : "yorchnet.com"
};
this.appearence =
{
buttonHeight : 30,
buttonWidth : 126
};
this.resources =
{
icon : new File('yNet.png'),
e_0000 : "There are no comps in project.",
e_0001 : "No Comps selected."
};
this.init = function init()
{
yStopMotion_data.scriptName = 'yStopMotion';
yStopMotion_data.scriptDesc = 'Dynamically change layer sequence opacity from a slider in pComp';
yStopMotion_data.scriptVer = '0.1a';
yStopMotion_data.webLink = 'yorchnet.com';
//if yToolBox Exists add it to its tool list.
if (typeof(yToolBox_data)!=='undefined'){
yToolBox_data.tools.push(yStopMotion_data);
//it should be called from toolbox.
/* yStopMotion_data.buttonWidth=76;
yStopMotion_data.buttonHeight=30;
*/
yStopMotion_data.btnLayout = "btn_"+yStopMotion_data.scriptName+": Button { preferredSize: ['"+ yToolBox_data.buttonWidth+"','"+ yToolBox_data.buttonHeight+"'], text:'"+yStopMotion_data.scriptName+"', helpTip:'"+yStopMotion_data.scriptDesc+"' }";
}
yStopMotion_data.res = "window { \
type:'palette' , text:'"+yStopMotion_data.scriptName+' '+yStopMotion_data.scriptVer+"',\
\
\
info: Group { \
alignment:['center','bottom'], \
icon: Image {preferredSize: [15, 18]},\
website: StaticText { text:'"+yStopMotion_data.webLink+"', alignment:['fill','center'] },\
}\
\
this.btnLauyout =
"button\
{\
preferredSize: ['" + this.appearence.buttonWidth + "','" + this.appearence.buttonHeight + "'],\
text:'" + this.info.name + "',\
helpTip:'" + this.info.description + "'\
}";
//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------
// MAIN SCRIPT GOES HERE.
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()
{
res =
"window {\
resizeable : true\
closeButton : true\
text:'wtf'\
}"
e_0000 = "There are no comps in project."
e_0001 = "No Comps selected."
this.window = new Window( res );
this.window.layout.layout(true);
this.window.center();
this.window.show();
}
/** MEAT **/
this.yApplyStopMotionLayer = function yApplyStopMotionLayer(){
function yStopMotionLayer(){
myName = "yStopMotionLayer";
myVer = "0.2a";
nComps = app.project.items.length;
@@ -73,29 +110,42 @@ max\
txtExpression = null;
}
}else{
alert(e_0001,myName+' '+myVer);
alert( this.resources.e_0001,myName+' '+myVer);
}
}else{
alert(e_0000,myName+' '+myVer+" : Error");
alert(this.resources.e_0000,myName+' '+myVer+" : Error");
}
app.endUndoGroup();
}
/**/
this.yMainFunction = function yMainFunction()
{
//this.createUI();
this.YStopMotionLayer();
}
this.activate = function activate()
{
yStopMotionLayer.yApplyStopMotionLayer();
//this.yMainFunction();
}
//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------
function build_yStopMotion_data_UI(){
yStopMotion_data.window = new Window ( yStopMotion_data.res);
yStopMotion_data.window.show();
this.init();
return this;
}
yStopMotion_data.activate = yStopMotionLayer ;
//CHECKS that the toolbox exists, and if it doesn´t it runs the script on its own.
if (typeof(yToolBox_data)=='undefined'){
yStopMotion_data.activate();
}else{
if (typeof(YTB)=='undefined')
{
yStopMotionLayer = new YStopMotionLayer();
yStopMotionLayer.activate();
}
else
{
yStopMotionLayer = YTB.addTool(new YStopMotionLayer());
}
File diff suppressed because one or more lines are too long