Skip to content

Commit

Permalink
Merge pull request ekaj2#3 from bovesan/blender28
Browse files Browse the repository at this point in the history
Blender28 support

not tested by @ekaj2
  • Loading branch information
ekaj2 committed Jul 17, 2020
2 parents db91535 + 7a55141 commit ea2894f
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions uv_map_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@

bl_info = {
"name": "UV Tools",
"author": "Jake Dube",
"version": (1, 0),
"blender": (2, 77, 0),
"author": "Jake Dube, cdeguise, bovesan",
"version": (1, 1),
"blender": (2, 80, 0),
"location": "UV maps in properties window",
"description": "Some tools for uv maps that should already be in Blender.",
"category": "UV"}


def make_active(name):
uvs = bpy.context.scene.objects.active.data.uv_textures
uvs = bpy.context.view_layer.objects.active.data.uv_layers
for uv in uvs:
if uv.name == name:
uvs.active = uv
Expand All @@ -38,7 +38,8 @@ def make_active(name):


def move_to_bottom(index):
uvs = bpy.context.scene.objects.active.data.uv_textures
# uvs = bpy.context.scene.objects.active.data.uv_textures
uvs = bpy.context.view_layer.objects.active.data.uv_layers
uvs.active_index = index
new_name = uvs.active.name

Expand All @@ -59,7 +60,7 @@ class MoveUVMapDown(Operator):
bl_options = {"REGISTER", "UNDO"}

def execute(self, context):
uvs = context.scene.objects.active.data.uv_textures
uvs = context.view_layer.objects.active.data.uv_layers

# get the selected UV map
orig_ind = uvs.active_index
Expand Down Expand Up @@ -89,7 +90,7 @@ class MoveUVMapUp(Operator):
bl_options = {"REGISTER", "UNDO"}

def execute(self, context):
uvs = context.scene.objects.active.data.uv_textures
uvs = bpy.context.view_layer.objects.active.data.uv_layers

if uvs.active_index == 0:
return {'FINISHED'}
Expand Down

0 comments on commit ea2894f

Please sign in to comment.