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:
authorAntonio Vazquez <blendergit@gmail.com>2020-03-17 19:09:20 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-03-17 19:28:49 +0300
commit2518f601094bfa14474c24c3a1e640b9fca0e6e2 (patch)
treee08f9598b274a575506a0ec2302ff29ecc3849d6 /source/blender/depsgraph
parent964375e36a2b2a56d12201a3a96dd4572e0a8827 (diff)
GPencil: Fix Parent layer not working
The parenting was using the old logic, but with new engine the draw is done using eval data. Fixed the depsgraph relationship missing with bones to get an update when the bone is transformed. Also fixed Snap cursor to Selected
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_relations.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index 6791125d1e9..27d6db6a58f 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -2127,9 +2127,20 @@ void DepsgraphRelationBuilder::build_object_data_geometry_datablock(ID *obdata)
/* Layer parenting need react to the parent object transformation. */
LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
if (gpl->parent != NULL) {
- ComponentKey transform_key(&gpl->parent->id, NodeType::TRANSFORM);
ComponentKey gpd_geom_key(&gpd->id, NodeType::GEOMETRY);
- add_relation(transform_key, gpd_geom_key, "GPencil Parent Layer");
+
+ if (gpl->partype == PARBONE) {
+ ComponentKey bone_key(&gpl->parent->id, NodeType::BONE, gpl->parsubstr);
+ OperationKey armature_key(
+ &gpl->parent->id, NodeType::TRANSFORM, OperationCode::TRANSFORM_FINAL);
+
+ add_relation(bone_key, gpd_geom_key, "Bone Parent");
+ add_relation(armature_key, gpd_geom_key, "Armature Parent");
+ }
+ else {
+ ComponentKey transform_key(&gpl->parent->id, NodeType::TRANSFORM);
+ add_relation(transform_key, gpd_geom_key, "GPencil Parent Layer");
+ }
}
}
break;