UI: Object "Make Links" sub-menu overhaul

- Rename to "Link/Transfer Data".
- Move Mesh Data Transfer operators here from the Relations sub-menu.
- Clarify which operations links to, copies or transfers/projects
  data using Link, Copy and Transfer leading text.
- Re-order contents to fit each category and add separators.
- Add enum tool-tips.

Reviewed By: Blendify, campbellbarton pablovazquez, mont29

Ref D10090
This commit is contained in:
William Reynish 2021-01-20 20:48:14 +11:00 committed by Campbell Barton
parent 91bf24dd00
commit 685419d6be
2 changed files with 33 additions and 20 deletions

@ -2236,11 +2236,6 @@ class VIEW3D_MT_object_relations(Menu):
layout.operator_menu_enum("object.make_local", "type", text="Make Local...")
layout.menu("VIEW3D_MT_make_single_user")
layout.separator()
layout.operator("object.data_transfer")
layout.operator("object.datalayout_transfer")
class VIEW3D_MT_object(Menu):
bl_context = "objectmode"
@ -2274,7 +2269,7 @@ class VIEW3D_MT_object(Menu):
layout.menu("VIEW3D_MT_object_relations")
layout.menu("VIEW3D_MT_object_constraints")
layout.menu("VIEW3D_MT_object_track")
layout.menu("VIEW3D_MT_make_links", text="Make Links")
layout.menu("VIEW3D_MT_make_links")
layout.separator()
@ -2787,7 +2782,7 @@ class VIEW3D_MT_make_single_user(Menu):
class VIEW3D_MT_make_links(Menu):
bl_label = "Make Links"
bl_label = "Link/Transfer Data"
def draw(self, _context):
layout = self.layout
@ -2795,10 +2790,10 @@ class VIEW3D_MT_make_links(Menu):
if len(bpy.data.scenes) > 10:
layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("object.make_links_scene", text="Objects to Scene...", icon='OUTLINER_OB_EMPTY')
layout.operator("object.make_links_scene", text="Link Objects to Scene...", icon='OUTLINER_OB_EMPTY')
else:
layout.operator_context = 'EXEC_REGION_WIN'
layout.operator_menu_enum("object.make_links_scene", "scene", text="Objects to Scene")
layout.operator_menu_enum("object.make_links_scene", "scene", text="Link Objects to Scene")
layout.separator()
@ -2806,7 +2801,12 @@ class VIEW3D_MT_make_links(Menu):
layout.operator_enum("object.make_links_data", "type") # inline
layout.operator("object.join_uvs") # stupid place to add this!
layout.operator("object.join_uvs", text="Copy UV Maps")
layout.separator()
layout.operator("object.data_transfer")
layout.operator("object.datalayout_transfer")
class VIEW3D_MT_brush_paint_modes(Menu):

@ -1790,20 +1790,33 @@ void OBJECT_OT_make_links_scene(wmOperatorType *ot)
void OBJECT_OT_make_links_data(wmOperatorType *ot)
{
static const EnumPropertyItem make_links_items[] = {
{MAKE_LINKS_OBDATA, "OBDATA", 0, "Object Data", ""},
{MAKE_LINKS_MATERIALS, "MATERIAL", 0, "Materials", ""},
{MAKE_LINKS_ANIMDATA, "ANIMATION", 0, "Animation Data", ""},
{MAKE_LINKS_GROUP, "GROUPS", 0, "Collection", ""},
{MAKE_LINKS_DUPLICOLLECTION, "DUPLICOLLECTION", 0, "Instance Collection", ""},
{MAKE_LINKS_MODIFIERS, "MODIFIERS", 0, "Modifiers", ""},
{MAKE_LINKS_FONTS, "FONTS", 0, "Fonts", ""},
{MAKE_LINKS_SHADERFX, "EFFECTS", 0, "Effects", ""},
{MAKE_LINKS_OBDATA, "OBDATA", 0, "Link Object Data", "Replace assigned Object Data"},
{MAKE_LINKS_MATERIALS, "MATERIAL", 0, "Link Materials", "Replace assigned Materials"},
{MAKE_LINKS_ANIMDATA,
"ANIMATION",
0,
"Link Animation Data",
"Replace assigned Animation Data"},
{MAKE_LINKS_GROUP, "GROUPS", 0, "Link Collections", "Replace assigned Collections"},
{MAKE_LINKS_DUPLICOLLECTION,
"DUPLICOLLECTION",
0,
"Link Instance Collection",
"Replace assigned Collection Instance"},
{MAKE_LINKS_FONTS, "FONTS", 0, "Link Fonts to Text", "Replace Text object Fonts"},
{0, "", 0, NULL, NULL},
{MAKE_LINKS_MODIFIERS, "MODIFIERS", 0, "Copy Modifiers", "Replace Modifiers"},
{MAKE_LINKS_SHADERFX,
"EFFECTS",
0,
"Copy Grease Pencil Effects",
"Replace Grease Pencil Effects"},
{0, NULL, 0, NULL, NULL},
};
/* identifiers */
ot->name = "Link Data";
ot->description = "Apply active object links to other selected objects";
ot->name = "Link/Transfer Data";
ot->description = "Transfer data from active object to selected objects";
ot->idname = "OBJECT_OT_make_links_data";
/* api callbacks */