Bart
(Bart)
April 13, 2007, 4:01am
1
Hi,
i like to support the new UVlayers to make it possible exporting different uv coords per texture channel.
But how to do the? I didn’t understand it.
Exporting vertex colors works out of the box and the active color layer will be exported automaticly. But not the UVlayer.
i basicly use this code to export the the texture coords and index:
rawData = Blender.NMesh.GetRawFromObject(thisObj.getName())
rawData.faces
face.uv
Thanks!
NMesh cant access UV layers, only Mesh
You have to set the active layer, then access teh UV’s or vcols as useual.
see the FBX exporter in blender for an example
for uvlayer in me.getUVLayers():
me.activeUVLayer = uvlayer
print uvlayer
for f in me.faces:
print ' ', f.index, f.uv
Bart
(Bart)
April 13, 2007, 4:23am
3
Will NMesh have access to UV layers in future?
nope, NMesh is awful,
long answer is, if anyone wants to maintain NMesh, they can. but we (ken and myself) are focusing on Mesh now and only touching NMesh when we have to.
we will also have BMesh soon bopefully so maintain 3x mesh API’s is a bit much.
Bart
(Bart)
April 13, 2007, 4:55am
5
NMesh will export the mesh as is including the modifiers right? That’s the only differenz or?
That’s why i’m using it. Or is there a way getting the same data from Mesh?
Thanx!
both Mesh and NMesh can access mesh data with and without modifiers applied.
Bart
(Bart)
April 15, 2007, 1:07am
7
Hi Cambo,
ok changed anything from NMesh to mesh (just chnaging zwo lines). But i can’t find a way to get the information which texture channel using whicj uvlayer
Are the uvlayers always ordered like the texture channels?
Thanks so far!
Bart
(Bart)
April 15, 2007, 4:12am
9
Mhm, interesting, it seems the official documentation got holes. I downloaded it from blender.org and the uvlayer didn’t appear at this chapter. Thanks so far.
I think I added this after 2.43
Bart
(Bart)
April 21, 2007, 11:34am
11
Oh man problems, problems, problems
Did you know how to combine Mesh.getFromObject and activeUVLayer?
I ike to get the uv coords and index of the derrived mesh and not of the original (this is needed exporting subsurfed meshes with multiple uv layers).
THANX!
there is no problem with getting UV ;layers from deformed subsurf mesh
This works with the new and decieded on API
import bpy
sce= bpy.data.scenes
ob = sce.active.objects.active
me = bpy.data.meshes.new()
me.getFromObject(ob)
print me.getUVLayerNames()
Bart
(Bart)
April 22, 2007, 4:31am
13
Oh Man! Yes!
Thanx thousend times!!!
Let me know if you some times need my help.
Best regards.
Bart.