[Bf-blender-cvs] [3f2b1f1b667] blender-v2.83-release: Fix T81218: Crash in pose mode using a driver on bendy bone Segment
Sybren A. Stüvel
noreply at git.blender.org
Wed Oct 7 10:23:19 CEST 2020
Commit: 3f2b1f1b667d00494b01ed4b9d65196f45eb75d3
Author: Sybren A. Stüvel
Date: Tue Oct 6 17:49:57 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB3f2b1f1b667d00494b01ed4b9d65196f45eb75d3
Fix T81218: Crash in pose mode using a driver on bendy bone Segment
The example file in T81218 has a driver that maps a bone's X-location to
the number of BBone segments. This caused a dependency cycle, which
resulted in bad thread serialisation, which caused the crash.
This patch breaks the dependency cycle `BONE_LOCAL` →
`DRIVER(bones["Bone"].bbone_segments)` → `BONE_LOCAL`. The 'Driver Data'
relation now points to `BONE_SEGMENTS` when the driven property starts
with `bbone_`.
Differential Revision: https://developer.blender.org/D9122
===================================================================
M source/blender/depsgraph/intern/builder/deg_builder_relations.cc
===================================================================
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index 4fb893b350c..182404a848b 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -1453,6 +1453,9 @@ void DepsgraphRelationBuilder::build_driver_data(ID *id, FCurve *fcu)
* which will affect the evaluation of corresponding pose bones. */
Bone *bone = (Bone *)property_entry_key.ptr.data;
if (bone != nullptr) {
+ const char *prop_identifier = RNA_property_identifier(property_entry_key.prop);
+ const bool driver_targets_bbone = STRPREFIX(prop_identifier, "bbone_");
+
/* Find objects which use this, and make their eval callbacks
* depend on this. */
for (IDNode *to_node : graph_->id_nodes) {
@@ -1462,8 +1465,9 @@ void DepsgraphRelationBuilder::build_driver_data(ID *id, FCurve *fcu)
if (object->data == id_ptr && object->pose != nullptr) {
bPoseChannel *pchan = BKE_pose_channel_find_name(object->pose, bone->name);
if (pchan != nullptr) {
- OperationKey bone_key(
- &object->id, NodeType::BONE, pchan->name, OperationCode::BONE_LOCAL);
+ OperationCode target_op = driver_targets_bbone ? OperationCode::BONE_SEGMENTS :
+ OperationCode::BONE_LOCAL;
+ OperationKey bone_key(&object->id, NodeType::BONE, pchan->name, target_op);
add_relation(driver_key, bone_key, "Arm Bone -> Driver -> Bone");
}
}
More information about the Bf-blender-cvs
mailing list