by thomthom » Mon Sep 13, 2010 6:41 pm
OverviewExports the current view with transparent background option (SU8) if you use the PNG format. Will also let you export only what is displayed on your screen - where SketchUp's native Export 2D function would export the whole model, regardless. AccessView > Export 2DUsageTT_Export2d.png ExportSaveAs.png ant.png Requirements- SketchUp 7 or newer - ( Other versions untested )
- TT_Lib2
Download Footprint <Sketchup>/Plugins/ +- 
tt_export.rb 
Last edited by thomthom on Fri Nov 29, 2013 12:21 am, edited 1 time in total.
-

thomthom
- PluginStore Author

-
- Posts: 19457
- Joined: Tue Nov 13, 2007 12:47 pm
- Location: Trondheim, Norway
- Name: Thomas Thomassen
- Operating system: Windows
- SketchUp version: 2019
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Advanced
-
by Ben Ritter » Mon Sep 13, 2010 7:35 pm
Thomas, thank you once again and happy Monday.
-
Ben Ritter
-
- Posts: 468
- Joined: Wed Nov 14, 2007 4:55 pm
- Name: Ben Ritter
- Operating system: Windows
- SketchUp version: pre-2013
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Intermediate
by JClements » Mon Sep 13, 2010 8:48 pm
Thomas, this is great. I use the transparent PNG format for most all of my work so I can do compositing.
A few weeks ago I had to make a 4' x 3' poster. Layout couldn't export the PNG because, I think because of the all the textures I had combined with the anti-aliasing of LayOut's export filter). My old workaround was to make all layers Black and then turn on color by layer to produce a black and white mask for an Alpha Channel but that doesn't work with textures that are comprised of transparent PNGs. Hopefully, this script will address these type of textures.
This could be script my workaround for transparent PNG's. I will give it a test.
Thank you !
[Edit] P.S. I am going to change the name, however, to "tt_eportPNG.rb" ... incase you come up with some other export options
Last edited by JClements on Mon Sep 13, 2010 9:00 pm, edited 3 times in total.
John | Illustrator | Beaverton, Oregon
-
JClements
- Premium Member

-
- Posts: 948
- Joined: Wed Nov 14, 2007 4:32 pm
- Location: Portland/Beaverton, Oregon
- Name: JClements
- Operating system: Windows
- SketchUp version: 2022
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by Pixero » Mon Sep 13, 2010 8:55 pm
Thanks, but I'm curious...how does it work? Was transparency there all along but the built in exporter couldn't handle it? 
-

Pixero
-
- Posts: 2597
- Joined: Thu May 24, 2018 12:49 pm
- Location: Halmstad, Sweden
- Name: Pixero
- Operating system: Windows
- SketchUp version: 2020
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
-
by JClements » Mon Sep 13, 2010 9:35 pm
Thomas, so far so good. I exported a 4,000 x 2,000 pix file no problem. I haven't tried using sketchy edge styles with it yet.
Q- Would it be possible to read the aspect ratio of the users model window and give that as an option in your dropdown list?
If you'd like a model to do tests with I can arrange to send one that could push the script to it's limits. Let me know.
John | Illustrator | Beaverton, Oregon
-
JClements
- Premium Member

-
- Posts: 948
- Joined: Wed Nov 14, 2007 4:32 pm
- Location: Portland/Beaverton, Oregon
- Name: JClements
- Operating system: Windows
- SketchUp version: 2022
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by thomthom » Mon Sep 13, 2010 9:51 pm
Pixero wrote:Was transparency there all along but the built in exporter couldn't handle it?
Added with the SU8 API. JClements wrote:Q- Would it be possible to read the aspect ratio of the users model window and give that as an option in your dropdown list?
I can read the aspect ratio - but I can't make the values in the inputbox interactively change. I'd have to make a webdialog for that. JClements wrote:If you'd like a model to do tests with I can arrange to send one that could push the script to it's limits. Let me know.
I really have no control over what it can export. It simply calls the SU API: view.write_image - so I'm not doing anything different from what SU does - because it's all SU.
-

thomthom
- PluginStore Author

-
- Posts: 19457
- Joined: Tue Nov 13, 2007 12:47 pm
- Location: Trondheim, Norway
- Name: Thomas Thomassen
- Operating system: Windows
- SketchUp version: 2019
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Advanced
-
by CadFather » Mon Sep 13, 2010 10:10 pm
Master Thom Thom strikes again!  (a true gem) now i know why the name: it's two of you!! thank you, thank you
-

CadFather
- PluginStore Author

-
- Posts: 1047
- Joined: Fri Nov 16, 2007 11:03 am
- Location: London, Milano, Sicily
- Name: CadFather
- Operating system: Windows
- SketchUp version: 2014
- License type: Pro
- SketchUp use: landscape architecture
- Level of SketchUp: Advanced
-
by JClements » Mon Sep 13, 2010 10:16 pm
Thomas, if you could just display the aspect ratio that would be helpful. I could manually enter values using a calculator.
John
John | Illustrator | Beaverton, Oregon
-
JClements
- Premium Member

-
- Posts: 948
- Joined: Wed Nov 14, 2007 4:32 pm
- Location: Portland/Beaverton, Oregon
- Name: JClements
- Operating system: Windows
- SketchUp version: 2022
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by EscapeArtist » Mon Sep 13, 2010 10:29 pm
Great! I needed something like this last week, how did you know? Thanks for another useful plugin! 
-

EscapeArtist
- Top SketchUcator
-
- Posts: 1310
- Joined: Sun Aug 03, 2008 7:36 pm
- Location: Northeast US
- Name: EscapeArtist
- Operating system: Windows
- SketchUp version: pre-2013
- License type: Pro
- SketchUp use: hobby
- Level of SketchUp: Intermediate
by thomthom » Mon Sep 13, 2010 10:33 pm
JClements wrote:Thomas, if you could just display the aspect ratio that would be helpful. I could manually enter values using a calculator.
John
I'll see what I can do. I am currently working on a system to make advanced inputboxes easier to make.
-

thomthom
- PluginStore Author

-
- Posts: 19457
- Joined: Tue Nov 13, 2007 12:47 pm
- Location: Trondheim, Norway
- Name: Thomas Thomassen
- Operating system: Windows
- SketchUp version: 2019
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Advanced
-
by JClements » Mon Sep 13, 2010 11:05 pm
Thomas. Not urgent by any means.
John | Illustrator | Beaverton, Oregon
-
JClements
- Premium Member

-
- Posts: 948
- Joined: Wed Nov 14, 2007 4:32 pm
- Location: Portland/Beaverton, Oregon
- Name: JClements
- Operating system: Windows
- SketchUp version: 2022
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by Pixero » Tue Sep 14, 2010 7:21 am
thomthom wrote:•SketchUp 7 or newer
thomthom wrote:Added with the SU8 API.
So...how do I get this to work with SU 7.1? It exports without transparency and always the whole model.
-

Pixero
-
- Posts: 2597
- Joined: Thu May 24, 2018 12:49 pm
- Location: Halmstad, Sweden
- Name: Pixero
- Operating system: Windows
- SketchUp version: 2020
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
-
by thomthom » Tue Sep 14, 2010 7:26 am
Pixero wrote:So...how do I get this to work with SU 7.1?
Transparency? You can't. Pixero wrote:and always the whole model.
hmm, not on my machine - remember to Hide Rest of Model. WYSIWYG.
-

thomthom
- PluginStore Author

-
- Posts: 19457
- Joined: Tue Nov 13, 2007 12:47 pm
- Location: Trondheim, Norway
- Name: Thomas Thomassen
- Operating system: Windows
- SketchUp version: 2019
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Advanced
-
by Pixero » Tue Sep 14, 2010 7:59 am
thomthom wrote:Pixero wrote:So...how do I get this to work with SU 7.1?
thomthom wrote: Transparency? You can't.

Last edited by Pixero on Tue Sep 14, 2010 9:46 am, edited 2 times in total.
-

Pixero
-
- Posts: 2597
- Joined: Thu May 24, 2018 12:49 pm
- Location: Halmstad, Sweden
- Name: Pixero
- Operating system: Windows
- SketchUp version: 2020
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
-
by rv1974 » Tue Sep 14, 2010 9:19 am
Is there some way to separate shadows pass?
-
rv1974
-
- Posts: 1710
- Joined: Tue Nov 13, 2007 11:38 am
- Name: rv1974
- Operating system: Windows
- SketchUp version: 2017
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by thomthom » Tue Sep 14, 2010 9:46 am
No - I have no control of how it's generated. As you see from the sample I posted the shadows even comes from the whole model, not just what is visible.
-

thomthom
- PluginStore Author

-
- Posts: 19457
- Joined: Tue Nov 13, 2007 12:47 pm
- Location: Trondheim, Norway
- Name: Thomas Thomassen
- Operating system: Windows
- SketchUp version: 2019
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Advanced
-
by Pixero » Tue Sep 14, 2010 10:41 am
thomthom wrote:No - I have no control of how it's generated. As you see from the sample I posted the shadows even comes from the whole model, not just what is visible.
This can help for a shadow pass: http://rhin.crai.archi.fr/RubyLibraryDe ... emplate.rbAnd maybe a modification of my Shadow control script ( http://www.pixero.com/downloads_sketchup.html) could be made to set everything not selected to: e.casts_shadows = false
-

Pixero
-
- Posts: 2597
- Joined: Thu May 24, 2018 12:49 pm
- Location: Halmstad, Sweden
- Name: Pixero
- Operating system: Windows
- SketchUp version: 2020
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
-
by archworks » Wed Nov 24, 2010 3:25 pm
Congratulations - one of the best for su 2d app
-
archworks
- Premium Member

-
- Posts: 3
- Joined: Sat Jul 26, 2008 5:55 pm
by Gaieus » Wed Nov 24, 2010 4:33 pm
Hey, I did not see this, great plugin, thanks Thom!  _______ Edit; to me, it does not export with transparent background... Nor does it export only the active context.  test.png
-

Gaieus
-
- Posts: 26832
- Joined: Sat Oct 20, 2007 8:24 am
- Location: Pécs, Hungary
- Name: Csaba Pozsárkó
- Operating system: Windows
- SketchUp version: 2013
- License type: Pro
- SketchUp use: historical reconstruction
- Level of SketchUp: Advanced
-
by thomthom » Wed Nov 24, 2010 6:04 pm
Gaieus wrote:Edit; to me, it does not export with transparent background... Nor does it export only the active context. 
What version of SU did you use? Got a screencapture?
-

thomthom
- PluginStore Author

-
- Posts: 19457
- Joined: Tue Nov 13, 2007 12:47 pm
- Location: Trondheim, Norway
- Name: Thomas Thomassen
- Operating system: Windows
- SketchUp version: 2019
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Advanced
-
by Humpmetwice » Wed Nov 24, 2010 6:34 pm
Have I put something in the wrong spot or something cause when I go to view/export 2D the settings comes up but then it doesn't give me a file type to save it as?
-

Humpmetwice
-
- Posts: 415
- Joined: Sun Dec 27, 2009 2:43 am
- Location: Oak Grove Louisiana
- Name: humpmetwice
- Operating system: Windows
- SketchUp version: 2018
- License type: Pro
- SketchUp use: woodworking
- Level of SketchUp: Intermediate
by thomthom » Wed Nov 24, 2010 6:47 pm
humpmetwice wrote:Have I put something in the wrong spot or something cause when I go to view/export 2D the settings comes up but then it doesn't give me a file type to save it as?
After the Settings window and you click OK you should get a File Dialog asking you what name to give the file. You must specify the file extension yourself.
-

thomthom
- PluginStore Author

-
- Posts: 19457
- Joined: Tue Nov 13, 2007 12:47 pm
- Location: Trondheim, Norway
- Name: Thomas Thomassen
- Operating system: Windows
- SketchUp version: 2019
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Advanced
-
by Humpmetwice » Wed Nov 24, 2010 7:16 pm
thomthom wrote:After the Settings window and you click OK you should get a File Dialog asking you what name to give the file. You must specify the file extension yourself. I know and it doesn't give me any file type to save it as at all.
-

Humpmetwice
-
- Posts: 415
- Joined: Sun Dec 27, 2009 2:43 am
- Location: Oak Grove Louisiana
- Name: humpmetwice
- Operating system: Windows
- SketchUp version: 2018
- License type: Pro
- SketchUp use: woodworking
- Level of SketchUp: Intermediate
by thomthom » Wed Nov 24, 2010 7:29 pm
You have to type the file type yourself - there is no list of file types because the SketchUp Ruby API doesn't let me provide one. So if you want to save a jpg file just enter "myfile.jpg" in the file dialog. filedialog.png
-

thomthom
- PluginStore Author

-
- Posts: 19457
- Joined: Tue Nov 13, 2007 12:47 pm
- Location: Trondheim, Norway
- Name: Thomas Thomassen
- Operating system: Windows
- SketchUp version: 2019
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Advanced
-
by Gaieus » Thu Nov 25, 2010 11:37 pm
thomthom wrote:Gaieus wrote:Edit; to me, it does not export with transparent background... Nor does it export only the active context. 
What version of SU did you use? Got a screencapture?
The most recent one; SU 8. Here is a screen capture; now with a different codec than the one you could not open the other day if you remember...
-

Gaieus
-
- Posts: 26832
- Joined: Sat Oct 20, 2007 8:24 am
- Location: Pécs, Hungary
- Name: Csaba Pozsárkó
- Operating system: Windows
- SketchUp version: 2013
- License type: Pro
- SketchUp use: historical reconstruction
- Level of SketchUp: Advanced
-
by thomthom » Fri Nov 26, 2010 9:18 am
-

thomthom
- PluginStore Author

-
- Posts: 19457
- Joined: Tue Nov 13, 2007 12:47 pm
- Location: Trondheim, Norway
- Name: Thomas Thomassen
- Operating system: Windows
- SketchUp version: 2019
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Advanced
-
by Gaieus » Fri Nov 26, 2010 9:51 am
Well, sigh... I can always use LO for exporting png's with transparent background...
Maybe it's an XP thing?
-

Gaieus
-
- Posts: 26832
- Joined: Sat Oct 20, 2007 8:24 am
- Location: Pécs, Hungary
- Name: Csaba Pozsárkó
- Operating system: Windows
- SketchUp version: 2013
- License type: Pro
- SketchUp use: historical reconstruction
- Level of SketchUp: Advanced
-
by thomthom » Fri Nov 26, 2010 9:54 am
I don't know. Haven't got an XP machine at hand right now. Could be an SketchUp bug...
-

thomthom
- PluginStore Author

-
- Posts: 19457
- Joined: Tue Nov 13, 2007 12:47 pm
- Location: Trondheim, Norway
- Name: Thomas Thomassen
- Operating system: Windows
- SketchUp version: 2019
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Advanced
-
by Gaieus » Fri Nov 26, 2010 10:35 am
Well, you know where to report it (and who has all sorts of machines). I have no clue about the ins and outs of ruby. I could never make a proper bug report on plugins! 
-

Gaieus
-
- Posts: 26832
- Joined: Sat Oct 20, 2007 8:24 am
- Location: Pécs, Hungary
- Name: Csaba Pozsárkó
- Operating system: Windows
- SketchUp version: 2013
- License type: Pro
- SketchUp use: historical reconstruction
- Level of SketchUp: Advanced
-
by thomthom » Fri Nov 26, 2010 11:08 am
Just to narrow it down to a simple test case - can you try this one-liner? - Code: Select all
Sketchup.active_model.active_view.write_image( { :filename=>'C:\test.png', :width=>640, :height=>480, :antialias=>false, :transparent=>true } )
-

thomthom
- PluginStore Author

-
- Posts: 19457
- Joined: Tue Nov 13, 2007 12:47 pm
- Location: Trondheim, Norway
- Name: Thomas Thomassen
- Operating system: Windows
- SketchUp version: 2019
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Advanced
-
by Ad Machine » 5 minutes ago
-
Ad Machine
- Robot
-
- Posts: 2012
-
Return to Plugins
|