sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Texture Position

    Scheduled Pinned Locked Moved Developers' Forum
    10 Posts 2 Posters 774 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.
    • E Offline
      e-anima
      last edited by

      Hi,

      i imported a 3ds file into Sketchup. The result was the textured model, but the texture was kind of twosided. from the outside it was for example a wall and from the inside the same face had a texture of the roof. (model is 100% ok, passed STL check and has no double sided faces).
      The solution to fix this is to select every triangle go to texture-> position , do nothing and klick done. So my idea was to make a script that does this to every face. What i did is the following, i put every information in an array. Now iam searching for the functions to do this. ( something like face[1].setPosition(getcurrentPosition(face[1])) ).
      Maybe you can help me with some snippets.

      Thank you

      Marco


      model = Sketchup.active_model
      entities = model.active_entities
      selection = model.selection

      faces = []
      entities.each do |e|
      faces.push e if e.is_a? Sketchup::Face

      end

      puts "Total Faces : " + faces.length.to_s

      1 Reply Last reply Reply Quote 0
      • thomthomT Offline
        thomthom
        last edited by

        Not sure what you're trying to do... Remove the texture from the backsides? Transfer them?
        Why do you need to do Texture->Position ?

        The API methods you want to look into in regards to position textures are:
        Face.position_material http://code.google.com/apis/sketchup/docs/ourdoc/face.html#position_material
        UVHelper http://code.google.com/apis/sketchup/docs/ourdoc/uvhelper.html
        TextureWriter http://code.google.com/apis/sketchup/docs/ourdoc/texturewriter.html

        I got two plugins that works with UV mapping. One is transferring front side to back side, and the other fits texture materials to quad-faces.

        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

          Do you have a sample model?

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

          1 Reply Last reply Reply Quote 0
          • E Offline
            e-anima
            last edited by

            transfers front side to backside sounds nice. ill take a look. thank you
            installed your uv tools. selected a face and tried to transfer...nothing happened.
            i think somehow sketchup is not able to import a 3ds correctly with uv coordinates.
            what i was trying to to fixes the wrong "pseudo non existing double faces".

            if i understood right you use that method to transfer the uvs. hmm so what i want to do will not work, because the transfer does not work.

            your plugin is working if i first do a "fit texture to quad faces". problem is mine is triangulated and already textured correctly from the outside

            1 Reply Last reply Reply Quote 0
            • E Offline
              e-anima
              last edited by

              yes. heres some testwall with the test texture


              sketchup file


              texture

              1 Reply Last reply Reply Quote 0
              • E Offline
                e-anima
                last edited by

                have you seen what i meant?

                1 Reply Last reply Reply Quote 0
                • thomthomT Offline
                  thomthom
                  last edited by

                  The material was transferred to the backside fine - No problems or error. (SU7 - PC)

                  What version and OS are you using?

                  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

                    Did you select all the faces first?

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

                    1 Reply Last reply Reply Quote 0
                    • E Offline
                      e-anima
                      last edited by

                      I use
                      Sketchup 7.0.8657
                      Windows Vista Ultimate 64 bit

                      Is it only working if i select all faces (without edges) ?
                      i chose all faces and klciked FRONTFACE TO BACKFACE and nothing changed
                      Where did you get the output ?

                      @unknownuser said:

                      The material was transferred to the backside fine - No problems or error. (SU7 - PC)

                      1 Reply Last reply Reply Quote 0
                      • thomthomT Offline
                        thomthom
                        last edited by

                        @e-anima said:

                        Is it only working if i select all faces (without edges) ?

                        It only transfer the material of the selected faces. (Doesn't matter if you select edges, they are ignored.)

                        @e-anima said:

                        Where did you get the output ?

                        Where?
                        The Backside of the faces will look like the Frontside.

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

                        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