SketchUp and KeyShot FOV and Focal Length don't match
-
@chippwalters said:
So then, what do I do next? Use the Keyshot plugin button to export the file? Will it use your script or it's script?
it will use the last loaded script, i.e. my version...
-
Thanks.
I did what you said, but the results weren't what was expected:
- ORIGINAL in SU (Focal Lenght 42mm, FOV 46.8 degrees)
- Using your plugin code. Note the FOV is different, but still not correct.
- ORIGINAL KS Plugin. Note the FOV is also different.
-
you want post the skp [or PM...]
-
Here's the SKP
https://dl.dropboxusercontent.com/u/3788438/3D/test.skp -
btw, so you know...
the only thing I change was a 'back up' for a SU shortfall
if cam_aspect == 0.0 cam_aspect = width/height.to_f.round(3) end
I you don't have a Advanced camera set, SU sets the aspect ratio to 0.0, which is crazy...
this bit of code just tell KS to use 16:9 in that circumstance...I'll have a look at your skp...
-
@driven said:
btw, so you know...
the only thing I change was a 'back up' for a SU shortfall
if cam_aspect == 0.0 > cam_aspect = width/height.to_f.round(3) > end
I you don't have a Advanced camera set, SU sets the aspect ratio to 0.0, which is crazy...
this bit of code just tell KS to use 16:9 in that circumstance...I'll have a look at your skp...
Thanks again for your generous help.
I did look at your Ruby and saw that, and was wondering if there was anything else. I've written some Python scripts for Vue-Infinite, but don't know much about SU's api-- other than other plugins have figured this out-- and KS hasn't. I believe they first mentioned to me SU didn't have the correct api hooks to get an accurate camera from. That's when I mentioned all the other renderers have figured it out. They said they would take a look at it. Last time they said they'd work on the SU plugin it took them 2 years.
Too bad Thea and Vray are so damn slow compared to Keyshot. Of course, they both can do a lot more too!
Fwiw, here's an interior shot modeled in SU, and rendered in KS @ 1920x1080. Took a bit under 3 hours on my 2013 i7 iMac. Anyone think Thea can do that? If so, I have a license and can try. My early tests told me no, but then I'm not an accomplished Thea user.
-
that looks very well accomplished to me...
I think KS may ignore the 0.0, even though they extract it...
heres some code that I've been fiddling with to try and work out the variance...model = Sketchup.active_model camera = model.active_view.camera position = camera.eye.to_a direction = camera.eye.vector_to(camera.target) up = camera.up fov = camera.fov aspect_ratio = camera.aspect_ratio width = model.active_view.vpwidth height = model.active_view.vpheight p [ position, direction.to_a, camera.up.to_a, fov, aspect_ratio, width, height] model = Sketchup.active_model view = model.active_view target = camera.target vector = target - position if vector.x>0 if vector.y>0 az = Geom;;Vector3d.new(0,1,0).angle_between(vector).radians else az = Geom;;Vector3d.new(1,0,0).angle_between(vector).radians+Math;;PI/2 end else if vector.y<0 az = Geom;;Vector3d.new(0,-1,0).angle_between(vector).radians+Math;;PI else az = Geom;;Vector3d.new(-1,0,0).angle_between(vector).radians+(3*Math;;PI/2) end end
the first one is just the same as KS pulls out
the second bit is trying to see how they arrive at the azimuth...
I remember reading some where that SU reads from the camera 'film' plane and you need to subtract the length to the lens 'plane', or similar... [I can't find the link]
the API has to much misinformation about all of this...john
-
Thanks for you help. I'll test your new code tomorrow when I get a moment.
The workaround I found seems to be doing the trick: Here's a model I built tonight and used a SU wireframe overlaid on top (autonomous mobile office meeting room for an article) and it seems to work pretty well . FWIW, the model is not complete...just WIP).
-
Can someone please summarize the working solution to this SKP>KS FOV + focal length 1:1 export dilemma. Super irritated with KS. Thanks for your consideration!
-
Last I checked, the latest KeyShot plugin seemed to be working.
Advertisement