From e11cd54096dcc1ad31b748389d28e9d2b0a8debe Mon Sep 17 00:00:00 2001 From: Samuele Lorefice Date: Thu, 6 Mar 2025 19:14:59 +0100 Subject: [PATCH] Fioxed dictionary being recreated every step of the for loop. --- BlendFile/DNA/ActionChannelBag.cs | 4 ++-- CodeGenerator/Program.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/BlendFile/DNA/ActionChannelBag.cs b/BlendFile/DNA/ActionChannelBag.cs index cb39ea2..ebbacde 100644 --- a/BlendFile/DNA/ActionChannelBag.cs +++ b/BlendFile/DNA/ActionChannelBag.cs @@ -19,9 +19,9 @@ namespace BlendFile.DNA { public int slot_handle; [DNAFieldAttribute(4, "uchar", 3, "_pad[4]", "System.Byte[]", false, 4)] public byte[] _pad = new System.Byte[4]; - [DNAListAttribute(8, "bActionGroup", "**group_array", 2, "bActionGroup", "group_array_num", 1, 8, 0)] + [DNAListAttribute(8, "bActionGroup", "**group_array", 2, "bActionGroup", "group_array_num", 1, 8, 8)] public System.Collections.Generic.List group_array; - [DNAListAttribute(8, "FCurve", "**fcurve_array", 5, "FCurve", "fcurve_array_num", 4, 16, 0)] + [DNAListAttribute(8, "FCurve", "**fcurve_array", 5, "FCurve", "fcurve_array_num", 4, 16, 16)] public System.Collections.Generic.List fcurve_array; public ActionChannelBag() { this.slot_handle = default; diff --git a/CodeGenerator/Program.cs b/CodeGenerator/Program.cs index c5a6fc8..5d91549 100644 --- a/CodeGenerator/Program.cs +++ b/CodeGenerator/Program.cs @@ -184,9 +184,9 @@ namespace CodeGenerator { ctd.Members.Add(cmf); } + Dictionary listCountOffsets = new(); //Add the lists to the class for (var index = 0; index < type.Fields.Count; index++) { - Dictionary listCountOffsets = new(); var field = type.Fields[index]; //Skip fields that are not part of a list if (listFields.Select(f => f.Item1).Contains(field)) {