[Plugin] Export 2d with Alpha
-
@thomthom said:
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.
-
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.
-
@thomthom said:
@gaieus said:
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...
-
-
Well, sigh... I can always use LO for exporting png's with transparent background...
Maybe it's an XP thing?
-
I don't know. Haven't got an XP machine at hand right now. Could be an SketchUp bug...
-
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!
-
Just to narrow it down to a simple test case - can you try this one-liner?
<span class="syntaxdefault">Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_view</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">write_image</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">Β </span><span class="syntaxkeyword">{</span><span class="syntaxdefault">Β </span><span class="syntaxkeyword">;</span><span class="syntaxdefault">filename</span><span class="syntaxkeyword">=></span><span class="syntaxstring">'C;\test.png'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">Β </span><span class="syntaxkeyword">;</span><span class="syntaxdefault">width</span><span class="syntaxkeyword">=></span><span class="syntaxdefault">640</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">Β </span><span class="syntaxkeyword">;</span><span class="syntaxdefault">height</span><span class="syntaxkeyword">=></span><span class="syntaxdefault">480</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">Β </span><span class="syntaxkeyword">;</span><span class="syntaxdefault">antialias</span><span class="syntaxkeyword">=></span><span class="syntaxdefault">false</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">Β </span><span class="syntaxkeyword">;</span><span class="syntaxdefault">transparent</span><span class="syntaxkeyword">=></span><span class="syntaxdefault">trueΒ </span><span class="syntaxkeyword">}</span><span class="syntaxdefault">Β </span><span class="syntaxkeyword">)</span><span class="syntaxdefault">Β </span>
-
Try what? Enter the ruby console? I get this:
-
If you set the background color to be 0,0,0 [pure-black] then the image will export with a transparent background in place of the 'pure-black', when you open it in Gimp or a web-browser etc you will see there is no background...
-
@tig said:
If you set the background color to be 0,0,0 [pure-black]
Should not need to do this - I export with the default SketchUp Sky - still I get transparency.
-
@thomthom said:
@tig said:
If you set the background color to be 0,0,0 [pure-black]
Should not need to do this - I export with the default SketchUp Sky - still I get transparency.
That's not entirely correct... iIF you have a Sky and/or Ground ticked in your Style you will not get a transparent background to the png for the areas that these parts 'cover'.
BUT if you have the Sky AND Ground un-ticked in your Style then I agree - the color of the Background itself is irrelevant because whatever it is when the have the png export transparency set 'on' that background is made 'transparent' - no matter what color it is - white, black, magenta or anything else! -
I get Transparency with Sky on. But not with Ground.
...Gaieus... do you have the Ground on?
-
Correction: Sky do appear when exporting. I just always tried with a view looking down so no sky was visible.
-
@thomthom said:
I get Transparency with Sky on. But not with Ground.
...Gaieus... do you have the Ground on?
I find that both sky and ground obscure my png's background transparency ?
I need to have sky and ground both off to have a fully transparent background in the png, BUT even then shadows on the ground-pane will show up floating is space so you need to have that option off too... -
Don't know why I haven't seen this gem before today...
Awesome, Thomas...!
Thank you SO much...!! -
Hi Thom and TIG; you are right, when I turn ground and sky off, I can export with transparency.
And now I am banging my head to the wall (where is that smiley?
)This is exactly the way you need to set your style to be able to export your png with transparency!
-
Yea - we need that smiley.
This has been one for my Duh! list as well.
-
Thanks anyway (and again) for the plug however. I do not know if there is a solution in ruby but if not, I guess you have already updated the info on the first page.
Maybe a solution to temporarily disable ground and sky?
-
@gaieus said:
Maybe a solution to temporarily disable ground and sky?
Maybe the user want either one on/off...
Advertisement