sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    SketchUp and KeyShot FOV and Focal Length don't match

    Scheduled Pinned Locked Moved SketchUp Discussions
    sketchup
    31 Posts 4 Posters 6.6k Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • chippwaltersC Offline
      chippwalters
      last edited by

      It turns out a Focal Length of 25mm (FOV 70.84 deg) translates (via the KeyShot plugin) to 5.763 in KeyShot, which (FOV of 144.5)

      So, when the camera imports from SketchUp into KeyShot, it looks like this:

      1. SketchUp with Camera INFO
      2. SketchUp Camera as Imported into KeyShot
      3. Eyeballed changing of FOV in KeyShot

      http://dl.dropboxusercontent.com/u/3788438/3D/cameramapping.jpg

      I believe the only thing OFF in KeyShot is the FOV/Focal Length. Any idea on how one would go about converting it correctly? Thanks for shedding any light on this.

      Currently working with Cross-Reality technologies

      1 Reply Last reply Reply Quote 0
      • D Offline
        driven
        last edited by

        have you contacted Luxion support?
        which of the 2 versions of the plugin is failing?

        I haven't used Ketyshot for years, but it seems like the export may need updating for v2015...
        john

        learn from the mistakes of others, you may not live long enough to make them all yourself...

        1 Reply Last reply Reply Quote 0
        • D Offline
          driven
          last edited by

          can you post this file
          /Library/Application Support/KeyShot5/keyshot5.xml

          i can check if the problem is coming from SU...

          learn from the mistakes of others, you may not live long enough to make them all yourself...

          1 Reply Last reply Reply Quote 0
          • chippwaltersC Offline
            chippwalters
            last edited by

            I can, but first tell me what is that file for? What exactly does it do? I may need to get it from my office computer unless it's okay to reproduce on my home computer.

            Currently working with Cross-Reality technologies

            1 Reply Last reply Reply Quote 0
            • chippwaltersC Offline
              chippwalters
              last edited by

              Here's the file.
              https://dl.dropboxusercontent.com/u/3788438/3D/keyshot5.xml

              Currently working with Cross-Reality technologies

              1 Reply Last reply Reply Quote 0
              • D Offline
                driven
                last edited by

                @chippwalters said:

                I can, but first tell me what is that file for? What exactly does it do? ...

                I finally went to bed last night and missed this post,
                it's just a setting file, easier than asking you to list all the possible setting...
                unfortunately it doesn't tell me anything decisive about the fov...
                you can remove it from the post now...
                I'll have another look at their plugin...
                no promises...
                john

                learn from the mistakes of others, you may not live long enough to make them all yourself...

                1 Reply Last reply Reply Quote 0
                • D Offline
                  driven
                  last edited by

                  had a look at the code and can see what the issue is...
                  This is how SU states it works...

                  Camera.aspect_ratio=SketchUp 6.0+
                  The aspect_ratio= method is used to set the aspect ratio for a Camera. Changing this value will cause SketchUp to show gray bars over the screen to show the resulting view. 
                  
                  If you set the value to 0.0, then the aspect ratio of the Camera will match the aspect ratio of its View.
                  

                  I think the problem is that KeyShot uses this method to collect data from SU.

                  why might that be a problem?

                  Unless you use one of the preset Advanced Cameras, or a plugin, SU returns 0.0 for the aspect ratio, which is then used to calculate the parameters in KS, this would account for a variance.
                  e.g. if I have my window set at 1.414, SU reports it as 0.0
                  if I use the 16mm camera aperture, SU reports 1.37

                  I don't have KS, so I can't test if KeyShot works correctly with an Advanced Camera, but the plugin code suggests it would.

                  If it does, then a small addition in the ruby, may allow it work for the Standard SU camera...

                  Can you test with an AC, to confirm/dispel the thinking?

                  and/or you could try modifying the plugin...

                  I'll PM some code that may work if you want...
                  john

                  learn from the mistakes of others, you may not live long enough to make them all yourself...

                  1 Reply Last reply Reply Quote 0
                  • chippwaltersC Offline
                    chippwalters
                    last edited by

                    If what you're asking is if I used the Advanced Camera, I believe so. I did actually use an AC for export as shown in the first image above (see the camera settings values in dot 1).

                    That said, I had installed some AC plugin and I have now about 20 different camera 'types' I can set. I suppose this does not matter. I am setting the SU window to 1600 x 900 pixels and the Keyshot is set to 1280 x 720 which is the same 16:9 aspect ratio. Let me know if there's anything I need to send or do, or if I'm miscommunicating anything.

                    I can try modifying the plugin code.

                    Thanks for your help.

                    Currently working with Cross-Reality technologies

                    1 Reply Last reply Reply Quote 0
                    • D Offline
                      driven
                      last edited by

                      @chippwalters said:

                      If what you're asking is if I used the Advanced Camera, I believe so. I did actually use an AC for export as shown in the first image above (see the camera settings values in dot 1).

                      the setting AC tools prints on the screen are rubbish, it could easily supply better info about the 'screen'...

                      @unknownuser said:

                      ...I am setting the SU window to 1600 x 900 pixels

                      are you using my plugin for that?

                      @unknownuser said:

                      and the Keyshot is set to 1280 x 720 which is the same 16:9 aspect ratio...

                      is that not auto from the SU size?

                      learn from the mistakes of others, you may not live long enough to make them all yourself...

                      1 Reply Last reply Reply Quote 0
                      • chippwaltersC Offline
                        chippwalters
                        last edited by

                        Yep, using your fine plugin to set the screen window resolution. Thanks!

                        I don't know, maybe the 1280x720 is set from the plugin. I typically use the same fixed size as my default, but I can certainly check and let you know.

                        Currently working with Cross-Reality technologies

                        1 Reply Last reply Reply Quote 0
                        • D Offline
                          driven
                          last edited by

                          can you try a simple cube in a different sized SU window and see if KS adjusts...

                          learn from the mistakes of others, you may not live long enough to make them all yourself...

                          1 Reply Last reply Reply Quote 0
                          • chippwaltersC Offline
                            chippwalters
                            last edited by

                            Nope, KeyShot does not adjust. It always defaults to the last screen setting which KS was left in.
                            Interesingly, the CAMERA shows up as an object in KeyShot. Here's a possible workaround-- though certainly NOT perfect.

                            See below:

                            1. Camera Object in KS
                            2. Camera Object shown in SU Camera view (inside of cube) showing the 'bounds' of the camera cone.
                            3. Camera Object shown in SU showing 'bounds' of camera cone
                            4. First change FOV so that the edges of the 'bounds' extend to the horizontal borders of the KS camera window.
                            5. Set aspect ratio so that it matches the SU aspect ratio..

                            Still need to test:
                            Different FOVs and Different SU aspect ratio other than square.

                            http://dl.dropboxusercontent.com/u/3788438/3D/cameramapping2.jpg

                            Currently working with Cross-Reality technologies

                            1 Reply Last reply Reply Quote 0
                            • D Offline
                              driven
                              last edited by

                              your image are to small for me to read, when I enlarge them the text is to distorted...

                              however, you want to see if this works, without the workaround?
                              download this
                              in Ruby Console

                              load ~/Downloads/keyShotExporter.rb
                              

                              then test a correctly size window export...

                              may work...

                              learn from the mistakes of others, you may not live long enough to make them all yourself...

                              1 Reply Last reply Reply Quote 0
                              • chippwaltersC Offline
                                chippwalters
                                last edited by

                                I'll take a look at the plugin and let you know.

                                Even though the image is small, I believe the details aren't important other than the overall notion that one can manually adjust the FOV using the imported SU Camera Geometry Object to get 'close.'

                                Here's the same test using a different FOV and aspect ratio (green is because it's using your plugin and is perfect 16:9).

                                1. Green 16:9 Aspect Ratio with different FOV than first test.
                                2. Imported into Keyshot. Border is indicated.
                                3. Adjust Field of View to match border then render. Looks very close.

                                http://dl.dropboxusercontent.com/u/3788438/3D/cameramapping3.jpg

                                Currently working with Cross-Reality technologies

                                1 Reply Last reply Reply Quote 0
                                • chippwaltersC Offline
                                  chippwalters
                                  last edited by

                                  @driven said:

                                  however, you want to see if this works, without the workaround?
                                  [attachment=0:3036vr1q]<!-- ia0 -->keyShotExporter.rb<!-- ia0 -->[/attachment:3036vr1q]
                                  in Ruby Console

                                  load ~/Downloads/keyShotExporter.rb
                                  

                                  then test a correctly size window export...

                                  may work...

                                  Thanks for the help! When I run it I get this:

                                  > load ~/Downloads/keyShotExporter.rb
                                  Error; #<SyntaxError; <main>; unknown regexp options - kyShtEprtr>
                                  SketchUp;1;in `eval'
                                  

                                  Currently working with Cross-Reality technologies

                                  1 Reply Last reply Reply Quote 0
                                  • chippwaltersC Offline
                                    chippwalters
                                    last edited by

                                    Yes, I contacted them. They don't really have an answer. They say it works with SU15 but the camera transfer doesn't work right. I was hoping to try and figure out a manual way to go from one setting to the other. I know it's possible to do it manually, I just need to find the right 'formula' and while I posted this same on their forum (and support ticket), I doubt there's much if any answer there.

                                    Currently working with Cross-Reality technologies

                                    1 Reply Last reply Reply Quote 0
                                    • D Offline
                                      driven
                                      last edited by

                                      I forgot the quotes ""

                                      load  "~/Downloads/keyShotExporter.rb"
                                      

                                      learn from the mistakes of others, you may not live long enough to make them all yourself...

                                      1 Reply Last reply Reply Quote 0
                                      • chippwaltersC Offline
                                        chippwalters
                                        last edited by

                                        Sorry to be a pain. But now, when I copy/paste it in I receive:

                                        > load  "~/Downloads/keyShotExporter.rb"
                                        /Users/chippwalters/Downloads/keyShotExporter.rb;35; warning; already initialized constant KeyShot5;;Set
                                        /Users/chippwalters/Library/Application Support/SketchUp 2015/SketchUp/Plugins/luxion_keyshot5/keyShotExporter.rb;35; warning; previous definition of Set was here
                                        /Users/chippwalters/Downloads/keyShotExporter.rb;316; warning; already initialized constant KeyShot5;;TEXTURE_PATH
                                        /Users/chippwalters/Library/Application Support/SketchUp 2015/SketchUp/Plugins/luxion_keyshot5/keyShotExporter.rb;309; warning; previous definition of TEXTURE_PATH was here
                                        /Users/chippwalters/Downloads/keyShotExporter.rb;319; warning; already initialized constant KeyShot5;;VERSION
                                        /Users/chippwalters/Library/Application Support/SketchUp 2015/SketchUp/Plugins/luxion_keyshot5/keyShotExporter.rb;312; warning; previous definition of VERSION was here
                                        true
                                        
                                        

                                        Not sure what to do...

                                        Currently working with Cross-Reality technologies

                                        1 Reply Last reply Reply Quote 0
                                        • S Offline
                                          slbaumgartner
                                          last edited by

                                          Those warnings occur when you reload a Ruby that defines constants in its code. They won't happen if the code is written to allow for this possibility. However, in most cases the warnings have no effect and can safely be ignored. The final line saying "true" is your indicator that the load succeeded.

                                          1 Reply Last reply Reply Quote 0
                                          • chippwaltersC Offline
                                            chippwalters
                                            last edited by

                                            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?

                                            Currently working with Cross-Reality technologies

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement