Reorganized some functions on corresponding scripts to make it clearer of what was supposed to go in each one

yorchnet
Jorge Vásquez Pérez 9 years ago
parent 631cb8f607
commit b038e66615

@ -81,6 +81,7 @@ 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 );
@ -92,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;
@ -117,8 +119,10 @@ YTB =
YTB.init(); YTB.init();
#include "../yScripts/y_setStructure.jsx"; #include "../yScripts/y_setStructure.jsx";
#include "../yScripts/y_CompHerder.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_stopMotionLayer.jsx"; #include "../yScripts/y_stopMotionLayer.jsx";

@ -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');
}
}

@ -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];

File diff suppressed because one or more lines are too long

@ -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');
}
}

Loading…
Cancel
Save