[Plugin][Code]SKMtools,Material/ImageTools

[Plugin][Code]SKMtools,Material/ImageTools

Postby TIG » Sat Dec 11, 2010 5:55 pm

Please download from the PluginStore...

Download



The archive should be extracted into the Plugins folder - there should be a SKMtools.rb file [loader] that goes directly into Plugins, the there is also a SKMtools subfolder containing several files and sub-folders - theses should all remain in their relative sub-folders, and the SKMtools folder itself goes into Plugins.

The wide-ranging set of tools and code that these files provide briefly is as follows:-

'skm_class.rb' - a new class 'SKM' added to the API - with SKM-file methods - .import, .export, .save_texture and .save_thumbnail, PLUS .extract and .save_texture_and_thumbnail - a separate post outlines these in detail...

'material_class.rb' - extensions of the 'Sketchup::Material' class - with new Material methods - .save_texture, .save_thumbnail, .save_bumpmap, .export_skm, .delete and .name=, PLUS .save_texture_and_thumbnail- a separate post outlines these in detail...

There is a file 'podium_texture+bumpmap.rb' that makes a new method podiumtexturebumpmap(materialname, folder, boolean) to export a given material by name into a given folder as a bumpmap PNG [the optional boolean determines if the bumpmap is 'inverted' or not] using specific naming conventions etc - it could easily be modified to suit other applications - a separate post outlines this in detail...

'image_class.rb' - extensions of the 'Sketchup::Image' class - with new Image methods - .definition, .transformation, .transformation=, .use_as_material, .make_unique, .copy, .clone, .imagefile, .imagefile=, .save_imagefile and a series of methods relating to Image-Animation - .folder, .folder=, .timer, .timer=, .faceme, .faceme=, .start_animation, .start_animation_all, .stop_animation and .stop_animation_all - a separate post outlines these in detail...

There are various cross-platform Java .jar executable applets in the folder required for some of the image and SKM file manipulations. There is also a 'SKMDefaultXMLs' folder containing the premade XML files required for new SKM files.

It also includes the ImageTrimmer tool... viewtopic.php?p=294815#p294815

There is a script 'ImageAnimator.rb' that adds a new Tool to the Plugins Menu / Toolbar. This allows you to set a selected Image's 'folder' containing sequential image-files for use in an Image-Animation. It also allows you to set the selected Image(s) 'folder' to 'Nil'. You can also set the selected Image(s) 'timer' to a frame-rate in seconds [the default of 0.0 means the Image only updates as a Scene tab changes]. You can also set the selected Image{s] 'faceme' behavior between 'None' and facing the camera pivoting about Bottom-Left, Bottom-Center and Bottom-Right locations of the image: when 'faceme' is set the Image is grouped when 'None' it is not. The other controls are 'Animate Selected Images' and 'Stop Selected Images' Animation' or 'Animate All Images' and 'Stop All Image Animation' = PLUS new menu items 'make_unique' and 'clone'.
An animated image will change as you work/pan-zoom or take a screen shot. It should also change with the Scene-tabs if timer=0.0... A separate post covers this in more detail...

There are 'ImageAnimator' examples in these two 'ImageAnimatorExamples' zip files...
ImageAnimatorExamples1.zip
ImageAnimatorExamples2.zip

See these example movies

Download the RBZ archive from the SCF PluginStore

Download

and install its contents... OR get the SketchUcation Plugin Store toolset from the Resources menu, which will AutoInstall Plugins from within SketchUp itself...
2
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin][Code] SKMtools, MaterialTools, ImageTools 20101

Postby Rich O Brien » Sat Dec 11, 2010 6:11 pm

That's an impressive toolset. Thanks TIG!
0
There's a frontroom and a backroom....reverse faces
User avatar
Rich O Brien 
Administrator
 

Re: [Plugin][Code] SKMtools, MaterialTools, ImageTools 20101

Postby Bob James » Sat Dec 11, 2010 8:40 pm

Really neat effects, TIG, but I've loaded the SKM files into the plugins folder and I don't get any toolbar.
0
Last edited by Bob James on Sat Dec 11, 2010 9:19 pm, edited 2 times in total.
i7-4930K 3.4Ghz, 2x GTX780 6GB, 32GB DDR3-1600 ECC, OCZ Vertex 4 500GB, WD Black 3TB, 32TB NAS, 4x 27" Monitors, SpaceMouse Pro, X-keys XK-60
User avatar
Bob James 
Premium Member
Premium Member
 

Re: [Plugin][Code] SKMtools, MaterialTools, ImageTools 20101

Postby ARTchi » Sat Dec 11, 2010 9:01 pm

In what fun? User Sahi, one week ago has made plug-in JpgGif with similar functions!
viewtopic.php?f=323&t=33054
What for to do a similar plug-in? Or in what of advantages of your plug-in?
0
Last edited by ARTchi on Sat Dec 11, 2010 9:43 pm, edited 1 time in total.
User avatar
ARTchi 
 

Re: [Plugin][Code] SKMtools, MaterialTools, ImageTools 20101

Postby Pixero » Sat Dec 11, 2010 9:38 pm

Wow. Thanks! :thumb:
0
User avatar
Pixero 
Premium Member
Premium Member
 

Re: [Plugin][Code] SKMtools, MaterialTools, ImageTools 20101

Postby TIG » Sat Dec 11, 2010 10:39 pm

Bob James wrote:Really neat effects, TIG, but I've loaded the SKM files into the plugins folder and I don't get any toolbar.

ONLY the SKMtools_loader.rb*** goes into Plugings!
ALL other files stay inside their sub-folders [SKMtools etc] inside Plugins...
You need to activate the toolbar from View > Toolbars too...

***NOTE: in more recent version this is named "SKMtools.rb"
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin][Code] SKMtools, MaterialTools, ImageTools 20101

Postby TIG » Sat Dec 11, 2010 10:44 pm

ARTchi wrote:In what fun? User Sahi, one week ago has made plug-in JpgGif with similar functions!
viewtopic.php?f=323&t=33054
What for to do a similar plug-in? Or in what of advantages of your plug-in?

I am well aware of Sahi's tool.
I haven't tried it, but I suspect that it'll be quite similar...
Now for my tool's advantages ?
The main one is it's written by me ?? :mrgreen:
It's 'donation-ware' - i.e. you probably won't pay anything for it!! :?
It's part of a greater set of new API class/methods to expand SKM/Material/Image tools and their use in scripts and web-dialogs... :ugeek:
It was work in progress when Sahi published and I won't waste the coding time even if it might perhaps tread on his toes...
:fro:
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin][Code] SKMtools, MaterialTools, ImageTools 20101

Postby Box » Sat Dec 11, 2010 10:51 pm

Tig I get the same problem as Bob James.

I've extracted all to the plugins folder, but nothing to be seen anywhere.
Looked for it in View toolbars, windows preferences, doesn't seem to load.
0
User avatar
Box 
 

Re: [Plugin][Code] SKMtools, MaterialTools, ImageTools 20101

Postby TIG » Sat Dec 11, 2010 10:52 pm

Box wrote:Tig I get the same problem as Bob James.

I've extracted all to the plugins folder, but nothing to be seen anywhere.
Looked for it in View toolbars, windows preferences, doesn't seem to load.

Do you have menu in View ?
Capture.PNG
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin][Code] SKMtools, MaterialTools, ImageTools 20101

Postby Bob James » Sat Dec 11, 2010 10:54 pm

Sorry, TIG: Operator error - I was looking for "SKM...." in the View/Toolbars list not "ImageAnimator" :oops:
0
i7-4930K 3.4Ghz, 2x GTX780 6GB, 32GB DDR3-1600 ECC, OCZ Vertex 4 500GB, WD Black 3TB, 32TB NAS, 4x 27" Monitors, SpaceMouse Pro, X-keys XK-60
User avatar
Bob James 
Premium Member
Premium Member
 

Re: [Plugin][Code] SKMtools, MaterialTools, ImageTools 20101

Postby TIG » Sat Dec 11, 2010 10:58 pm

Bob James wrote:Sorry, TIG: Operator error - I was looking for "SKM...." in the View/Toolbars list not "ImageAnimator" :oops:

PEBCAC - Problem Exists Between the Computer and Chair [i.e. YOU ;) ]
SO is it working now ?
Do you get the Menu entry too - see my recent post about this...
The Menu AND the Toolbar are both named 'ImageAnimator'
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin][Code] SKMtools, MaterialTools, ImageTools 20101

Postby Box » Sat Dec 11, 2010 11:02 pm

I don't think its a PEBCAC for me, I've searched everywhere, not a sausage.

I've restarted, reextracted, copy and pasted instead of extract all, nothing nadda zilch :mrgreen:
0
User avatar
Box 
 

Re: [Plugin][Code] SKMtools, MaterialTools, ImageTools 20101

Postby TIG » Sat Dec 11, 2010 11:13 pm

Box
You should have only one new file in the ../Plugins/ folder - SKMtools_loader.rb***
Inside the Plugins folder you should have a new sub-folder called SKMtools.
In that folder ../Plugins/SKMtools/ you should have the following files:
Capture.PNG
In these sub-sub-folders you have...
Capture1.PNG

and
Capture2.PNG
and an empty 'Temp' folder.
Make sure you don't have any of the files in the wrong places from an earlier mis-install - it will screw up the correctly placed ones! ...
There is an ImageAnimator sub-menu under the main View menu AND also a new toolbar under View > Toolbars - which is also called ImageAnimator........
***NOTE: in more recent version it is named SKMtools.rb NOT '_loader.rb'
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin][Code] SKMtools, MaterialTools, ImageTools 20101

Postby Box » Sat Dec 11, 2010 11:32 pm

It's odd Tig, it's all as you say it should be, but still nothing showing up.
It's late for me now so I'll have another try with it tomorrow.

Thanks
0
User avatar
Box 
 

Re: [Plugin][Code] SKMtools, MaterialTools, ImageTools 20101

Postby sahi » Sun Dec 12, 2010 12:14 am

Bob James wrote:Really neat effects, TIG, but I've loaded the SKM files into the plugins folder and I don't get any toolbar.

Hi!
I have a similar problem arose.

I made it for myself decided thus

file SKMtools_loader.rb replaced path ="SKMtools" он
path = File.dirname(__FILE__) + "/SKMtools"
0

sahi 
PluginStore Author
PluginStore Author
 

Re: [Plugin][Code] SKMtools, MaterialTools, ImageTools 20101

Postby TIG » Sun Dec 12, 2010 12:49 am

sahi wrote:
Bob James wrote:Really neat effects, TIG, but I've loaded the SKM files into the plugins folder and I don't get any toolbar.

Hi!
I have a similar problem arose.
I made it for myself decided thus
file SKMtools_loader.rb replaced path ="SKMtools" он
path = File.dirname(__FILE__) + "/SKMtools"

Thanks for the advice BUT
path="SKMtools" should work as load "SKMtools/xxx.rb" [when path and the filename are 'added together'] will start in any of the $LOAD_PATH locations which will include ../Plugins/ where SKMtools_loader.rb resides and then SKMtools is that directory up and it looks for the 'file' - I use it all the time to load scripts from subfolders without problem ?
Why do you think it isn't working for just some users ??
It works fine for me... :?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin][Code] SKMtools, MaterialTools, ImageTools 20101

Postby TIG » Sun Dec 12, 2010 12:51 am

TIG wrote:
sahi wrote:
Bob James wrote:Really neat effects, TIG, but I've loaded the SKM files into the plugins folder and I don't get any toolbar.

Hi!
I have a similar problem arose.
I made it for myself decided thus
file SKMtools_loader.rb replaced path ="SKMtools" он
path = File.dirname(__FILE__) + "/SKMtools"

Thanks for the advice BUT...........
path="SKMtools" should work as load "SKMtools/xxx.rb" [when path and the filename are 'added together'] will start in any of the $LOAD_PATH locations which will include ../Plugins/ where SKMtools_loader.rb resides and then SKMtools is that directory up and it looks for the 'file' - I use it all the time to load scripts from subfolders without problem ?
Your example will work - although I'd use path=File.join(File.dirname(__FILE__),"SKMtools") BUT the other method will work anyway :(
Why do you think it isn't working for just some users ??
It works fine for me... :?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin][Code] SKMtools, MaterialTools, ImageTools 20101

Postby sahi » Sun Dec 12, 2010 1:19 am

TIG wrote:Why do you think it isn't working for just some users ??
It works fine for me... :?

I have it too did not work, until I made changes after that he earned.

I have a folder "Plugins" is a standard set of plug-ins, not something extra.
0

sahi 
PluginStore Author
PluginStore Author
 

Re: [Plugin][Code] SKMtools, MaterialTools, ImageTools 20101

Postby Box » Sun Dec 12, 2010 12:41 pm

I've tried it again on a different computer and same result. Nothing.

Just to be sure, I downloaded the .zip, double click, select extract all, browse to Plugin folder, extract all. Should I be doing anything else, or perhaps there is another file from one of your other tools that I am missing.

Other thoughts would be,

I may have a conflicting plugin

or

I have sketchup installed in the default location, ie: in program files.


I just installed your other plugin, Manifold in exactly the same way and it works perfectly.
0
User avatar
Box 
 

Re: [Plugin][Code] SKMtools,MaterialTools,ImageTools101212

Postby TIG » Sun Dec 12, 2010 1:39 pm

sahi wrote:
TIG wrote:Why do you think it isn't working for just some users ??
It works fine for me... :?

I have it too did not work, until I made changes after that he earned.

I have a folder "Plugins" is a standard set of plug-ins, not something extra.

Sahi / Box

I think I have the cause...
If there's an obscure script [that I don't know of] that loads before SKMtools_loader.rb and it has code outside of its methods that is permanently changing the current directory [ill-advisedly] then my method will fail when using 'Dir' [but not 'load']. Sahi's method [or something like it] will work as it uses an 'absolute' and not 'relative' path. To check what the current directory is after startup type Dir.pwd in the Ruby Console - it should return the ../Plugins/ folder where SKMtools_loader.rb resides - if not then we know something is changing the pwd.

There's now an updated SKMtools_loader.rb file - please replace the one in the ../Plugins/ folder with this one, and retry. I have included this file in an update of the zipped set in the first post too...
NOTE: more recent versions do NOT need/use SKMtools_loader.rb.
Only install the files from the RBZ set...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin][Code]SKMtools,MaterialTools,ImageTools101212

Postby TIG » Sun Dec 12, 2010 1:47 pm

viewtopic.php?p=293677#p293677 Here is an updated version with the 'loader' script adjusted to avoid earlier loading scripts messing up the 'dir/load' paths...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin][Code]SKMtools,MaterialTools,ImageTools101212

Postby Box » Sun Dec 12, 2010 2:23 pm

Perfect Tig, thanks, works now.
0
User avatar
Box 
 

Re: [Plugin][Code]SKMtools,MaterialTools,ImageTools101213

Postby TIG » Mon Dec 13, 2010 12:42 am

Here's an update viewtopic.php?p=293677#p293677
It includes new methods:-

Material.save_texture_and_thumbnail(folder)
- saves Material's texture [if any] and its thumbnail [png] into a subfolder named after the material in 'folder' - returns that subfolder path or nil.

SKM.save_texture_and_thumbnail(path_skm, folder)
- saves SKM's texture [if any] and its thumbnail [png] to a subfolder named after the SKM in 'folder' - returns taht subfolder path or nil

SKM.extract(path_skm, 'folder')
- extracts all of the SKM's data into a 'hash': if the optional 'folder' is given the files from the SKM are extracted into a subfolder named after the SKM in 'folder'. All of the available SKM data is accessible from the 'hash', if 'folder' is given then the paths to the texture/thumbnail etc are accessible...

ImageAnimator
- new menu items 'Make_Unique' and 'Clone'.

See individual tools threads for more details...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin][Code]SKMtools,MaterialTools,ImageTools101213

Postby TIG » Mon Dec 13, 2010 5:06 pm

Here's another update viewtopic.php?p=293677#p293677
It contains a new tool 'gifxtractor' which lets you quickly extract PNG files for each frame in a given animated GIF file...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin][Code]SKMtools,MaterialTools,ImageTools101213

Postby Ken » Mon Dec 13, 2010 7:25 pm

TIG

It appears that the version, ....3a.zip is missing two images for the last two menu items, make unique and clone.


Thanks for all of your work.

Ken
0
Fight like your the third monkey on Noah's Ark gangway.
User avatar
Ken 
Premium Member
Premium Member
 

Re: [Plugin][Code]SKMtools,MaterialTools,ImageTools101213

Postby TIG » Mon Dec 13, 2010 8:03 pm

Ken, the two new 'ImageAnimator' tools 'Make_Unique' and 'Clone' should only have appeared in the View > ImageAnimator sub-menu as they are not that often used - the toolbar buttons were a result of a typo in my code :oops:
This is the updated version ..13b...viewtopic.php?p=293677#p293677
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin][Code]SKMtools,MaterialTools,ImageTools101213

Postby xrok1 » Tue Dec 14, 2010 4:05 am

WOW! :shock:
good work :thumb:
0
“There are three classes of people: those who see. Those who see when they are shown. Those who do not see.”

http://www.Twilightrender.com try it!

xrok1 
 

Re: [Plugin][Code]SKMtools,MaterialTools,ImageTools101213

Postby erikB » Thu Dec 16, 2010 2:51 pm

tig,
fantastic ruby !
Only I can't seem to find the "make unique button"
In stead I see two times : set folder from selected images to Nil ?

greetings,

erikB
0
User avatar
erikB 
 

Re: [Plugin][Code]SKMtools,MaterialTools,ImageTools101216

Postby TIG » Thu Dec 16, 2010 4:49 pm

erikB

Another typo in my code :roll: the latest [corrected] version is here
viewtopic.php?p=293677#p293677
This version also includes 'ImageTrimmer' - a tool to trim around transparent areas in a .png Image and make a new Component - useful to trim around 'cardboard' cutout people from photos etc... see here for more details viewtopic.php?p=294815#p294815
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin][Code]SKMtools,MaterialTools,ImageTools101217

Postby TIG » Fri Dec 17, 2010 4:09 pm

Here's an update viewtopic.php?p=293677#p293677
The 'ImageTrimmer' now has an option to simplify the outline and a new separate tool to do this post processing too.
0
TIG
User avatar
TIG 
Global Moderator
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

Next


 

Return to Plugins

Who is online

Users browsing this forum: Hutton, karistodimos, kohji, navichan, PierreGB, SIMFAR88 and 12 guests

Visit our sponsors: