diff options
author | Aleš Jelovčan <frogstomp> | 2022-09-27 18:47:01 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2022-09-27 18:55:43 +0300 |
commit | b0d70a9c80402e8b7af173a76e9a8b6050598825 (patch) | |
tree | cc2d98fe527473e16052ab09adf6ed5615a07f61 /source/blender/blenkernel | |
parent | 12fdf9069abe3cd2250a9efec6e059eb85ec59d8 (diff) |
Gpencil: Time Offset modifier new Chain mode
This patch adds 5th mode to Time offset modifier, which should allow
to create time segments list.
This will allow users to chain together multiple time ranges in 4 modes:
- Forward
- Backwards
- Pingpong
- Reverse Pingpong
It also comes with additional Repeat parameter which specifies number
of times particular segment should run.
The mechanic of it is transforming initial parameters into array of frames which
are mapped to existing cfra (current frame) value.
Prototype : https://jsfiddle.net/ha2sjw8p/3/
This is also closely aligned to community request:
https://blender.community/c/rightclickselect/Txhbbc/
This should allow creation of complex animations like dancing,
which consists of repeating loops and transitions to the next.
One important side effect of this is dramatically reduced
file sizes, as user no longer needs to copy paste keyframes.
Reviewed By: antoniov, mendio, pepeland
Differential Revision: https://developer.blender.org/D15052
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/gpencil_modifier.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/gpencil_modifier.c b/source/blender/blenkernel/intern/gpencil_modifier.c index 70b8717abbe..191231f2b43 100644 --- a/source/blender/blenkernel/intern/gpencil_modifier.c +++ b/source/blender/blenkernel/intern/gpencil_modifier.c @@ -904,6 +904,11 @@ void BKE_gpencil_modifier_blend_write(BlendWriter *writer, ListBase *modbase) BLO_write_struct_array( writer, DashGpencilModifierSegment, gpmd->segments_len, gpmd->segments); } + else if (md->type == eGpencilModifierType_Time) { + TimeGpencilModifierData *gpmd = (TimeGpencilModifierData *)md; + BLO_write_struct_array( + writer, TimeGpencilModifierSegment, gpmd->segments_len, gpmd->segments); + } } } @@ -990,6 +995,13 @@ void BKE_gpencil_modifier_blend_read_data(BlendDataReader *reader, ListBase *lb) gpmd->segments[i].dmd = gpmd; } } + else if (md->type == eGpencilModifierType_Time) { + TimeGpencilModifierData *gpmd = (TimeGpencilModifierData *)md; + BLO_read_data_address(reader, &gpmd->segments); + for (int i = 0; i < gpmd->segments_len; i++) { + gpmd->segments[i].gpmd = gpmd; + } + } if (md->type == eGpencilModifierType_Shrinkwrap) { ShrinkwrapGpencilModifierData *gpmd = (ShrinkwrapGpencilModifierData *)md; gpmd->cache_data = NULL; |