Auto naming and replacing materials?
-
Hello!
I'm looking for plugins which allow me to
- replace certain textures with other ones (like replacing "Black_Center.png","Black_Side.png" and "Black_Corner.png" with "Red_Center.png", "Red_Side.png" and "Red_Corner.png")
- name all materials after the filename of the texture (if it uses a texture)
The second function is more important. I cannot code but if you can give me a line of code that does that, I could try to wrap it up as a plugin.
Thank you in advance!
-
The method
texturepath = material.texture.filenamereturns the path/name of the material's texture's image-file. Use something likeimagename = nil; imagename = File.basename(material.texture.filename) if material.texture...
To change a material's texture you use a new pathmaterial.texture="C:/.../mytetxure.png".
To get a material's name usematname = material.name.
To rename a material usematerial.name="newname"ORmaterial.name=imagename if imagename- note that the renaming method is unavailable in older versions of Sketchup...
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement