Forum Replies Created

Page 9 of 11
  • Miguel De mendoza

    February 8, 2016 at 10:21 am in reply to: Walk cycle speed

    Maybe do you need to use a “cycle” loop:

    loopOut("cycle",0)

  • You cant`t change a layer outpoint via expressions, you must do it by script. But if you only have to do it once per day, the best way is mouse+shift.

  • Miguel De mendoza

    January 18, 2016 at 3:31 pm in reply to: Combining 2 expressions on a slider control

    You can change the random() min parameter to 2 like this:
    Math.floor(random(2,index));

    Or you can check the value with an if statement:
    duration = .125; //length of each cut (seconds)

    seed = Math.floor(time/duration) + 1;
    seedRandom(seed,true);
    randomValue = Math.floor(random(1,index));

    val = (randomValue < 2) 2: randomValue;

  • Miguel De mendoza

    December 17, 2015 at 2:00 pm in reply to: how to pick scale and position

    Write this on the number scale then:

    arrowPos = thisComp.layer("arrow").transform.position[1];
    if (arrowPos > 500) {
    [100, 100];
    } else {
    [50, 50];
    }

  • Miguel De mendoza

    December 17, 2015 at 1:16 pm in reply to: how to pick scale and position

    Try this:

    max = thisComp.height;
    magnitude = 0.1;
    masterPos = transform.position[1]; //Or the position you want to follow
    posY = (masterPos - max)* magnitude ;

    [posY, posY]

  • You can use a name sufix. For example, do you want to instantiate 100 odometer comps, you can create one odometer comp “Odometer_1”. Now you can write something like this:

    try {
    nameSplit = name.split("_");
    ind = nameSplit[nameSplit.length - 1];
    pippo = comp("lots_of_counters").layer("counter_" + ind).effect("Slider Control")("Slider");
    } catch (err) {
    }

    At this point you can duplicate the comp and do the same for the layers do you want to reference: “counter_1”, “counter_2″….

  • There are some erros on your code.
    First of all,using a try/catch statement to check if a layer have a property is not the best way:
    // If the layer has the property, invoke the function with the property as input
    try{//wrong
    myProperty = myLayer.property("sourceText");
    convertToKeyframes(myProperty);
    }catch(err){
    }

    You must do it by a if/else statement, and in your case, what you need to check is if the current layer is a TextLayer object, because all text layers must have a sourceText property.

    Second you are trying to access sourceText property on a wrong way. You must access it using full property spec, and it’s better to use the matchName instead of the name:

    if(myLayer instanceof TextLayer){
    myProperty = myLayer.property(" ADBE Text Properties").property("ADBE Text Document");
    //Do stuff
    }

    Other thing I can see is if you want to do this for multiple comps you must encapsulate your code on a function with the current comp as parameter, and then iterate throug the comps:

    function bakeExpressions(curComp){
    // Check if something is selected and if selection it is a Composition...
    //...
    }
    selection = app.project.selection;

    for(var curComp in selection){
    bakeExpressions(curComp);
    }

  • Miguel De mendoza

    November 25, 2015 at 1:48 pm in reply to: Time Remap expression for multiple keyframes

    Maybe this aproach is what do you need:
    https://motionscript.com/design-guide/marker-sync.html

  • Look at this post: https://forums.creativecow.net/thread/227/30494

    You can tweek it to change any property of any layer. Here is an example on how I use this tecchnique:

    As you can see on top, there are various ‘master’ comps named “triangles_n”. You only need to set the triangles(or any layer) position where do you want on each ‘master’ comp and then control the animations by the marker comment.

  • Can you copy here the full error code?

Page 9 of 11

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