diff options
author | Hans Goudey <h.goudey@me.com> | 2020-10-15 17:44:39 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-10-15 17:44:39 +0300 |
commit | d1b3439b80fd6e9a0caa653cd55c7a5def18b122 (patch) | |
tree | c9d70e6ce66126d436bdb4e1d9307d7f487d064c /source/blender/gpencil_modifiers/intern/MOD_gpencilmultiply.c | |
parent | bac91956ae9755722b81da4b6a0a394f9f77b2e1 (diff) |
Cleanup: Use DNA defaults for grease pencil modifiers
This will make "Reset to Default Value" work properly for grease
pencil modifiers. See T80164 for more information.
Diffstat (limited to 'source/blender/gpencil_modifiers/intern/MOD_gpencilmultiply.c')
-rw-r--r-- | source/blender/gpencil_modifiers/intern/MOD_gpencilmultiply.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilmultiply.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilmultiply.c index 1ae258032eb..7d0e3ce53fe 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilmultiply.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilmultiply.c @@ -25,6 +25,7 @@ #include "MEM_guardedalloc.h" +#include "DNA_defaults.h" #include "DNA_gpencil_modifier_types.h" #include "DNA_gpencil_types.h" #include "DNA_object_types.h" @@ -74,14 +75,11 @@ static void initData(GpencilModifierData *md) { - MultiplyGpencilModifierData *mmd = (MultiplyGpencilModifierData *)md; - mmd->duplications = 3; - mmd->distance = 0.1f; - mmd->split_angle = DEG2RADF(1.0f); - mmd->fading_center = 0.5f; - mmd->fading_thickness = 0.5f; - mmd->fading_opacity = 0.5f; - mmd->material = NULL; + MultiplyGpencilModifierData *gpmd = (MultiplyGpencilModifierData *)md; + + BLI_assert(MEMCMP_STRUCT_AFTER_IS_ZERO(gpmd, modifier)); + + MEMCPY_STRUCT_AFTER(gpmd, DNA_struct_default_get(MultiplyGpencilModifierData), modifier); } static void copyData(const GpencilModifierData *md, GpencilModifierData *target) |