Posts by felt_tips

5315 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Helps us moderate the forums
  • Had an item that became a weekly top seller
  • Became a Top 20 Author of the Month
+13 more
felt_tips
Moderator
says

Instead of using the linear() function use the ease() function, or the easeIn() function, or easeOut function. They work just like the linear function, but ease in to / out of the movement as required. If you want different kinds of eases (double eased or cubic for instance), you can easily write your own little function to do this.


Hi There, I have 2 keyframes both of them are eased ease (Not sure if I can say that in English), what I want to do is connecting the second keyframe to a marker, so the buyers can make the animation faster/slower. I tried this expression
L = thisLayer;

if ((L.marker.numKeys > 0) && (numKeys > 1)){ 
   t1 = key(1).time; 
   t2 = L.marker.key(1).time; 
   val1 = valueAtTime(key(1).time); 
   val2 = valueAtTime(key(2).time); 
   linear(time,t1,t2,val1,val2);

} else { 
  value;
}
But the problem is that I lose the easiness of the animation because of linear() function. Is there anyway to do that?
5315 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Helps us moderate the forums
  • Had an item that became a weekly top seller
  • Became a Top 20 Author of the Month
+13 more
felt_tips
Moderator
says

Epic thread!

I agree essentially with the OP, but this is actually just a symptom of the way items are searched and the name is a big ingredient in that mix. Unique names are much more fun, but they tend to rank badly in the search results and an invisible project is a project with no sales. Hence all those trends. And don’t forget that some of those projects were using those terms before they were trends.

For that reason, I wouldn’t necessarily assume that an “epic” or “dynamic” project is an uncreative one.

5315 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Helps us moderate the forums
  • Had an item that became a weekly top seller
  • Became a Top 20 Author of the Month
+13 more
felt_tips
Moderator
says
5315 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Helps us moderate the forums
  • Had an item that became a weekly top seller
  • Became a Top 20 Author of the Month
+13 more
felt_tips
Moderator
says

Hi there! So i uploaded this little 2D animation: https://youtu.be/7LDbPYJ2yX8 and it was rejected. The reason of rejection was not very clear so i need some feedback and help on what can i improve. thank you )

The animation is good, and I also think an area that Videohive could use more of.

The reason for rejection is probably more likely the usefulness of what you have made. What actually is the usefulness of a 2 second loop animation of a wolf running? If you had lots of other wolf animations that the user could then join together, it suddenly becomes more useful. If you can put it together into a wolf-presenter presentation, then it gets more useful still.

The problem is that that’s a lot of work and you’d need to think carefully about what the demand is for wolf animations at all. I personally like the wolf, and I think if you were to work on your concept and think about your customers and how you can sell this wolf idea to them, it could be great.

Remember, in most successful cartoons the characters are first and foremost characters – they have an identity. You need to build your character’s identity. Similar ideas would be Vectorica’s robot animations on Videohive. They’re 3D, not 2D, but inhabit a similar territory to what I’m talking about.

Perhaps you could take a similar approach. Expand on your wolf character to make a super short presentation – perhaps a logo or a greeting – 10 seconds long. And if that’s successful, work it up into something more complete.

Also consider saving off a series of stills of your character for Graphic River. How about some close-ups and facial expressions too?

But don’t get disheartened. Rome wasn’t built in a day.

5315 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Helps us moderate the forums
  • Had an item that became a weekly top seller
  • Became a Top 20 Author of the Month
+13 more
felt_tips
Moderator
says

‘Scuse the delay, Efekt. I’ve been a bit busy. Actually, not true. I’ve been a bit lazy. :-)

Here’s the code. Put it on the time remap. I’ll come back and explain later. I’ve annotated the code, so you can probably work out what’s going on.

L = thisLayer; 
Src = L.source;
SrcDur = Src.duration;
LDur = L.outPoint-L.inPoint;

SrcInDur = 2; //the duration of the in animation
SrcOutDur = 2; //the duration of the out animation
SrcLoopDur = SrcDur-SrcInDur-SrcOutDur; //the rest is the loop

if(time < L.inPoint+ SrcInDur) { //in animation
    tSampleT = value; //sample time is just the value
} else if(time > L.outPoint-SrcOutDur) { //out animation
    LOutElapsed = time - (L.outPoint-SrcOutDur);
    tSampleT = SrcDur-SrcOutDur + LOutElapsed;
} else {
    // the loop in the middle

    LLoopDur = LDur - SrcInDur - SrcOutDur; //the duration of the loop bit
    LNumLoops = Math.floor(LLoopDur/SrcLoopDur); //how many whole loops fit?
    LNumLoops = Math.max(1, LNumLoops); //Make sure it's at least 1
    //Below: how much to stretch the loops by to fill the gap
    LLoopStretchFactor = (LNumLoops* SrcLoopDur)/LLoopDur;     
    LLoopElapsed = time-(L.inPoint + SrcInDur); //time elapsed since loop start
    LLoopElapsed *= LLoopStretchFactor; // stretch this time by the stretch factor

    //sample time
    tSampleT = SrcInDur +(LLoopElapsed % SrcLoopDur); // peform a modulo and add the in duration
}
5315 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Helps us moderate the forums
  • Had an item that became a weekly top seller
  • Became a Top 20 Author of the Month
+13 more
felt_tips
Moderator
says

Hi Efekt,

That’s a bit more complicated. I’ll get back to you later on today or tomorrow with an answer. The problem is that you need to work out the nearest number of loops that fit, then you have the option, to 1) finish the whole animation before the out point, but keep it at the right speed, 2) to run the whole animation a bit slower to make it fit perfectly, or 3) just slow down the loop part to fit perfectly. I would favour option 2, but let me know which is better for you.

5315 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Helps us moderate the forums
  • Had an item that became a weekly top seller
  • Became a Top 20 Author of the Month
+13 more
felt_tips
Moderator
says

Perfect! This expression works fine, thank you so much Felt!

Cool. :-)

5315 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Helps us moderate the forums
  • Had an item that became a weekly top seller
  • Became a Top 20 Author of the Month
+13 more
felt_tips
Moderator
says

//On the time remap property
L = thisLayer;
t = time;
animLength = 10;
animLength *= thisComp.frameDuration;
LDur = L.outPoint-L.inPoint;
MidDur = LDur - animLength*2;
if( t>=L.inPoint && t<= L.inPoint+animLength) {t-L.inPoint} 
else if( t>L.inPoint+animLength && t<L.outPoint-animLength) {animLength + (t-L.inPoint+animLength)/MidDur)*(L.source.duration-animLength*2)}
else if(t>=L.outPoint-animLength && t<=L.outPoint) {t-(L.outPoint-animLength)}
else 0;

Hi Felt, I´ve created 2 comps.

Comp1 has keyframes in position, scale and rotation : In: 10 frames Mid: 50 frames Out: 10 frames

So i’ve created a Comp2, just a precomposed Comp1, enabled time remap and applied the expression above. The idea is maintain the in-out animations and stretch the middle, but this message appear:

After Effects warning: Expected: ; Expressiondisabled.

Error ocurred at Line 8.

Comp: ‘Comp2”

Layer: 1(‘Comp1’)

Property: ‘Time remap’

What is wrong here?

Thank you Felt and Amberija!

Hi Diego,

‘Scuse the delay. A little sytax error and a little flaw in the logic. I should test my code out before I post it.

This should work for you…

//On the time remap property
L = thisLayer;
t = time;
animLength = 10;
animLength *= thisComp.frameDuration;
LDur = L.outPoint-L.inPoint;
MidDur = LDur - animLength*2;

if( t>=L.inPoint && t<= L.inPoint+animLength) {
    t-L.inPoint;
} 
else if( t>L.inPoint+animLength && t<L.outPoint-animLength) {
    tRatio = (t-(L.inPoint+animLength))/MidDur;
    animLength + (tRatio * (L.source.duration-animLength*2));
}
else if(t>=L.outPoint-animLength && t<=L.outPoint) {
    L.source.duration + t-L.outPoint;
}
else 0;
5315 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Helps us moderate the forums
  • Had an item that became a weekly top seller
  • Became a Top 20 Author of the Month
+13 more
felt_tips
Moderator
says



FF = 10*thisComp.frameDuration;
if (time=inPoint && time<=inPoint+FF) {time-inPoint}
else if (time=outPoint && time>=outPoint-FF) {thisLayer.source.duration+time-outPoint}
Don’t you mean…
FF = 10*thisComp.frameDuration;
if (time>=inPoint && time<=inPoint+FF) {time-inPoint}
else if (time<=outPoint && time>=outPoint-FF) {thisLayer.source.duration+(time-(outPoint-FF))}

...? You used an = instead of a >= . If you did want to use an ‘equals’ it would need to be a comparative equals, i.e. == . At the moment, you’re setting time to be inPoint and then comparing it to a different value. In the above, both of your if statements will evaluate to false and the expression will always return FF. Also, shouldn’t the time to subtract from the layer source duration be the time past the outPoint- FF, not the time past the outPoint.

With my adjustment above the case where time >inPoint+FF and time <outPoint-FF isn’t really covered. (i.e. when not animating in or out). The expression will currently return the value FF. That’s probably a decent thing to return, but it’s probably good to make it explicit, with the addition of…

else FF;
True words, felt! With this thread and your help I hope I will enhance my expression! I wrote that late night, tested and it worked for me) I like your approach for that solution. But I would also to hear from you – will the length of code reduce speed in viewport. I see it, for example, in bounce expression when there are too many objects evaluated by it.

Longer expressions will generally take longer to evaluate, yes.

As far as I’m aware, there are two stages – first the code needs to be converted (i.e. the plain english you type is translated into a bunch of Javascript ‘tokens’ – computer instructions basically), that series of tokens is then evaluated as a program. I don’t know for certain which takes longer, but I could well imagine it’s the first part.

In that respect, it’s probably a good idea to keep code as short as possible – i.e. with a minimum of fluff, short variable names etc. Also, it’s a very good idea to keep the actual concept of the code efficient. Don’t do a load of unnecessary stuff, and try and think of a succinct way to do things.

Generally though, unless you’re getting up to complex expressions of several 10s of lines long (or even hundreds), that contain tricky stuff like repeats, recursive calls etc. then the execution time isn’t going to be particularly significant.

A good example of where it’s a great idea to keep your code as efficient as possible is coding text animations, where each expressions is iterated for each of the units in your text, for each iteration of motion blur. If you have 40 letters and 48 iterations of motion blur, that’s 1920 times that your expression is going to execute…. PER FRAME. In a 30 second animation, the expression will be evaluated 1.4 million times.

I have a feeling that what changed in the latest version of CC regarding expressions is that the converting stage (stage 1) is now cached, whereas before I suspect they were re-converted with each iteration. Anyway, one way or another expressions got a lot faster recently.

5315 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Helps us moderate the forums
  • Had an item that became a weekly top seller
  • Became a Top 20 Author of the Month
+13 more
felt_tips
Moderator
says

FF = 10*thisComp.frameDuration;
if (time=inPoint && time<=inPoint+FF) {time-inPoint}
else if (time=outPoint && time>=outPoint-FF) {thisLayer.source.duration+time-outPoint}
Don’t you mean…
FF = 10*thisComp.frameDuration;
if (time>=inPoint && time<=inPoint+FF) {time-inPoint}
else if (time<=outPoint && time>=outPoint-FF) {thisLayer.source.duration+(time-(outPoint-FF))}

...? You used an = instead of a >= . If you did want to use an ‘equals’ it would need to be a comparative equals, i.e. == . At the moment, you’re setting time to be inPoint and then comparing it to a different value. In the above, both of your if statements will evaluate to false and the expression will always return FF. Also, shouldn’t the time to subtract from the layer source duration be the time past the outPoint- FF, not the time past the outPoint.

With my adjustment above the case where time >inPoint+FF and time <outPoint-FF isn’t really covered. (i.e. when not animating in or out). The expression will currently return the value FF. That’s probably a decent thing to return, but it’s probably good to make it explicit, with the addition of…

else FF;
by
by
by
by
by
by