diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2018-11-14 14:01:28 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2018-11-14 14:01:40 +0300 |
commit | 5c27c76ed3a9683c5d54745add6713eb562996e8 (patch) | |
tree | d6e3726fd08ce8cc8298c54fa8f2e9ccf559c041 /source/blender/depsgraph/intern/depsgraph.cc | |
parent | 43ee433dceccf13868da683ec781b30f17185a2b (diff) |
Depsgraph: fix relations for drivers on bone weight in Armature constraint.
Diffstat (limited to 'source/blender/depsgraph/intern/depsgraph.cc')
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph.cc b/source/blender/depsgraph/intern/depsgraph.cc index d3c9560bcb1..7f47dce9f47 100644 --- a/source/blender/depsgraph/intern/depsgraph.cc +++ b/source/blender/depsgraph/intern/depsgraph.cc @@ -51,6 +51,7 @@ extern "C" { #include "RNA_access.h" #include "BKE_scene.h" +#include "BKE_constraint.h" } #include <algorithm> @@ -183,6 +184,25 @@ static bool pointer_to_component_node_criteria( } } } + else if (ELEM(ptr->type, &RNA_ConstraintTarget, &RNA_ConstraintTargetBone)) { + Object *object = (Object *)ptr->id.data; + bConstraintTarget *tgt = (bConstraintTarget *)ptr->data; + /* Check whether is object or bone constraint. */ + bPoseChannel *pchan = NULL; + bConstraint *con = BKE_constraint_find_from_target(object, tgt, &pchan); + if (con != NULL) { + if (pchan != NULL) { + *type = DEG_NODE_TYPE_BONE; + *operation_code = DEG_OPCODE_BONE_LOCAL; + *subdata = pchan->name; + } + else { + *type = DEG_NODE_TYPE_TRANSFORM; + *operation_code = DEG_OPCODE_TRANSFORM_LOCAL; + } + return true; + } + } else if (RNA_struct_is_a(ptr->type, &RNA_Modifier)) { *type = DEG_NODE_TYPE_GEOMETRY; return true; |