[Bf-blender-cvs] [5e7e49e00d4] master: Fix T65662: Drivers on custom properties doesn't properly update

Sergey Sharybin noreply at git.blender.org
Mon Jun 17 14:10:37 CEST 2019


Commit: 5e7e49e00d46734281b28a82582e3e3dd37e609c
Author: Sergey Sharybin
Date:   Mon Jun 17 14:09:01 2019 +0200
Branches: master
https://developer.blender.org/rB5e7e49e00d46734281b28a82582e3e3dd37e609c

Fix T65662: Drivers on custom properties doesn't properly update

Happens if custom property is on object data data-block, which doesn't
have translation or geometry components. Not for lights and cameras at
least.

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

M	source/blender/depsgraph/intern/depsgraph_tag.cc
M	source/blender/makesdna/DNA_ID.h
M	source/blender/makesrna/intern/rna_access.c

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

diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc
index 1c26e6fecd5..583191490d2 100644
--- a/source/blender/depsgraph/intern/depsgraph_tag.cc
+++ b/source/blender/depsgraph/intern/depsgraph_tag.cc
@@ -226,6 +226,9 @@ void depsgraph_tag_to_component_opcode(const ID *id,
     case ID_RECALC_AUDIO:
       *component_type = NodeType::AUDIO;
       break;
+    case ID_RECALC_PARAMETERS:
+      *component_type = NodeType::PARAMETERS;
+      break;
     case ID_RECALC_ALL:
     case ID_RECALC_PSYS_ALL:
       BLI_assert(!"Should not happen");
@@ -659,6 +662,8 @@ const char *DEG_update_tag_as_string(IDRecalcFlag flag)
       return "AUDIO_LISTENER";
     case ID_RECALC_AUDIO:
       return "AUDIO";
+    case ID_RECALC_PARAMETERS:
+      return "PARAMETERS";
     case ID_RECALC_ALL:
       return "ALL";
   }
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index 2a6800c55b6..cad1af8eb50 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -614,6 +614,8 @@ typedef enum IDRecalcFlag {
 
   ID_RECALC_AUDIO = (1 << 20),
 
+  ID_RECALC_PARAMETERS = (1 << 21),
+
   /***************************************************************************
    * Pseudonyms, to have more semantic meaning in the actual code without
    * using too much low-level and implementation specific tags. */
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 3aa938ee713..731f549b497 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -2316,7 +2316,8 @@ static void rna_property_update(
   if (!is_rna || (prop->flag & PROP_IDPROPERTY)) {
     /* WARNING! This is so property drivers update the display!
      * not especially nice  */
-    DEG_id_tag_update(ptr->id.data, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
+    DEG_id_tag_update(ptr->id.data,
+                      ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_PARAMETERS);
     WM_main_add_notifier(NC_WINDOW, NULL);
     /* Not nice as well, but the only way to make sure material preview
      * is updated with custom nodes.



More information about the Bf-blender-cvs mailing list