Remove Group/component materials and apply to faces
-
I was looking for this function in one of Thomthoms scripts but cannot find it. Am I wrong that it was there before?
I have this file from an architect where all materials are applied to the groups which makes it very difficult to edit. Now I can't find the required plugin.
-
If you want to simply find each group's material and apply it onto the default-material faces within that group, and then default the group's material, then a 'one-liner' will do it.
However, note that copied groups will get made unique, and any nested groups will get the material of the outer most wrapper where appropriate - which might then be nil ?m=Sketchup.active_model; m.start_operation('ma',true); m.definitions.find_all{|g|g.group?}.each{|g|if g.entities.parent.instances[1];g.entities.parent.instances[1..-1].each{|i|i.make_unique};end}; m.definitions.find_all{|g|g.group?}.each{|d|g=d.instances[0]; ma=g.material;g.entities.grep(Sketchup;;Face).each{|f|f.material=ma unless f.material;f.back_material=ma unless f.back_material};g.material=nil}; m.commit_operation;
-
Its not a Thomthom one. If you had searched by the first two words of your thread title you would have found
https://sketchucation.com/pluginstore?pln=Remove_CG_mat -
Thanks TIG. I'll try that.
@Box: I found and tested it but weird things happened when it applied same material to entire selection. I was just so sure Thomthom had it in his Material Tools. -
Are you talking about "Material Replacer" ?
https://sketchucation.com/pluginstore?pln=tt_mat_replace'Remove material from All...' is inside Thomthom "Material Tools"
-
I've tried the same thing and had trouble with Remove_CG_mat. It's not the same as material replacer. Still looking.
Advertisement