[Bf-blender-cvs] [c041e10c9a9] master: Depsgraph: provide more granularity to PoseBone property links.
Alexander Gavrilov
noreply at git.blender.org
Tue May 7 14:02:05 CEST 2019
Commit: c041e10c9a94864537e78c4a36e3f03838889655
Author: Alexander Gavrilov
Date: Tue May 7 14:51:40 2019 +0300
Branches: master
https://developer.blender.org/rBc041e10c9a94864537e78c4a36e3f03838889655
Depsgraph: provide more granularity to PoseBone property links.
Most properties aren't altered by the evaluation of the bone,
and can be read immediately from its input operation. B-Bone
properties can be evaluated at the last possible moment.
This provides more freedom in using drivers to connect bone
properties: for example, it is now possible to read raw local
transform values via drivers from a bone that depends on the
reader bone via constraints.
===================================================================
M source/blender/depsgraph/intern/builder/deg_builder_rna.cc
===================================================================
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_rna.cc b/source/blender/depsgraph/intern/builder/deg_builder_rna.cc
index ea5f86a31a8..fa38dce1a9f 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_rna.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_rna.cc
@@ -196,11 +196,30 @@ RNANodeIdentifier RNANodeQuery::construct_node_identifier(const PointerRNA *ptr,
/* Bone - generally, we just want the bone component. */
node_identifier.type = NodeType::BONE;
node_identifier.component_name = pchan->name;
- /* But B-Bone properties should connect to the actual operation. */
- Object *object = reinterpret_cast<Object *>(node_identifier.id);
- if (!ELEM(NULL, pchan->bone, prop) && STRPREFIX(RNA_property_identifier(prop), "bbone_") &&
- builder_->check_pchan_has_bbone_segments(object, pchan)) {
- node_identifier.operation_code = OperationCode::BONE_SEGMENTS;
+ /* However check property name for special handling. */
+ if (prop != NULL) {
+ Object *object = reinterpret_cast<Object *>(node_identifier.id);
+ const char *prop_name = RNA_property_identifier(prop);
+ /* B-Bone properties should connect to the final operation. */
+ if (STRPREFIX(prop_name, "bbone_")) {
+ if (builder_->check_pchan_has_bbone_segments(object, pchan)) {
+ node_identifier.operation_code = OperationCode::BONE_SEGMENTS;
+ }
+ else {
+ node_identifier.operation_code = OperationCode::BONE_DONE;
+ }
+ }
+ /* Final transform properties go to the Done node for the exit. */
+ else if (STREQ(prop_name, "head") || STREQ(prop_name, "tail") ||
+ STRPREFIX(prop_name, "matrix")) {
+ if (source == RNAPointerSource::EXIT) {
+ node_identifier.operation_code = OperationCode::BONE_DONE;
+ }
+ }
+ /* And other properties can always go to the entry operation. */
+ else {
+ node_identifier.operation_code = OperationCode::BONE_LOCAL;
+ }
}
}
return node_identifier;
More information about the Bf-blender-cvs
mailing list