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

Animate shape in plugin in c++

Contributor ,
Sep 30, 2020 Sep 30, 2020

Dear AE fellows.

I'm trying to write a plugin for AE in c++.

 

So far I've learnt  how to draw simple curves. What I don't know is how to animate these curves as the user moves a time slider in timeline  panel. 

 

Suppose I draw a circle:

_____________________________________

double x = 100;

double y = 100;

double R = 50;

double phi1 = 0.;

double phi2 = 2*MF_PI.;

cairo_t *cr = cairo_create(surface);

cairo_arc(cr, x, y, R, phi1, phi2);

 _____________________________________

 

I want the radius of the circle to change as the user moves time slider from 0 to 30 frames.

How do you achieve this?

 

Yaroslav.  

TOPICS
How to , Scripting , SDK
686
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 , Sep 30, 2020 Sep 30, 2020

in_data->current_time is the current frame's time step.

in_data->time_step is the number of steps per second.

Translate
Community Expert ,
Sep 30, 2020 Sep 30, 2020

in_data->current_time is the current frame's time step.

in_data->time_step is the number of steps per second.

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
Contributor ,
Sep 30, 2020 Sep 30, 2020

Thank you, Shachar!

Sorry, I'd like to eleborate slightly.

 

Suppose I have a complicated shape as a fuction of time: shape(t).

Just let me point out some details about this shape (these may be relevant)

It is a combination of bezier curves. At t=0 it has, say, 40 paths, at t=30 frames, it has 100 paths.

Therefore, I can't simply set two moments of time and tell Adobe After to interpolate the shape between to time points. 

This shape is computed with the help of function shape(t) at each moment of time.

 

Could you (if it is not time consuming) to elaborate slightly more about the code?

 

Yaroslav.

 

 

 

 

 

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 ,
Sep 30, 2020 Sep 30, 2020

i probably don't understand the problem.

AE calls the plug-in to render a frame with a given time. when renderin a sequence of 30 frames, AE will call the plug-in 30 times, each with a corresponding time stamp.

what's keeping you from calling shape(t) for each requested frame?

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
Contributor ,
Sep 30, 2020 Sep 30, 2020
LATEST

Sorry, now it is clear!

Thanks!

Yaroslav.

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