[Bf-blender-cvs] [c8a3d1a1fa6] master: GPencil: Add Link support to Effects using Ctrl+L
Antonio Vazquez
noreply at git.blender.org
Fri Dec 11 15:54:49 CET 2020
Commit: c8a3d1a1fa65f2ff21202d79c5f027119203319f
Author: Antonio Vazquez
Date: Thu Dec 10 23:04:54 2020 +0100
Branches: master
https://developer.blender.org/rBc8a3d1a1fa65f2ff21202d79c5f027119203319f
GPencil: Add Link support to Effects using Ctrl+L
The effects were not supported in this operator, but it was supported in the Outliner.
Differential Revision: https://developer.blender.org/D9824
===================================================================
M source/blender/editors/object/object_relations.c
===================================================================
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 8841b1955bf..3ad500d3d0d 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -1554,6 +1554,7 @@ enum {
MAKE_LINKS_DUPLICOLLECTION = 5,
MAKE_LINKS_MODIFIERS = 6,
MAKE_LINKS_FONTS = 7,
+ MAKE_LINKS_SHADERFX = 8,
};
/* Return true if make link data is allowed, false otherwise */
@@ -1589,6 +1590,11 @@ static bool allow_make_links_data(const int type, Object *ob_src, Object *ob_dst
return true;
}
break;
+ case MAKE_LINKS_SHADERFX:
+ if ((ob_src->type == OB_GPENCIL) && (ob_dst->type == OB_GPENCIL)) {
+ return true;
+ }
+ break;
}
return false;
}
@@ -1720,6 +1726,11 @@ static int make_links_data_exec(bContext *C, wmOperator *op)
ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION);
break;
}
+ case MAKE_LINKS_SHADERFX:
+ ED_object_shaderfx_link(ob_dst, ob_src);
+ DEG_id_tag_update(&ob_dst->id,
+ ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION);
+ break;
}
}
}
@@ -1782,6 +1793,7 @@ void OBJECT_OT_make_links_data(wmOperatorType *ot)
{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", ""},
{0, NULL, 0, NULL, NULL},
};
More information about the Bf-blender-cvs
mailing list