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

How to create a mask by specifying a frame

Community Beginner ,
Jul 21, 2022 Jul 21, 2022

 

I'm looking for a way to create a frame-based mask from a script (jsx).

 

I can create a mask based on time (seconds) with addKey (), but I don't know how to mask based on the frame.

keyIndex1 = newMask.property(1).addKey(frame * frameDuration);
newMask.property(1).setInterpolationTypeAtKey(keyIndex1, KeyframeInterpolationType.HOLD);

 

If anyone knows how to create a mask based on a frame without using addkey (), please let me know.

TOPICS
FAQ , How to , Scripting
316
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
LEGEND ,
Jul 21, 2022 Jul 21, 2022

Time conversion methods such as frameToTime() are available both in scripts and expressions. That's all you need.

 

Mylenium

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 Beginner ,
Jul 26, 2022 Jul 26, 2022

The frameToTime () function was not recognized as a function in the script.
By the way, is there any other way to convert to frame unit?

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 ,
Jul 21, 2022 Jul 21, 2022

Not sur ewhat your question is. You already have the answer how to convert number of frames to a time in seconds in your example:

frame * frameDuration
Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
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 Beginner ,
Jul 26, 2022 Jul 26, 2022
LATEST

In the official addKey () function description, the addKey argument specifies the number of seconds.
Basically, there is no problem with specifying the number of seconds.
But,In the case of a long movie (after about 8 minutes), problems such as the mask collapsing, the rotobeje not being applied, and an unrelated mask appearing will occur.

 

https://community.adobe.com/t5/after-effects-discussions/unable-to-create-rotobezier-mask-on-long-vi... 

 

While investigating the cause of the problem, I suspect that the cause is that the number of digits in the value of frame * frameDuration becomes large.
On the other hand, if you reduce the number of digits in frame * frameDuration, the frame will deviate from the frame you want to mask, so you cannot reduce the number of digits poorly.
Therefore, this time I was looking for a method that can be set on a frame-by-frame basis.

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