Getting wrong uvs?


#1

Hello! I come for help again. Here’s my problem,
At first I have a model file simplewithgroup.skp and there is one group in it. The model looks like this:


After I break the group, the model happens to look like this:
It seems that all the vertices uvs have changed. Then I save the change to another file simplewithoutgroup.skp.
At last, I load these two files in my own program to see if i can get the right uvs. It turns out that I can get right uvs from the model without a group and can’t get right uvs from another model with a group.
One vertice i get is (54.80995, -14.41791, 66.8265), its uv coordinate in the model without a group is (1.34621, 0.60907, 1.000), while in the model with a group it’s (10.04553, 16.03673, 1.000) which is wrong.
So I have two questions:

  1. Why do the uvs change when I break the group? Do they really change?
  2. Does the group have any effect on the mesh vertice’s uv? If so, what should i do to get right uvs? I have searched almost all the head files of sketchup c api, and couldn’t find if there is any relation between group and uv.

p.s. I use SUMeshHelperGetFrontSTQCoords to get uv, and have no other calculation on it.
simplewithgroup.skp (136.8 KB)
simplewithoutgroup.skp (136.0 KB)


#2

I have the same question. Wait for experts’ response. @tt_su


#3

So, when the material is applied to the group the UV data isn’t bound to the faces. And exploding the group will transfer the material to the faces and the UV data is recalculates which some times makes the texture positions shift.

One important thing to note - and we should improve our documentation for this - is when a face has the default material (none) the UV data you pull from it doesn’t relate to the material applied to it’s parent component or group. When SketchUp display this in the viewport it generates UV mapping on the fly.