i'm working on a camera matching JS script, to get the correct camera FOV from a photography and place some 3D on top of it. I'm using some mathematics, trigonometry and all, people will just have to place some curves along the vanishing lines of the pictures and the script will give the correct FOV. but to achieve my goal i think need to get the ratio of the photography used as a reference. However i can't tell how to get the width (xres) and the height (yres) of the loaded image clip. It's displayed in the image source property editor but as people will use their own pictures, i need to get these informations dynamically.
Here is a part of my code:
Code: Select all
var ClipImage;
var oFileBrowser = oUIToolkit.FileBrowser ;
oFileBrowser.DialogTitle = "Select a file" ;
oFileBrowser.InitialDirectory = "c:" ;
oFileBrowser.Filter = "All Files (*.*)|*.*||" ;
oFileBrowser.ShowOpen() ;
if ( oFileBrowser.FilePathName != "" )
{
SetValue("preferences.Interaction.autoinspect", false, null);
ClipImage=CreateImageClip2(oFileBrowser.FilePathName, null, null);
SetValue("preferences.Interaction.autoinspect", true, null);
}
SetValue(CurrentCamera+".rotoscope.imagename", ""+ClipImage, null);
I'm not very skilled with softimage 2014. And sorry for the poor english, i'm having a hard time trying to explain my problem as clearly as possible.
Thanks a lot for your help.