Script API replacements because of BMesh

Hi,

with the new coming release of Blender 2.63 with all the changes for BMesh, there are changes in the API.
i have a problem with my old MS3D add-on script, that will not work anymore with the new coming blender release 2.63, because of the API is changed and the old properties are not available anymore…

e.g.: v2.62 (44136)
bpy.data.objects[0].data.uv_textures[‘UVMap’].data[0].uv1
http://www.blender.org/documentation/blender_python_api_2_62_release/bpy.types.MeshTextureFace.html#bpy.types.MeshTextureFace

and in v2.62.1 (44620) there are no UVs accessible anymore on that way…
bpy.data.objects[0].data.uv_textures[‘UVMap’].data[0].???
http://www.blender.org/documentation/blender_python_api_2_62_1/bpy.types.MeshTexturePoly.html#bpy.types.MeshTexturePoly

can some body give me an example how i can create uv coordinates to an mesh with the new API?

or is there a document available with a “Howto” “old API” -> “new API” replacements…

bpy.data.objects[‘Cube’].data.uv_loop_layers[0].data[0].uv

Greetings!

@oscurart
Would you please inform me(us) how to create an uv_loop_layer and then a number of uv ? (2d Vectors I think)?

Yes!.

bpy.ops.mesh.uv_texture_add()
bpy.context.active_object.data.uv_textures[-1].name="HELLO_UV"

Thank you… the question raised by me, because an *.obj import did not work because of UV mapping was not ok and I had the idea to repair the script …
But luckily import wavefront does its job nicely! SVN 44849 this morning compiled :wink:

So good info can be gotton by looking at import.py from io_scene_obj directory !!!

Great, I recommend use Collada. This format supports several uvs.

Greetings.