25 Commits
Author SHA1 Message Date
jorge 49975f6760 Slightly changed the folders on the original structure, Mostly replacing spaces with underscores. 2023-07-24 08:58:26 -07:00
jorge 5acdd0d815 Delete README.md 2022-10-05 21:45:40 -07:00
jorge 9446d53478 Create README.md 2022-10-05 21:44:56 -07:00
jorge ce0743269d Added a BaseScriptsUIPanel script for adding more tools easily. 2021-07-16 23:08:13 -07:00
jorge 2d35ce31f5 fixed undo mistmach issue 2021-07-15 23:01:28 -07:00
Jorge Vásquez Pérez 4d91bbfe60 Cleared some spacing issues. 2019-02-05 18:00:26 -08:00
Jorge Vásquez Pérez 30a69f02a5 Added a to-do. 2019-02-05 17:59:43 -08:00
Jorge Vásquez Pérez 38f087dce4 Added a tool to render a still frame for each of the markers contained in a dummy layer called 'Render'. 2019-02-05 17:31:01 -08:00
Jorge Vásquez Pérez 29b22e7658 Added a tool to flatten a folder's contents in the AFX project. 2019-02-05 15:32:49 -08:00
Jorge Vásquez Pérez 7c11b48082 Fixed the RenderToProject script so it created the right foilders 2017-11-16 16:30:48 -08:00
Jorge Vásquez Pérez 24af8e259b Changed the way in which the RenderToProjects scripts adds the items to the queue, if a CompItem is selected, it'll add it to the project's appropriate folder, if a folder is selected, it'll create a subfolder for all the items in the selected folder 2017-07-11 12:39:35 -07:00
Jorge Vásquez Pérez 00748360db Fixed a bug that rendered end_tags to the wrong folder. 2017-07-10 17:23:46 -07:00
Jorge Vásquez Pérez fe6f637561 Changed the script for it to allow to probe scaled layers without breaking. 2017-05-03 12:17:06 -07:00
Jorge Vásquez Pérez 8e4b7bba2d Changed the behavior of the button from SETTING the items already present in the queue to the correct folder; to actually ADDING the selected project items to the corresponding folders 2017-04-18 13:20:50 -07:00
Jorge Vásquez Pérez 1b34576b61 Fixed a mislabeling of a UI input field that rendered the Prefixing function unusable. 2017-04-13 18:17:42 -07:00
Jorge Vásquez Pérez 81ae9c5398 Fixed an error on a string declaration that broke the yToolMenu when addig said tool. 2017-04-13 18:03:59 -07:00
Jorge Vásquez Pérez df23e7403f Changed the description for RenderToProject and y_CompHerder scripts. 2017-04-13 17:01:25 -07:00
Jorge Vásquez Pérez c74ed78512 Added CompHearder and RenderToProject to the yScriptsToolbox 2017-04-13 15:38:42 -07:00
Jorge Vásquez Pérez b77f4552c2 Added a new tool to reroute items in the render quque to the approopriate folder, according to the studio folder structure 2017-04-13 15:34:10 -07:00
Jorge Vásquez Pérez b038e66615 Reorganized some functions on corresponding scripts to make it clearer of what was supposed to go in each one 2017-04-13 15:30:13 -07:00
Jorge Vássquez Pérez 631cb8f607 Brought back the main UI Panel to functioning condition. 2016-12-02 17:29:48 -08:00
Jorge Vássquez Pérez b1efb4928b Hopefully this will finally fix the merging issues I had. 2016-12-02 17:20:13 -08:00
Jorge Vássquez Pérez 4ca84b5fee Fixing even more merge issues. 2016-12-02 16:55:46 -08:00
Jorge Vássquez Pérez f7b18e98d6 Fixed more issues with the git merge. 2016-12-02 16:50:58 -08:00
Jorge Vássquez Pérez f1a6f31448 Brought y_stopMotionLayer up to date. 2016-12-02 16:48:01 -08:00
16 changed files with 1271 additions and 89 deletions
+71
View File
@@ -0,0 +1,71 @@
/*
Base ScriptUI Panel v.0.1
by Jorge Vásquez Pérez
Changes 0.2:
- None
*/
(function createNullsFromPaths (thisObj) {
/* Build UI */
function buildUI(thisObj) {
var windowTitle = "windowTitle";
var firstButton = "firstButton";
var secondButton = "secondButton";
var thirdButton = "thirdButton";
var win = (thisObj instanceof Panel)? thisObj : new Window('palette', windowTitle);
win.spacing = 0;
win.margins = 4;
var myButtonGroup = win.add ("group");
myButtonGroup.spacing = 4;
myButtonGroup.margins = 0;
myButtonGroup.orientation = "row";
win.button1 = myButtonGroup.add ("button", undefined, firstButton);
win.button2 = myButtonGroup.add ("button", undefined, secondButton);
win.button3 = myButtonGroup.add ("button", undefined, thirdButton);
myButtonGroup.alignment = "center";
myButtonGroup.alignChildren = "center";
win.button1.onClick = function(){
button1Click();
}
win.button2.onClick = function(){
button2Click();
}
win.button3.onClick = function(){
button3Click();
}
win.layout.layout(true);
return win
}
// Show the Panel
var w = buildUI(thisObj);
if (w.toString() == "[object Panel]") {
w;
} else {
w.show();
}
/* General functions */
/* Project Specific functions */
function button1Click(){
alert("Button 1 was clicked");
}
function button2Click(){
alert("Button 2 was clicked");
}
function button3Click(){
alert("Button 3 was clicked");
}
})(this);
+10 -6
View File
@@ -1,6 +1,3 @@
<<<<<<< HEAD
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; var scriptUIPanel = this;
YTB = YTB =
{ {
@@ -84,9 +81,10 @@ YTB =
/**** TO DO ****/ /**** TO DO ****/
// Check that the tool object is unique. // Check that the tool object is unique.
// Call for a window resize so it refreshes propperly. // Call for a window resize so it refreshes propperly.
//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;
@@ -95,6 +93,7 @@ YTB =
//alert(btn.onClick); //alert(btn.onClick);
this.window.layout.layout(true); this.window.layout.layout(true);
this.window.layout.resize();
return aTool; return aTool;
@@ -120,9 +119,14 @@ YTB =
YTB.init(); YTB.init();
#include "../yScripts/y_setStructure.jsx"; #include "../yScripts/y_setStructure.jsx";
#include "../yScripts/y_CompHerder.jsx";
#include "../yScripts/y_flattenSelectedFolderContents.jsx";
#include "../yScripts/RenderToProject.jsx";
#include "../yScripts/y_RenderMarkers.jsx";
#include "../yScripts/y_colorProbe.jsx"; #include "../yScripts/y_colorProbe.jsx";
#include "../yScripts/y_BindBetween2.jsx"; #include "../yScripts/y_BindBetween2.jsx";
#include "../yScripts/y_CPOffset.jsx"; #include "../yScripts/y_CPOffset.jsx";
#include "../yScripts/y_puppetRig.jsx"; #include "../yScripts/y_puppetRig.jsx";
#include "../yScripts/y_GenericNewScript.jsx"; #include "../yScripts/y_stopMotionLayer.jsx";
>>>>>>> 841484771586f75c140288b329d54c96d3cb3925
+357
View File
@@ -0,0 +1,357 @@
#include "../yScripts/y_JSExtensions.jsx";
function RenderToProject()
{
this.info =
{
name : "RenderToProject",
btn1 : "RenderToProject",
btn2 : "SetAllToProject",
version : 0.1,
stage : "development",
description : "Set Renders to project appropriate folders according to the studio folder structure.",
url : "yorchnet.com"
};
this.appearence =
{
buttonHeight : 30,
buttonWidth : 126
};
this.resources =
{
icon : new File('yNet.png'),
};
this.methods =
{
getSelectedProjectItems: function(){
var items = [];
//var debugItems = [];
var p = app.project;
for ( var i = 1 ; i <= p.numItems ; i ++ ){
var item = p.item(i);
if ( item.selected ){
items.push(item);
//debugItems.push(item.name);
}
}
//alert(debugItems);
return items;
},
pad : function ( n , pad ) {
zeros = "";
for ( i = 0 ; i < pad ; i ++ )
{
zeros+="0";
}
n = String(n);
padded = zeros.substr( 0, pad - n.length ) + String(n) ;
return padded
},
getTodayTag : function(){
var today = new Date();
var month_component = pad(String(today.getMonth()+1),2);
var date_component = pad(today.getDate(),2);
var full_year_component = String(today.getFullYear())
var year_component = full_year_component.substr(full_year_component.length - 2,full_year_component.length );
var tag = month_component + date_component + year_component
return tag;
},
getOutputBasePath : function(){
var file = app.project.file;
var file_path = String(app.project.file);
var gfx_output_base = "05_Graphics_Output";
var endtag_output_extra = "02_EndTags";
var scene_output_extra = "01_GFX_Scenes";
var vfx_output_base = "03_Composite_Outputs";
var vfx_output_base;
var gfx_string = "09_Graphics";
var vfx_string = "08_Composite";
var endtag_string = "EndTags";
var search_gfx = file_path.search(gfx_string);
var search_vfx = file_path.search(vfx_string);
var search_endtag = file_path.search(endtag_string);
var base_path;
if ( search_gfx != -1 ){
var base_path = file_path.substr(0,search_gfx+gfx_string.length)+"/"+gfx_output_base;
if ( search_endtag != -1 ){
base_path += "/" + endtag_output_extra;
}else{
base_path += "/" + scene_output_extra;
}
}
if( search_vfx != -1 ){
var base_path = file_path.substr(0,search_vfx+vfx_string.length)+"/"+vfx_output_base ;;
}
//alert(base_path);
return base_path + "/" + this.getTodayTag();
},
/*
setRenderToProjectPath : function( 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 ){
var new_path = this.getOutputBasePath();
var new_folder = Folder( new_path );
if ( !new_folder.exists ){
new_folder.create();
}
//alert(new_path + "/" + old_name)
var new_file = new File( new_path + "/" + old_name );
o_module.file = new_file ;
//alert ( new_path );
//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 );
}
}
},
*/
setRenderToProjectPath : function( rqItem , extra_path ){
//alert(extra_path);
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 ){
if ( extra_path != undefined )
{
var new_path = this.getOutputBasePath()+ "/" +extra_path;
}
else
{
var new_path = this.getOutputBasePath();
}
var new_folder = Folder( new_path );
if ( !new_folder.exists ){
new_folder.create();
}
//alert(new_path + "/" + old_name)
var new_file = new File( new_path + "/" + old_name );
o_module.file = new_file ;
//alert ( new_path );
//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 );
}
}
},
setRendersToProjectPath : function(){
var q = app.project.renderQueue;
//check the render queue item is not already rendered.
for ( var i = 1 ; i <= q.numItems ; i ++ ){
item = q.item(i);
//3015 is QUEUED
//3013 is NEEDS_OUTPUT
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 ++){
if( items[i].typeName == "Composition" ){
var item = items[i];
rqItem = q.items.add(item);
this.setRenderToProjectPath(rqItem);
}
//alert(items);
if( items[i].typeName == "Folder" ){
var folder = items[i];
for ( var j = 1 ; j <= folder.numItems ; j ++ )
{
var item = folder.items[j];
rqItem = q.items.add(item);
this.setRenderToProjectPath(rqItem, item.parentFolder.name );
}
}
}
/*
for ( var i = 0 ; i < items.length; i ++){
if( items[i].typeName == "Composition" ){
var item = items[i];
rqItem = q.items.add(item);
this.setRenderToProjectPath(rqItem);
}
else if ( items[i].typeName == "Folder" )
{
var folder = items[i];
for ( var j = 1 ; j <= folder.numItems ; j ++ )
{
var item = folder.items[j];
rqItem = q.items.add(item);
this.setRenderToProjectPath(rqItem, item.parentFolder.name );
}
}
else
{
}
}*/
q.showWindow(true);
}
}
this.init = function init()
{
/*
* Sketching a possible multi button approach.
this.btnLauyout =
"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 + "'],\
text:'" + this.info.btn1 + "',\
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 myUI = this;
var res =
" window {\
text: 'RenderToProject',\
alignment: ['fill','fill'], \
alignChildren: ['center','top'], \
orientation: 'column', \
resizeable: 'true'\
}";
myUI.window = new Window( res );
myUI.window.layout.layout(true);
myUI.window.show();
myUI.window.layout.onResizing = myUI.window.layout.onResize = function () { myUI.layout.resize();}
//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.su.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 );
};
*/
//END EVENT HANDLERS
return(this);
}
this.yMainFunction = function yMainFunction()
{
//Have to Separate this into "Operators" so I can have mutiple buttons in a single Tool.
w = this.methods.renderSelectedToProjectPath();
}
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')
{
rtp = new RenderToProject();
rtp.activate();
}
else
{
YTB.addTool(new RenderToProject());
}
+9 -20
View File
@@ -1,20 +1,7 @@
#include "y_JSExtensions.jsx"; #include "y_JSExtensions.jsx";
/* function sortNumber(a,b){
if (Array.prototype.getOne==null) Array.prototype.getOne=function(item){ //Extends the Array class with the getOne functions wich
var val = -1;
for(i=0;i<=this.length;i++){
if(this[i]==item){
var val = i;
}
}
return val;
}
*/
function sortNumber(a,b)
{
return a - b; return a - b;
} }
function pad(n,i){ //pad n with ceroes up to i places. function pad(n,i){ //pad n with ceroes up to i places.
if (String(n).length>=i){ if (String(n).length>=i){
return String(n) return String(n)
@@ -27,8 +14,6 @@ function pad(n,i){ //pad n with ceroes up to i places.
return padding+String(n) return padding+String(n)
} }
} }
function yUniStr(str){ function yUniStr(str){
if (app.project.activeItem != null) { if (app.project.activeItem != null) {
myLayers = app.project.activeItem.layers; myLayers = app.project.activeItem.layers;
@@ -67,7 +52,6 @@ function getBaseName(str){
return str; return str;
}; };
} }
function getFirstGap(array){ function getFirstGap(array){
length = array.length length = array.length
array.sort(function sortNumber(a,b){return a-b}) array.sort(function sortNumber(a,b){return a-b})
@@ -92,8 +76,6 @@ function yReplace(inputSTR,replaceSTR,replacementSTR){
} }
return tmpSTR; return tmpSTR;
} }
function genStamp(args){ function genStamp(args){
d = new Date(); d = new Date();
//alert(d.getMonth()); //alert(d.getMonth());
@@ -103,7 +85,6 @@ function genStamp(args){
str = String(m)+String(d)+String(y); str = String(m)+String(d)+String(y);
return str return str
} }
function mergeMultiLine(_str){ function mergeMultiLine(_str){
var re = new RegExp('[\n\r]'); var re = new RegExp('[\n\r]');
_lines = _str.split(re); _lines = _str.split(re);
@@ -128,3 +109,11 @@ function mergeMultiLine(_str){
} }
return newStr; return newStr;
} }
function yFactor(n,f){
if((typeof(n)=='number'&&typeof(f)=='number')&&(n>f)){
value = n - (n%f);
return(value);
}else{
alert('error');
}
}
+3 -1
View File
@@ -1,4 +1,6 @@
if (AVLayer.prototype. getPins==null) AVLayer.prototype. getPins=function(){ //Extends the AVLayer class with the getPinsfunctions which returns the Layer's property groups which are pins. //Useful extensions to AFX Extendscript classes.
if (AVLayer.prototype. getPins==null) AVLayer.prototype. getPins=function(){ //Extends the AVLayer class with the getPinsfunctions which returns the Layer's property groups which are pins.
this.selectedPins = []; this.selectedPins = [];
for(prop=0;prop<this.selectedProperties.length;prop++){ for(prop=0;prop<this.selectedProperties.length;prop++){
p= this.selectedProperties[prop]; p= this.selectedProperties[prop];
+2 -2
View File
@@ -93,7 +93,7 @@ function YBindBetween2()
} }
this.activate = function activate() this.activate = function activate()
{ {
this.yTool.yMainFunction(); yBindBetween2.yMainFunction();
} }
this.run = function run() this.run = function run()
{ {
@@ -212,5 +212,5 @@ if (typeof(YTB)=='undefined')
} }
else else
{ {
YTB.addTool(new YBindBetween2()); yBindBetween2 = YTB.addTool(new YBindBetween2());
} }
File diff suppressed because one or more lines are too long
+115
View File
@@ -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());
}
+177 -14
View File
@@ -1,9 +1,10 @@
#include "../yScripts/y_JSExtensions.jsx"; #include "../yScripts/y_JSExtensions.jsx";
function YGenericTool()
function GenericTool()
{ {
this.info = this.info =
{ {
name : "yGenericTool", name : "GenericTool",
version : 0.1, version : 0.1,
stage : "development", stage : "development",
description : "Generic script to use as a base for new tools.", description : "Generic script to use as a base for new tools.",
@@ -18,6 +19,66 @@ function YGenericTool()
{ {
icon : new File('yNet.png'), icon : new File('yNet.png'),
}; };
this.methods =
{
pad : function ( n , pad ) {
zeros = "";
for ( i = 0 ; i < pad ; i ++ )
{
zeros+="0";
}
n = String(n);
padded = zeros.substr( 0, pad - n.length ) + String(n) ;
return padded
},
replace: function( items , string , newString ){
for ( i = 0 ; i < items.length ; i ++ ){
var item = items[i];
item.name = item.name.replace( string , newString );
}
return true;
},
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);
}
}
//items = items.concat( app.project.activeItem.selectedItems );
return items;
},
suffix: function ( items , suffix ){
for ( i = 0 ; i < items.length ; i ++ ){
var item = items[i];
if ( item.name.search( suffix ) != (item.name.length - suffix.length) ){
item.name+= "_"+suffix;
}
}
return true;
},
prefix : function( items , prefix ){
for ( i = 0 ; i < items.length ; i ++ )
{
var item = items[i];
if ( item.name.search( prefix ) != 0 ){
item.name = prefix + "_" + item.name;
}
}
return true;
},
rename: function ( items , new_name ){
for ( i = 0 ; i < items.length ; i ++ ){
var item = items[i];
item.name = new_name + "_" + i;
}
}
}
this.init = function init() this.init = function init()
{ {
@@ -52,21 +113,123 @@ function YGenericTool()
} }
this.createUI = function createUI( ) this.createUI = function createUI( )
{ {
res = var myUI = this;
var res =
" window {\ " window {\
resizeable : true\ text: 'GenericTool',\
closeButton : true\ alignment: ['fill','fill'], \
text:'wtf'\ alignChildren: ['center','top'], \
orientation: 'column', \
resizeable: 'true'\
}" }"
var res =
"window { \
text: 'GenericTool',\
alignment: ['fill','fill'], \
alignChildren: ['center','top'], \
orientation: 'column', \
resizeable: 'true',\
tabs: Panel {\
type: 'tabbedpanel',\
alignment: ['fill','fill'], \
alignChildren: ['center','top'], \
search_tab: Panel {\
type: 'tab',\
text: 'Search & Replace',\
orientation: 'column', \
alignChildren: ['center','top'], \
searchGrp: Group {\
alignment: ['fill','fill'], \
alignChildren: ['center','top'], \
orientation: 'column', \
searchString: EditText {text:'SEARCH FOR TEXT',alignment: ['fill','center']}, \
},\
replaceGrp: Group {\
alignment: ['fill','fill'], \
alignChildren: ['center','center'], \
orientation: 'column', \
replaceString: EditText {text:'REPLACE WITH TEXT',alignment: ['fill','center']}, \
}\
doItBtn: Button {text: 'Replace in selected Comps', alignment: ['center','center']} , \
}\
suprefix: Panel {\
type: 'tab',\
text: 'Suffix / Prefix',\
orientation: 'column', \
suprefixGrp: Group {\
alignment: ['fill','fill'], \
alignChildren: ['left','center'], \
orientation: 'column', \
pre:Group {\
alignment: ['fill','fill'], \
alignChildren: ['left','center'], \
orientation: 'row', \
prefixString: EditText {text:'PREFIX',alignment: ['fill','center']}, \
prefixBtn: Button {text: 'Preffix'} , \
},\
su:Group{\
alignment: ['fill','fill'], \
alignChildren: ['left','center'], \
orientation: 'row', \
sufixString: EditText {text:'SUFIX',alignment: ['fill','center']}, \
sufixBtn: Button {text: 'Sufix'} , \
}\
},\
},\
rename_tab: Panel {\
type: 'tab',\
text: 'Rename',\
renameGrp: Group {\
alignment: ['fill','fill'], \
alignChildren: ['left','center'], \
orientation: 'row', \
renameString: EditText {text:'NEW NAME',alignment: ['fill','center']}, \
renameBtn: Button {text: 'Rename'} ,\
}\
}\
},\
}";
this.window = new Window( res ); myUI.window = new Window( res );
this.window.layout.layout(true); myUI.window.layout.layout(true);
this.window.center();
this.window.show(); myUI.window.show();
myUI.window.layout.onResizing = myUI.window.layout.onResize = function () { myUI.layout.resize();}
//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.su.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 );
};
*/
//END EVENT HANDLERS
return(this);
} }
this.yMainFunction = function yMainFunction() this.yMainFunction = function yMainFunction()
{ {
this.createUI(); w = this.createUI();
} }
this.activate = function activate() this.activate = function activate()
{ {
@@ -80,10 +243,10 @@ function YGenericTool()
//CHECKS that the toolbox exists, and if it doesn´t it runs the script on its own. //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')
{ {
yGenericTool = new YGenericTool(); gt = new GenericTool();
yGenericTool.activate(); gt.activate();
} }
else else
{ {
YTB.addTool(new YGenericTool()); YTB.addTool(new GenericTool());
} }
+3 -9
View File
@@ -1,4 +1,6 @@
if (Array.prototype.getOne==null) Array.prototype.getOne=function(item){ //Extends the Array class with the getOne functions wich //Useful extensions to the JavaScript class versions that come with the default ExtendScript version.
if (Array.prototype.getOne==null) Array.prototype.getOne=function(item){ //Extends the Array class with the getOne functions wich
var val = -1; var val = -1;
for(i=0;i<=this.length;i++){ for(i=0;i<=this.length;i++){
if(this[i]==item){ if(this[i]==item){
@@ -7,11 +9,3 @@
} }
return val; return val;
} }
function yFactor(n,f){
if((typeof(n)=='number'&&typeof(f)=='number')&&(n>f)){
value = n - (n%f);
return(value);
}else{
alert('error');
}
}
+292
View File
@@ -0,0 +1,292 @@
#include "../yScripts/y_JSExtensions.jsx";
function RenderMarkers()
{
this.info =
{
name : "Render Markers",
version : 0.1,
stage : "development",
description : 'Render all markers in dummy layer "Renders".',
url : "yorchnet.com"
};
this.appearence =
{
buttonHeight : 30,
buttonWidth : 126
};
this.resources =
{
icon : new File('yNet.png'),
};
this.methods =
{
pad : function ( n , pad ) {
zeros = "";
for ( i = 0 ; i < pad ; i ++ )
{
zeros+="0";
}
n = String(n);
padded = zeros.substr( 0, pad - n.length ) + String(n) ;
return padded
},
replace: function( items , string , newString ){
for ( i = 0 ; i < items.length ; i ++ ){
var item = items[i];
item.name = item.name.replace( string , newString );
}
return true;
},
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);
}
}
//items = items.concat( app.project.activeItem.selectedItems );
return items;
},
suffix: function ( items , suffix ){
for ( i = 0 ; i < items.length ; i ++ ){
var item = items[i];
if ( item.name.search( suffix ) != (item.name.length - suffix.length) ){
item.name+= "_"+suffix;
}
}
return true;
},
prefix : function( items , prefix ){
for ( i = 0 ; i < items.length ; i ++ )
{
var item = items[i];
if ( item.name.search( prefix ) != 0 ){
item.name = prefix + "_" + item.name;
}
}
return true;
},
rename: function ( items , new_name ){
for ( i = 0 ; i < items.length ; i ++ ){
var item = items[i];
item.name = new_name + "_" + i;
}
}
}
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 myUI = this;
var res =
" window {\
text: 'RenderMarkers',\
alignment: ['fill','fill'], \
alignChildren: ['center','top'], \
orientation: 'column', \
resizeable: 'true'\
}"
var res =
"window { \
text: 'RenderMarkers',\
alignment: ['fill','fill'], \
alignChildren: ['center','top'], \
orientation: 'column', \
resizeable: 'true',\
tabs: Panel {\
type: 'tabbedpanel',\
alignment: ['fill','fill'], \
alignChildren: ['center','top'], \
search_tab: Panel {\
type: 'tab',\
text: 'Search & Replace',\
orientation: 'column', \
alignChildren: ['center','top'], \
searchGrp: Group {\
alignment: ['fill','fill'], \
alignChildren: ['center','top'], \
orientation: 'column', \
searchString: EditText {text:'SEARCH FOR TEXT',alignment: ['fill','center']}, \
},\
replaceGrp: Group {\
alignment: ['fill','fill'], \
alignChildren: ['center','center'], \
orientation: 'column', \
replaceString: EditText {text:'REPLACE WITH TEXT',alignment: ['fill','center']}, \
}\
doItBtn: Button {text: 'Replace in selected Comps', alignment: ['center','center']} , \
}\
suprefix: Panel {\
type: 'tab',\
text: 'Suffix / Prefix',\
orientation: 'column', \
suprefixGrp: Group {\
alignment: ['fill','fill'], \
alignChildren: ['left','center'], \
orientation: 'column', \
pre:Group {\
alignment: ['fill','fill'], \
alignChildren: ['left','center'], \
orientation: 'row', \
prefixString: EditText {text:'PREFIX',alignment: ['fill','center']}, \
prefixBtn: Button {text: 'Preffix'} , \
},\
su:Group{\
alignment: ['fill','fill'], \
alignChildren: ['left','center'], \
orientation: 'row', \
sufixString: EditText {text:'SUFIX',alignment: ['fill','center']}, \
sufixBtn: Button {text: 'Sufix'} , \
}\
},\
},\
rename_tab: Panel {\
type: 'tab',\
text: 'Rename',\
renameGrp: Group {\
alignment: ['fill','fill'], \
alignChildren: ['left','center'], \
orientation: 'row', \
renameString: EditText {text:'NEW NAME',alignment: ['fill','center']}, \
renameBtn: Button {text: 'Rename'} ,\
}\
}\
},\
}";
myUI.window = new Window( res );
myUI.window.layout.layout(true);
myUI.window.show();
myUI.window.layout.onResizing = myUI.window.layout.onResize = function () { myUI.layout.resize();}
//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.su.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 );
};
*/
//END EVENT HANDLERS
return(this);
}
this.renderMarkers = function renderMarkers(){
p = app.project;
rq = p.renderQueue;
rqi = rq.items;
comp = p.activeItem;
var myRenderNull = comp.layer("Render");
if ( myRenderNull == null ){
myRenderNull = app.project.activeItem.layers.addNull();
myRenderNull.name = "Render";
myRenderNull.inPoint = -1;
myRenderNull.outPoint = -1;
alert('Created "Render Stills" layer.\nAdd markers to this layer and run again to render stills.');
}
markers= myRenderNull.property("Marker");
for ( var j = 1 ; j <= markers.numKeys ; j ++ ){
i = rqi.add( comp );
var destPath = i.outputModule(1).file.path;
i.outputModule(1).applyTemplate("PNG+");
var markerName = markers.keyValue(j).comment;
i.timeSpanStart = markers.keyTime(j);
i.timeSpanDuration = comp.frameDuration;
var destName = comp.name.replace(" ","_");
var destFrame = markers.keyTime(j) / comp.frameDuration;
if ( markerName == "" ){
i.outputModule(1).file = new File( destPath + "/" + destName + "_Still_f" + "[####]" )
}else{
i.outputModule(1).file = new File( destPath + "/" + destName + "_Still" + "_f[####]_" + markerName )
}
//alert( i.outputModule(1).file );
//i.outputModule(1).includeSourceXMP = true;
rq.render();
}
//alert(i.timeSpanStart);
//alert(i.timeSpanDuration);
}
this.yMainFunction = function yMainFunction()
{
w = RenderMarkers().renderMarkers();
}
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')
{
gt = new RenderMarkers();
gt.activate();
}
else
{
YTB.addTool(new RenderMarkers());
}
+3 -3
View File
@@ -63,7 +63,7 @@ function YColorProbe()
} }
this.yMainFunction = function yMainFunction() this.yMainFunction = function yMainFunction()
{ {
app.beginUndoGroup(this.yTool.info.name); // yTool is a refernece to the Tool object, because THIS in this context returns the ButtonObject.... 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. //It works with Sampled layers at a 100% scale only.
try try
@@ -87,7 +87,7 @@ function YColorProbe()
radiusCTRL.name ='radius'; radiusCTRL.name ='radius';
myNull("Effects")("radius")('Slider').setValue(5); myNull("Effects")("radius")('Slider').setValue(5);
colExp = 'myLayer = thisLayer("Effects")("sampledLayer")("Layer");\ colExp = 'myLayer = thisLayer("Effects")("sampledLayer")("Layer");\
p = thisLayer.toWorld(thisLayer.transform.anchorPoint);\ p = myLayer.fromWorld(thisLayer.toComp(thisLayer.transform.anchorPoint))\
r = thisLayer("Effects")("radius")("Slider");\ r = thisLayer("Effects")("radius")("Slider");\
myLayer.sampleImage(p, radius = [r, r], postEffect=true, t=time)'; myLayer.sampleImage(p, radius = [r, r], postEffect=true, t=time)';
myNull("Effects")('outColor')('Color').expression=colExp; myNull("Effects")('outColor')('Color').expression=colExp;
@@ -124,5 +124,5 @@ if (typeof(YTB)=='undefined')
} }
else else
{ {
YTB.addTool(new YColorProbe()); yColorProbe = YTB.addTool(new YColorProbe());
} }
@@ -0,0 +1,145 @@
#include "../yScripts/y_JSExtensions.jsx";
function yFlattenSelectedFolderContentsTool()
{
this.info =
{
name : "yFlatten",
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.getSelectedProjectItems = function getSelectedProjectItems (){
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;
}
this.getAllItems = function getAllItems( folderItem ){
var items = [];
var folders = [];
for ( var i = 1 ; i <= folderItem.numItems ; i ++ ){
var item = folderItem.item(i);
if ( (item.typeName != "Folder") ){
//if ( (isInArray( items ,item )) == false ){
items.push( item );
//}
}else{
var new_items = yFlattenSelectedFolderContentsTool().getAllItems(item);
for ( var j = 0 ; j < new_items.length ; j ++ ){
new_item = new_items[j];
//if ( (isInArray ( new_item )) == false ){
items.push ( new_item );
//}
}
}
}
return items
}
this.flatten = function flatten( items, root ){
app.beginUndoGroup("Flatten Selected Folder Contents")
for ( var i = 0; i < items.length ; i ++){
item = items[i];
item.parentFolder = root;
}
app.endUndoGroup()
purgeEmptyFolders();
return
}
this.purgeEmptyFolders = function purgeEmptyFolders(){
//app.beginUndoGroup("Purge Empty Folders")
var emptyFolders = [];
var p = app.project;
for ( var i = p.numItems ; i >= 1 ; i -- ){
item = p.item(i);
if ( item.typeName == "Folder" ){
if ( item.numItems <= 0 ){
item.remove();
}
}
}
//app.endUndoGroup()
}
this.yFlattenSelectedFolderContents = function yFlattenSelectedFolderContents()
{
//alert("is this working");
//app.beginUndoGroup(yFlattenSelectedFolderContentsTool().info.description);
yFlattenSelectedFolderContentsTool().flatten( yFlattenSelectedFolderContentsTool().getAllItems( yFlattenSelectedFolderContentsTool().getSelectedProjectItems()[0] ) , yFlattenSelectedFolderContentsTool().getSelectedProjectItems()[0] );
//app.endUndoGroup();
}
this.activate = this.yFlattenSelectedFolderContents;
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')
{
yFlattenSelectedFolderContentsTool = new yFlattenSelectedFolderContentsTool();
yFlattenSelectedFolderContentsTool.activate();
}
else
{
yFlattenSelectedFolderContentsTool = YTB.addTool(new yFlattenSelectedFolderContentsTool());
}
+3 -8
View File
@@ -4,15 +4,9 @@ function YPuppetRigTool()
this.info = this.info =
{ {
name : "yPuppetRig", name : "yPuppetRig",
<<<<<<< HEAD version : 0.0,
version : 0.33,
stage : "development",
description : "Tools for streamlining puppet-based animation rigs.",
=======
version : 0.1,
stage : "development", stage : "development",
description : "Tool to create nulls at puppet pin locations, and link the latter to the former.", description : "Tool to create nulls at puppet pin locations, and link the latter to the former.",
>>>>>>> 841484771586f75c140288b329d54c96d3cb3925
url : "yorchnet.com" url : "yorchnet.com"
}; };
this.appearence = this.appearence =
@@ -104,7 +98,7 @@ function YPuppetRigTool()
} }
this.activate = function activate() this.activate = function activate()
{ {
this.yTool.yMainFunction(); yPuppetRigTool.yMainFunction();
} }
/**/ /**/
@@ -135,6 +129,7 @@ function YPuppetRigTool()
if(puppetEffects.length>0){ if(puppetEffects.length>0){
posPins = []; posPins = [];
for(i=0;i<puppetEffects.length;i++){ for(i=0;i<puppetEffects.length;i++){
/*TODO : Make it work with layers with multiple effects*/
posPinGroup = puppetEffects[i]('ADBE FreePin3 ARAP Group')('ADBE FreePin3 Mesh Group')('ADBE FreePin3 Mesh Atom')('ADBE FreePin3 PosPins'); posPinGroup = puppetEffects[i]('ADBE FreePin3 ARAP Group')('ADBE FreePin3 Mesh Group')('ADBE FreePin3 Mesh Atom')('ADBE FreePin3 PosPins');
for(j=1;j<=posPinGroup.numProperties;j++){ for(j=1;j<=posPinGroup.numProperties;j++){
posPins.push(puppetEffects[i]('ADBE FreePin3 ARAP Group')('ADBE FreePin3 Mesh Group')('ADBE FreePin3 Mesh Atom')('ADBE FreePin3 PosPins')(j)); posPins.push(puppetEffects[i]('ADBE FreePin3 ARAP Group')('ADBE FreePin3 Mesh Group')('ADBE FreePin3 Mesh Atom')('ADBE FreePin3 PosPins')(j));
+2 -6
View File
@@ -1,6 +1,3 @@
<<<<<<< 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"; #include "../yScripts/y_JSExtensions.jsx";
function YSetProjectTool() function YSetProjectTool()
{ {
@@ -62,7 +59,7 @@ function YSetProjectTool()
{ {
//alert("is this working"); //alert("is this working");
app.beginUndoGroup('ySetProject'); app.beginUndoGroup('ySetProject');
var preStruct = ["01 MAIN","02 PComp","03 Source Layers" ,"04 Movies","05 Other Projects","06 Audio" , "07 Reference"]; var preStruct = ["01_MAIN","02_pComps","03_Images" ,"04_Movies","05_Audio" ,"06_Projects", "07_Ref", "08_Tools"];
var newStruct = []; var newStruct = [];
var projectItems = []; var projectItems = [];
@@ -126,6 +123,5 @@ if (typeof(YTB)=='undefined')
} }
else else
{ {
YTB.addTool(new YSetProjectTool()); ySetProjectTool = YTB.addTool(new YSetProjectTool());
} }
>>>>>>> 841484771586f75c140288b329d54c96d3cb3925
+71 -13
View File
@@ -1,16 +1,12 @@
#include "../yScripts/y_JSExtensions.jsx"; #include "../yScripts/y_JSExtensions.jsx";
function YGenericTool() function YStopMotionLayer()
{ {
this.info = this.info =
{ {
<<<<<<< HEAD name : "YStopMotionLayer",
name : "yStopMotion", version : 0.11,
=======
name : "yGenericTool",
>>>>>>> 841484771586f75c140288b329d54c96d3cb3925
version : 0.1,
stage : "development", stage : "development",
description : "Dynamically change layer sequence opacity from a slider in pComp", description : "Tool to create a sprite-like behaviour with a composition.",
url : "yorchnet.com" url : "yorchnet.com"
}; };
this.appearence = this.appearence =
@@ -21,6 +17,8 @@ function YGenericTool()
this.resources = this.resources =
{ {
icon : new File('yNet.png'), icon : new File('yNet.png'),
e_0000 : "There are no comps in project.",
e_0001 : "No Comps selected."
}; };
this.init = function init() this.init = function init()
{ {
@@ -68,15 +66,75 @@ function YGenericTool()
this.window.center(); this.window.center();
this.window.show(); this.window.show();
} }
/** MEAT **/
this.yApplyStopMotionLayer = function yApplyStopMotionLayer(){
myName = "yStopMotionLayer";
myVer = "0.2a";
nComps = app.project.items.length;
app.beginUndoGroup(myName);
if(nComps>0){
sel = app.project.activeItem.selectedLayers; //array containing selection;
if(sel.length == 1&&sel[0].source!= null){
myItem = sel[0].source;
myItemType = myItem.typeName;
if(myItemType!="Composition"){
alert(e_0001,myName+' '+myVer);
}else{
sliderCtrl = sel[0]("Effects").addProperty("Slider Control");
sliderCtrl.name = "Animation State"; //should check for previously created sliders named the same and name uniquely accordingly.
txtExpression = 'myLayer = thisLayer;myComp =comp(myLayer.name);\
max = myComp.numLayers;\
myValue = effect("'+sliderCtrl.name+'")("'+sliderCtrl("Slider").name+'");\
if(myValue<=max&&myValue>1){\
parseInt(myValue)\
}else if (myValue>max){\
max\
}else if(myValue<1){1}';
//'l = thisComp.layer('+'"'+app.project.activeItem.selectedLayers[0].name+'"'+');'+'fromWorld(l.toComp(l.transform.anchorPoint))';
sliderCtrl("Slider").expression = txtExpression;
sliderCtrl("Slider").setValue(1);
txtExpression = null;
nLayers =myItem.numLayers;
txtExpression = 'extValue = comp("'+sel[0].containingComp.name+'").layer("'+myItem.name+'").effect("'+sliderCtrl.name+'")("'+sliderCtrl("Slider").name+'");if(extValue == thisLayer.index){100}else{0}';
for (z=1;z<=nLayers;z++){
myItem.layer(z).opacity.expression=txtExpression;
}
txtExpression = null;
}
}else{
alert( this.resources.e_0001,myName+' '+myVer);
}
}else{
alert(this.resources.e_0000,myName+' '+myVer+" : Error");
}
app.endUndoGroup();
}
/**/
this.yMainFunction = function yMainFunction() this.yMainFunction = function yMainFunction()
{ {
this.createUI(); //this.createUI();
this.YStopMotionLayer();
} }
this.activate = function activate() this.activate = function activate()
{ {
this.yTool.yMainFunction(); yStopMotionLayer.yApplyStopMotionLayer();
//this.yMainFunction();
} }
this.init(); this.init();
return this; return this;
} }
@@ -84,10 +142,10 @@ function YGenericTool()
//CHECKS that the toolbox exists, and if it doesn´t it runs the script on its own. //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')
{ {
yGenericTool = new YGenericTool(); yStopMotionLayer = new YStopMotionLayer();
yGenericTool.activate(); yStopMotionLayer.activate();
} }
else else
{ {
YTB.addTool(new YGenericTool()); yStopMotionLayer = YTB.addTool(new YStopMotionLayer());
} }