From a560a46f32f6d0e9862bb30dab05296cee98b05b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 14 Jan 2020 17:08:22 +0100 Subject: 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. --- source/blender/blenloader/intern/versioning_280.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to '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, -- cgit v1.2.3