<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Massmaterialimportant.rb woes]]></title><description><![CDATA[<p dir="auto">hi tig,</p>
<p dir="auto">i am having a little problem with this script. it works fine as far as importing goes.</p>
<p dir="auto">i am trying to import a number of wood textures into a skp file. the problem i am having is that no matter what texture i choose to import it keeps importing the first one.</p>
<p dir="auto">is there a solution for that? or, am i doing something wrong?</p>
<p dir="auto">cheers.</p>
]]></description><link>https://community.sketchucation.com/topic/99008/massmaterialimportant-rb-woes</link><generator>RSS for Node</generator><lastBuildDate>Wed, 12 Aug 2026 23:22:28 GMT</lastBuildDate><atom:link href="https://community.sketchucation.com/topic/99008.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 08 Dec 2007 06:34:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Massmaterialimportant.rb woes on Sat, 08 Dec 2007 06:39:21 GMT]]></title><description><![CDATA[<p dir="auto">better than that, i will post the files.</p>
<p dir="auto"><img src="http://www.sketchucation.com/forums/scf/sas/Ruby/BOARD01.JPG" alt="http://www.sketchucation.com/forums/scf/sas/Ruby/BOARD01.JPG" class=" img-fluid img-markdown" /></p>
<p dir="auto"><img src="http://www.sketchucation.com/forums/scf/sas/Ruby/WOO003.JPG" alt="http://www.sketchucation.com/forums/scf/sas/Ruby/WOO003.JPG" class=" img-fluid img-markdown" /></p>
<p dir="auto"><img src="http://www.sketchucation.com/forums/scf/sas/Ruby/ratty_wood.jpg" alt="http://www.sketchucation.com/forums/scf/sas/Ruby/ratty_wood.jpg" class=" img-fluid img-markdown" /></p>
<p dir="auto"><img src="http://www.sketchucation.com/forums/scf/sas/Ruby/garden_wood_slats_color.jpeg" alt="http://www.sketchucation.com/forums/scf/sas/Ruby/garden_wood_slats_color.jpeg" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.sketchucation.com/post/962507</link><guid isPermaLink="true">https://community.sketchucation.com/post/962507</guid><dc:creator><![CDATA[Edson]]></dc:creator><pubDate>Sat, 08 Dec 2007 06:39:21 GMT</pubDate></item><item><title><![CDATA[Reply to Massmaterialimportant.rb woes on Sat, 08 Dec 2007 06:35:27 GMT]]></title><description><![CDATA[<p dir="auto">This may have nothing to do with it but I have been burned using this type of code before:</p>
<pre><code>imgname= image.split(".")[0..-2].join(".") ### removes .jpg etc from end
</code></pre>
<p dir="auto">Maybe he is using weird filenames that aren't properly handled by this code.  (eg. "my.texture.jpeg")</p>
<p dir="auto">Can you post the names of the files you are trying to import?</p>
]]></description><link>https://community.sketchucation.com/post/962506</link><guid isPermaLink="true">https://community.sketchucation.com/post/962506</guid><dc:creator><![CDATA[Whaat]]></dc:creator><pubDate>Sat, 08 Dec 2007 06:35:27 GMT</pubDate></item><item><title><![CDATA[Reply to Massmaterialimportant.rb woes on Sat, 08 Dec 2007 06:34:56 GMT]]></title><description><![CDATA[<p dir="auto">This is the entire code [I tweaked it almost two years ago...]</p>
<pre><code>#This script was created by Adam Beazley for public use and may be edited.
#http://www.abeazleydesign.com
#Directions
#Just click in the Import Materials button in the plugins menu and type in the location of all of you image files.
#This script will create a material and name it the same name as the image file and then use that file as the texture.
#all textures will come in at a standard scale and must be edited later
#after all materials and textures have been imported into the model, simply add them to your library
#you can then save the library as a .skm library file through sketchup.
#have fun!!!
#
### v1.1 TIG tweaks 29/12/05 ###
#-----------------------------------------------------------------------------
require 'sketchup.rb'
#-----------------------------------------------------------------------------
def materialimporter
   model= Sketchup.active_model
   materials= model.materials
   model.start_operation ("Import Materials") ###undo - see commit at end
   pwd= Dir.getwd.split("/").join("\\")+"\\" ### fix for SU
   dry= UI.openpanel "To Pick this Directory; Pick Any Image File + OK...", pwd , "*.???"
   ### for jpg or png
   return nil if not dry
   dry= File.dirname(dry)
   return nil if not dry
   cwd= Dir.chdir(dry)
   images= Dir["*.{jpg,png,tif,bmp,gif,tga,epx}"]### for all supported image file types
   for image in images
      imgname= image.split(".")[0..-2].join(".") ### removes .jpg etc from end
      mat= materials.add imgname
      mat.texture= image
   end#for image###
   model.commit_operation ###undo all if needed
end#def###
if(not file_loaded?("massmaterialimporter.rb"))
    menu=UI.menu("Plugins")
    menu.add_separator
    menu.add_item("Import Materials") { materialimporter }
end
#-----------------------------------------------------------------------------
file_loaded("massmaterialimporter.rb")
#
</code></pre>
<p dir="auto">Works fine for me ?</p>
]]></description><link>https://community.sketchucation.com/post/962505</link><guid isPermaLink="true">https://community.sketchucation.com/post/962505</guid><dc:creator><![CDATA[TIG]]></dc:creator><pubDate>Sat, 08 Dec 2007 06:34:56 GMT</pubDate></item></channel></rss>