Inherit SubsurfModifierData and MirrorModifierData from SharedModifierData

This makes the cast in BlenderModifierShowcase::ApplyModifiers work
correctly and not invoke UB.
pull/4679/head
Turo Lamminen 2022-08-08 13:56:20 +03:00
parent e43e3e11b9
commit 2e64880abf
1 changed files with 2 additions and 5 deletions

View File

@ -656,7 +656,7 @@ struct SharedModifierData : ElemBase {
// ------------------------------------------------------------------------------- // -------------------------------------------------------------------------------
struct SubsurfModifierData : ElemBase { struct SubsurfModifierData : SharedModifierData {
enum Type { enum Type {
@ -669,7 +669,6 @@ struct SubsurfModifierData : ElemBase {
FLAGS_SubsurfUV = 1 << 3 FLAGS_SubsurfUV = 1 << 3
}; };
ModifierData modifier FAIL;
short subdivType WARN; short subdivType WARN;
short levels FAIL; short levels FAIL;
short renderLevels; short renderLevels;
@ -677,7 +676,7 @@ struct SubsurfModifierData : ElemBase {
}; };
// ------------------------------------------------------------------------------- // -------------------------------------------------------------------------------
struct MirrorModifierData : ElemBase { struct MirrorModifierData : SharedModifierData {
enum Flags { enum Flags {
Flags_CLIPPING = 1 << 0, Flags_CLIPPING = 1 << 0,
@ -689,8 +688,6 @@ struct MirrorModifierData : ElemBase {
Flags_VGROUP = 1 << 6 Flags_VGROUP = 1 << 6
}; };
ModifierData modifier FAIL;
short axis, flag; short axis, flag;
float tolerance; float tolerance;
std::shared_ptr<Object> mirror_ob; std::shared_ptr<Object> mirror_ob;