JustinPedersen / maya_fspy

Simple UI to import fSpy files into Autodesk Maya
MIT License
38 stars 0 forks source link

fSpy camera focal length to Maya #2

Open Broken1334 opened 3 years ago

Broken1334 commented 3 years ago

Currently this script changes camera transform only. So maybe better to add something like this?

hfa = pm.camera(camera_shape, q=True, hfa=True)
mm = hfa*25.4
fl = data['relativeFocalLength']*mm/2
pm.camera(camera_shape, e=True, fl=fl)
JustinPedersen96 commented 3 years ago

Great suggestion! Will give this a look when I have have a gap. Also happy to accept a PR if you would like to implement it sooner than I can 😉

kloworks commented 3 years ago

so if this implemented is it gonna be match like blender ? the only struggle in Maya still didn't match while in blender 100% match.

joaocc89 commented 2 years ago

Currently this script changes camera transform only. So maybe better to add something like this?

hfa = pm.camera(camera_shape, q=True, hfa=True)
mm = hfa*25.4
fl = data['relativeFocalLength']*mm/2
pm.camera(camera_shape, e=True, fl=fl)

I found that this works fine for 2 point perspective match. But not working for 3 point perspective. I noticed that the .json file doesn't have any information on the 3rd (z) axis. Can this be the issue or the code can be updated somehow? Thanks.

JustinPedersen commented 2 years ago

Sorry I've put this off for so long, been horribly busy. Will see if I can find a minute to add some of these changes in.

joaocc89 commented 2 years ago

Sorry I've put this off for so long, been horribly busy. Will see if I can find a minute to add some of these changes in.

Thanks Justin. Take your time. :)

JustinPedersen commented 2 years ago

Just updating here, I've created a v2 branch with some enhancements. Please can you give it a test run if you have time. Thanks!

joaocc89 commented 2 years ago

Just updating here, I've created a v2 branch with some enhancements. Please can you give it a test run if you have time. Thanks!

Hey Justin, thanks for taking the time to update the script. From what I've tested it gives me the same result as the last version. My issue was with 3 point perspective, still don't get the same result as in fspy. Cheers.