Forum Replies Created

Page 5 of 11
  • Unfortunately you can`t access comp instances directly by expressions. You can access to any comp by comp(“compName”), so you can can trick it a little bit using the names of the comps and layers and the magic function split(), to make it some kind of “dynamic” reference. Depending on what you want to do it can be more or less complex. In a simple case mainComp_a->childComp_a->someLayer_a you can access mainComp in the layer like this:

    nSplit = name.split("_");
    refCompName = "mainComp_" + nSplit[nSplit.length -1];
    refComp = comp(refCompName);

  • Miguel De mendoza

    April 14, 2016 at 4:10 pm in reply to: Offset shape scale animation

    Use valueAtTime() function on shape scale property:

    offsetTime = 0.5 * index
    thisComp.layer(“sliderLayer”).effect(“Your Slider”)(“Slider”).valueAtTime(time – offsetTime)

  • Miguel De mendoza

    April 14, 2016 at 3:33 pm in reply to: Pick-whip nested comp name expression

    split() function splits a string by the character passed as an argument, and it returns one array of x length, in that case length of 2. Accesing to the array nameSplit[nameSplit.length -1 ] is only to ensure that you are accesing the last element of the array, so you can write more complex names like “Yellow_fish_character_1” and still getting the correct number of the name.

  • Miguel De mendoza

    April 14, 2016 at 3:07 pm in reply to: Delay effect with Slider Control?

    I mean change all “+ value[1]” value, not only the number : value[100] incorrect:

    pos=thisComp.layer(“CONTROL”).effect(“pos”)(“Slider”);
    x = value[0];
    y = thisComp.layer (index+1).transform.position.valueAtTime(time-pos)[1] + 100; //<—this is the right change to do
    [x,y]

    But with the value[1] instead of a fixed number, you can position your layers where you want in y axis, and still mantain the offset, it depends on you.

  • Miguel De mendoza

    April 14, 2016 at 2:59 pm in reply to: Pick-whip nested comp name expression

    I see, you have to do the inverse of what I told you XD. There are little erros on your code too, so I think is better to see how it works in the project:

    9977_9976expressionstestedited.aep.zip

    As you can see, tha sliders on the main comp, work independent with the same expression inside of the comps.

  • Miguel De mendoza

    April 12, 2016 at 4:06 pm in reply to: Delay effect with Slider Control?

    Sorry, I forget to add the y value to the y variable:

    pos=thisComp.layer(“CONTROL”).effect(“pos”)(“Slider”);
    x = value[0];
    y = thisComp.layer (index+1).transform.position.valueAtTime(time-pos)[1] + value[1];
    [x,y]

    You can change value[1] on the 3rd line by whatever you want ex 100, try diferent alues to see what happends. The reason for using value[1] is for “unlocking” the y axis so you can positionate it manualy where you want.

  • Miguel De mendoza

    April 12, 2016 at 11:07 am in reply to: Pick-whip nested comp name expression

    I think the best way is using split() function. Let’s say you have a character comp named”Character_1″, with all that expressions and controls inside it. Put your character on a scene comp and then you can write this code above all your linked properties :

    nameSplit = thisComp.name.split("_");
    characterNum = nameSplit[nameSplitLength -1];
    selfComp = "Character_" + characterNum;

    Then, you can use the selfComp variable to link the properties to the self comp:

    masterPosition = comp(selfComp).layer("myLayer").transform.position;

    At this point, you can setup one character and then duplicate it on the project, ensuring that the name changes from “Character_1” to “Character_2”, “Character_3” etc. Now you can duplicate your character layer in the main comp and alt+drag the correspondig character comp to his layer.

  • Miguel De mendoza

    April 12, 2016 at 9:42 am in reply to: movement control km/h or miles/h

    Ok, delete the “//” (comment) of the first variable:
    speedValue = thisComp.layer("speed_(slider control)").effect("Slider Control")("Slider");
    offset = 50;// tweek this to correct positioning
    x = (speedValue >= 100)? value[0] + offset: value[0];
    [x, value[1]]

  • Miguel De mendoza

    April 12, 2016 at 9:03 am in reply to: Delay effect with Slider Control?

    Try this:
    pos=thisComp.layer("CONTROL").effect("pos")("Slider");
    x = value[0];
    y = thisComp.layer (index+1).transform.position.valueAtTime(time-pos)[1];
    [x,y]

  • Miguel De mendoza

    April 12, 2016 at 8:54 am in reply to: movement control km/h or miles/h

    Can you paste here the code from your project?

Page 5 of 11

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