How to apply expression loopOut to mask

Explorer ,
Dec 23, 2019 Dec 23, 2019

Copy link to clipboard

Copied

Hi;

I wanted to animate a mask, so turned on the "maskpath" stopwatch created three point, and tried to apply loopOut expression to repeatedly continue it, but not worked.

is there any resolve.

gratefully

martinmiciciday

TOPICS
Expressions , FAQ

Views

5.7K

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

correct answers 1 Correct answer

Community Expert , Dec 23, 2019 Dec 23, 2019

The loopOut() method only works for numerical values or numerical arrays. Mask keyframes contain complex vector information and none of the looping or traditional math functions will work with masks. There are very few options for creating expressions that will work with masks. You can find most of the methods that will work directly on masks in the Expression Language menu in the timeline. 

Screenshot_2019-12-23 10.29.44_AMbgzI.png

Unfortunately, there is very little documentation yet on using these methods and you can't just click on

...

Likes

Translate

Translate
Community Expert ,
Dec 23, 2019 Dec 23, 2019

Copy link to clipboard

Copied

The loopOut() method only works for numerical values or numerical arrays. Mask keyframes contain complex vector information and none of the looping or traditional math functions will work with masks. There are very few options for creating expressions that will work with masks. You can find most of the methods that will work directly on masks in the Expression Language menu in the timeline. 

Screenshot_2019-12-23 10.29.44_AMbgzI.png

Unfortunately, there is very little documentation yet on using these methods and you can't just click on one and apply it.

 

If the first and last mask keyframe are identical you can apply this expression to create a loop:

 

valueAtTime(time % key(numKeys).time)

 

It is kind of a sledgehammer solution and it will only loop smoothly only if the first and last keyframe is identical. If they are not identical now you can just copy the first keyframe, move down the line and paste to get identical starting and ending keyframes.

 

If you are using the mask to mask something then another option is to have the mask on a separate layer, move to the last keyframe, set the out point for the layer at the last mask keyframe (Alt/Option + ]) then pre-compose the layer moving all attributes and apply time remapping to the pre-comp (Alt/Option + Ctrl/Cmnd + t). Then you move to the last time remapping keyframe (k) then back one frame (Ctrl/Cmnd + left arrow), set a new Time Remapping keyframe, delete the original last keyframe, then use this animated shape layer as a track matte for the layer that you originally wanted to mask.

 

I hope this makes sense. 

 

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
Explorer ,
Dec 26, 2019 Dec 26, 2019

Copy link to clipboard

Copied

thanks sir;

that was exactly what I wanted

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
New Here ,
Nov 29, 2021 Nov 29, 2021

Copy link to clipboard

Copied

LATEST

Thank you sir

 

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