How do we have access to action resolution in an expression? for example, I would like a new layer to be placed at 3/4 of the frame and do that with an expression, without having to change values by hand.
And by the way, is there a a complete and exhaustive document that would reference all functions, attributes etc available in flame expressions? with for each the way to use it?
I can’t find that. There are a few exemples in Flame documentation but it looks quite poor regarding to expressions.
I courd swear I saw such a documents years back but I can’t find it now…
We don’t have access to canvas resolution as far as I know. But I think we can calculate a value depending on the camera fov and position. I’ll have to take a look at it, maybe @ytf has it handy.
As far as the document I still keep a copy of Flame 2013 manual as a pdf. I even have the expression part exported as a separate document.
You can derive the resolution with a formula that uses the default camera’s distance, near and FOV values. I would have to spend a little time to figure out exactly how to tailor that to your needs.
The Y is easy: (2*(tan(radians(.5*Default.fov))*Default.position.z))
I use a similar function to determine scale, but it occurs to me I may not be calculateing for X when I do it and there is a strange relationship between the near value and the position.z value that I can’t remember offhand.
I will think of this in my copiuos free moments today
So there is a pretty straightforward, simple way. My issue with it is that you need to add the background as a surface, which has been possible for about 3 or 4 versions.
Drag the background into the action schematic and name it background.
The H resolution is 2(times)background.lensDistort.centreX.
The V resolution is 2(times)background.lensDistort.centreY
Because the forum identifies the asterix as some sort of html function, everywhere I wrote (times), use an asterix.