[Bf-blender-cvs] [a560a46f32f] blender-v2.82-release: Fix T72625: Outliner visibility keying doesn't carry over from 2.79b

Sybren A. Stüvel noreply at git.blender.org
Tue Jan 14 17:31:54 CET 2020


Commit: a560a46f32f6d0e9862bb30dab05296cee98b05b
Author: Sybren A. Stüvel
Date:   Tue Jan 14 17:08:22 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rBa560a46f32f6d0e9862bb30dab05296cee98b05b

Fix T72625: Outliner visibility keying doesn't carry over from 2.79b

During development of Blender 2.80 the `Object.hide` property was removed,
and later reintroduced in rB5e968a996a53 as `Object.hide_viewport`. Of
course there are some technical details missing in this summary, but this
is the view that's given in the 2.80 release notes.

FCurves on `Object.hide` weren't updated in versioning code, resulting in
the property no longer being animated. This commit corrects the RNA path
of such FCurves.

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

M	source/blender/blenloader/intern/versioning_280.c

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

diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index ee4e62f19d1..4443c4bb4ad 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -1091,6 +1091,18 @@ static void do_version_curvemapping_walker(Main *bmain, void (*callback)(CurveMa
   }
 }
 
+static void do_version_fcurve_hide_viewport_fix(struct ID *UNUSED(id),
+                                                struct FCurve *fcu,
+                                                void *UNUSED(user_data))
+{
+  if (strcmp(fcu->rna_path, "hide")) {
+    return;
+  }
+
+  MEM_freeN(fcu->rna_path);
+  fcu->rna_path = BLI_strdupn("hide_viewport", 13);
+}
+
 void do_versions_after_linking_280(Main *bmain, ReportList *UNUSED(reports))
 {
   bool use_collection_compat_28 = true;
@@ -1524,6 +1536,14 @@ void do_versions_after_linking_280(Main *bmain, ReportList *UNUSED(reports))
       }
     }
   }
+
+  {
+    /* During development of Blender 2.80 the "Object.hide" property was
+     * removed, and reintroduced in 5e968a996a53 as "Object.hide_viewport". */
+    LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
+      BKE_fcurves_id_cb(&ob->id, do_version_fcurve_hide_viewport_fix, NULL);
+    }
+  }
 }
 
 /* NOTE: This version patch is intended for versions < 2.52.2,



More information about the Bf-blender-cvs mailing list