Does anyone know how how to get the watermark image in the ruby console? The API shows how to get the active_style and such, but no reference to the watermark!
Thanks for any advice you can provide.
Ruby code to extract watermark
15 posts
• Page 1 of 1
Ruby code to extract watermarkDoes anyone know how how to get the watermark image in the ruby console? The API shows how to get the active_style and such, but no reference to the watermark!
Thanks for any advice you can provide. I'm from Mars and moved to Earth to alienize you. Unfortunately, I became humanized.
Re: Ruby code to extract watermarkThere doesn't seem to be any get/set methods for watermarks...
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
Re: Ruby code to extract watermarkBut there is a 'WatermarkManager', perhaps undocumented?
I'm from Mars and moved to Earth to alienize you. Unfortunately, I became humanized.
Re: Ruby code to extract watermark
Where have you found this? I don't find it anywhere in the Ruby API... Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
Re: Ruby code to extract watermark
In Sketchup.exe there is the word 'WatermarkManager' (no space) so it must mean something oter than plain English 'Watermark Manager'. I'm from Mars and moved to Earth to alienize you. Unfortunately, I became humanized.
Re: Ruby code to extract watermarkThere might very well be something like that in SketchUp - but not something that's exposed to the Ruby API.
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
Re: Ruby code to extract watermark
Maybe it's just an undocumented api? I'm from Mars and moved to Earth to alienize you. Unfortunately, I became humanized.
Re: Ruby code to extract watermarkIt's not an API if it's not available. I can't find it even in the C++ SDK for reading and writing SketchUp files.
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
Re: Ruby code to extract watermark'WatermarkManager' appears in these files
Please, register (free) to access all the attachments on the forums. TIG
Re: Ruby code to extract watermarkThe only solution I see would be to scan the .skp for image header info.
See this post for example code.
Re: Ruby code to extract watermark
I was hoping I could find something here on the forum on how access watermarks (set at least). I guess it can be done through C Extension... I appreciate a help from Google team. Author of Thea Render for SketchUp
Re: Ruby code to extract watermark
C Extensions can't do anything more than normal Ruby. It still needs to deal with the Ruby API. The C++ SDK might, but that is for reading and writing .skp files - not dealing with the currently open model in SU. Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
Re: Ruby code to extract watermarkIn the same way that my SKMtools add some missing API functions to let you load a SKM file as a Material, save a Material as a SKM file, or extract SKM images/thumbnails etc, you COULD envisage a similar StyleTools set of additional methods. A '.style' file is only a zip-file with a different suffix - any watermarks are defined in the 'document.xml' under the 'screenimages' section as an individual 'screemimage' with its settings and the required image file is in the 'ref' folder. So if you just want to get a watermark image from a .style file it's straightforward - but getting any info from a loaded Style is fraught... Unfortunately, whilst the making/setting/adding .style parts seem quite possible, access to loaded Style info is very limited - to name and description !
You could envisage a tool that compiles the required parts of a 'zipped' style [images and xml files] into a new .style file that you then load into the SKP using standard API methods... Here's an extract of some watermark xml
Please, register (free) to access all the attachments on the forums. TIG
Re: Ruby code to extract watermark
I am aware of it. I thought one could access certain C methods within SU Dll's/internals to set a watermark. Author of Thea Render for SketchUp
Re: Ruby code to extract watermarkYou can actually display watermarks.
model = Sketchup.active_model opts = model.rendering_options opts['DisplayWatermarks'] = true/false Yep, there is no function to get/set watermark image, though there is actually a way around it. "Watermarks are part of a Style. You would have to have a preset Style with the watermark, and change the Style with the API." - quote by Dan. Create a style or two, add watermarks to each, and set them via Ruby API: styles = Sketchup.active_model.styles styles.selected_style = styles['Style Name'/style index#] Reference: Watermark via Ruby API
SketchUcation One-Liner AdvertsAre you a Premium Member? Get your freebies here. Are you not> a Premium Member yet? Upgrade your account to grab these freebies instantly.
15 posts
• Page 1 of 1
|