Again, New expression question.
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.
flame_expressions.pdf (895.6 KB)
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.
Thx for the pdf. It’s actually the same as in Flame 2023 documentation, but still very handy to have that part in a small pdf. Thx.
Ok, I’ll have a look and try to figure it out by myself. Chances of success…5/100. But still.
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
Thx. But I need to revise my chances of success alone. New estimation : 0.0000001/100
When someone says it’s easy …
It’s just two times the tan radians
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.
I believe this is case sensitive.
basic camera math: fov= 2*(atan(.5Aperture/focal length))