Forum Replies Created

Page 4 of 10
  • Steve Sierra

    May 10, 2017 at 2:23 pm in reply to: Display the name of the next visible layer below

    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 !
    😉

  • Steve Sierra

    May 8, 2017 at 5:39 pm in reply to: Radio buttons

    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 !

  • Steve Sierra

    May 8, 2017 at 3:12 pm in reply to: Range control by slider

    I see…
    I’ll look into it, but it seems a bit complicated for me.

    I’ll keep you posted !
    Good luck 😉

  • Steve Sierra

    May 8, 2017 at 2:05 pm in reply to: Range control by slider

    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 !
    😉

  • Steve Sierra

    May 8, 2017 at 1:23 pm in reply to: Radio buttons

    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 !

  • Steve Sierra

    May 8, 2017 at 12:54 pm in reply to: Radio buttons

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

  • Steve Sierra

    May 5, 2017 at 5:47 pm in reply to: Circle Chart – Expression

    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 !

  • Steve Sierra

    May 4, 2017 at 1:46 pm in reply to: x position move randomly
  • How 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 &lt; InTime +p){x}
    if(time > n){y}

Page 4 of 10

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy