Forum Replies Created

Page 956 of 1081
  • Dan Ebberts

    October 20, 2007 at 7:45 pm in reply to: creating a layer accordion

    I can’t picture exactly what you’re after, but this should help. Say you have a bunch of 3D solids, arranged left to right with edges just touching. You move each anchor point to the left edge of the solid. Starting on the left, you make each solid the parent of the one to its right. You then apply this expression to the y rotation property of the second solid from the left:

    -2*parent.transform.yRotation

    All the others (except the left-most, which has no expression) get this expression:

    -parent.transform.yRotation

    Then as you adjust the y rotation of the left-most solid, the others will do the accordion thing.

    Dan

  • Dan Ebberts

    October 20, 2007 at 4:16 pm in reply to: 2 sliders that change height and width on 1 layer?

    “height” and “width” are reserved words (use for the layer’s height and width), so try this instead:

    h = thisComp.layer(“slider1”).effect(“Both Channels”)(“Slider”);
    w = thisComp.layer(“slider2”).effect(“Both Channels”)(“Slider”);
    value+[w, h]

    I haven’t tested it, but it should work.

    Dan

  • Dan Ebberts

    October 19, 2007 at 10:49 pm in reply to: expression for switching between compositions

    A simple way would be to put all the precomps in a master comp, add a slider control to a null (“Null 1”), and add this expression to the opacity of the precomps:

    slider = Math.round(thisComp.layer(“Null 1”).effect(“Slider Control”)(“Slider”) );
    if (slider == index) 100 else 0;

    Then each layer will be visible when its layer index matches the slider, invisible otherwise.

    Dan

  • Dan Ebberts

    October 19, 2007 at 9:54 pm in reply to: Detecting an object’s direction change

    1) Not exactly. The tolerence variable is the amount (in radians) that the angle has to change from the previous half frame to be considered as having changed direction.

    2) Velocity is a vector that contains the speed and direction of movement. It’s stored as an x component and a y component. Using Math.atan2(), you can use those components to calculate the angle (relative to the world coordinate system) of movement at that moment.

    Dan

  • Dan Ebberts

    October 19, 2007 at 4:51 pm in reply to: Detecting an object’s direction change

    I think I’d do something like this – this opacity expression sets the opacity to 50% when the layer has changed direction by more than the angle tolerance setting over the period defined by delta (half a frame in this case):

    delta = thisComp.frameDuration/2;
    tolerance = .05;
    v1 = transform.position.velocity;
    angle1 = Math.atan2(v1[1],v1[0]);
    v2 = transform.position.velocityAtTime(time-delta);
    angle2 = Math.atan2(v2[1],v2[0]);

    if (Math.abs(angle1 – angle2) > tolerance) 50 else 100;

    Hopefully that helps.

    Dan

  • Dan Ebberts

    October 19, 2007 at 1:14 am in reply to: Expression Using Midi

    Well, you could certainly construct a script that would read a midi file and generate keyframes. It would be a bit of work, so you’d need a reason to do it. 🙂

    Dan

  • Dan Ebberts

    October 18, 2007 at 8:45 pm in reply to: Flying text

    Try something like this. Create you list of words in a text editor, like this:

    word1
    word2
    word3
    word4
    etc.

    Paste that into a text layer that’s directly above (in the layer stack) your flying word layers. Name it “master text” and turn off its visibility. Then paste this expression into the Source Text propetry of each of your word layers:

    masterText = thisComp.layer(“master text”);
    s = masterText.text.sourceText.split(String.fromCharCode(13));
    s[index – masterText.index – 1]

    Dan

  • Dan Ebberts

    October 18, 2007 at 8:21 pm in reply to: Expression Using Midi

    Do you mean you want to be able to control an expression in real time from a midi device? No way to do that I can think of.

    The best you could hope to do is to capture the midi data, store it as text in a text layer and write a huge expression to parse the midi data. It would be really slow and inefficient because the expression would probably have to go through the whole file on each frame to figure out what it should be doing.

    You might be able to do something useful with a script, but it wouldn’t be in real time.

    Dan

  • Dan Ebberts

    October 17, 2007 at 9:00 pm in reply to: Toggle On/Off multiple checkboxes?

    Are you trying to make a radio button control by linking check boxes together with expressions? I don’t think that will work because an expression applied to a check box would only have access to its own pe-expression value and its neighbors post-expression values. I can’t think of way to make that work.

    Maybe you could use a slider instead.

    Dan

  • Dan Ebberts

    October 17, 2007 at 3:23 pm in reply to: Autoorientcamera script doesnt work

    Hard to say. You might try contacting the guy that wrote the script. Sorry.

    Dan

Page 956 of 1081

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