Skip to content
Snippets Groups Projects
Commit 75784ccb authored by Philipp Oeser's avatar Philipp Oeser
Browse files

Copy Attributes Menu: remove 'UV Image' option [edit mode]

Since uv_textures are gone in 2.8, remove the option to copy 'UV Image'
in editmode (was giving errors obviously and prevented other usage in
editmode)

Fixes T72881
parent 97e08ebb
No related branches found
No related tags found
No related merge requests found
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
bl_info = { bl_info = {
"name": "Copy Attributes Menu", "name": "Copy Attributes Menu",
"author": "Bassam Kurdali, Fabian Fricke, Adam Wiseman", "author": "Bassam Kurdali, Fabian Fricke, Adam Wiseman",
"version": (0, 4, 8), "version": (0, 4, 9),
"blender": (2, 80, 0), "blender": (2, 80, 0),
"location": "View3D > Ctrl-C", "location": "View3D > Ctrl-C",
"description": "Copy Attributes Menu from Blender 2.4", "description": "Copy Attributes Menu from Blender 2.4",
...@@ -655,7 +655,7 @@ class MESH_MT_CopyFaceSettings(Menu): ...@@ -655,7 +655,7 @@ class MESH_MT_CopyFaceSettings(Menu):
def draw(self, context): def draw(self, context):
mesh = context.object.data mesh = context.object.data
uv = len(mesh.uv_textures) > 1 uv = len(mesh.uv_layers) > 1
vc = len(mesh.vertex_colors) > 1 vc = len(mesh.vertex_colors) > 1
layout = self.layout layout = self.layout
...@@ -665,11 +665,7 @@ class MESH_MT_CopyFaceSettings(Menu): ...@@ -665,11 +665,7 @@ class MESH_MT_CopyFaceSettings(Menu):
op['layer'] = '' op['layer'] = ''
op['mode'] = 'MAT' op['mode'] = 'MAT'
if mesh.uv_textures.active: if mesh.uv_layers.active:
op = layout.operator(MESH_OT_CopyFaceSettings.bl_idname,
text="Copy Active UV Image")
op['layer'] = ''
op['mode'] = 'IMAGE'
op = layout.operator(MESH_OT_CopyFaceSettings.bl_idname, op = layout.operator(MESH_OT_CopyFaceSettings.bl_idname,
text="Copy Active UV Coords") text="Copy Active UV Coords")
op['layer'] = '' op['layer'] = ''
...@@ -694,19 +690,6 @@ class MESH_MT_CopyFaceSettings(Menu): ...@@ -694,19 +690,6 @@ class MESH_MT_CopyFaceSettings(Menu):
# Explicitly defined as using the generator code was broken in case of Menus # Explicitly defined as using the generator code was broken in case of Menus
# causing issues with access and registration # causing issues with access and registration
class MESH_MT_CopyImagesFromLayer(Menu):
bl_label = "Copy Other UV Image Layers"
@classmethod
def poll(cls, context):
obj = context.active_object
return obj and obj.mode == "EDIT_MESH" and len(
obj.data.uv_layers) > 1
def draw(self, context):
mesh = context.active_object.data
_buildmenu(self, mesh, 'IMAGE', "IMAGE_COL")
class MESH_MT_CopyUVCoordsFromLayer(Menu): class MESH_MT_CopyUVCoordsFromLayer(Menu):
bl_label = "Copy Other UV Coord Layers" bl_label = "Copy Other UV Coord Layers"
...@@ -741,7 +724,7 @@ def _buildmenu(self, mesh, mode, icon): ...@@ -741,7 +724,7 @@ def _buildmenu(self, mesh, mode, icon):
if mode == 'VCOL': if mode == 'VCOL':
layers = mesh.vertex_colors layers = mesh.vertex_colors
else: else:
layers = mesh.uv_textures layers = mesh.uv_layers
for layer in layers: for layer in layers:
if not layer.active: if not layer.active:
op = layout.operator(MESH_OT_CopyFaceSettings.bl_idname, op = layout.operator(MESH_OT_CopyFaceSettings.bl_idname,
...@@ -771,7 +754,7 @@ class MESH_OT_CopyFaceSettings(Operator): ...@@ -771,7 +754,7 @@ class MESH_OT_CopyFaceSettings(Operator):
def execute(self, context): def execute(self, context):
mode = getattr(self, 'mode', '') mode = getattr(self, 'mode', '')
if mode not in {'MAT', 'VCOL', 'IMAGE', 'UV'}: if mode not in {'MAT', 'VCOL', 'UV'}:
self.report({'ERROR'}, "No mode specified or invalid mode") self.report({'ERROR'}, "No mode specified or invalid mode")
return self._end(context, {'CANCELLED'}) return self._end(context, {'CANCELLED'})
layername = getattr(self, 'layer', '') layername = getattr(self, 'layer', '')
...@@ -788,9 +771,6 @@ class MESH_OT_CopyFaceSettings(Operator): ...@@ -788,9 +771,6 @@ class MESH_OT_CopyFaceSettings(Operator):
if mode == 'VCOL': if mode == 'VCOL':
layers = mesh.vertex_colors layers = mesh.vertex_colors
act_layer = mesh.vertex_colors.active act_layer = mesh.vertex_colors.active
elif mode == 'IMAGE':
layers = mesh.uv_textures
act_layer = mesh.uv_textures.active
elif mode == 'UV': elif mode == 'UV':
layers = mesh.uv_layers layers = mesh.uv_layers
act_layer = mesh.uv_layers.active act_layer = mesh.uv_layers.active
...@@ -813,9 +793,6 @@ class MESH_OT_CopyFaceSettings(Operator): ...@@ -813,9 +793,6 @@ class MESH_OT_CopyFaceSettings(Operator):
if mode == 'MAT': if mode == 'MAT':
f.material_index = polys[from_index].material_index f.material_index = polys[from_index].material_index
continue continue
elif mode == 'IMAGE':
to_data[f.index].image = from_data[from_index].image
continue
if len(f.loop_indices) != len(polys[from_index].loop_indices): if len(f.loop_indices) != len(polys[from_index].loop_indices):
self.report({'WARNING'}, "Different number of vertices.") self.report({'WARNING'}, "Different number of vertices.")
for i in range(len(f.loop_indices)): for i in range(len(f.loop_indices)):
...@@ -842,7 +819,6 @@ classes = ( ...@@ -842,7 +819,6 @@ classes = (
CopySelectedObjectModifiers, CopySelectedObjectModifiers,
VIEW3D_MT_copypopup, VIEW3D_MT_copypopup,
MESH_MT_CopyFaceSettings, MESH_MT_CopyFaceSettings,
MESH_MT_CopyImagesFromLayer,
MESH_MT_CopyUVCoordsFromLayer, MESH_MT_CopyUVCoordsFromLayer,
MESH_MT_CopyVertexColorsFromLayer, MESH_MT_CopyVertexColorsFromLayer,
MESH_OT_CopyFaceSettings, MESH_OT_CopyFaceSettings,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment