Texture mapping and CFaceTextureCoords


I’m using SketchUp SDK to create skp-files and occasionally get issues with opening the files in SketchUp (v.15.3.331). The issue seems to be related to the texture mapping, but I can’t see what is wrong with the object / mapping. Upon opening the skp-file and choosing the “Fix later”-option in the “Don’t Panic!”-dialog everything looks fine with the object (texture looks correctly mapped), but if I choose “Fix now” the mapping is visually incorrect. Is this some kind of false positive warning, or have I missed something here?

In order to make it easier to find the problem (CFaceTextureCoords), I’ve cropped out all but the single “incorrectly” mapped triangle from a file totaling 1984 triangles, saved it separately and attached it here:

(the triangle is supposed to be light gray only)

If someone could please point out what is actually wrong with the mapping (or confirm if it’s reported incorrectly) I’d be most grateful for the help.

Can you provide a small standalone code snippet that reproduce this?

It’s hard to tell what is going on just by the SKP file.

Stepping through the validation check it flags an issue with the texture transformation matrix that doesn’t conform to expectations. Might be the API functions that didn’t probably control check input arguments which lead to an undesired matrix. Need to see some code to tell exactly what goes on.

Hi Thomas. Thank you for your answer. The source code is part of a bigger conversion tool for file formats so it took me awhile to clean it up to the relevant lines for this particular problem. Anyway, I’ve now done that and it’s a short main.cpp https://www.dropbox.com/s/ismfrot4uhedj8n/main.cpp?dl=0 and its associated texture https://www.dropbox.com/s/0f9c4q3uwyhhzi3/20717.png?dl=0. Hope this helps. I’m very grateful for your input, since I can solve it myself or find any answers to a similar problem on the forum.

Btw, in the original code I check that every API call returns a SU_ERROR_NONE but I’ve removed that in the shorter sample file above.

Update: Due to a new company policy I had to drop Dropbox and the associated source code, etc. is now on Google Drive instead. The new link is: https://drive.google.com/file/d/0ByJml22LUMLiay1ETExSeG1RWVE/view?usp=sharing

Sorry for the very late response. Things got really busy with SU2017 release. Just wanted to check up if this is still an active issue?

No worries Thomas, but yes it is still an active issue. If you have time to look into it, I’d be very grateful. I’m worried that the validation check in SU returns a “false positive”, but maybe I’ve missed something.

I downloaded your latest example from Google Drive - I’ll get it logged.

Hi again Thomas. Just thought I’d check in and hear if you made any progress with this issue? It’s still an active issue in the development of our production tool, unfortunately. Thanks.