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_gpenciltime.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_gpenciltime.c')
-rw-r--r-- | source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c b/source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c index 7587d6a53e6..b1c35452733 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c @@ -29,6 +29,7 @@ #include "BLT_translation.h" +#include "DNA_defaults.h" #include "DNA_gpencil_modifier_types.h" #include "DNA_gpencil_types.h" #include "DNA_meshdata_types.h" @@ -57,11 +58,10 @@ static void initData(GpencilModifierData *md) { TimeGpencilModifierData *gpmd = (TimeGpencilModifierData *)md; - gpmd->offset = 1; - gpmd->frame_scale = 1.0f; - gpmd->flag |= GP_TIME_KEEP_LOOP; - gpmd->sfra = 1; - gpmd->efra = 250; + + BLI_assert(MEMCMP_STRUCT_AFTER_IS_ZERO(gpmd, modifier)); + + MEMCPY_STRUCT_AFTER(gpmd, DNA_struct_default_get(TimeGpencilModifierData), modifier); } static void copyData(const GpencilModifierData *md, GpencilModifierData *target) |