I’ve been using this little snippet of code to determine the path to my various subfolders and files within my plugin folder:
this_dir=File.dirname(__FILE__) # Fix for ruby 2.0 if this_dir.respond_to?(:force_encoding) this_dir=this_dir.dup.force_encoding("UTF-8") end
then something like this:
@Roof_osb_mat.texture = File.join(this_dir,'materials/WOOD_OSB.jpg')
Now I’ve decided to nest some of my ruby files within sub-folders but I still want to access this same content found in the materials folder. What would be the best way to do this?