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.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement