From 2e64880abf50b17864913b7db3279f5862c19d7e Mon Sep 17 00:00:00 2001 From: Turo Lamminen Date: Mon, 8 Aug 2022 13:56:20 +0300 Subject: [PATCH] Inherit SubsurfModifierData and MirrorModifierData from SharedModifierData This makes the cast in BlenderModifierShowcase::ApplyModifiers work correctly and not invoke UB. --- code/AssetLib/Blender/BlenderScene.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/code/AssetLib/Blender/BlenderScene.h b/code/AssetLib/Blender/BlenderScene.h index cef40b660..d44a7c470 100644 --- a/code/AssetLib/Blender/BlenderScene.h +++ b/code/AssetLib/Blender/BlenderScene.h @@ -656,7 +656,7 @@ struct SharedModifierData : ElemBase { // ------------------------------------------------------------------------------- -struct SubsurfModifierData : ElemBase { +struct SubsurfModifierData : SharedModifierData { enum Type { @@ -669,7 +669,6 @@ struct SubsurfModifierData : ElemBase { FLAGS_SubsurfUV = 1 << 3 }; - ModifierData modifier FAIL; short subdivType WARN; short levels FAIL; short renderLevels; @@ -677,7 +676,7 @@ struct SubsurfModifierData : ElemBase { }; // ------------------------------------------------------------------------------- -struct MirrorModifierData : ElemBase { +struct MirrorModifierData : SharedModifierData { enum Flags { Flags_CLIPPING = 1 << 0, @@ -689,8 +688,6 @@ struct MirrorModifierData : ElemBase { Flags_VGROUP = 1 << 6 }; - ModifierData modifier FAIL; - short axis, flag; float tolerance; std::shared_ptr mirror_ob;