sketchucation logo sketchucation
    • Login
    πŸ›£οΈ Road Profile Builder | Generate roads, curbs and pavements easily Download

    Reset All Face UV's in a selection

    scheduled pinned locked moved Developers' Forum
    4 Posts 2 Posters 794 Views 2 Watching
    loading-more-posts
    • oldest-to-newest
    • newest-to-oldest
    • most-votes
    reply
    • reply-as-topic
    guest-login-reply
    deleted-message
    • D Offline
      dburdick
      last edited by

      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?

      one-reply-to-this-post last-reply-time reply quote 0
      • thomthomT Offline
        thomthom
        last edited by

        
        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.

        Thomas Thomassen β€” SketchUp Monkey & Coding addict
        List of my plugins and link to the CookieWare fund

        one-reply-to-this-post last-reply-time reply quote 0
        • thomthomT Offline
          thomthom
          last edited by

          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)

          Thomas Thomassen β€” SketchUp Monkey & Coding addict
          List of my plugins and link to the CookieWare fund

          one-reply-to-this-post last-reply-time reply quote 0
          • D Offline
            dburdick
            last edited by

            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.

            one-reply-to-this-post last-reply-time reply quote 0
            • 1 / 1
            • first-post
              last-post
            Buy SketchPlus
            Buy SUbD
            Buy WrapR
            Buy eBook
            Buy Modelur
            Buy Vertex Tools
            Buy SketchCuisine
            Buy FormFonts

            Advertisement