From f6c323aa42e94c4750f52940b47a0d57b503c1b9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 23 Aug 2010 22:16:45 +0000 Subject: - move more active properties into their collections: scene.active_keying_set --> scene.keying_sets.active ...same for active_uv_texture. active_vertex_color, active_keyconfig, - move mesh.add_uv_layer() and mesh.add_vertex_color() into their collections also have them return the newly created layer and dont set the layer active. uvtex = mesh.uv_layers.new(name) vcol = mesh.vertex_colors.new(name) --- release/scripts/templates/operator_uv.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'release/scripts/templates') diff --git a/release/scripts/templates/operator_uv.py b/release/scripts/templates/operator_uv.py index a18aaf358c8..305496e31ce 100644 --- a/release/scripts/templates/operator_uv.py +++ b/release/scripts/templates/operator_uv.py @@ -9,11 +9,11 @@ def main(context): bpy.ops.object.mode_set(mode='OBJECT', toggle=False) - if not mesh.active_uv_texture: - bpy.ops.mesh.uv_texture_add() + if not mesh.uv_textures: + uvtex = bpy.ops.mesh.uv_texture_add() # adjust UVs - for i, uv in enumerate(mesh.active_uv_texture.data): + for i, uv in enumerate(uvtex.data): uvs = uv.uv1, uv.uv2, uv.uv3, uv.uv4 for j, v_idx in enumerate(mesh.faces[i].vertices): if uv.select_uv[j]: -- cgit v1.2.3