How to create a mask by specifying a frame

Community Beginner ,
Jul 21, 2022 Jul 21, 2022

Copy link to clipboard

Copied

 

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

Views

94

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

 

Mylenium

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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?

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

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