sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Reset All Face UV's in a selection

    Scheduled Pinned Locked Moved Developers' Forum
    4 Posts 2 Posters 766 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • 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?

      1 Reply Last reply 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

        1 Reply Last reply 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

          1 Reply Last reply 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.

            1 Reply Last reply 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