Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
3

property speed expression/script

Explorer ,
Jun 24, 2023 Jun 24, 2023

in the expressions the position property has speed attribute but not in the script. Is there a way to get the speed of a property in script? And can we get the avarage speed exactly?

TOPICS
Expressions , Scripting
473
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jun 24, 2023 Jun 24, 2023

You could have your script temporarily add an expression, and then harvest the speed value and delete the expression. Or, you could approximate it by using .valueAtTime() with your target time and again with the same time plus a tiny increment and do the math to calculate the difference divided by the time interval. Something like that. But no, you don't have those tools directly available in scripting.

Translate
Community Expert ,
Jun 24, 2023 Jun 24, 2023

I am not sure what you are trying to accomplish. What "speed" attribute are you talking about and how are you trying to use it?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 26, 2023 Jun 26, 2023

just wanted to make a script where I needed it. in the expression type position.speed, you will see

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 24, 2023 Jun 24, 2023

You could have your script temporarily add an expression, and then harvest the speed value and delete the expression. Or, you could approximate it by using .valueAtTime() with your target time and again with the same time plus a tiny increment and do the math to calculate the difference divided by the time interval. Something like that. But no, you don't have those tools directly available in scripting.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 26, 2023 Jun 26, 2023

Thank you very much, the temporary expression method seems the most sensible.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 26, 2023 Jun 26, 2023
LATEST

And do you know how to do the operation like you ctrl/cmd click the eased keyframe and remove the eases, how to do that with script? It automatically sets the speed of the keyframe to the average speed, which I can't set with changing the keyframe eases with setTemporaleEaseAtKey() method because I don't know the average speed. I think the easiest way would be the to do it with command ID if there is sth like that.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines