Skip to main content
ericsten
Inspiring
July 5, 2018
Question

SourceRectAtTime of Sub-Comp visible pixels

  • July 5, 2018
  • 1 reply
  • 810 views

I've been using the SourceRectAtTime function a lot for lower-3rds, subtitles, disclaimers etc and had a lot of good times with it. However I'm attempting to build a template wherein I can swap between a set of pre-selected fonts. To simplify things I figured I would put all of my text layers in sub-comps and then get the SourceRect of those sub-comps, but the SourceRect only returns the Sub-Comp dimensions, not the visible pixel dimensions of the internal elements even if I collapse transformations. Anyone know a way around this?

This topic has been closed for replies.

1 reply

Mylenium
Legend
July 7, 2018

Same old, same old: You'll likely have to use sampleImage() to determine the actual boundaries and then write your own code. The only other solution i can think of would be to create dummy expression controls (2D point) inside the sub-comps and have them sample the values, then reference those dummies. It may not ecvaluate correctly, though, or require massive extra code due to possible update issues and temporal dependencies if not all layers share the same start times or things liek time-remapping are involved.

Mylenium