Uv Operators

bpy.ops.uv.align(axis='ALIGN_AUTO')

Align selected UV vertices to an axis

Parameters:axis (enum in [‘ALIGN_S’, ‘ALIGN_T’, ‘ALIGN_U’, ‘ALIGN_AUTO’, ‘ALIGN_X’, ‘ALIGN_Y’], (optional)) –

Axis, Axis to align UV locations on

  • ALIGN_S Straighten, Align UVs along the line defined by the endpoints.
  • ALIGN_T Straighten X, Align UVs along the line defined by the endpoints along the X axis.
  • ALIGN_U Straighten Y, Align UVs along the line defined by the endpoints along the Y axis.
  • ALIGN_AUTO Align Auto, Automatically choose the axis on which there is most alignment already.
  • ALIGN_X Align X, Align UVs on X axis.
  • ALIGN_Y Align Y, Align UVs on Y axis.
bpy.ops.uv.average_islands_scale()

Average the size of separate UV islands, based on their area in 3D space

bpy.ops.uv.circle_select(x=0, y=0, radius=0, gesture_mode=0)

Select UV vertices using circle selection

Parameters:
  • x (int in [-inf, inf], (optional)) – X
  • y (int in [-inf, inf], (optional)) – Y
  • radius (int in [-inf, inf], (optional)) – Radius
  • gesture_mode (int in [-inf, inf], (optional)) – Gesture Mode
bpy.ops.uv.cube_project(cube_size=1.0, correct_aspect=True, clip_to_bounds=False, scale_to_bounds=False)

Project the UV vertices of the mesh over the six faces of a cube

Parameters:
  • cube_size (float in [0, inf], (optional)) – Cube Size, Size of the cube to project on
  • correct_aspect (boolean, (optional)) – Correct Aspect, Map UVs taking image aspect ratio into account
  • clip_to_bounds (boolean, (optional)) – Clip to Bounds, Clip UV coordinates to bounds after unwrapping
  • scale_to_bounds (boolean, (optional)) – Scale to Bounds, Scale UV coordinates to bounds after unwrapping
bpy.ops.uv.cursor_set(location=(0.0, 0.0))

Set 2D cursor location

Parameters:location (float array of 2 items in [-inf, inf], (optional)) – Location, Cursor location in normalized (0.0-1.0) coordinates
bpy.ops.uv.cylinder_project(direction='VIEW_ON_EQUATOR', align='POLAR_ZX', radius=1.0, correct_aspect=True, clip_to_bounds=False, scale_to_bounds=False)

Project the UV vertices of the mesh over the curved wall of a cylinder

Parameters:
  • direction (enum in [‘VIEW_ON_EQUATOR’, ‘VIEW_ON_POLES’, ‘ALIGN_TO_OBJECT’], (optional)) –

    Direction, Direction of the sphere or cylinder

    • VIEW_ON_EQUATOR View on Equator, 3D view is on the equator.
    • VIEW_ON_POLES View on Poles, 3D view is on the poles.
    • ALIGN_TO_OBJECT Align to Object, Align according to object transform.
  • align (enum in [‘POLAR_ZX’, ‘POLAR_ZY’], (optional)) –

    Align, How to determine rotation around the pole

    • POLAR_ZX Polar ZX, Polar 0 is X.
    • POLAR_ZY Polar ZY, Polar 0 is Y.
  • radius (float in [0, inf], (optional)) – Radius, Radius of the sphere or cylinder
  • correct_aspect (boolean, (optional)) – Correct Aspect, Map UVs taking image aspect ratio into account
  • clip_to_bounds (boolean, (optional)) – Clip to Bounds, Clip UV coordinates to bounds after unwrapping
  • scale_to_bounds (boolean, (optional)) – Scale to Bounds, Scale UV coordinates to bounds after unwrapping
bpy.ops.uv.export_layout(filepath="", check_existing=True, export_all=False, modified=False, mode='PNG', size=(1024, 1024), opacity=0.25, tessellated=False)

Export UV layout to file

Parameters:
  • filepath (string, (optional, never None)) – filepath
  • check_existing (boolean, (optional)) – Check Existing, Check and warn on overwriting existing files
  • export_all (boolean, (optional)) – All UVs, Export all UVs in this mesh (not just visible ones)
  • modified (boolean, (optional)) – Modified, Exports UVs from the modified mesh
  • mode (enum in [‘SVG’, ‘EPS’, ‘PNG’], (optional)) –

    Format, File format to export the UV layout to

    • SVG Scalable Vector Graphic (.svg), Export the UV layout to a vector SVG file.
    • EPS Encapsulate PostScript (.eps), Export the UV layout to a vector EPS file.
    • PNG PNG Image (.png), Export the UV layout to a bitmap image.
  • size (int array of 2 items in [8, 32768], (optional)) – size, Dimensions of the exported file
  • opacity (float in [0, 1], (optional)) – Fill Opacity
  • tessellated (boolean, (optional)) – Tessellated UVs, Export tessellated UVs instead of polygons ones
File :

addons/io_mesh_uv_layout/__init__.py:172

bpy.ops.uv.follow_active_quads(mode='LENGTH')

Follow UVs from active quads along continuous face loops

Parameters:mode (enum in [‘EVEN’, ‘LENGTH’], (optional)) –

Edge Length Mode, Method to space UV edge loops

  • EVEN Even, Space all UVs evenly.
  • LENGTH Length, Average space UVs edge length of each loop.
File :startup/bl_operators/uvcalc_follow_active.py:245
bpy.ops.uv.hide(unselected=False)

Hide (un)selected UV vertices

Parameters:unselected (boolean, (optional)) – Unselected, Hide unselected rather than selected
bpy.ops.uv.lightmap_pack(PREF_CONTEXT='SEL_FACES', PREF_PACK_IN_ONE=True, PREF_NEW_UVLAYER=False, PREF_APPLY_IMAGE=False, PREF_IMG_PX_SIZE=512, PREF_BOX_DIV=12, PREF_MARGIN_DIV=0.1)

Follow UVs from active quads along continuous face loops

Parameters:
  • PREF_CONTEXT (enum in [‘SEL_FACES’, ‘ALL_FACES’, ‘ALL_OBJECTS’], (optional)) –

    Selection

    • SEL_FACES Selected Faces, Space all UVs evenly.
    • ALL_FACES All Faces, Average space UVs edge length of each loop.
    • ALL_OBJECTS Selected Mesh Object, Average space UVs edge length of each loop.
  • PREF_PACK_IN_ONE (boolean, (optional)) – Share Tex Space, Objects Share texture space, map all objects into 1 uvmap
  • PREF_NEW_UVLAYER (boolean, (optional)) – New UV Map, Create a new UV map for every mesh packed
  • PREF_APPLY_IMAGE (boolean, (optional)) – New Image, Assign new images for every mesh (only one if shared tex space enabled)
  • PREF_IMG_PX_SIZE (int in [64, 5000], (optional)) – Image Size, Width and Height for the new image
  • PREF_BOX_DIV (int in [1, 48], (optional)) – Pack Quality, Pre Packing before the complex boxpack
  • PREF_MARGIN_DIV (float in [0.001, 1], (optional)) – Margin, Size of the margin as a division of the UV
File :

startup/bl_operators/uvcalc_lightmap.py:608

bpy.ops.uv.mark_seam()

Mark selected UV edges as seams

bpy.ops.uv.minimize_stretch(fill_holes=True, blend=0.0, iterations=0)

Reduce UV stretching by relaxing angles

Parameters:
  • fill_holes (boolean, (optional)) – Fill Holes, Virtual fill holes in mesh before unwrapping, to better avoid overlaps and preserve symmetry
  • blend (float in [0, 1], (optional)) – Blend, Blend factor between stretch minimized and original
  • iterations (int in [0, inf], (optional)) – Iterations, Number of iterations to run, 0 is unlimited when run interactively
bpy.ops.uv.pack_islands(margin=0.0)

Transform all islands so that they fill up the UV space as much as possible

Parameters:margin (float in [0, 1], (optional)) – Margin, Space between islands
bpy.ops.uv.pin(clear=False)

Set/clear selected UV vertices as anchored between multiple unwrap operations

Parameters:clear (boolean, (optional)) – Clear, Clear pinning for the selection instead of setting it
bpy.ops.uv.project_from_view(orthographic=False, correct_aspect=True, clip_to_bounds=False, scale_to_bounds=False)

Project the UV vertices of the mesh as seen in current 3D view

Parameters:
  • orthographic (boolean, (optional)) – Orthographic, Use orthographic projection
  • correct_aspect (boolean, (optional)) – Correct Aspect, Map UVs taking image aspect ratio into account
  • clip_to_bounds (boolean, (optional)) – Clip to Bounds, Clip UV coordinates to bounds after unwrapping
  • scale_to_bounds (boolean, (optional)) – Scale to Bounds, Scale UV coordinates to bounds after unwrapping
bpy.ops.uv.reset()

Reset UV projection

bpy.ops.uv.reveal()

Reveal all hidden UV vertices

bpy.ops.uv.seams_from_islands(mark_seams=True, mark_sharp=False)

Set mesh seams according to island setup in the UV editor

Parameters:
  • mark_seams (boolean, (optional)) – Mark Seams, Mark boundary edges as seams
  • mark_sharp (boolean, (optional)) – Mark Sharp, Mark boundary edges as sharp
bpy.ops.uv.select(extend=False, location=(0.0, 0.0))

Select UV vertices

Parameters:
  • extend (boolean, (optional)) – Extend, Extend selection rather than clearing the existing selection
  • location (float array of 2 items in [-inf, inf], (optional)) – Location, Mouse location in normalized coordinates, 0.0 to 1.0 is within the image bounds
bpy.ops.uv.select_all(action='TOGGLE')

Change selection of all UV vertices

Parameters:action (enum in [‘TOGGLE’, ‘SELECT’, ‘DESELECT’, ‘INVERT’], (optional)) –

Action, Selection action to execute

  • TOGGLE Toggle, Toggle selection for all elements.
  • SELECT Select, Select all elements.
  • DESELECT Deselect, Deselect all elements.
  • INVERT Invert, Invert selection of all elements.
bpy.ops.uv.select_border(pinned=False, gesture_mode=0, xmin=0, xmax=0, ymin=0, ymax=0, extend=True)

Select UV vertices using border selection

Parameters:
  • pinned (boolean, (optional)) – Pinned, Border select pinned UVs only
  • gesture_mode (int in [-inf, inf], (optional)) – Gesture Mode
  • xmin (int in [-inf, inf], (optional)) – X Min
  • xmax (int in [-inf, inf], (optional)) – X Max
  • ymin (int in [-inf, inf], (optional)) – Y Min
  • ymax (int in [-inf, inf], (optional)) – Y Max
  • extend (boolean, (optional)) – Extend, Extend selection instead of deselecting everything first
bpy.ops.uv.select_lasso(path=None, deselect=False, extend=True)

Select UVs using lasso selection

Parameters:
  • path (bpy_prop_collection of OperatorMousePath, (optional)) – Path
  • deselect (boolean, (optional)) – Deselect, Deselect rather than select items
  • extend (boolean, (optional)) – Extend, Extend selection instead of deselecting everything first
bpy.ops.uv.select_linked(extend=False)

Select all UV vertices linked to the active UV map

Parameters:extend (boolean, (optional)) – Extend, Extend selection rather than clearing the existing selection
bpy.ops.uv.select_linked_pick(extend=False, location=(0.0, 0.0))

Select all UV vertices linked under the mouse

Parameters:
  • extend (boolean, (optional)) – Extend, Extend selection rather than clearing the existing selection
  • location (float array of 2 items in [-inf, inf], (optional)) – Location, Mouse location in normalized coordinates, 0.0 to 1.0 is within the image bounds
bpy.ops.uv.select_loop(extend=False, location=(0.0, 0.0))

Select a loop of connected UV vertices

Parameters:
  • extend (boolean, (optional)) – Extend, Extend selection rather than clearing the existing selection
  • location (float array of 2 items in [-inf, inf], (optional)) – Location, Mouse location in normalized coordinates, 0.0 to 1.0 is within the image bounds
bpy.ops.uv.select_pinned()

Select all pinned UV vertices

bpy.ops.uv.smart_project(angle_limit=66.0, island_margin=0.0, user_area_weight=0.0)

This script projection unwraps the selected faces of a mesh (it operates on all selected mesh objects, and can be used to unwrap selected faces, or all faces)

Parameters:
  • angle_limit (float in [1, 89], (optional)) – Angle Limit, Lower for more projection groups, higher for less distortion
  • island_margin (float in [0, 1], (optional)) – Island Margin, Margin to reduce bleed from adjacent islands
  • user_area_weight (float in [0, 1], (optional)) – Area Weight, Weight projections vector by faces with larger areas
File :

startup/bl_operators/uvcalc_smart_project.py:1137

bpy.ops.uv.snap_cursor(target='PIXELS')

Snap cursor to target type

Parameters:target (enum in [‘PIXELS’, ‘SELECTED’], (optional)) – Target, Target to snap the selected UVs to
bpy.ops.uv.snap_selected(target='PIXELS')

Snap selected UV vertices to target type

Parameters:target (enum in [‘PIXELS’, ‘CURSOR’, ‘ADJACENT_UNSELECTED’], (optional)) – Target, Target to snap the selected UVs to
bpy.ops.uv.sphere_project(direction='VIEW_ON_EQUATOR', align='POLAR_ZX', correct_aspect=True, clip_to_bounds=False, scale_to_bounds=False)

Project the UV vertices of the mesh over the curved surface of a sphere

Parameters:
  • direction (enum in [‘VIEW_ON_EQUATOR’, ‘VIEW_ON_POLES’, ‘ALIGN_TO_OBJECT’], (optional)) –

    Direction, Direction of the sphere or cylinder

    • VIEW_ON_EQUATOR View on Equator, 3D view is on the equator.
    • VIEW_ON_POLES View on Poles, 3D view is on the poles.
    • ALIGN_TO_OBJECT Align to Object, Align according to object transform.
  • align (enum in [‘POLAR_ZX’, ‘POLAR_ZY’], (optional)) –

    Align, How to determine rotation around the pole

    • POLAR_ZX Polar ZX, Polar 0 is X.
    • POLAR_ZY Polar ZY, Polar 0 is Y.
  • correct_aspect (boolean, (optional)) – Correct Aspect, Map UVs taking image aspect ratio into account
  • clip_to_bounds (boolean, (optional)) – Clip to Bounds, Clip UV coordinates to bounds after unwrapping
  • scale_to_bounds (boolean, (optional)) – Scale to Bounds, Scale UV coordinates to bounds after unwrapping
bpy.ops.uv.stitch(use_limit=False, snap_islands=True, limit=0.01, static_island=0, midpoint_snap=False, selection=None)

Stitch selected UV vertices by proximity

Parameters:
  • use_limit (boolean, (optional)) – Use Limit, Stitch UVs within a specified limit distance
  • snap_islands (boolean, (optional)) – Snap Islands, Snap islands together (on edge stitch mode, rotates the islands too)
  • limit (float in [0, inf], (optional)) – Limit, Limit distance in normalized coordinates
  • static_island (int in [0, inf], (optional)) – Static Island, Island that stays in place when stitching islands
  • midpoint_snap (boolean, (optional)) – Snap At Midpoint, UVs are stitched at midpoint instead of at static island
  • selection (bpy_prop_collection of SelectedUvElement, (optional)) – Selection
bpy.ops.uv.tile_set(tile=(0, 0))

Set UV image tile coordinates

Parameters:tile (int array of 2 items in [0, inf], (optional)) – Tile, Tile coordinate

Unlink selected UV vertices from active UV map

bpy.ops.uv.unwrap(method='ANGLE_BASED', fill_holes=True, correct_aspect=True, use_subsurf_data=False, uv_subsurf_level=1)

Unwrap the mesh of the object being edited

Parameters:
  • method (enum in [‘ANGLE_BASED’, ‘CONFORMAL’], (optional)) – Method, Unwrapping method (Angle Based usually gives better results than Conformal, while being somewhat slower)
  • fill_holes (boolean, (optional)) – Fill Holes, Virtual fill holes in mesh before unwrapping, to better avoid overlaps and preserve symmetry
  • correct_aspect (boolean, (optional)) – Correct Aspect, Map UVs taking image aspect ratio into account
  • use_subsurf_data (boolean, (optional)) – Use Subsurf Data, Map UVs taking vertex position after subsurf into account
  • uv_subsurf_level (int in [1, 6], (optional)) – SubSurf Target, Number of times to subdivide before calculating UVs
bpy.ops.uv.weld()

Weld selected UV vertices together

Previous topic

Ui Operators

Next topic

View2D Operators