[Plugin] Material Tools

[Plugin] Material Tools

Postby thomthom » Mon Mar 16, 2009 3:00 pm

Overview
(Previously named "Remove Materials")
There are some various plugins out there already which removes material from the model. But I had some specific needs which didn't fit so I wrote some extra ones. Thought I'd post them here just in case. There's been other small utitlities I've written which I thought other people would never have any use for, but as it turned out, they did.

Access
Plugins > Material Tools

Features
Instance Material to Faces
Recursively transfers the material on groups and components onto the faces inside.
(Does not take into account instances with different materials applied.)

Remove From Entire Model
Removes all materials from all the entities in the model.

Remove From Selection
Recursively removes the material from the selected entities.

Remove From All Edges
Removes the material from all edges in the model. This is useful for when some edges has a material applied to it preventing the material from being purged.

Remove From Faces and Edges
Removes the material from all edges and faces in the model.

Remove All Backface Materials

Remove Specific Material
This will prompt you for which material you would like to remove from the entities in your current selection. I also processes the entities of the groups and components in your selection, but not nested groups or components!

Remove All Textures
Strips all materials from the texture.

List Textures in Console
Prints out a list of the textures in the model sorted by texture size (number of pixels).

Apply Colour Adjustments
Bakes the colour adjustment into the textured materials.

Ensure Unique Filenames
Ensures all texture filenames are unique. ( Use at own risk! )

Paint roof
Applies the current material to non-vertical surfaces.

Transparent Material to Backside
Transfers transparent front side materials from to the backside.

Requirements
  • SketchUp 7 or newer - ( Other versions untested )
  • TT_Lib2 (v2.7.0)

Download



Footprint
<Sketchup>/Plugins/
+-
tt_material_tools.rb

0
Last edited by thomthom on Sat Jan 18, 2014 1:19 pm, edited 3 times in total.
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Remove Materials (1.1.0)

Postby Heven7_floor » Mon Mar 16, 2009 4:22 pm

Thanks very much Thom
I doubt and wait the script like this for a long time, it is usefully for specific mat. what need edit/remove :thumb:
0

Heven7_floor 
 

Re: [Plugin] Remove Materials (1.1.0)

Postby Jim Smith » Mon Mar 16, 2009 4:43 pm

Thank you Thomas. I will find this useful.
0
"Out of clutter find simplicity,
from discord find harmony,
In the middle of difficulty lies opportunity"
Albert Einstein
User avatar
Jim Smith 
Premium Member
Premium Member
 

Re: [Plugin] Remove Materials (1.1.0)

Postby Chris Fullmer » Mon Mar 16, 2009 4:57 pm

thomthom wrote:There's been other small utitlities I've written which I thought other people would never have any use for, but as it turned out, they did.

Funny how that works! My most involved script so far has been a script that started off drawing a vertical line. :roflmao:

And so it is with this, it will be quite useful to many, thanks a bunch!

Chris
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] Remove Materials (1.1.0)

Postby craigbic » Mon Mar 16, 2009 6:45 pm

Excellent! Can't have too many options for removing materials. Thank you! :D
0
Checkout the Sketchup Graphics Blog at http://sketchupgraphics.com

craigbic 
 

Re: [Plugin] Remove Materials (1.1.0)

Postby ilovesally99 » Tue Mar 31, 2009 9:42 am

thx for sharing
it solved a lot of problem!
0

ilovesally99 
 

Re: [Plugin] Remove Materials (1.1.0)

Postby wolfy » Tue Mar 31, 2009 2:42 pm

Thanks Thomthom! Will come in very handy. I was wondering why some mats wouldn't purge so thanks for answering that as well. :D Keep up the great work!
0

wolfy 
 

Re: [Plugin] Remove Materials (1.1.0)

Postby xjxjordan » Wed Apr 01, 2009 12:21 am

Thank you so muck :berserk: :berserk: :berserk:
0

xjxjordan 
 

Re: [Plugin] Remove Materials (1.1.0)

Postby linea » Wed Apr 01, 2009 6:58 am

Good idea Thom.

Thanks
0

linea 
 

Re: [Plugin] Remove Materials (1.1.0)

Postby Tomi » Sat May 09, 2009 10:13 am

I apologise for this not being quite the right thread, but you're the man for this, I think...

I have a thoroughly complex model, imported from Autocad where every individual object was a block and then those blocks nested within a block (e.g. 1st floor structure). Now in Sketchup I want to add materials to what are now components, components nested within components, groups etc. I thought I could do this from the layer window, but, of course, I'm still thinking in Autocad and Sketchup works differently, and I can not change the materials of components and nested components this way.

Is there a way to apply materials by layer to components, groups, and nested components? I'm loathed to edit thousands of components individually by double clicking on the component and then using the paint bucket tool.

Please help me thomthom!
0

Tomi 
 

Re: [Plugin] Remove Materials (1.1.0)

Postby Chris Fullmer » Sat May 09, 2009 10:23 am

I'll help get the ball rolling...

Do you just want a single material applied to the entire component? Like, you want all components named "doorhandle_01" to be painted silver, regardless how deep they are buried?

Also, how many DIFFERENT components are there? You say thousands, but is it 10os of copies of only 10 different components? Or is it really thousands of different components?

Do you have a sample model you could upload?
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] Remove Materials (1.1.0)

Postby thomthom » Sat May 09, 2009 10:27 am

Tomi wrote:Is there a way to apply materials by layer to components, groups, and nested components? I'm loathed to edit thousands of components individually by double clicking on the component and then using the paint bucket tool.


Are you aware of the Color By Layer function from the menu that pops up when you click the button with the arrow icon to tha far right of the layer window? Would that do the trick for you?
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Remove Materials (1.1.0)

Postby thomthom » Sat May 09, 2009 10:30 am

If you want to transfer the layer colours to the geometry, then there's already a plugin out there. Search for " layers_materials" at http://www.sketchucation.com/extensions-index/
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Remove Materials (1.1.0)

Postby Tomi » Sat May 09, 2009 10:39 am

Wow. You were quick. I can't upload the whole file because even zipped it is 25MB. Layer by colour... tried that first but it only changed the elements of the drawings that weren't components - namely one or two (the landscaping). The other suggestions sound promising, let me look into them now...

P.S. Thanks tremendously.
0

Tomi 
 

Re: [Plugin] Remove Materials (1.1.0)

Postby Tomi » Sat May 09, 2009 10:55 am

Chris Fullmer wrote:I'll help get the ball rolling...

Do you just want a single material applied to the entire component? Like, you want all components named "doorhandle_01" to be painted silver, regardless how deep they are buried?

Also, how many DIFFERENT components are there? You say thousands, but is it 10os of copies of only 10 different components? Or is it really thousands of different components?

Do you have a sample model you could upload?


Yes. I'd like to apply a single material to a component, regardless of how deep they are buried.

Yep, there's thousands of separate components all made to create a building. I've uploaded a zipped file of just the structure. Added to this is secondary structure, claddings, windows, stairs, floors - essentially every element of the entire build (right down to silly things that I probably shouldn't have detailed, like the rubber seals in between the panes of double glazing). The plan is to do an exploded perspective along the way (I'd love it if there was a plugin for this!).
0

Tomi 
 

Re: [Plugin] Remove Materials (1.1.0)

Postby Tomi » Sat May 09, 2009 10:59 am

thomthom wrote:If you want to transfer the layer colours to the geometry, then there's already a plugin out there. Search for " layers_materials" at http://www.sketchucation.com/extensions-index/


I'm going to try this now. Do you know if it applies the layer colours to even geometry nested as components within larger components? Thanks thomthom
0

Tomi 
 

Re: [Plugin] Remove Materials (1.1.0)

Postby Tomi » Sat May 09, 2009 11:20 am

Hang about, sometimes when you're stressed you miss things. I had a little meditation, came back to re-read your first comment, thomthom, and just needed to select layer by colour like you suggested. Thanks a million (and Chris) for your help. It's kind people like you who by sharing, make the world a better place. I didn't need any plugins after all, but as I'm falling back in love with sketchup, how do you load them? I went to the layers_materials plugin page and the link brought up a script...
0

Tomi 
 

Re: [Plugin] Remove Materials (1.1.0)

Postby thomthom » Sat May 09, 2009 11:29 am

Place the .rb file in the Plugins folder where SU is installed. Some plugins also include folders that needs to be extracted to the plugin folder as well.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Remove Materials (1.1.0)

Postby Sir » Sat May 09, 2009 11:40 am

ok, not actually thousands of components! you have lots of instances, but with the others added you'll only have a hundred or so, maybe 200!

have you found the components window yet? this is a good way to keep track of the components in your model. you can also use it to add materials to specific components by

1) insert a new copy of the component into the model, doesnt matter where
2) add material to that new one. this will update all instances (copys) of it throughout the model
3) delete the inserted component

repeat
0

Sir 
 

Re: [Plugin] Remove Materials (1.1.0)

Postby Tomi » Sat May 09, 2009 12:43 pm

Sir wrote:ok, not actually thousands of components! you have lots of instances, but with the others added you'll only have a hundred or so, maybe 200!

have you found the components window yet? this is a good way to keep track of the components in your model. you can also use it to add materials to specific components by

1) insert a new copy of the component into the model, doesnt matter where
2) add material to that new one. this will update all instances (copys) of it throughout the model
3) delete the inserted component

repeat


Thanks. Still getting my head round the nitty gritty. Thomthom's simple suggestion achieved what I wanted to do - add materials according to layer - by using the colour by layer option. But that's a great tip - my drawings is mainly organised into layers, but supposedly by this way I could have more control if needed and change individual components on the same layer. Thanks for your help.
0

Tomi 
 

Re: [Plugin] Remove Materials (1.1.0)

Postby Sir » Sun May 10, 2009 4:30 pm

very useful plugin thomthom. is it possible to add the functionality to remove ALL materials but ONLY from the selection?

fantastic!
0

Sir 
 

Re: [Plugin] Remove Materials (1.1.0)

Postby thomthom » Sun May 10, 2009 4:43 pm

Sir wrote:very useful plugin thomthom. is it possible to add the functionality to remove ALL materials but ONLY from the selection?

fantastic!

Yea, that would be possible. I was thinking of doing that anyway. ;)
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Remove Materials (1.1.0)

Postby Sir » Sun May 10, 2009 4:45 pm

:berserk:
0

Sir 
 

Re: [Plugin] Remove Materials (1.1.0)

Postby thomthom » Sun May 10, 2009 4:48 pm

Only one thing; what would be the expected behaviour if the selection contains an component instance?
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Remove Materials (1.1.0)

Postby Sir » Sun May 10, 2009 4:53 pm

id have to say that remove from all instances too, as you'd want them all the same, no? suppose it could always be a check before compleating the script tho, im sure someone would want it both ways!
0

Sir 
 

Re: [Plugin] Remove Materials (1.1.0)

Postby TIG » Sun May 10, 2009 5:18 pm

Can't you just use my GlobalMaterialChanger.rb ? ... It works on a selection, OR the whole model... and it asks if you want to 'mine' down into groups and instances etc...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Remove Materials (1.1.0)

Postby Sir » Sun May 10, 2009 5:48 pm

i wasnt aware of it... ill go take a look :thumb:
0

Sir 
 

Re: [Plugin] Remove Materials (1.3.0) — 8 July 2009

Postby Pout » Mon Jul 13, 2009 11:00 am

great! Thx!
0

Pout 
 

Re: [Plugin] Remove Materials (1.3.0) — 8 July 2009

Postby Gaieus » Thu Aug 19, 2010 2:16 pm

Hi Thom,

sorry for bumping the topic... Could you add "Remove materials applied to back faces"? (Or is there a plugin that does that already?)
0
User avatar
Gaieus 
 

Re: [Plugin] Remove Materials (1.4.0) — 19 August 2010

Postby thomthom » Thu Aug 19, 2010 2:25 pm

*Al-ka-zam!*
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

Next


 

Return to Plugins

Who is online

Users browsing this forum: amulongo, mokhtar, Yahoo Bot and 11 guests

Visit our sponsors: