diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-08-24 02:16:45 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-08-24 02:16:45 +0400 |
commit | f6c323aa42e94c4750f52940b47a0d57b503c1b9 (patch) | |
tree | 486b03bf59d3e022443c8e290f354265d0126578 /release/scripts/templates/operator_uv.py | |
parent | 1be4eda552aa97aa5f5fe43fd34196c57425a7c2 (diff) |
- 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)
Diffstat (limited to 'release/scripts/templates/operator_uv.py')
-rw-r--r-- | release/scripts/templates/operator_uv.py | 6 |
1 files changed, 3 insertions, 3 deletions
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]: |