Hello,
I am using a physical camera with the appropriate camera sensor and lens specifications for my application. I am able to view what the camera is seeing through the Camera Viewport and the Render tools. However, there seems to be a major feature missing: how can I tell the size of my field of view in length units (inches by inches or mm by mm)?
Thanks,
Neil
Hello,
I am using a physical camera with the appropriate camera sensor and lens specifications for my application. I am able to view what the camera is seeing through the Camera Viewport and the Render tools. However, there seems to be a major feature missing: how can I tell the size of my field of view in length units (inches by inches or mm by mm)?
Thanks,
Neil
@Anonymous
However, there seems to be a major feature missing: how can I tell the size of my field of view in length units (inches by inches or mm by mm)?
Can you clarify what you mean by the size of your FOV in 2 dimensions? I guess you can't mean Focal Length because that is a one dimensional length reported in mm which is as you probably know is inversely related to the FOV in degrees and is accessible in the Physical Camera modifier panel (Uncheck Specify FOV and it will be easier to see the Focal length).
Maybe you mean the dimensions of the FOV at the Target distance?
@Anonymous
However, there seems to be a major feature missing: how can I tell the size of my field of view in length units (inches by inches or mm by mm)?
Can you clarify what you mean by the size of your FOV in 2 dimensions? I guess you can't mean Focal Length because that is a one dimensional length reported in mm which is as you probably know is inversely related to the FOV in degrees and is accessible in the Physical Camera modifier panel (Uncheck Specify FOV and it will be easier to see the Focal length).
Maybe you mean the dimensions of the FOV at the Target distance?
Thanks for your comment. Yes this is exactly what I mean. I want to know the field-of-view at the targeted distance in terms of a height by width (e.g. 40 mm x 90 mm). Basically the height times width dimensions of the window that shows what the camera is seeing? Is this possible without having to manually measure with the ruler or something silly like that?
Thanks,
Neil
Thanks for your comment. Yes this is exactly what I mean. I want to know the field-of-view at the targeted distance in terms of a height by width (e.g. 40 mm x 90 mm). Basically the height times width dimensions of the window that shows what the camera is seeing? Is this possible without having to manually measure with the ruler or something silly like that?
Thanks,
Neil
Hi @Anonymous
I want to know the field-of-view at the targeted distance in terms of a height by width (e.g. 40 mm x 90 mm).
This is basically just a trigonometry problem and I recently had written a maxscript for a different but related purpose. So I adapted the script (see attached) to do the math for you. The script will report out to you the dimensions of the FOV at the target distance for the selected camera. It works for standard target cameras and the Physical Camera.
To install the script, unzip and drag the file FOVDimensionsatTargetDistance.mcr to a viewport.
This will then make the macroscript available (via Customize>Customize User Interface ) and you can place it on a custom toolbar, a custom menu or just hotkey it.
Basically the height times width dimensions of the window that shows what the camera is seeing?
Make sure to enable "Show Safe Frames" in your camera viewport (click on the name of the Camera in the upper left Viewport label for the dropdown) or your viewport will not match the FOV at the target distance exactly. This is due to the difference between the aspect ratio of the Max viewport compared to whatever aspect ratio that you have selected in the Render settings dialogue. Since you seem to be knowledgeable about cameras, you probably already know this but just in case you are not familiar with the Show Safe Frames feature in max...
Hope this helps.
Hi @Anonymous
I want to know the field-of-view at the targeted distance in terms of a height by width (e.g. 40 mm x 90 mm).
This is basically just a trigonometry problem and I recently had written a maxscript for a different but related purpose. So I adapted the script (see attached) to do the math for you. The script will report out to you the dimensions of the FOV at the target distance for the selected camera. It works for standard target cameras and the Physical Camera.
To install the script, unzip and drag the file FOVDimensionsatTargetDistance.mcr to a viewport.
This will then make the macroscript available (via Customize>Customize User Interface ) and you can place it on a custom toolbar, a custom menu or just hotkey it.
Basically the height times width dimensions of the window that shows what the camera is seeing?
Make sure to enable "Show Safe Frames" in your camera viewport (click on the name of the Camera in the upper left Viewport label for the dropdown) or your viewport will not match the FOV at the target distance exactly. This is due to the difference between the aspect ratio of the Max viewport compared to whatever aspect ratio that you have selected in the Render settings dialogue. Since you seem to be knowledgeable about cameras, you probably already know this but just in case you are not familiar with the Show Safe Frames feature in max...
Hope this helps.
Hi @10DSpace ,
I am trying to use the script you provided for the same purpose as Neil. Every time I try to execute the script, I receive the following error:
As I do not know much about MAXScript, could you give any insight into why I would be running into this?
Thanks
Hi @10DSpace ,
I am trying to use the script you provided for the same purpose as Neil. Every time I try to execute the script, I receive the following error:
As I do not know much about MAXScript, could you give any insight into why I would be running into this?
Thanks
@Anonymous
How are running the macroscript exactly? Did you follow the installation instructions? I do not get any errors with Max 2020 and there is built in error correction if you do not have a supported camera (Standard Target camera or Physical camera) selected. What version of Max are you using and what type of camera do you have selected when you run the script?
@Anonymous
How are running the macroscript exactly? Did you follow the installation instructions? I do not get any errors with Max 2020 and there is built in error correction if you do not have a supported camera (Standard Target camera or Physical camera) selected. What version of Max are you using and what type of camera do you have selected when you run the script?
I followed the installation instructions. I have a custom toolbar I can click. If I don't have a camera selected, the correct message is displayed, but if I select my physical camera I receive the error message I showed. I am currently using Autodesk 3ds Max 2021.
I followed the installation instructions. I have a custom toolbar I can click. If I don't have a camera selected, the correct message is displayed, but if I select my physical camera I receive the error message I showed. I am currently using Autodesk 3ds Max 2021.
@Anonymous
Sorry about that , but I don't have Max 2021 installed and cannot check the issue. I did test it in max 2019 also and it works fine.
But does it work with a standard target camera in Max 2021? That would be an important clue concerning the error message you are getting.
@Anonymous
Sorry about that , but I don't have Max 2021 installed and cannot check the issue. I did test it in max 2019 also and it works fine.
But does it work with a standard target camera in Max 2021? That would be an important clue concerning the error message you are getting.
@Anonymous
I just figured out your issue. For the Physical Camera you have to have "Targeted" checked for the script to work. The script needs the position of the target for the calculations to figure out the FOV at the Target distance. . When I unchecked "Targeted" in the basic Tab of the physical Camera rollout, I got the same error message. Just check "Targeted" for your Physical Camera (it is on by default when you create a Physical Camera) and the script should work fine.
@Anonymous
I just figured out your issue. For the Physical Camera you have to have "Targeted" checked for the script to work. The script needs the position of the target for the calculations to figure out the FOV at the Target distance. . When I unchecked "Targeted" in the basic Tab of the physical Camera rollout, I got the same error message. Just check "Targeted" for your Physical Camera (it is on by default when you create a Physical Camera) and the script should work fine.
Hi @10DSpace ,
Thank you for all the help so far! Your suggestion works, although I am working with a lot of untargeted cameras, and it would be ideal in the future to not have to switch to targeted to get the script to work.
Currently, I modified your script so that ' a = getKBValue prompt:"Enter target distance:" ', which allows me to input a number for target distance anytime I run it.
For an untargeted physical camera, a user inputs a target distance under its settings (shown in the image below). Do you know how 3ds Max stores this value and how I might be able to call it?
In your script, ideally, I would just want to set "a" directly to the target distance I inputted when I set up the physical camera (i.e., ' a = StoredTargetDistance ' where StoredTargetDistance is 35.433 in this case)
Hi @10DSpace ,
Thank you for all the help so far! Your suggestion works, although I am working with a lot of untargeted cameras, and it would be ideal in the future to not have to switch to targeted to get the script to work.
Currently, I modified your script so that ' a = getKBValue prompt:"Enter target distance:" ', which allows me to input a number for target distance anytime I run it.
For an untargeted physical camera, a user inputs a target distance under its settings (shown in the image below). Do you know how 3ds Max stores this value and how I might be able to call it?
In your script, ideally, I would just want to set "a" directly to the target distance I inputted when I set up the physical camera (i.e., ' a = StoredTargetDistance ' where StoredTargetDistance is 35.433 in this case)
@Anonymous
Glad you are finding the script useful and are inspired to adapt it to your use.
Do you know how 3ds Max stores this value and how I might be able to call it? ...I would just want to set "a" directly to the target distance I inputted when I set up the physical camera (i.e., ' a = StoredTargetDistance ' where StoredTargetDistance is 35.433 in this case)
Very simple: Once you have collected the selected camera's desired target distance from the user in variable "a"
the following line will set the target distance to a:
$.target_distance = a
But you still need to at least temporarily enable "targeted" with the following line for the calculations:
$.targeted = true
Then at the very end of the script you can disable "Targeted" again if you want it back to untargeted with the line:
$.targeted = false
If you want to get fancy and just change the Targeted state back to disabled if it was that way to begin with, just set up a test for the state at the beginning of the script and implement that reset with a conditional statement.
As a general maxscript tip if you want to find out what properties are available for an object, just select it and then enter the following in the listener window and hit enter:
showProperties $
Do this for a physical camera and you will the properties mentioned above.
Hope this helps.
@Anonymous
Glad you are finding the script useful and are inspired to adapt it to your use.
Do you know how 3ds Max stores this value and how I might be able to call it? ...I would just want to set "a" directly to the target distance I inputted when I set up the physical camera (i.e., ' a = StoredTargetDistance ' where StoredTargetDistance is 35.433 in this case)
Very simple: Once you have collected the selected camera's desired target distance from the user in variable "a"
the following line will set the target distance to a:
$.target_distance = a
But you still need to at least temporarily enable "targeted" with the following line for the calculations:
$.targeted = true
Then at the very end of the script you can disable "Targeted" again if you want it back to untargeted with the line:
$.targeted = false
If you want to get fancy and just change the Targeted state back to disabled if it was that way to begin with, just set up a test for the state at the beginning of the script and implement that reset with a conditional statement.
As a general maxscript tip if you want to find out what properties are available for an object, just select it and then enter the following in the listener window and hit enter:
showProperties $
Do this for a physical camera and you will the properties mentioned above.
Hope this helps.
@Anonymous
Out of curiosity, I meant to ask you what you are doing with the dimensions of the FOV at the target distance?
@Anonymous
Out of curiosity, I meant to ask you what you are doing with the dimensions of the FOV at the target distance?
@Anonymous
I think I misread your post and that actually what you were saying is that getting the user input via
a = getKBValue prompt:"Enter target distance:"
was just a temporary solution and that you really want to get the value of "a" directly from the Physical Camera target distance field regardless of whether or not targeted is checked. And that is also easy. I modified the script accordingly and it now supports either Free or Targeted Standard cameras as well as Physical cameras regardless of of whether targeted is checked or not. Thanks for asking about this, because it makes the script more generally useful and as mentioned above, I am curious about your use case.
@Anonymous
I think I misread your post and that actually what you were saying is that getting the user input via
a = getKBValue prompt:"Enter target distance:"
was just a temporary solution and that you really want to get the value of "a" directly from the Physical Camera target distance field regardless of whether or not targeted is checked. And that is also easy. I modified the script accordingly and it now supports either Free or Targeted Standard cameras as well as Physical cameras regardless of of whether targeted is checked or not. Thanks for asking about this, because it makes the script more generally useful and as mentioned above, I am curious about your use case.
@10DSpace Thanks a lot for your help on this topic. @Anonymous and I are research engineers (we work together) who wanted this tool to ultimately determine field-of-view and the spatial resolution of our optical (and often laser-based) diagnostics measurement set-up (e.g. mm/pix) for various camera positions.
@10DSpace Thanks a lot for your help on this topic. @Anonymous and I are research engineers (we work together) who wanted this tool to ultimately determine field-of-view and the spatial resolution of our optical (and often laser-based) diagnostics measurement set-up (e.g. mm/pix) for various camera positions.
@Anonymous
You are welcome. Interesting use of Max. Am I safe in assuming that version 2 of the script gave you what you need?
@Anonymous
You are welcome. Interesting use of Max. Am I safe in assuming that version 2 of the script gave you what you need?
Hi,
Version 2 is now giving us what we need. Thanks so much!
Hi,
Version 2 is now giving us what we need. Thanks so much!
Can't find what you're looking for? Ask the community or share your knowledge.