Mass Material Importer
-
My old computer (the one with all my materials libraries on them) took a dump. I now need to recreate the materials folders. I seem to be having trouble getting the old Mass Material Importer plug-in to work. It loads and asks for a file location, I enter that, and then nothing.
Is there a way to batch do this outside of the old plug-in? It is way too tedious doing this one at a time. I find it hard to believe there's nothing in the warehouse that accomplishes this. It's got to be one of the most basic plug-ins.
Thanks!
-
Do you need to add .skm files back to SketchUp as collections?
If you have your original .skm files then is is relatively quick to setup new collection in SketchUp.
PS...
What concerns me more is that your old PC took a dump. -
I do not have the skm collections. I do have old Sketchup files with materials in them but I thought it'd be just easier to download the jpgs (mostly from manufacturer tileable images). But converting hundreds of jpgs to skms isn't fun.
-
@dillow said:
I do not have the skm collections. I do have old Sketchup files with materials in them but I thought it'd be just easier to download the jpgs (mostly from manufacturer tileable images). But converting hundreds of jpgs to skis isn't fun.
Here is a version of the method I use to load materials into a model.
module DILLOW def self.materials_from_file @mod = Sketchup.active_model @textures_from_file = []; @images = []; @image_path ||= File.dirname(__FILE__)+"/*.*" @image_path = UI.openpanel("Texture Files",@image_path) unless @image_path==nil image_folder = File.dirname(@image_path.gsub('\\','/')); @images = Dir[image_folder+"/*.{jpg,png,tif,bmp,gif,tga,epx}"] @images.each{|i| @textures_from_file<<File.basename(i,'.*')}; if @textures_from_file[0] @textures_from_file.each_with_index{|name,i| unless @mod.materials[name] mat = @mod.materials.add(name) mat.texture = @images[i] end } end end end end DILLOW.materials_from_file
Copy and paste into Ruby Console and press Enter to execute. Select any image file and click Open.
-
sdmitch your code is awesome, thank you!
-
SDMITCH! After searching for hours, I finally found your script and it does 90% of what I was looking for. Thank you so much!!! This is the closest thing I have found to a batch material import for 2019. I still have to save the skms back to the folder i want and then upload the collection, but bringing the images in into sketchup is the real timesuck.
Advertisement