I'm working on a feature for one of my extensions and I've come across a problem.

The feature is to export all layers from a group into whatever image type the user selects (Jpg/png/tga)

and save into a new folder based on the group name and then save the files either as GroupName_layerName or GroupName_ascendingNumbers.

The problem I run into is when the user is using a timeline with those groups.

What happens is when I try to go through the group and toggle each layer on and save it out, I end up getting blank images unless it happens that the frame the timeline is on has the layer active/visible (whatever you want to call it)

So the question is, is there a way to check what frame on the timeline a layer is active so I can switch to that frame, save the image then continue on for all other layers?