mass material importer

mass material importer

Postby ARCHI_BUM » Thu Mar 26, 2009 4:53 pm

Hi all,

I found this post on the google groups from nov. of 07, when searching for a way to import a group of materials into sketchup. I installed the ruby and it shows up under my plugins drop down. Problem is I cant get it to work. Does anyone have any experience with this particular plugin??? The genesis of my problem is the need for a bunch of sketchy type materials for a black and white presentation i'm preparing in Layout. I was only able to find a set of jpg's hence my need to convert them to .skm files.

"QUESTION:
Is there a way to automate a bulk add of a JPG library to the
SKM library? I've got several hundred material texture images and it
would be tedious to convert them by hand one by one.

ANSWER:
Use the ruby script Mass Material Importer
http://www.crai.archi.fr/RubyLibraryDep ... mporter.rb.
to place an entire folder of images into your In-Model library, which
you can then save with Save As Library. You'll probably have to tweak
the scales on the images."

Thanks for any help!!
0

ARCHI_BUM 
 

Re: mass material importer

Postby TIG » Thu Mar 26, 2009 5:21 pm

Since I tweaked this so it worked originally, here goes...

You pick 'Import Materials' off the Plugins menu.
You'll get a dialog open up.
Navigate to the folder that contains all of your image files (jpg etc).
Select one of the files and click OK - the instructions on the dialog's top-bar tell you to do this...
Because there is no 'get directory' method in SketchUp Ruby the work around is that you select one file and the script works out that file's directory... Then it takes all of the images in that directory and these are added as materials in the Model - open the 'model-tab' in the Materials browser to see them...
You might need to scale the materials individually...
You can then 'save_as' pop-out to export these as separate .skm files outside of the one model if you have multiple models needing some of these materials.

Still works for me...

.
0
Last edited by TIG on Fri Mar 27, 2009 11:21 am, edited 1 time in total.
TIG
User avatar
TIG 
Global Moderator
 

Re: mass material importer

Postby Burkhard » Thu Mar 26, 2009 7:38 pm

0
User avatar
Burkhard 
Premium Member
Premium Member
 

Re: mass material importer

Postby putnik » Fri Mar 27, 2009 1:38 am

What do you do about the scale of the imported images? You still have to manually scale every imported image to make it usable, i.e. brick textures (or any patterned texture that is meant to have a certain size in relation to SketchUp model space).

There are a few SketchUp material libraries floating around the www, that are basically just images with unrealistic scale, and not true material libraries..
0

putnik 
 

Re: mass material importer

Postby ericschimel » Sat May 01, 2010 10:29 pm

Is there a way that you can set the default texture size? I see that when you import them, they all come in at 10" x 10".....

Other then that, sweet plugin!
0
-Eric
http://sketchucation.com/click.php?url=http://plugin.sketchthis.net
Sketchup Kitchen Design Plugin
Custom Models

ericschimel 
PluginStore Author
PluginStore Author
 

Re: mass material importer

Postby TIG » Sun May 02, 2010 4:43 pm

You can read the image size and set the materials texture to suit...
Code: Select all
### material == mat in the script...
image_width_in_pixels = mat.texture.image_width
image_height_in_pixels = mat.texture.image_height
my_factor = 0.3333333 ### how do we decide this ?***
image_height_in_inches = image_height_in_pixels * my_factor
mat.texture.size = image_height_in_inches ### auto-keeping aspect ratio
### OR perhaps mat.texture.size = [image_width_in_inches, image_height_in_inches] ### ???

*** Unfortunately there seems to be no direct relationship between the original image size in pixels and imported image or the texture size it produces. We could find
path_to_image=mat.texture.filename
then use Ruby to find its size - as its file-size might come into the equation with it w/h pixel size ?
file_size=File.size(path_to_image)
Not sure how though ??? my_factor would then be calculated based on the file_size and image_height in pixels, to return it as inches ?
To show this weirdness manually you can import two images of different pixel sizes and double-click to place them with no scaling - and an image of 225x225px might become a SUp image of 75x75" when exploded, whilst one 512x512px might become 69x69" - the height:width ratio is kept but the image-size varies - probably depending on the image's complexity, I find that low-res monochrome images import as very large in w/h inches ?

It's an enhancement I've yet to implement - if you want to add it then it's not so hard - except for working out what the size should be ??? ... :geek:
0
TIG
User avatar
TIG 
Global Moderator
 

Re: mass material importer

Postby Gaieus » Sun May 02, 2010 5:54 pm

Also there is no direct relationship between an image size in pixels and how many virtualinches/sms it should cover in SU (just think of brick sizes -how would the plugin know how many bricks are in the image and how big they are supposed to be each?).

It seems that some manual tweaking and rescaling the images cannot be spared in SU.
0
User avatar
Gaieus 
 

Re: mass material importer

Postby 3D Modeler » Fri Feb 01, 2013 10:44 pm

BTW - WOW ... this is an EXCELLENT Plugin.
I wish I had known about this a long time ago but better late than never.
This plugin will save me (and others) a HUGE amount of time.

I have hundreds of hi-res repeating photo textures that would take hours or even days to import and save one-by-one.
With this Plugin/Ruby, I was able to save many in just a few clicks.
It's going to get lots of use over the next day or two ... any for hereinafter.
0
User avatar
3D Modeler 
 

Re: mass material importer

Postby tomot » Mon Feb 04, 2013 6:30 pm

3D Modeler wrote:BTW - WOW ... this is an EXCELLENT Plugin.
I wish I had known about this a long time ago but better late than never.
This plugin will save me (and others) a HUGE amount of time.


I agree, I have a large collection, which I'm willing to share, is it possible to
setup a sharing of Materials Repository for .skm files at this Forum?
0

tomot 
PluginStore Author
PluginStore Author
 

Re: mass material importer

Postby Krisidious » Mon Feb 04, 2013 8:37 pm

Tomot... I don't know but let me know. I'd love to see what you have.

I still use the importer and it works somewhat well. I do have issues with it after using it 3 times in a row or using it on folders with over 50 textures it imports them in a black hue or a light gray hue. So I try to keep the folders small.

then of course the standard 10" I would at least like it to be 1'x 1'.
0
By: Kristoff Rand
Home Designer
Unique House Plans
User avatar
Krisidious 
 

Re: mass material importer

Postby tomot » Mon Feb 04, 2013 9:17 pm

Krisidious wrote:Tomot... I don't know but let me know. I'd love to see what you have.

I don't want to be accused of stealing this thread, ....sorry!
Come to think of it this might not be feasible in this forum.
Therefore I would suggest Google Drive as an alternative. It offers 5GB free and its easy to email download links to friends that are interested in cross sharing.

My current customized material files are not small?
0

tomot 
PluginStore Author
PluginStore Author
 

Re: mass material importer

Postby Krisidious » Mon Feb 04, 2013 10:07 pm

I know what you mean...

the smaller folder being my .skm's the larger all the originals and stuff I might not have used or converted yet.

I would really love and would pay (hint hint) to be able to convert all the files to skms... and keep the folder structure in tact.

materials.JPG
0
By: Kristoff Rand
Home Designer
Unique House Plans
User avatar
Krisidious 
 

Re: mass material importer

Postby tomot » Mon Feb 04, 2013 11:46 pm

Krisidious wrote:I know what you mean...

the smaller folder being my .skm's the larger all the originals and stuff I might not have used or converted yet.

I would really love and would pay (hint hint) to be able to convert all the files to skms... and keep the folder structure in tact.

materials.JPG


It does not take long to make the conversion, all it takes is time :) Hint: I keep my textures in separate prefixed folders, while keeping the original texture file folder names unchanged. This way I can always copy my texture folders to any new install of SU. Using this procedure your new prefixed folders can be added to my folders under the common Materials folder, or vice versa.
0

tomot 
PluginStore Author
PluginStore Author
 

Re: mass material importer

Postby charlezzz » Tue Jun 20, 2017 4:25 pm

Thanks a lot guys for the tips ! the script work fine.

But really no one have any idea how to batch-adjust the tiling of the material ? Other ways it will take me days to manually adjust each one of them :? (I have like 500 skm tu adjust)
0

charlezzz 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Developers' Forum

Who is online

Users browsing this forum: No registered users and 3 guests

Visit our sponsors: