Export dae creates hundreds of duplicate materials when it should only be one


#1

I’m having trouble with some models when I export them as .dae
The current model has 8 materials in it, but when i export the model, the folder containing the materials has 270 duplicate materials with a number added at the end.
This makes the model unusable when I try to use it in other programs and makes the file size way bigger than is needed. I’m not sure why its doing this, is there a way to stop this from happening?

I have no idea why its generating a unique material for every window pain in this model. This has happened on other models I have made before, but not every time. I really want to know how to fix this or what causes it so i can prevent it happening in the future.
Thanks for your input.


Why resampling of texture image when it is multiple used?
#2

I remember that Dale (@Whaat) helps me with this kind of problem some years ago (Indigo export? SketchUV?) but can’t find the discussion and don’t remember the solution. Maybe he does?


#3

This happens because of the way how textures are applied and distorted on your model. The exporter assumes the target file format (or target application) does not handle projective texture distortions (4 independent texture pins), but only affine texture distortion (3 independent texture pins, parallelogram distortion).

The solution is either to go over a different exporter or file format (eg. Kerkythea xml, maybe Indigo), or to avoid such texture transformations in advance if you know you want to export to Collada.

Here is a code example that can change the texture coordinates to affine, but it may change the visual appearance of the model: http://sketchucation.com/forums/viewtopic.php?t=45539


#4

It seems that SketchUp failed to save the window texture positions I had left them in. I had aligned each window material up perfectly with its face with no distortions. I just checked and every face was out of position but not distorted! How frustrating! Still it shouldn’t be too hard to fix now providing it remembers the new positions. Will the materials come out of alignment if I move the component? Because that’s all I had done since setting the materials position originally.

Thanks for all the help, its much appreciated.


#5

The position of a component instance does not have any effects on whatever is inside of the component definition.

There must have been something else wrong. Texture coordinates can change if they were not (never) manually set (then the texture has just the default positioning) or when you move/scale edges, but not the face.


#6

Hello, the same thing is occurring for most of my models too (if not all), and like you I need to export as *.dae Collada.

The only Option I have found so far (which is very tedious) was to use either the
- remove material extension found here : http://extensions.sketchup.com/fr/content/material-tools (Thank you ThomThom !) or
- the pluggin from smustard (http://www.smustard.com/script/RemoveMaterials), and remove every material from the file, and re-apply one by one, saving the file and re-opening along the repainting of surfaces and checking it is all working.

Those 2 tools also allow for group or component material removal so you can always try on a few of them and see the result and if it fixes the issue. But my advice is to save then close re-open the file before exporting. This is not a quick fix I admit, and it doesn’t solve the original issue but the only option I have found so far.


#7

Luds et al
When you export as collada there is an options button on the right side do you see any difference what is selected there. Is your model high poly and have you done any purging to make as simple as possible?;
Secondly I could not tell from the attached jpg if you have photo textures and how you are painting the faces. What I mean by that is what is shown in this tutorial. http://sketchucation.com/resources/tutorials/beginner/139-texturing-a-component-vs-its-faces-inside. I am not saying this is the problem but I have not seen this reporting before so was looking for some pathological case that my help explain it. However, I have not been able to duplicate the issue.


#8

Hello mac7595. Those are the default options when exporting to .dae Collada (using SketchUp 2015 v15.3.331). I can confirm that indeed I regularly purge the model and especially before exporting (Window > Model info > Statistics > Purge unused or by doing a purge directly from the Material panel > Purge unused). Using one or the other method does not achieve a different result, and there are still duplicates.

I have printed the tutorial you mentioned and will look into it + take the time to go through over the weekend. Thank you.

A pluggin from ThomThom really eases the pain as it allows to replacement of one material copy by another, and deleting the copy after it is dealt with : https://extensions.sketchup.com/fr/content/material-replacer

Still it is quite tedious.


#9

Any chance to have a post of the skp that shows the problem.
I would like and try some different filters to see what issue is. I did quick net search and looks like there are other apps in the past reporting similar problems.
Additional info http://sketchucation.com/forums/viewtopic.php?f=79&t=49080


#10

Thanks for the replies, I since fixed the export problem by manually realigning all the offending textures in the window components again. Just for clarification I made a window frame and the glass was just a single face with the material on both sides. I aligned the glass material on both sides the made it into a component. I then copied the component along the walls of my building and used intersect faces to cut the holes in the walls. Prior to export I must explode all groups/components or the origin point will be confused with a randomly selected origin of one of the components and not use the world origin when I import into another program. The resulting export had this problem of duplicates. Somewhere in that process the materials got borked. Like I said, I managed to correct the problem now so its all good, but still strange why it does this sometimes.

Oh and I’m still using sketchup 2013 as I hate updating and finding my plugins are broken.


#11

If you are using SketchUV, just select all faces and triangulate them prior to exporting to DAE. Then, you shouldn’t get these duplicate materials.