[Solved] Sketchup makes multiple files, if I turn textures
-
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.
-
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.
-
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.
-
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?
-
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...
-
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...
v1.9 makes one additional distorted image but it fails to UVmap it properly [if at all].
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.
So v2.0 will be posted shortly in the tool's original thread -
This is a known and rather annoying "feature" of most exporters in SU: distorted image textures become "unique" when exporting.
-
@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]
Advertisement