[Bf-blender-cvs] [71d53ab4654] blender-v2.82-release: Fix T73001: Shader Node with driver not updating when animated

Sybren A. Stüvel noreply at git.blender.org
Fri Jan 24 12:17:21 CET 2020


Commit: 71d53ab4654c3abb9bd548b324f8c9ca34250a9b
Author: Sybren A. Stüvel
Date:   Fri Jan 24 12:15:12 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rB71d53ab4654c3abb9bd548b324f8c9ca34250a9b

Fix T73001: Shader Node with driver not updating when animated

When there are ID properties on an object, and these are animated and
used by a driver, the depsgraph has proper connections between ACTION →
ID PROPERTY → DRIVER.

When these properties are defined on a mesh, however, the depsgraph
relations are incorrectly created between GEOMETRY → PROPERTIES_EXIT →
DRIVER (because it's assumed that 'source = ENTRY' implies 'geometry').

This patch solves this by first checking whether the targeted property
is an ID property and handling it accordingly. This also made it
possible to remove some special cases from pose bone relations.

Maniphest Tasks: T73001

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D6571

===================================================================

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 180499519f6..d092240e665 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_rna.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_rna.cc
@@ -183,44 +183,42 @@ RNANodeIdentifier RNANodeQuery::construct_node_identifier(const PointerRNA *ptr,
   node_identifier.operation_name = "";
   node_identifier.operation_name_tag = -1;
   /* Handling of commonly known scenarios. */
-  if (ptr->type == &RNA_PoseBone) {
+  if (prop != NULL && RNA_property_is_idprop(prop)) {
+    node_identifier.type = NodeType::PARAMETERS;
+    node_identifier.operation_code = OperationCode::ID_PROPERTY;
+    node_identifier.operation_name = RNA_property_identifier(
+        reinterpret_cast<const PropertyRNA *>(prop));
+    return node_identifier;
+  }
+  else if (ptr->type == &RNA_PoseBone) {
     const bPoseChannel *pchan = static_cast<const bPoseChannel *>(ptr->data);
-    if (prop != NULL && RNA_property_is_idprop(prop)) {
-      node_identifier.type = NodeType::PARAMETERS;
-      node_identifier.operation_code = OperationCode::ID_PROPERTY;
-      node_identifier.operation_name = RNA_property_identifier(
-          reinterpret_cast<const PropertyRNA *>(prop));
-      node_identifier.operation_name_tag = -1;
-    }
-    else {
-      /* Bone - generally, we just want the bone component. */
-      node_identifier.type = NodeType::BONE;
-      node_identifier.component_name = pchan->name;
-      /* 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") ||
-                 STREQ(prop_name, "length") || STRPREFIX(prop_name, "matrix")) {
-          if (source == RNAPointerSource::EXIT) {
-            node_identifier.operation_code = OperationCode::BONE_DONE;
-          }
+    /* Bone - generally, we just want the bone component. */
+    node_identifier.type = NodeType::BONE;
+    node_identifier.component_name = pchan->name;
+    /* 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;
         }
-        /* And other properties can always go to the entry operation. */
         else {
-          node_identifier.operation_code = OperationCode::BONE_LOCAL;
+          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") ||
+               STREQ(prop_name, "length") || 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;
   }
@@ -374,18 +372,10 @@ RNANodeIdentifier RNANodeQuery::construct_node_identifier(const PointerRNA *ptr,
   }
   if (prop != NULL) {
     /* All unknown data effectively falls under "parameter evaluation". */
-    if (RNA_property_is_idprop(prop)) {
-      node_identifier.type = NodeType::PARAMETERS;
-      node_identifier.operation_code = OperationCode::ID_PROPERTY;
-      node_identifier.operation_name = RNA_property_identifier((PropertyRNA *)prop);
-      node_identifier.operation_name_tag = -1;
-    }
-    else {
-      node_identifier.type = NodeType::PARAMETERS;
-      node_identifier.operation_code = OperationCode::PARAMETERS_EVAL;
-      node_identifier.operation_name = "";
-      node_identifier.operation_name_tag = -1;
-    }
+    node_identifier.type = NodeType::PARAMETERS;
+    node_identifier.operation_code = OperationCode::PARAMETERS_EVAL;
+    node_identifier.operation_name = "";
+    node_identifier.operation_name_tag = -1;
     return node_identifier;
   }
   return node_identifier;



More information about the Bf-blender-cvs mailing list