Had my exporter working fine for UV Coords to export but since the update to 2.63. So ive been trying to try a few things for the past week and no luck has appeared. The closest i’ve been is exporting values but, they are incorrect.
Example:
Whats exporting from Blender
0.669797 1.300080
0.318956 1.496827
0.377478 1.571246
What should be exporting:
0.344562 1.453787
0.318956 1.503173
0.346527 1.510960
As for the code to get the UV Coords:
for obj in bpy.context.selectable_objects:
if obj.type == 'MESH':
temp = obj.data
me = bmesh.new()
me.from_mesh(temp)
me.transform(EXPORT_GLOBAL_MATRIX * obj.matrix_world)
try:
materials.extend(temp.materials)
except:
materials.extends(None)
uv_layer = temp.uv_layers.active
for face in me.faces:
try:
uv1x = uv_layer.data[face.verts[0].index].uv.x
uv1y = uv_layer.data[face.verts[0].index].uv.y
except:
uv1x = 0.0
uv1y = 0.0
try:
uv2x = uv_layer.data[face.verts[1].index].uv.x
uv2y = uv_layer.data[face.verts[1].index].uv.y
except:
uv2x = 0.0
uv2y = 0.0
try:
uv3x = uv_layer.data[face.verts[2].index].uv.x
uv3y = 2.0 + vec(uv_layer.data[face.verts[2].index].uv.y
except:
uv3x = 0.0
uv3y = 0.0
try:
uv4x = uv_layer.data[face.verts[3].index].uv.x
uv4y = 2.0 + vec(uv_layer.data[face.verts[3].index].uv.y
except:
uv4x = 0.0
uv4y = 0.0
I’ve added 2.0 to each y (don’t ask why it was more suggested for the last version and it worked fine so I thought id try it. Any Advice?
Also, been looking for how to get the world position for joints as well as the rotation for the joints. I have got values but they are incorrect. Here is my code:
for obj in bpy.context.selectable_objects:
me = obj.data
if obj.type == 'ARMATURE':
obj.matrix_local *= obj.matrix_world
for bone in me.bones:
getBoneRot = bone.matrix_local.to_euler()
fw(bone.name + '
')
try:
fw(bone.parent.name + '
')
except:
fw('null
')
fw('%.6f %.6f %.6f %.6f %.6f %.6f
' % (bone.head.x, bone.head.y, bone.head.z, getBoneRot.x, getBoneRot.y, getBoneRot.z))