Skip to content
Snippets Groups Projects
Commit 05f475f2 authored by Aaron Carlisle's avatar Aaron Carlisle
Browse files

Copy Attributes: Updates for Blender 3.4

- Remove time offset -- this feature was removed in Blender 2.61
- Cleanup Code
- Rename groups to collections
- Rename dupli to instancing
- Remove BGE feature
- Remove non existent `MESH_MT_CopyImagesFromLayer`
- Update operator labels

Addresses parts of T100240
parent 4be7119a
No related branches found
No related tags found
No related merge requests found
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
bl_info = { bl_info = {
"name": "Copy Attributes Menu", "name": "Copy Attributes Menu",
"author": "Bassam Kurdali, Fabian Fricke, Adam Wiseman, Demeter Dzadik", "author": "Bassam Kurdali, Fabian Fricke, Adam Wiseman, Demeter Dzadik",
"version": (0, 5, 0), "version": (0, 6, 0),
"blender": (3, 0, 0), "blender": (3, 4, 0),
"location": "View3D > Ctrl-C", "location": "View3D > Ctrl-C",
"description": "Copy Attributes Menu", "description": "Copy Attributes Menu",
"doc_url": "{BLENDER_MANUAL_URL}/addons/interface/copy_attributes.html", "doc_url": "{BLENDER_MANUAL_URL}/addons/interface/copy_attributes.html",
...@@ -425,13 +425,8 @@ def obDrw(ob, active, context): ...@@ -425,13 +425,8 @@ def obDrw(ob, active, context):
ob.empty_display_size = active.empty_display_size ob.empty_display_size = active.empty_display_size
def obOfs(ob, active, context):
ob.time_offset = active.time_offset
return('INFO', "Time offset copied")
def obDup(ob, active, context): def obDup(ob, active, context):
generic_copy(active, ob, "dupli") generic_copy(active, ob, "instance_type")
return('INFO', "Duplication method copied") return('INFO', "Duplication method copied")
...@@ -486,11 +481,11 @@ def obMod(ob, active, context): ...@@ -486,11 +481,11 @@ def obMod(ob, active, context):
return('INFO', "Modifiers copied") return('INFO', "Modifiers copied")
def obGrp(ob, active, context): def obCollections(ob, active, context):
for grp in bpy.data.collections: for collection in bpy.data.collections:
if active.name in grp.objects and ob.name not in grp.objects: if active.name in collection.objects and ob.name not in collection.objects:
grp.objects.link(ob) collection.objects.link(ob)
return('INFO', "Groups copied") return('INFO', "Collections copied")
def obWei(ob, active, context): def obWei(ob, active, context):
...@@ -557,10 +552,8 @@ object_copies = ( ...@@ -557,10 +552,8 @@ object_copies = (
"Copy Scale from Active to Selected", obVisSca), "Copy Scale from Active to Selected", obVisSca),
('obj_drw', "Draw Options", ('obj_drw', "Draw Options",
"Copy Draw Options from Active to Selected", obDrw), "Copy Draw Options from Active to Selected", obDrw),
('obj_ofs', "Time Offset", ('obj_dup', "Instancing",
"Copy Time Offset from Active to Selected", obOfs), "Copy instancing properties from Active to Selected", obDup),
('obj_dup', "Dupli",
"Copy Dupli from Active to Selected", obDup),
('obj_col', "Object Color", ('obj_col', "Object Color",
"Copy Object Color from Active to Selected", obCol), "Copy Object Color from Active to Selected", obCol),
# ('obj_dmp', "Damping", # ('obj_dmp', "Damping",
...@@ -569,8 +562,6 @@ object_copies = ( ...@@ -569,8 +562,6 @@ object_copies = (
# "Copy Physical Attributes from Active to Selected"), # "Copy Physical Attributes from Active to Selected"),
# ('obj_prp', "Properties", # ('obj_prp', "Properties",
# "Copy Properties from Active to Selected"), # "Copy Properties from Active to Selected"),
# ('obj_log', "Logic Bricks",
# "Copy Logic Bricks from Active to Selected"),
('obj_lok', "Protected Transform", ('obj_lok', "Protected Transform",
"Copy Protected Transforms from Active to Selected", obLok), "Copy Protected Transforms from Active to Selected", obLok),
('obj_con', "Object Constraints", ('obj_con', "Object Constraints",
...@@ -589,8 +580,8 @@ object_copies = ( ...@@ -589,8 +580,8 @@ object_copies = (
"Copy Modifiers from Active to Selected", obMod), "Copy Modifiers from Active to Selected", obMod),
('obj_wei', "Vertex Weights", ('obj_wei', "Vertex Weights",
"Copy vertex weights based on indices", obWei), "Copy vertex weights based on indices", obWei),
('obj_grp', "Group Links", ('obj_grp', "Collection Links",
"Copy selected into active object's groups", obGrp) "Copy selected into active object's collection", obCollections)
) )
...@@ -729,27 +720,23 @@ class MESH_MT_CopyFaceSettings(Menu): ...@@ -729,27 +720,23 @@ class MESH_MT_CopyFaceSettings(Menu):
layout = self.layout layout = self.layout
op = layout.operator(MESH_OT_CopyFaceSettings.bl_idname, op = layout.operator(mesh.copy_face_settings, text="Copy Material")
text="Copy Material")
op['layer'] = '' op['layer'] = ''
op['mode'] = 'MAT' op['mode'] = 'MAT'
if mesh.uv_layers.active: if mesh.uv_layers.active:
op = layout.operator(MESH_OT_CopyFaceSettings.bl_idname, op = layout.operator(mesh.copy_face_settings, text="Copy Active UV Coords")
text="Copy Active UV Coords")
op['layer'] = '' op['layer'] = ''
op['mode'] = 'UV' op['mode'] = 'UV'
if mesh.vertex_colors.active: if mesh.vertex_colors.active:
op = layout.operator(MESH_OT_CopyFaceSettings.bl_idname, op = layout.operator(mesh.copy_face_settings, text="Copy Active Vertex Colors")
text="Copy Active Vertex Colors")
op['layer'] = '' op['layer'] = ''
op['mode'] = 'VCOL' op['mode'] = 'VCOL'
if uv or vc: if uv or vc:
layout.separator() layout.separator()
if uv: if uv:
layout.menu("MESH_MT_CopyImagesFromLayer")
layout.menu("MESH_MT_CopyUVCoordsFromLayer") layout.menu("MESH_MT_CopyUVCoordsFromLayer")
if vc: if vc:
layout.menu("MESH_MT_CopyVertexColorsFromLayer") layout.menu("MESH_MT_CopyVertexColorsFromLayer")
...@@ -761,7 +748,7 @@ class MESH_MT_CopyFaceSettings(Menu): ...@@ -761,7 +748,7 @@ class MESH_MT_CopyFaceSettings(Menu):
class MESH_MT_CopyUVCoordsFromLayer(Menu): class MESH_MT_CopyUVCoordsFromLayer(Menu):
bl_label = "Copy Other UV Coord Layers" bl_label = "Copy UV Coordinates from Layer"
@classmethod @classmethod
def poll(cls, context): def poll(cls, context):
...@@ -775,7 +762,7 @@ class MESH_MT_CopyUVCoordsFromLayer(Menu): ...@@ -775,7 +762,7 @@ class MESH_MT_CopyUVCoordsFromLayer(Menu):
class MESH_MT_CopyVertexColorsFromLayer(Menu): class MESH_MT_CopyVertexColorsFromLayer(Menu):
bl_label = "Copy Other Vertex Colors Layers" bl_label = "Copy Vertex Colors from Layer"
@classmethod @classmethod
def poll(cls, context): def poll(cls, context):
...@@ -796,7 +783,7 @@ def _buildmenu(self, mesh, mode, icon): ...@@ -796,7 +783,7 @@ def _buildmenu(self, mesh, mode, icon):
layers = mesh.uv_layers 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.copy_face_settings,
text=layer.name, icon=icon) text=layer.name, icon=icon)
op['layer'] = layer.name op['layer'] = layer.name
op['mode'] = mode op['mode'] = mode
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment