• Login
sketchucation logo sketchucation
  • Login
ℹ️ GoFundMe | Our friend Gus Robatto needs some help in a challenging time Learn More

[Solved] Sketchup makes multiple files, if I turn textures

Scheduled Pinned Locked Moved SketchUp Discussions
sketchup
8 Posts 4 Posters 2.5k Views
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.
  • A Offline
    Alan Fraser
    last edited by 14 Feb 2012, 10:54

    Mapping in SketchUp is not very good at all. That's the problem. Even the various UV mapping scripts that have been written are mostly only compromises.
    If, for example, you use the spherical mapping tool and export to obj or 3ds, SU tends to produce a separate image file for every single face.
    For this reason, I only use the mapping tools if I'm sticking with SketchUp. If I intend to export anything more complicated that wood grain on shelving, I tend to use something else like Ultimate Unwrap 3D.

    Whaat (I think) has written a very nice script (UV Tools Pro) that uses an obj file as a proxy between SU and a number of other mapping programs, including UU3D.

    3D Figures
    Were you required to walk 500 miles? Were you advised to walk 500 more?
    You could be entitled to compensation. Call the Pro Claimers now!

    1 Reply Last reply Reply Quote 0
    • A Offline
      Aerilius
      last edited by 14 Feb 2012, 22:07

      Does this really happen when you rotate the texture?

      SketchUp does not handle well distorted textures with its exporters (except skp format). If a texture has a "projective" distortion, SketchUp will burn it into a new, separate texture image. This often leads to many almost similar files that appear to be redundant. I think this does not happen with affine distortions (red, green, blue pin).

      You should be on the save side if you avoid touching other pins except of the red and green.

      Rotating a texture with the green pin does not automatically change the size. You can move the green pin in 2 dimensions. If you move it with constant radius around the red pin it will rotate, if you move it away from the red pin it will scale. If you move it again back it will snap to the original scale.

      1 Reply Last reply Reply Quote 0
      • A Offline
        Alan Fraser
        last edited by 15 Feb 2012, 07:20

        I tried to replicate your problem using a similar curved border filled with a shingle texture. I even deliberately rescaled the image when rotating it, giving me small shingles on one face and huge shingles on the next one. However the exported obj file would only give me a single image...so I'm not sure what you are doing differently.

        I agree that the controls for rotation and scaling ought to be separate. It's virtually impossible to rotate without affecting the scale.

        If you really do need to take the model into another program to texture it...but don't have any money, you could try something like Anim8tor, which is completely free.

        3D Figures
        Were you required to walk 500 miles? Were you advised to walk 500 more?
        You could be entitled to compensation. Call the Pro Claimers now!

        1 Reply Last reply Reply Quote 0
        • A Offline
          Aerilius
          last edited by 16 Feb 2012, 22:21

          Hi,
          "this Obj-Exporter" is TIG's OBJexporter (for which you would get best support by posting on his thread).

          I tested it and the plugin's first release exports only one texture while the version that you have exports 3 copies. The difference is that TIG added some code to handle distorted textures.

          I replaced it by similar code from Tomasz Marek's su2kt.rb and it worked. There must be something that causes the algorithm to come to a different result about whether the texture is distorted. I'm sure TIG will take a look into this.

          def distorted?(face=nil, objname="", tr=nil)
            return false if not face
            mat=face.material
            return false if not mat
            texture=mat.texture
            return false if not texture
            ### check for distortion
            front = true
            disto = false
            temp_tw = Sketchup.create_texture_writer
            ents = @model.active_entities
            @model.start_operation "Group"
            group = ents.add_group
            group.material = (front==true)? face.material ; face.back_material
            group_handle = temp_tw.load(group)
            temp_handle = temp_tw.load(face, front)
            ents.erase_entities(group)
            Sketchup.undo
            disto = true if temp_handle != group_handle
            temp_tw = nil
            @distorted << [face, objname, tr, mat] if disto
            return disto
          end#distorted?
          
          1 Reply Last reply Reply Quote 0
          • T Offline
            TIG Moderator
            last edited by 17 Feb 2012, 09:08

            I'm not sure why someone is posting my OBJexporter, with a different name and without consultation... ❗ It's also THREE revisions behind the current version [i.e. v1.7 versus v1.9] 😒
            Anyway... Get the latest version of my OBJexporter [use the 'Plugins Index' red-button OR here's a direct link http://forums.sketchucation.com/viewtopic.php?p=294844#p294844 ].
            The latest version UVmaps all 'adjusted textures' correctly [including positioned/scaled/rotated] including within any mirrored instances etc; and note how also any severely 'skewed/sheared/distorted' textures are exported as a separate 'distorted' image-file too [note how v1.8 eased the 'tolerance' used when deciding what is 'distorted', so there are now fewer additional images created with virtually no difference in them] - so you should always get correct results in your OBJ/MTL/ImageSet...
            🤓

            TIG

            1 Reply Last reply Reply Quote 0
            • T Offline
              TIG Moderator
              last edited by 17 Feb 2012, 09:35

              I've tested your SKP with the latest version of OBJexporter - it takes a while to export [>100s] as there are many many edges to the relatively few faces which then need a lot of triangulation...Capture.PNG
              v1.9 makes one additional distorted image but it fails to UVmap it properly [if at all].Capture1.PNG
              I've again adjusted the tolerance settings to decide if an image is 'distorted', and it now exports the one image and UVmaps it all properly.Capture2.PNG
              So v2.0 will be posted shortly in the tool's original thread 🤓

              TIG

              1 Reply Last reply Reply Quote 0
              • G Offline
                Gaieus
                last edited by 17 Feb 2012, 11:37

                This is a known and rather annoying "feature" of most exporters in SU: distorted image textures become "unique" when exporting.

                Gai...

                1 Reply Last reply Reply Quote 0
                • T Offline
                  TIG Moderator
                  last edited by 17 Feb 2012, 12:28

                  @unknownuser said:

                  Thank you TIG. Now it works fine.
                  But what are the lot of lines in the second and third picture you posted and how can it happen, that one texture is showing wrong? Did I done something bad?
                  When you export a SKP it's likely that many of the faces will have more than three sides.
                  Many third-party applications that will be importing the exported data expect it to be 'triangulated'.
                  Many, like renderers, do not show the edges so this triangulation is unseen in their output.
                  If you re-import the OBJ file back into a SKP it will include all of the additional lines needed to triangulate the faces.
                  These can be removed manually or if part of a mesh 'smoothed' or erased as coplanar-edges...
                  Because of the expectation of triangular faces by such apps the OBJexporter [and many other similar tools] triangulate the faces in the SKP as they are exported.
                  In your case you have only a few faces, but there are thousands of edges.
                  Therefore to make a face out of triangles requires a lot of lines adding to the geometry - not an issue when used in a renderer but when used back into a SKP it needs 'fixing'...

                  An OBJ file [and several other exporter file formats] can only include texture data that is UVmapped in '2d' - positioned/rotated/scaled etc - this is because it can use just 3 UVmapping values.
                  However, a texture in a SKP can be sheared/skewed etc in '3d' so that it is 'distorted' - and then its UVmapping has 4 values to describe how it is 'twisted' !
                  BUT the OBJ file format cannot include for this, so instead we have to spot the 'distortion' and make an extra 'distorted image' file and then define that for that face's texture, with a basic UVmapping set [this is because the 'distortion' is in the texture's file itself, rather than how it is changed by the face's UVmapping data in the OBJ file]. So how we detect the texture's 'distortion' becomes critical...

                  Your 'problem texture' probably resulted when you adjusted it to align along that face - you must have added a slight 'shear/skew' to it in '3d', rather than the usual '2d' 'flat' mapping used for rotations etc. Thus the v1.9 exporter considered that texture to be 'distorted' and therefore it then exported a virtually identical image-file to use just for that face. Its UVmapping then failed as there was no appreciable 'real' distortion to compensate for. When I recoded the distortion-checker in v2.0 I reduced its "sensitivity" - so now when it sees that 'problem texture' it regards it as NOT being distorted... and therefore it uses the usual base-image file and the required distortion-free UVmapping that works just fine... I think I now have a reasonable compromise between making a distorted image-file - needed IF the image has been 'intentionally' skewed/sheared etc - and the alternative of using the base-image even when very slight [unintentional] distortions are detected [and which are so slight that the UVmapping can be assumed to be '2d' not '3d' anyway]
                  😒

                  TIG

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  1 / 1
                  • First post
                    1/8
                    Last post
                  Buy SketchPlus
                  Buy SUbD
                  Buy WrapR
                  Buy eBook
                  Buy Modelur
                  Buy Vertex Tools
                  Buy SketchCuisine
                  Buy FormFonts

                  Advertisement