Extract Material thumbnail?
-
But isn't that thumbnails for .skp files? Like
Sketchup.save_thumbnail
http://code.google.com/intl/nb/apis/sketchup/docs/ourdoc/sketchup.html#save_thumbnail
-
The think that SDK's
ISkpThumbnailProvider
code is applicable to any object supporting a thumbnails - like Components and Materials... -
And this C++ voodoo can be used at run-time?
-
Just open the file from Ruby and rip out what you want, whats the problem?
-
I think you'd need to make an add-on that loads at startup that provides extra methods like the Exporters do like Skp2Acad.dll [presumably something else on a Mac!]- in this case say export(material.thumbnail,"filepath")
Not sure - it's a bit outside my remit............
You can also find the material's texture inside the SKP file's data but then getting it's thumbnail and the 'bits' is beyond me... -
@adamb said:
Just open the file from Ruby and rip out what you want, whats the problem?
But how - how do we find the particular material, then its texture and then its thumbnail within the mess of SKP data...
-
@adamb said:
Just open the file from Ruby and rip out what you want, whats the problem?
Because that would require the user to save the model before the script would be able to extract the thumbnails.
As mentioned - I'm trying to make a replacement for the material browser - so I need to get the material thumbnails at run time from the open model. -
@thomthom said:
Because that would require the user to save the model before the script would be able to extract the thumbnails.
Also - material thumbnails doesn't appear to be stored in the .skp file...
-
The material thumbnails are stored in the .SKM files [which is actually '.ZIP' files].
You can export a material's texture's image-file quite easily using existing API methods... and use that as your image... OR extract the thumbnail from the .SKM file as if it were a 'zip' using Ruby 'zip' methods'... -
@tig said:
You can export the material's texture's image-file quite easily using existing API methods
Original size - which might be huge. Not ideal for a material browser which would then load lots of full size images and only display it at a fraction of its size.@tig said:
OR extract the thumbnail from the file as if it were a 'zip' using ruby 'zip' methods'...
But there isn't a way to get in-model materials exported as .skm via Ruby, is it? -
If you get a 'large' image there are Ruby tools to down-size it into a thumbnail ???
http://rmagick.rubyforge.org/
http://snippets.dzone.com/posts/show/3621
http://oldwiki.rubyonrails.org/rails/pages/HowtoCreateThumbnailImages
etc etc............
Advertisement