I want to use python to move the UVs of the selected objects. I am having trouble with moving the UVs. When I run my script I moves the objects instead, not the UVs. All object have exactly 1 UV map.
My approach the problem:
for mesh in selection:
for UVs in mesh
select all UVs
- move UVs
Here is my code.
import bpy
scene = bpy.context.scene
for count, ob in enumerate(bpy.context.selected_objects):
if ob.type == 'MESH':
scene.objects.active = ob
bpy.ops.object.mode_set(mode='EDIT', toggle=False)
bpy.ops.mesh.reveal()
bpy.ops.mesh.select_all(action='SELECT')
# execute any editmode tool
move_x = count % 10
move_y = count // 10
bpy.ops.transform.translate(value=(move_x, move_y, 0), constraint_axis=(True, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=0.263331)
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)