multiple UV sets

Dear all.
Please forgive me if this question has been answered already, I wasn’t able to find a solution yet

I’m trying to generate a model from vertices with

format=GeomVertexFormat.getV3n3t2()
vdata=GeomVertexData('square', format, Geom.UHStatic)
vertex=GeomVertexWriter(self.vdata, 'vertex')
normal=GeomVertexWriter(self.vdata, 'normal')
texcoord = GeomVertexWriter(self.vdata, 'texcoord')
texcoord2= GeomVertexWriter(self.vdata, 'texcoord.second')
prim = GeomTriangles(Geom.UHStatic)

but when i try to add data

texcoord.addData2f(eval(line[7]),eval(line[8]))
texcoord2.addData2f(eval(line[9]),eval(line[10]))

I got an error:

the problem is,as i see it, that GeomVertexWriter(vdata, ‘texcoord.second’) returns GeomVertexWriter() but not GeomVertexWriter, array = 00000000, column = 02631524 (Packer_nativefloat_2), write row 0

>>GeomVertexWriter(vdata, 'texcoord')
GeomVertexWriter, array = 00000000, column = 02631524 (Packer_nativefloat_2), write row 0
>>GeomVertexWriter(vdata, 'texcoord.second')
GeomVertexWriter()

So the question is what i’m doing wrong?
Thank you in advance…

Your GeomVertexFormat does not properly describe your intended structure. You used this:

format=GeomVertexFormat.getV3n3t2()

This returns one of the default GeomVertexFormats, in particular one that has room for a set of vertex positions, normals and texcoords, but not for a second set of texcoords.

You’ll have to create your own GeomVertexFormat that specifies an additional “texcoord.second” column and register and use that. This is described here:
panda3d.org/manual/index.ph … rtexFormat

What you’d be doing is another addColumn call, but instead of using InternalName.getTexcoord() you’d be passing InternalName.getTexcoordName(‘second’), or simply ‘texcoord.second’ as a short-hand as you have been doing.

Thnks, it works.