[REQ] remove backface materials (selected)
-
Does anyone know of a plugin that can remove backface materials from a selection. I use TT's Material tools which are excellent. But the actions seem to work on the whole model instead of selections, and removing materials from ALL backfaces is a problem when I just need to work on a specific selection.
-
If you inverse Selection / Hide then Remove that works not ? (not tested)
-
put selection in separate file, run TT tools and paste it back- what's the problem?
-
If you are within a group you can use the Specific Material option to remove the backface material without effecting other backfaces.
Edit: actually you don't need to be in groups, Remove Specific works on selection not entire model.
-
Thanks going into every group is what I was hoping to avoid. If there's nothing out there, I can deal with it these different methods.
-
You don't have to go into each group, if the material is only on the back faces you can select groups components and raw geometry and it will remove the chosen material from anywhere in the selection while leaving the rest of the model alone. If the material is both back and front then this wouldn't work.
-
Now i see what you mean--that's a different approach to the same solution. Thanks!
-
@pbacot said:
Does anyone know of a plugin that can remove backface materials from a selection... I just need to work on a specific selection.
Dezmo_remove_back_materials.rbz
Here are a quick one...This will remove Back Face Material from selection recursively. You can undo it.
Start by toolbar icon or context menu after selection.The result will be printed out to Ruby Console e.g.:
"Back Face Material removed from 11 faces."
or
"Back Face Material removed from 0 face."Quickly tested only on Windows. No responsibility... but should be okay on MAC too.
(Sorry about the ugly icon )
#main.rb module Dezmo module Remove_Back_Mat @@loaded = false unless defined?(@@loaded) extend self def remove_back_materials model=Sketchup.active_model model.start_operation('Remove Back Face Materials', true) @count = 0 remove_back_materials_recursively plural = @count > 1 ? "s" ; "" p "Back Face Material removed from #{@count} face#{plural}." model.commit_operation end def remove_back_materials_recursively(ents = Sketchup.active_model.selection) ents.each { |e| case e when Sketchup;;Face if e.respond_to?( ;back_material ) && e.back_material e.back_material = nil @count += 1 end when Sketchup;;ComponentInstance, Sketchup;;Group remove_back_materials_recursively(e.definition.entities) end } end unless @@loaded cmd1 = UI;;Command.new("Remove Back Face Materials") {remove_back_materials} cmd1.small_icon = File.join(File.dirname(__FILE__), "/rbm.png") cmd1.large_icon = File.join(File.dirname(__FILE__), "/rbm.png") cmd1.tooltip = "Remove Back Face Materials" cmd1.status_bar_text = "Remove Back Face Materials (Selection required)" cmd1.set_validation_proc { if Sketchup.active_model.selection.empty? MF_GRAYED | MF_DISABLED else MF_ENABLED end } UI.add_context_menu_handler do |context_menu| context_menu.add_item(cmd1) unless Sketchup.active_model.selection.empty? end toolbar1 = UI;;Toolbar.new("Remove Back Face Materials") toolbar1.add_item(cmd1) toolbar1.restore @@loaded = true end end end
-
Nice one Dezmo.
I really must learn to code one day. -
Wow! Thanks so much for writing that! It works great!
Advertisement