[Plugin] Camera Settings Export/Import
32 posts
• Page 1 of 2 • 1, 2
[Plugin] Camera Settings Export/ImportHello.
I'm sharing a little script with everybody that does export & import camera settings, making transfers between files possible. As I was not able to find any script that can do this (though "Camera Statistics" provides the raw numbers, it requires quite a bit of copy&paste efforts), I went ahead and wrote it myself. So it's basically tackling an issue we have quite frequently in the office, when we have several versions of SU model files, dating back to different dates and occasions. And then sometime the client asks for a before/after comparison, for what we have to retain older files and retrofit them with newer camera positions (or do the same thing vice-verse). The scripting might be ruby-beginner-style, but is seems to be working on our SU 8 Win7 systems. It provides basic export options (choose between exporting "all scenes", "current scene" "selected scene") and import options (update camera of scenes with identical scene name) If somebody find this helpful, feel free to download and use it and let me know if you like it. Also feel free to enhance the script further. Best regards. Martin p.s. updated version uploaded 2012-08-29 Last edited by careca on Wed Aug 29, 2012 8:13 am, edited 1 time in total.
Re: [Plugin] Camera Settings Export/ImportThanks I'll let you know how i get on.
Toby
Philippians 4:13 I can do everything through him who gives me strength. Re: [Plugin] Camera Settings Export/ImportUsing the Advanced Camera extension in SU8 you can copy and paste camera objects around.
View > Toolbars > Advanced Camera Tools Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
Re: [Plugin] Camera Settings Export/ImportBtw - to avoid potential clashes with other plugins it's best to wrap everything into a module. otherwise you're adding methods inthe global namespace which affects all other plugins.
See more notes about avoiding clashes with other plugins in this article: http://www.thomthom.net/thoughts/2012/0 ... velopment/ Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
Re: [Plugin] Camera Settings Export/ImportIn addition to using a module, avoid any hard-coded file paths:
D:\SU_camera_export.txt does most likely not exist. An alternative is to use environment variables (ENV["TEMP"]||(ENV["TMP"]; ENV["USERPROFILE"]||ENV["HOME"]) to get a default path or to ask the user directly for a path. Example: mypath = UI.savepanel("Save the camera settings") return if mypath.nil? mypath = File.expand_path(mypath) myfile = File.new(mypath, "w") # ... UI.messagebox exported_cams.to_s + " Cameras were successfully exported to #{mypath}" Lastly file_loaded?("camera_export_import.rb") does not look up a file path but just an arbitrary string. That means after the file has loaded, we have to tell it SketchUp at the end of the file by using the same string: file_loaded("camera_export_import.rb") Otherwise it looks good for the first script! ![]() ![]()
Re: [Plugin] Camera Settings Export/Importhi Aerilius, thomthom, all.
thanks for the feedback, i have updated the script accordingly and replaced it in my original post. regards, martin p.s. advanced camera tools would be great - maybe you can convince our sysadmins to install it for us ![]()
Re: [Plugin] Camera Settings Export/Import
Should be bundled with SketchUp 8... Maybe you need to enable it under you list of Extensions? Anyway - looking forward to seeing more plugin creations! ![]() Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
Re: [Plugin] Camera Settings Export/ImportCould you add support for hidden geometry, visible layers, style and shadows please?
Re: [Plugin] Camera Settings Export/ImportIs that a pro tool only? Not in my free 8.
Not in Ext. list either
Re: [Plugin] Camera Settings Export/Import
Ah! Now that's a good point! Could very well be a Pro feature. Didn't think of that. ![]() Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
Re: [Plugin] Camera Settings Export/Import
thanks for your comment - but to be honest, this was not the intention of this plugin, I only wanted to transfer camera settings between files. going into "hidden geometry, visible layers, style and shadows" will require to write a script for transferring complete scenes/pages, a completely different approach... martin
Re: [Plugin] Camera Settings Export/Import"...with Maintenance 2 release, ACT installs with SketchUp 8.
Re: [Plugin] Camera Settings Export/Import
Not free version! Unless I'm getting a missing module.
Re: [Plugin] Camera Settings Export/ImportGreat plugin~ I was worrying how to compare two designs the very last minute~
paranoia is a higher form of awareness...
Re: [Plugin] Camera Settings Export/ImportACT is a Pro-only add-on...
Just like LayOut, Solid tools, some Exporters/Importers etc... TIG
Re: [Plugin] Camera Settings Export/ImportMerci beaucoup pour ce script qui fonctionne à merveille
Re: [Plugin] Camera Settings Export/ImportI have the same problem with going back to older designs often. The script does what it should in a fast and simple way. It helped me a lot! Thanks!
Re: [Plugin] Camera Settings Export/ImportThanks you very much!!
![]() Very useful for a project that I'm working on. Re: [Plugin] Camera Settings Export/ImportWould it be possible to export/import also shadow settings and layer visibility along with the camera scenes?
Basically exporting/importing whole scenes, and not just the cameras? Re: [Plugin] Camera Settings Export/ImportHi again,
I have installed the plugin in SU2014 on Mac OS X 10.9.4 but it doesn't work, it appears this message in Ruby Console when I try to import the cameras exported: Error: #<ArgumentError: Cannot create unit vector from zero length vector> /Users/Oxer/Library/Application Support/SketchUp 2014/SketchUp/Plugins/camera_export_import.rb:240:in `initialize' /Users/Oxer/Library/Application Support/SketchUp 2014/SketchUp/Plugins/camera_export_import.rb:240:in `new' /Users/Oxer/Library/Application Support/SketchUp 2014/SketchUp/Plugins/camera_export_import.rb:240:in `block in run_import_camera' /Users/Oxer/Library/Application Support/SketchUp 2014/SketchUp/Plugins/camera_export_import.rb:184:in `each' /Users/Oxer/Library/Application Support/SketchUp 2014/SketchUp/Plugins/camera_export_import.rb:184:in `run_import_camera' /Users/Oxer/Library/Application Support/SketchUp 2014/SketchUp/Plugins/camera_export_import.rb:45:in `block in <module:NN_Camera_Export_Import>' -e:1:in `call' The plugin works fine on SU2013, the file exported with SU2013 it's opened perfectly with SU2014. If this can help you, here the content of the SU_export_camera.txt files for SU2013 & SU2014, the cameras exported are the same for SU2013 & SU2014: SU_export_camera.txt file generated by SU2013 Escena 1xxxxx114.776582759505xxxxx-470.759756047837xxxxx255.52670318483xxxxx-4.73467719892792xxxxx394.780293580179xxxxx-156.71068082903xxxxx-0.0583630895867597xxxxx0.42268478698106xxxxx0.904395555400768xxxxx1xxxxx35.0 Escena 2xxxxx284.515642984778xxxxx24.4839257174341xxxxx100.474199327822xxxxx-646.416139390573xxxxx156.269579438326xxxxx-121.743571298921xxxxx-0.227740570706893xxxxx0.0322396770177899xxxxx0.973187975511354xxxxx1xxxxx35.0 SU_export_camera.txt file generated by SU2014 ["Escena 1", "xxxxx", 114.776582759505, "xxxxx", -470.759756047837, "xxxxx", 255.52670318483, "xxxxx", -4.73467719892792, "xxxxx", 394.780293580179, "xxxxx", -156.71068082903, "xxxxx", -0.05836308958675972, "xxxxx", 0.4226847869810601, "xxxxx", 0.9043955554007682, "xxxxx", 1, "xxxxx", 35.0] ["Escena 2", "xxxxx", 284.515642984778, "xxxxx", 24.4839257174341, "xxxxx", 100.474199327822, "xxxxx", -646.416139390573, "xxxxx", 156.269579438326, "xxxxx", -121.743571298921, "xxxxx", -0.22774057070689294, "xxxxx", 0.032239677017789896, "xxxxx", 0.9731879755113538, "xxxxx", 1, "xxxxx", 35.0] Re: [Plugin] Camera Settings Export/ImportThis is because the way the data is compiled from the array into a string in Ruby1.8 is different to Ruby2. It is currently incompatible with v2014 !
Here is how to fix it... Open the file in Notepad++ on PC or TextWrangler on the MAC. Find line #152, which reads: myfile.write(new_array_entry.to_s) Change it to read
Now it should write the same format of data-file in all versions of SketchUp. The import [reading] part should remain unaffected across versions... TIG
Re: [Plugin] Camera Settings Export/ImportBecause the author allows future changes by others, I have made v1.2 compatible with all SketchUp versions - available here http://sketchucation.com/pluginstore?pl ... ort_import
TIG
Re: [Plugin] Camera Settings Export/ImportThanks TIG!!
Re: [Plugin] Camera Settings Export/Import
Thank you TIG ![]() Toby
Philippians 4:13 I can do everything through him who gives me strength. Re: [Plugin] Camera Settings Export/ImportThank you careca and TIG - this plugin has saved my day!
Re: [Plugin] Camera Settings Export/Import2d perspective scenes are not exported properly, i hope you add that features soon.
Re: [Plugin] Camera Settings Export/ImportIm looking for something to place a camera on exact axis. This way i can copy a camera from different modeling app. Its seems to be missing in some importers.
Does anyone know a trick or script? Re: [Plugin] Camera Settings Export/Import
a quick search - in the SketchUcation plugin store http://sketchucation.com/pluginstore?li ... submit=%3F - in the extension warehouse http://extensions.sketchup.com/en/search/site/camera Save the Earth, it's the only planet with chocolate.
32 posts
• Page 1 of 2 • 1, 2
|
Who is online
Users browsing this forum: camarlengo25, genericusername and 6 guests