Forum Replies Created

Page 8 of 11
  • You can calculate the number of frames of each comp like this:

    var curCompFrames = curComp.duration/curComp.frameDuration;

  • Miguel De mendoza

    March 25, 2016 at 10:26 am in reply to: Expression to change Mask Bounding box values

    No, you cant acces mask sha attributes by expressions. Maybe you achieve something similar by precomping a solid with the mask shape you want, put it above the layer you want to mask and make an alpha trak mat. The you can control the scale values of your matte with a slider.

  • Miguel De mendoza

    March 22, 2016 at 10:26 am in reply to: Time remap expression and slider

    Is a little confusing what you are trying to achieve for me, but I can tell you that you cant’t change the duration of any composition by expression, for that you need to use a script.

    [Adam Greenberg] “The time remap expression will alter the speed from 10;00;00;25 to 10:00:03:11 ) and that is exactly what I want.

    The other part of the math I am having a hell of a time with; is that this slider will have a decimal point. So let us say that the user enters 7.17 as the input value into the slider.

    I want this to represent 7 seconds and 17 frames which logically would give me a time code of 10;00;07;16 ) because the comp starts at 10;00;00;00;00”

    A simplest way to achieve that is to converting the input value to string and then split the string:

    sliderVal = thisComp.layer("sliderLayer").effect("Slider Control")("Slider").value;
    stringVal = sliderVal.toString();
    timeFrames = stringVal.split(".");

    At that point you only need to map the frame value (timeFrames[1]) to your framerate.

  • Miguel De mendoza

    March 22, 2016 at 10:08 am in reply to: Expression to control font

    As far as I Know, you can’t acces the font attributes by expressions, you must do it by scritpt. Maybe you must change the scale of the text layers instead of font size.

  • Miguel De mendoza

    March 17, 2016 at 10:58 pm in reply to: Adding a value to object position in Xpresso

    Thanks Adam, I didn’t tell that the value I wan to add is changing over time(I’n new in Xpresso sorry), so on each frame it adds the new position, and the object falls to the infinite. However, I found an easiest solutinon while trying what you say, I simply nested my object into a null. Thanks for help!

  • Can you write the full error code?

  • Yes, it can be done by many ways. The key is to stablish a way to find the correct layer on each comp. Let’ say that you always have your song in the last layer of each comp, you can do this:

    var proj = app.project;

    function chageCompsDuration() {
    var selectedComps = proj.selection;
    if(selectedComps.length == 0) {
    alert("Select one or more comps");
    }

    for (var i = 0; i < selectedComps.length; i++){
    var curComp = selectedComps[i];
    var layerIndex = curComp.layers.length; //change this for other search type
    var audioLayer = curComp.layer(layerIndex);

    if( audioLayer.hasAudio == false || audioLayer.hasVideo == true) {
    alert("Layer" + audioLayer.name + "in Comp" + curComp.name + "is not an audio file");
    }

    curComp.duration = audioLayer.source.duration;
    }
    }

    chageCompsDuration()

    Then you only have to select the comps you want to change and run the script (or use the function in a onClick event, anywhere you want).

  • Is there any reason you want to do it through a script?

    According to the screenshot you’ve uploaded, you can do it by simply dragging the audio tracks from your project panel on the Create comp icon, or by right click on the tracks and click on “Create comps from selection”

  • Miguel De mendoza

    February 11, 2016 at 1:34 pm in reply to: Linking 2D and 3D layers for character rig

    At first, you must write “toComp” instead of “to_comp”.
    Second, do you need to call toWorld instead toComp, because you are geting a 3D value.
    But I think the real problem is the perspective, because I can see that the arm you are trying to link is bigger than the back arm.
    I think the best way to solve it(and the normal way to animate characters) is to animate character movements inside a character comp, where all the components are 2d, and make this comp 3d in your scene.

  • Miguel De mendoza

    February 9, 2016 at 11:20 am in reply to: Position layers in groups

    What you must do is to add a multiplier for each bar and group. Let’s say you have group 1, group 2 and group 3. Name each bar like this “bar_1_1”, “bar_2_1”, “bar_1_2”, etc… (first number for bar number and second for group number. Now you have to do two things: get the multipliers for each bar, and add two slider controls to your “Layout” layer: “bar_separation”, “group_separation”. Now you can write this:

    barSpacing = thisComp.layer("Layout").effect("bar_spacing")("Slider");
    groupSpacing = thisComp.layer("Layout").effect("group_spacing")("Slider");

    multipliers = name.split("_");
    barNum = multipliers[1];
    groupNum = multipliers[2];

    spacing = (barSpacing * barNum) + (groupSpacing * groupNum);
    //.... the rest of your code.

Page 8 of 11

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