# tiscavalcanti

Members

46

1. ## Infinity Loop between two values

footage = comp("Footage").layer(1); IP = footage.inPoint; OP = footage.outPoint; IP+time%(OP-IP); I got it!
2. ## Infinity Loop between two values

Your information is quite useful, I will delve into the links, and in fact, I use video program that uses expressions based on JS ... Look, I just figured out a way to sort this out ... maybe it'll work ... Do you know how I can make a variable go from 0 to 22, and when it reaches 22, return to 0? Type a slide inside the number 22, that is, from 0 to 22, it results in 22, and from 22 to 44 it also results in 22, as if the variable was reset every time it was 22, then 23 would be 1 , and 45, 1 also, and so on.

4. ## Infinity Loop between two values

I need to make a code like this: Initial value 11 Final value 33 I want to insert the code on the property time (that changes) of the program I use So I want the code to interpolate through the time between numbers 11 and 33, meaning this code will move 22 seconds in time I want that when the code results in the final value, that is, arrive at the value 33 It is reinitiated, thus causing an infinite loop. Going from 11 to 33 in 22 seconds and then repeating on and on. There is a codebase that may allow time to be used in a dynamic way: linear (t, tMin, tMax,
5. ## JS Math."middle"

Thanks for your time, my friend. This forum like ever, very efficient. Work very well.
6. ## JS Math."middle"

I want the value of a property of my program, to which this code is entered, is defined by the value of another property that is between two other properties, ie three properties, I do not even want Math.max or Math. min, but the value is between these two.
7. ## JS Math."middle"

Thanks, but I believe which Math.median() don't work in After Effects Software by expression. I get a error ("Math.median is not a function"). I could use if/else but, in my case, the values are not fixed, this value that I show is just example. How i can do this between if/else?
8. ## JS Math."middle"

I want to get the value that is in the center between three values. For example: Math."middle"(34.78, 56.12, 45.54) Result in: 45.54 How I can do this?
9. ## Javascript Checkbox

Perfect, friend; Work very cool! Exactly!
10. ## Javascript Checkbox

Okay! I will make some tests. Thank you very, very much!
11. ## Javascript Checkbox

I want a code which switch a property, that is, toggle between two fixed values; (Checkbox - 1 or 0) If a determined condition is true. For example: a = 1; b = 2; if (a > "CheckBox switch for 1 (if was at 0) or switch for 0 (if was at 1)"; else 0; If "ELSE" is satisfied, and get back to "IF" satisfied; The Checkbox will be with the inverse value of what was before "ELSE". That's what I want. In another example. I will create a situation, step by step: Checkbox is at 0. "IF" is satisfied. Checkbox is at 1. "ELSE" is satisfied. Checkbox is at 0 ("ELSE" always is 0).
12. ## Javascript Checkbox

I really don't know do this. Could you help me anyway?

Yes. Can be.
14. ## Javascript Checkbox

I want to know, if is there any way to javascript change (switch) between two values (1 and 0) in a Checkbox, A code without resulting in a fixed value, its function becomes only toggle value. For example, I need put this in a Property: if (thisComp.layer("Logo").transform.opacity==100) "My Checkbox" (switch) else 0; After Effects Expression
15. ## Optimize Code

Thank you too!
16. ## Optimize Code

This way is interesting: return (yB <xA)? [yB, yB]: [xA, xA]; Could you explain a little more how it works. The use of interrogation, is something new to me.
17. ## Optimize Code

Really, thanks for all, justsomeguy davej Ingolme In fact, I wanted to know different ways of dealing with conditions a little more complex. You all helped me realize how many ways I can do the same thing, that's what I needed really. I expressed myself badly. Thanks again!

Why not?
19. ## Optimize Code

I can do this: function getValue() { switch (true) { case yB < xA: return [yB, yB]; default: return [xA, xA]; } } E = getValue(); if (w > maxWidth || h > textHeight){ x = E[0]; y = E[1]; } [x, y];
20. ## Optimize Code

And something like "switch(true)" work? If not, could edit this code for me, in If/Else same, of a better way? Thanks!
21. ## Optimize Code

Hello, I have created this code: if (w > maxWidth || h > textHeight) { if (y < x) { [y, y] } else { [x, x] } } else { [value[0], value[1]] } It is a piece, but it gives to understand what I want to optimize without the rest. How to modify this code to work with: Switch Statement instead If/Else mode? This is a expression of After Effects. Thanks.
22. ## Functions, Parameters & Conditions

Ok. Good. I needed use a Array in final of code, because After Effects require it. My code was practically perfect. I'm going to change only a few details. Thank you very much!
23. ## Functions, Parameters & Conditions

How to use a "case" statement with two "conditons"? For example: switch(b) {"case 1 or 4:" } Thanks.
24. ## Functions, Parameters & Conditions

Oh, yeah! Thank you very much, help me a lot! This code is my result after many tries, and finally I got it. And with your instructions, will stay very best.
25. ## Functions, Parameters & Conditions

This is it. I'm able, finally. Thanks for your time! w=1920;h=1080;p = [".95", ".90", ".85",".05", ".10",".15"];x=0;y=0;b=3;c=3;function xyFinal(){ function variable(x,y){ if(b==1){ return [x*p[3],y*p[0]]; }else if(b==2){ return [x*p[4],y*p[1]]; }else if(b==3){ return [x*p[5],y*p[2]]; } } var o=variable(w,h); if(c==1){ return o; }else if(c==2){ return [w/2,o[1]]; }else if(c==3){
×
×
• Create New...