From 08a8de739d8c7fa60f257ed171d292879edae013 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Tue, 13 Sep 2022 11:43:34 -0500 Subject: Fix: Resolve deprecation warning when copying polygon struct `MPoly` is used and copied in many places. To avoid the need to use a special function for copying MPoly, or the need to add a copy constructor, just rename the `mat_nr` field to include "legacy" in the name. This keeps the original purpose of notifying developers that the field shouldn't be used without any further complexity. Apply the same fix to `bweight`. Differential Revision: https://developer.blender.org/D15841 --- source/blender/makesdna/DNA_meshdata_types.h | 6 +++--- source/blender/makesdna/intern/dna_rename_defs.h | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h index e621343b818..77cb27083ab 100644 --- a/source/blender/makesdna/DNA_meshdata_types.h +++ b/source/blender/makesdna/DNA_meshdata_types.h @@ -29,7 +29,7 @@ typedef struct MVert { /** * Deprecated bevel weight storage, now located in #CD_BWEIGHT, except for file read and write. */ - char bweight DNA_DEPRECATED; + char bweight_legacy; char _pad[2]; } MVert; @@ -55,7 +55,7 @@ typedef struct MEdge { /** * Deprecated bevel weight storage, now located in #CD_BWEIGHT, except for file read and write. */ - char bweight DNA_DEPRECATED; + char bweight_legacy; short flag; } MEdge; @@ -83,7 +83,7 @@ typedef struct MPoly { /** Keep signed since we need to subtract when getting the previous loop. */ int totloop; /** Deprecated material index. Now stored in the "material_index" attribute, but kept for IO. */ - short mat_nr DNA_DEPRECATED; + short mat_nr_legacy; char flag, _pad; } MPoly; diff --git a/source/blender/makesdna/intern/dna_rename_defs.h b/source/blender/makesdna/intern/dna_rename_defs.h index f25ff5fbbb8..257e60eae98 100644 --- a/source/blender/makesdna/intern/dna_rename_defs.h +++ b/source/blender/makesdna/intern/dna_rename_defs.h @@ -97,6 +97,9 @@ DNA_STRUCT_RENAME_ELEM(Object, dupfacesca, instance_faces_scale) DNA_STRUCT_RENAME_ELEM(Object, restrictflag, visibility_flag) DNA_STRUCT_RENAME_ELEM(Object, size, scale) DNA_STRUCT_RENAME_ELEM(Object_Runtime, crazyspace_num_verts, crazyspace_verts_num) +DNA_STRUCT_RENAME_ELEM(MEdge, bweight, bweight_legacy) +DNA_STRUCT_RENAME_ELEM(MPoly, mat_nr, mat_nr_legacy) +DNA_STRUCT_RENAME_ELEM(MVert, bweight, bweight_legacy) DNA_STRUCT_RENAME_ELEM(ParticleSettings, child_nbr, child_percent) DNA_STRUCT_RENAME_ELEM(ParticleSettings, dup_group, instance_collection) DNA_STRUCT_RENAME_ELEM(ParticleSettings, dup_ob, instance_object) -- cgit v1.2.3