mirror of
https://github.com/jorgevasquezp/AFX_yTools.git
synced 2026-08-16 15:30:59 +00:00
Brought the yStopMotionLayer to the new codebase.
This commit is contained in:
@@ -121,4 +121,4 @@ YTB.init();
|
||||
#include "../yScripts/y_BindBetween2.jsx";
|
||||
#include "../yScripts/y_CPOffset.jsx";
|
||||
#include "../yScripts/y_puppetRig.jsx";
|
||||
#include "../yScripts/y_GenericNewScript.jsx";
|
||||
#include "../yScripts/y_stopMotionLayer.jsx";
|
||||
|
||||
@@ -93,7 +93,7 @@ function YBindBetween2()
|
||||
}
|
||||
this.activate = function activate()
|
||||
{
|
||||
this.yTool.yMainFunction();
|
||||
yBindBetween2.yMainFunction();
|
||||
}
|
||||
this.run = function run()
|
||||
{
|
||||
@@ -212,5 +212,5 @@ if (typeof(YTB)=='undefined')
|
||||
}
|
||||
else
|
||||
{
|
||||
YTB.addTool(new YBindBetween2());
|
||||
yBindBetween2 = YTB.addTool(new YBindBetween2());
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ function YColorProbe()
|
||||
}
|
||||
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.
|
||||
try
|
||||
@@ -124,5 +124,5 @@ if (typeof(YTB)=='undefined')
|
||||
}
|
||||
else
|
||||
{
|
||||
YTB.addTool(new YColorProbe());
|
||||
yColorProbe = YTB.addTool(new YColorProbe());
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ function YPuppetRigTool()
|
||||
this.info =
|
||||
{
|
||||
name : "yPuppetRig",
|
||||
version : 0.1,
|
||||
version : 0.0,
|
||||
stage : "development",
|
||||
description : "Tool to create nulls at puppet pin locations, and link the latter to the former.",
|
||||
url : "yorchnet.com"
|
||||
@@ -98,7 +98,7 @@ function YPuppetRigTool()
|
||||
}
|
||||
this.activate = function activate()
|
||||
{
|
||||
this.yTool.yMainFunction();
|
||||
yPuppetRigTool.yMainFunction();
|
||||
}
|
||||
|
||||
/**/
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#include "../yScripts/y_JSExtensions.jsx";
|
||||
function YGenericTool()
|
||||
function YStopMotionLayer()
|
||||
{
|
||||
this.info =
|
||||
{
|
||||
name : "yGenericTool",
|
||||
name : "YStopMotionLayer",
|
||||
version : 0.1,
|
||||
stage : "development",
|
||||
description : "Generic script to use as a base for new tools.",
|
||||
description : "Tool to create a sprite-like behaviour with a composition.",
|
||||
url : "yorchnet.com"
|
||||
};
|
||||
this.appearence =
|
||||
@@ -17,6 +17,8 @@ function YGenericTool()
|
||||
this.resources =
|
||||
{
|
||||
icon : new File('yNet.png'),
|
||||
e_0000 : "There are no comps in project.",
|
||||
e_0001 : "No Comps selected."
|
||||
};
|
||||
this.init = function init()
|
||||
{
|
||||
@@ -64,15 +66,75 @@ function YGenericTool()
|
||||
this.window.center();
|
||||
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.createUI();
|
||||
//this.createUI();
|
||||
this.YStopMotionLayer();
|
||||
}
|
||||
this.activate = function activate()
|
||||
{
|
||||
this.yTool.yMainFunction();
|
||||
yStopMotionLayer.yApplyStopMotionLayer();
|
||||
//this.yMainFunction();
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.init();
|
||||
return this;
|
||||
}
|
||||
@@ -80,10 +142,10 @@ function YGenericTool()
|
||||
//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();
|
||||
yStopMotionLayer = new YStopMotionLayer();
|
||||
yStopMotionLayer.activate();
|
||||
}
|
||||
else
|
||||
{
|
||||
YTB.addTool(new YGenericTool());
|
||||
yStopMotionLayer = YTB.addTool(new YStopMotionLayer());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user