![]() The average of any n terms is the sum of all the terms divided by n. To find the centre of two points what you need is the average of those two points. That's the first problem with the expression you're using.īut as it stands the expression is not going to give you the results you want. I'd suggest you go and look at some basic JS tutorials, as well as reading the docs about expressions.In expressions (and Javascript) you need to end each line with a semicolon. You could be more terse and do it as a one-liner, at the expense of readability: (effect("Saber")("Core Start") + effect("Saber")("Core End")) / 2 ![]() It's not essential, but it's good practice. The let at the start of the variable declarations confines the scope of the variable. (startPt + endPt)/2 //this line evaluates to an array TL DR let startPt = effect("Saber")("Core Start") //N.B. It's not a function so using it in the form you have will result in an error. So you don't need, and it is incorrect to use, transform.anchorPoint() on the last line. Boring, but valid (I sometimes write static terms like this as expressions as a way of "locking" a property, because expressions override the property controls. The simplest expression you could write would be something like ![]() To return a value the expressions engine looks for a term that evaluates to something. ![]() To set the value of a property with you need to write an expression that returns a value that matches the property. And because you can add points in expressions, and you can multiply and divide points by scalars (single values, like numbers), all you have to do is add the points and divide by 2.Īnd finally, you seem to have a misunderstanding of how expressions work. In expressions (and Javascript) you need to end each line with a semicolon. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |