Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonioya <blendergit@gmail.com>2019-06-25 14:59:59 +0300
committerAntonioya <blendergit@gmail.com>2019-06-25 15:00:34 +0300
commitc186cfe419baa6f715544353b0861c374150b87b (patch)
treeb8b57da7414a9dd127c507cb89fd816b6817348b /source/blender/editors/object/object_relations.c
parent30bf48c9caee40ce457d58b5bfe7fc398b7e9891 (diff)
GPencil: Add Lattice modifier when use Ctrl+P to Lattice Deform
When parent a Grease Pencil object to Lattice, automatically a Lattice modifier is added.
Diffstat (limited to 'source/blender/editors/object/object_relations.c')
-rw-r--r--source/blender/editors/object/object_relations.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 42b27d1d255..e6637265fbc 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -898,6 +898,17 @@ bool ED_object_parent_set(ReportList *reports,
invert_m4_m4(ob->parentinv, workob.obmat);
}
+ else if ((ob->type == OB_GPENCIL) && (par->type == OB_LATTICE)) {
+ /* Add Lattice modifier */
+ if (partype == PAR_LATTICE) {
+ ED_gpencil_add_lattice_modifier(C, reports, ob, par);
+ }
+ /* get corrected inverse */
+ ob->partype = PAROBJECT;
+ BKE_object_workob_calc_parent(depsgraph, scene, ob, &workob);
+
+ invert_m4_m4(ob->parentinv, workob.obmat);
+ }
else {
/* calculate inverse parent matrix */
BKE_object_workob_calc_parent(depsgraph, scene, ob, &workob);