Reset All Face UV's in a selection
-
Like the title says... is this possible? I don't see anything in the Ruby api that will reset UV's although there is the send_command 21516 Reset original texture position. But I don't see a select method that would allow me to select a face by cycling through a selection list. Hard to beleive that the standard Sketchup does not allow a Texture Reset Position from a section of faces instead of just a single face. Any ideas?
-
model = Sketchup.active_model sel = model.selection cache_selection = sel.to_a cache_selection.each { |e| sel.clear sel.add(e) Sketchup.send_action(21516) } sel.clear sel.add(cache_selection)
But
Sketchup.send_action(21516)
does not appear to work. -
Not greatly tested, but this looks to position the texture as it where reset
face.position_material(face.material, [ ORIGIN, [0,0,0] ], true) face.position_material(face.back_material, [ ORIGIN, [0,0,0] ], false)
-
TT to the rescue again. Many thanks. I tried it the first way as well but found the send_action call didn't work either. Your second method works like a champ. You're a star.
Advertisement