Steve Sierra
Forum Replies Created
-
Hi,
I think this will work :
a = thisLayer.index;
b = thisComp.numLayers;
for(i = a+1; i <= b; i++){
curLay = thisComp.layer(i);
if(curLay.inPoint < time){
curLay.name;
break;
}
}Cheers !;)
-
Hi,
I haven’t seen it yet, but it sounds like this could maybe help you :
https://www.provideocoalition.com/after-effects-extendscript-training-ep-16
Good luck !
😉 -
Ok,
I found my error for the radio buttons… I had to redefine my variables for they were sliders and I had added other effects in the meantime.
So there was no error with the radio buttons ????
Cheers !
-
I see…
I’ll look into it, but it seems a bit complicated for me.I’ll keep you posted !
Good luck 😉 -
Hi,
You can put this in your property :
n1=thisComp.layer(“01”).sourceRectAtTime().width;
n2=thisComp.layer(“02”).sourceRectAtTime().width;
n3=thisComp.layer(“03”).sourceRectAtTime().width;
s = effect(“Slider Control”)(“Slider”);if(s<33){
max = Math.max(n1,n2,n3);
}else{
if(s>33 && s<66){
max = Math.max(n1,n2);
}else{
max = Math.max(n1);
}
};Hope this works for you !
😉 -
Hi Dan,
Thanks ! That works in deed.
I only need to parse width and height. It seems pixelAspectRatio, duration and frameRate are automatically read as numbers…
Is there a special rule for this ?Is there a similar rule I am not applying with my radio buttons ?
Thanks again for your time.
Cheers !
-
Hi again,
I’ve come upon a new problem while learning UI building…
I’m just trying to have a simple comp created… but it seems my width and height variables block everything and I can’t figure out why. All the other variables work (the ignored line of code works fine).
Thanks for any help !
😉{
function myScript(thisObj) {
function myScript_buildUI(thisObj) {
var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "NEW COMP", [0, 0, 600, 600]);res = "group{orientation:'column', alignment:['fill', 'fill'], alignChildren:['fill', 'fill'],\
compPanel: Panel{text:'Comp Settings', orientation:'column', alignChildren:['fill', 'fill'],\
nameGroup : Group{text:'Comp Name', orientation:'row', alignChildren:['left', 'fill'],\
cName: EditText{text:'New Comp'},\
cNameStaticText: StaticText{text:'Comp Name'},\
},\
widthGroup : Group{text:'Comp Width', orientation:'row', alignChildren:['left', 'fill'],\
cWidth: EditText{text:'1920'},\
cWidthStaticText: StaticText{text:'Comp Width'},\
},\
heightGroup : Group{text:'Comp Height', orientation:'row', alignChildren:['left', 'fill'],\
cHeight: EditText{text:'1080'},\
cHeightStaticText: StaticText{text:'Comp Height'},\
},\
pixelGroup : Group{text:'Comp PixAsp', orientation:'row', alignChildren:['left', 'fill'],\
cPA: EditText{text:'1'},\
cPAStaticText: StaticText{text:'Comp PixelAspect'},\
},\
durGroup : Group{text:'Comp Dur', orientation:'row', alignChildren:['left', 'fill'],\
cDur: EditText{text:'5'},\
cDurStaticText: StaticText{text:'Comp Duration'},\
},\
FPSGroup : Group{text:'Comp FPS', orientation:'row', alignChildren:['left', 'fill'],\
cFPS: EditText{text:'25'},\
cFPSStaticText: StaticText{text:'Comp FPS'},\
},\
},\
buttonGroup: Group{text:'Go', orientation:'column', alignChildren:['fill', 'fill'],\
myButton: Button{text:'Make New Comp'},\
},\
}"// Adds resource string to panel
myPanel.grp = myPanel.add(res);// Defaults
// Assign function to UI elements
myPanel.grp.buttonGroup.myButton.onClick = function (){app.beginUndoGroup("NewComp");
var ncName = myPanel.grp.compPanel.nameGroup.cName.text;
var ncWidth = myPanel.grp.compPanel.widthGroup.cWidth.text;
var ncHeight = myPanel.grp.compPanel.heightGroup.cHeight.text;
var ncPixel = myPanel.grp.compPanel.pixelGroup.cPA.text;
var ncDuration = myPanel.grp.compPanel.durGroup.cDur.text;
var ncFPS = myPanel.grp.compPanel.FPSGroup.cFPS.text;var newComp = app.project.items.addComp(ncName, ncWidth, ncHeight, ncPixel, ncDuration, ncFPS);
//var newComp = app.project.items.addComp(ncName, 1000, 1000, ncPixel, ncDuration, ncFPS);app.endUndoGroup();
}
// Setup panel sizing and make panel resizable
myPanel.layout.layout(true);
myPanel.grp.minimumSize = myPanel.grp.size;
myPanel.layout.resize();
myPanel.onResizing = myPanel.onResize = function () {this.layout.resize();}return myPanel;
}// Build script panel
var myScriptPal = myScript_buildUI(thisObj);if ((myScriptPal != null) && (myScriptPal instanceof Window)) {
myScriptPal.center();
myScriptPal.show();
}
}// Execute script
myScript(this);
}
-
Hi,
There must be an expression that does the job for you, but I was just thinking you could take your problem backwards :
Have the background be the light green (full circle), and have the strokes be the dark green lines. That way, you would only need to deal with a repeater and a mask.
But as I said, there must be an expression to do it your way as well ????
Good luck !
-
If you want to go with expressions, you may be able to use this :
https://www.provideocoalition.com/expression_shorts_-_swinging_motion_-_mathsin_part_1/
https://www.provideocoalition.com/expression_shorts_-_swinging_motion_-_mathsin_part_2/Cheers !
-
Steve Sierra
May 4, 2017 at 1:39 pm in reply to: Auto position animation at the end of the compositionHow about this :
InTime = thisLayer.inPoint;
InFrames = timeToFrames(InTime);
m = timeToFrames(thisLayer.source.duration) + InFrames – 20;
n = framesToTime(m);
p = framesToTime(20);
x = ease(time ,InTime, InTime+p, [960, -540], [960, 540]);
y = ease(time ,n, n+p, [960, 540], [960, -960]);if(time < InTime +p){x}
if(time > n){y}InTime = thisLayer.inPoint;
InFrames = timeToFrames(InTime);
m = timeToFrames(thisLayer.source.duration) + InFrames - 20;
n = framesToTime(m);
p = framesToTime(20);
x = ease(time ,InTime, InTime+p, [960, -540], [960, 540]);
y = ease(time ,n, n+p, [960, 540], [960, -960]);if(time < InTime +p){x}
if(time > n){y}