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

Camera import and control

Scheduled Pinned Locked Moved Newbie Forum
sketchup
23 Posts 6 Posters 4.9k Views
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.
  • M Offline
    mbark
    last edited by 8 Sept 2011, 09:51

    Hi
    I am not sure if this is the right place to post, but i am new 😄 so bare with me.

    Is there a plugin or a way to import the camera's from 3ds Max into sketchup - and have them set up as scenes. They need to have the precise parameters regarding position (X,Y,Z), target (x,y,z), roll (tilt of the camera) and focal length.
    Also, is there a plugin where the scene and view can be controlled by using the exact same camera parameters - position (X,Y,Z), target (x,y,z), roll (tilt of the camera) and focal length.

    The goal is to use known camera parameters in sketchup.

    Thanks

    1 Reply Last reply Reply Quote 0
    • M Offline
      mitcorb
      last edited by 8 Sept 2011, 12:01

      My approach would be to use Sketchup command: Camera> Position Camera, and Camera> Field of View. I believe Jim Foltz has a plugin having to do with camera Roll. Use Window> Scenes to set up these positions and run the scenes sequentially with View> Animation> Play. Also, you can do your scene setups under View>, as I just rediscovered while checking the menus.
      Hope this helps. This is my approach since I do not use 3dsmax.

      I take the slow, deliberate approach in my aimless wandering.

      1 Reply Last reply Reply Quote 0
      • M Offline
        mbark
        last edited by 8 Sept 2011, 13:41

        Thanks for the reply.
        I am though looking for a more precise way of setting up the camera.
        I have a well known camera with GPS measured position, and calculated target, so my pricision is down to centimeter lever.
        In Max one can set the camera parameters through number input, and it would be a script that can do that I am looking for.

        1 Reply Last reply Reply Quote 0
        • T Offline
          TIG Moderator
          last edited by 8 Sept 2011, 14:52

          If you can get some simple data out of the 3ds file you can then import that to make cameras and scene-tabs in the SKP.
          Can you export name,eye,target,up,fov as
          name, x,y,z, x,y,z, x,y,z, angle
          one per line into a txt/csv file then it can be done...
          BUT the question is can you export the data from 3ds so readily ?
          If you can then please post a file and I show you how to make new cameras from it...

          TIG

          1 Reply Last reply Reply Quote 0
          • M Offline
            mbark
            last edited by 8 Sept 2011, 15:12

            Sounds great.
            Actually i am using photomodeler - to calculate camera parameters, and it can deliver camera information i txt.
            I am not quite sure what the third coordinate is that you are refering to - the UP value.
            I can get the roll/til value which is in degrees - roll left or right.
            I can send a text file later today.
            Thanks!!

            1 Reply Last reply Reply Quote 0
            • T Offline
              TIG Moderator
              last edited by 8 Sept 2011, 15:22

              You could also look at the PageExIm script available from Smustard.com for just $5.
              It writes and reads '.sup' files in the format
              SceneName;(-107.49665, -174.644951, 91.64628);(201.036983, 201.920125, -22.396436);(0.144554343836861, 0.17642847255434, 0.973641122667915);true;30.0
              plus other stuff about location and style etc...
              The 'true' part is for 'perspective'.
              Its main purpose is to duplicate scene-tab cameras between SKP files, but clearly if you make a .sup file out of 3ds it'd import it too [perhaps with some tweaks to the code etc which might be 'a step too far']...

              TIG

              1 Reply Last reply Reply Quote 0
              • T Offline
                TIG Moderator
                last edited by 8 Sept 2011, 15:24

                The 'up' is a vector in Sketchup camera code to determine the 'roll' it could be simple to calculate that from an angle [from the vertical ?]...

                TIG

                1 Reply Last reply Reply Quote 0
                • M Offline
                  mbark
                  last edited by 8 Sept 2011, 15:29

                  I will look into the script.
                  Can you please explain what the following code describes (0.144554343836861, 0.17642847255434, 0.973641122667915)
                  Is it camera tilt parameters?

                  1 Reply Last reply Reply Quote 0
                  • T Offline
                    TIG Moderator
                    last edited by 8 Sept 2011, 15:34

                    That's the 'up' vector.
                    For now forget the .sup file example, all I need to make a simple importer is a simple text file with
                    name, xeye,yeye,zeye, xtarget,ytarget,ztarget, rollangle, fovangle
                    I can then get the 'up' vector from all of that and make scene-tabs with cameras to suit...

                    TIG

                    1 Reply Last reply Reply Quote 0
                    • M Offline
                      mbark
                      last edited by 8 Sept 2011, 21:50

                      Hi again
                      I have here two cameras that I would like get into sketchup. If you can explain the procedure and if there is a way to manipulate the cameras once in sketchup.
                      The coordinates follow
                      name, xeye,yeye,zeye, xtarget,ytarget,ztarget, rollangle, fovangle
                      Camera_1 160,4 130,52 2,12 10,20 1,53 1,32 -1,52 26,89
                      Camera_2 2510,23 1263,25 2,56 12,25 4,89 2,39 2,56 16,96
                      Thanks!

                      1 Reply Last reply Reply Quote 0
                      • T Offline
                        TIG Moderator
                        last edited by 8 Sept 2011, 22:04

                        What units are the xyz values ? meters/inches etc...
                        I assume you are using a ',' as a decimal-separator and separate the values with a 'space' !

                        TIG

                        1 Reply Last reply Reply Quote 0
                        • T Offline
                          TIG Moderator
                          last edited by 8 Sept 2011, 22:13

                          Here's a first pass...
                          Copyright 2011 (c) TIG
                          All Rights Reserved.
                          THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
                          WARRANTIES,INCLUDING,WITHOUT LIMITATION,THE IMPLIED WARRANTIES OF
                          MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

                          Usage:
                          Menu "View" > "ImportCamera..."
                          Choose the file containing the camera data, in the following format:
                          name,xeye,yeye,zeye,xtarget,ytarget,ztarget,rollangle,fovangle
                          You can have one camera per line.
                          The xyz values should be in 'inches'.
                          The two angles should be in degrees.
                          If the ",rollangle," is replaced with ",upx,upy,upz," a vector can be used.
                          New scene-tabs are made, each called 'name', with cameras as specified.
                          Edit the ICVSEP and ICDSEP constants below to suit your typical file's
                          value-separator [' ',;:\t] and decimal.separator [. or ,]...

                          Donations:
                          info @ revitrev.org via PayPal.com
                          Version:
                          1.0 20110908 First issue.

                          Put into the Plugins folder and restart Sketchup - read the instructions!

                          TIG

                          1 Reply Last reply Reply Quote 0
                          • M Offline
                            mbark
                            last edited by 10 Sept 2011, 19:09

                            Hi TIG

                            Sorry I havn't given a quick answer...
                            The script works!!!
                            Would it be hard work to thange the units from inches to meters?
                            Also, would it be possible to make a input panal inside sketchup where the camera values could be entered and manipulated.

                            I appreciate your help very much, and i didn't think it was possible to get the same precision in sketchup as in 3ds Max - awsome!!

                            1 Reply Last reply Reply Quote 0
                            • T Offline
                              TIG Moderator
                              last edited by 10 Sept 2011, 20:45

                              @mbark said:

                              Hi TIG
                              Sorry I haven't given a quick answer...
                              The script works!!!
                              Would it be hard work to change the units from inches to meters?
                              Also, would it be possible to make a input panel inside Sketchup where the camera values could be entered and manipulated.
                              I appreciate your help very much, and i didn't think it was possible to get the same precision in Sketchup as in 3ds Max - awesome!!

                              This is a version that assumes the units are in 'meters'...
                              Copyright 2011 (c) TIG
                              All Rights Reserved.
                              THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
                              WARRANTIES,INCLUDING,WITHOUT LIMITATION,THE IMPLIED WARRANTIES OF
                              MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

                              Usage:
                              Menu "View" > "ImportCamera..."
                              Choose the file containing the camera data, in the following format:
                              name,xeye,yeye,zeye,xtarget,ytarget,ztarget,rollangle,fovangle
                              You can have one camera per line.
                              The xyz values should be in 'METERS'.
                              The two angles should be in degrees.
                              If the ",rollangle," is replaced with ",upx,upy,upz," a vector can be used.
                              New scene-tabs are made, each called 'name', with cameras as specified.
                              Edit the ICVSEP and ICDSEP constants below to suit your typical file's
                              value-separator [' ',;:\t] and decimal.separator [. or ,]...

                              Donations:
                              info @ revitrev.org via PayPal.com
                              Version:
                              1.0 20110908 First issue.
                              1.1 20110910 METER version.
                              TIGimportcamera.rb

                              TIG

                              1 Reply Last reply Reply Quote 0
                              • T Offline
                                TIG Moderator
                                last edited by 10 Sept 2011, 20:54

                                You can get a dialog that takes some input for camera data [but 'up' is a vector!] using this code [PC only, I'm afraid!]

                                <span class="syntaxdefault">require </span><span class="syntaxstring">'sketchup.rb'<br /></span><span class="syntaxdefault">UI</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">menu</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"Camera"</span><span class="syntaxkeyword">).</span><span class="syntaxdefault">add_item</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"Camera Info..."</span><span class="syntaxkeyword">){</span><span class="syntaxdefault">Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">send_action</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">10624</span><span class="syntaxkeyword">)}</span><span class="syntaxdefault">unless&nbsp;file_loaded</span><span class="syntaxkeyword">?(</span><span class="syntaxdefault">__FILE__</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">file_loaded</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">__FILE__</span><span class="syntaxkeyword">)&nbsp;</span><span class="syntaxdefault"></span>
                                

                                copy+paste this code into a file called camera_info.rb in the Plugins folder and you get the new item in the menu after a restart...

                                TIG

                                1 Reply Last reply Reply Quote 0
                                • M Offline
                                  mbark
                                  last edited by 10 Sept 2011, 21:09

                                  Thanks TIG
                                  I have been looking for a way to get my exact camera information from max to sketchup for ..... a long time.
                                  Thank you for your time and work.

                                  1 Reply Last reply Reply Quote 0
                                  • E Offline
                                    eco
                                    last edited by 6 Nov 2011, 21:11

                                    I was looking something like this but I have different camera coordinates information: xeye,yeye,zeye, xrotation,yrotation,zrotation, focallenght(mm), framesize(px)

                                    1 Reply Last reply Reply Quote 0
                                    • L Offline
                                      lapx
                                      last edited by 29 Feb 2012, 20:22

                                      pageexim is not working for me. Has anyone else had a problem getting it to work in su8? It makes the .sup file on export but when I try importing the .sup file it's doing nothing. It doesnt even give and error.

                                      Thanks,

                                      Lapx

                                      1 Reply Last reply Reply Quote 0
                                      • M Offline
                                        mbarker
                                        last edited by 9 May 2015, 21:13

                                        @tig said:

                                        You can get a dialog that takes some input for camera data [but 'up' is a vector!] using this code [PC only, I'm afraid!]

                                        <span class="syntaxdefault">require </span><span class="syntaxstring">'sketchup.rb'<br /></span><span class="syntaxdefault">UI</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">menu</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"Camera"</span><span class="syntaxkeyword">).</span><span class="syntaxdefault">add_item</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"Camera Info..."</span><span class="syntaxkeyword">){</span><span class="syntaxdefault">Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">send_action</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">10624</span><span class="syntaxkeyword">)}</span><span class="syntaxdefault">unless file_loaded</span><span class="syntaxkeyword">?(</span><span class="syntaxdefault">__FILE__</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">file_loaded</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">__FILE__</span><span class="syntaxkeyword">)&nbsp;</span><span class="syntaxdefault"></span>
                                        

                                        copy+paste this code into a file called camera_info.rb in the Plugins folder and you get the new item in the menu after a restart...

                                        Dear TIG
                                        It has been a long time since last and i would like to ask you a big favor regarding the camera import script. I used to have the user name mbark and you made the TIGimportcamera.rb. I am now using Sketchup 2015 and the script will not import. Can you help with an updated version. I would really appreciate it!
                                        Thanks

                                        1 Reply Last reply Reply Quote 0
                                        • T Offline
                                          TIG Moderator
                                          last edited by 10 May 2015, 16:04

                                          I'd expect the old RB file still to work OK in v2015.
                                          However, how are you making the camera-data file ?
                                          Try Notepad++ and set the file's encoding to UTF8-without-BOM...
                                          Report back...

                                          TIG

                                          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