Thanks both - I do need to sample the texture, not just a pixel. Eg for wood grain. And I’d like the texture name picked up as well - as with the dropper.
I was hoping to find a way of doing this without copying and pasting faces as I’m creating quite an extensive collection of textures that my colleagues can select from and browse through with their clients. The copying and pasting option doesn’t look very slick if you are doing in multiple times with multiple textures.
I’m really trying to create a library of textures that all my colleagues can access, that I can keep up to date, and that requires no set up on my colleagues computers. That sounds like a big ask, but on a mac the dropper tool actually makes this easy (with the help of a file shared via dropbox). It is frustrating that on a windows a similar thing can’t work!
Why don’t you just save the textures into a local collection. You can do that easily enough with the secondary pane in the Materials panel open and set to the local collection folder. Then just drag and drop materials from the In Model collection to the local collection.
That’s what I do for myself, but I’m trying to create a system for everyone to use.
We’ve got over 80 colours, 30 different wood finishes, and about 20 leathers and fabrics. And they get regularly changed. I can’t rely on my colleagues to keep their collections all updated - which is clearly important as otherwise they might sell things we no longer offer. Its easily done in the heat of the moment when you are working on the model with a client!
Put one or two people in charge of keeping the materials collections up to date. They can add to or remove from the collections as needed. Put the collections folders in a common location that everyone has access to.
every computer could have a small SU ruby script that checks your server for the ‘current version’ of the folder, and install it automatically…
# first you need to add a txt file to the collection folder with "VERSION = 1.0.1" as content...
# you would use your folder name
installed_version = Sketchup.find_support_file("version.txt", "Materials/My Textures/") rescue 'missing'
i_number = IO.readlines(version)[0][-6..-1].to_s
# you would use your server path
update_version = File.expand_path( "~/Documents/Materials/My Textures/", "version.txt")
u_number = IO.readlines(update_version)[0][-6..-1].to_s rescue 'missing'
if installed_version == update_version
UI.messagebox("Materials are current")
else
msg = 'Installing new version '
msg << u_number
UI.messagebox("#{msg}")
# a second method would check both folders and update the files en-mass or individually...
# :update_all()
end
this script will run if pasted into Ruby Console, as a proof of concept…
john
Thank you for this script John - much appreciated. I’ve barely dipped my toe into ruby scripting so I’m not quite up to adapting this to my purpose yet, but it sounds like the way forward.