Remove materials plugin question.
-
I know that are several "remove materials" plugins, including remove C/G materials, leave geometry materials... but is there any plugin which removes materials from Groups/Components, but leaves on which don't have material attached to faces?
What I want to say: I have two components(or groups), one textured inside (the faces), one with material applied on component. By mistake i added a material to first component. I want to remove component material from the first one (it haves material on faces), but to leave on second one (If i remove from it too, it will be redered default).Thank you.
-
Here's a one-liner that removes any materials from [pre]selected groups/instances...
Copy+paste it into the Ruby Console + <enter>...Sketchup.active_model.selection.each{|e|e.material=nil if e.class==Sketchup;;Group or e.class==Sketchup;;ComponentInstance}
If you want to remove all materials from all groups/instances it can be done en mass by iterating the model's definitions thus [no selection needed]
Sketchup.active_model.definitions.each{|d|next if d.image?;d.instances.each{|i|i.material=nil}}
-
@tig said:
Here's a one-liner that removes any materials from [pre]selected groups/instances...
Copy+paste it into the Ruby Console + <enter>...Sketchup.active_model.selection.each{|e|e.material=nil if e.class==Sketchup;;Group or e.class==Sketchup;;ComponentInstance}
Shouldn't I get each instance and iterate trough each face inside for existing material? And if none found, to leave the material on instance ?
-
See the original post - I have edited it to include two methods - one that works on all selected groups/instances, and the other that works on ALL by iterating the definitions...
-
It would be nice if the remove CG material plugin worked on the entire model OR on a selection only. Some plugins can make this difference by first checking if there is a selection.
Advertisement